[Rivet] Some rivet things

Andy Buckley andy.buckley at cern.ch
Wed Jul 12 21:15:21 BST 2017


On 11/07/17 17:04, Jon Butterworth wrote:
> Hi all,
> 
> Some rivet issues which have shown up during Contur work:
> 
> Firstly, the plotinfo file for ATLAS_2012_I1203852 has spurious 
> "drawonly" statements which mess up the histogram parser. I attach a 
> fixed version.
> 
> In tracking this down, added a more informative exception message to 
> make-plots. I have attached a version with this minor mod in case you 
> want it.

Absolutely to both. And I see you are working on the dev head now, so 
please commit & push!

> Also, it seems that when looking for the plotinfo etc, the
> rivet-config --datadir
> and similar options ignore the environment variables like
> RIVET_PLOT_PATH, RIVET_DATA_PATH
> which seems wrong, and means I can't easily override the buggy .plot 
> file with a local version, since the histogram parser uses rivet-config
> to get it's .plot files. It looks like this was even spotted as a 
> problem, see the "TODO" at line 80 of plotinfo.py

rivet-config probably isn't sensitive to the environment variables, but 
it's meant to return the "Rivet system" data dir (etc.)... in general 
there can be lots, but that's the only "official" one.

But I think this is distinct from that. We avoid making system calls to 
rivet-config as a way of doing things because it's often broken by 
relocation -- better to ask the Rivet library directly, which uses 
exactly the same dynamic lookup scheme as the C++ loader. The relevant 
C++ functions are in src/Tools/RivetPaths.cc and can be called from 
Python like this:

andy at unity:~$ ipy
In [1]: import rivet
In [2]: rivet.getAnalysisDataPaths()
Out[2]:
['/home/andy/heplocal/share/Rivet',
  '/home/andy/heplocal/lib']
In [3]: rivet.getAnalysisPlotPaths()
Out[3]:
['/home/andy/heplocal/share/Rivet',
  '/home/andy/heplocal/lib']

rivet.getAnalysisPlotPaths() should be used by the plotting scripts. It 
first looks for RIVET_PLOT_PATH, then falls back to RIVET_DATA_PATH, 
then falls back to RIVET_ANALYSIS_PATH. I just checked, and that's 
definitely working: phew.

Anyway, please feel free to hack plotinfo.py to make it behave more 
sanely. As you saw, I noted that the behaviour was a bit odd (Frank S!), 
but it's not an itch I've ever had a sufficiently desperate need to 
scratch. So, necessity being the mother of invention and all that...

Andy

PS. I told you just last week that disproportionate effort went into 
getting the path searching right! And apparently it's still going ;-)

-- 
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
Particle Physics Expt Group, University of Glasgow


More information about the Rivet mailing list