Use
python measureOccupancy.py --inputfile=path/to/file --collBunch=int --instLumi=int/float --nFiles=int
(Single Mode)
or
python measureOccupancy.py --config=configs/testconfig.cfg
(Config Mode)
to run the code.
Add the flag --skipplots (without argument) if the plotting module should be skipped. Plots are only implemented for config mode.
The following python modules are necessary:
- ROOT (pyROOT)
- pandas (dependencies (?): numpy, scipy, matplotlib)
Note: If run on the T3@PSI using some versions of CMSSW (e.g. 8_0_26) results in crash because matplotlib can not be correctly imported.
The configs used for config mode need to contain a General section and one or more Run sections:
[General]
title=string
description=string
foldername=string
latexexport=bool
csvexport=bool
cfgexport=bool
- title will be displayed as
<h1>
in the top of the output HTML file - description will be displayed as subtitle in the output HTML file
- foldername is used as name of the folder containing the output files. If not present it will be created
- latexexport if True, all tables will be exported in LaTex and saved in foldername/tex
- csvexport if True, all tables will be exported in CSV (separator ;) and saved in foldername/csv
- cfgexport if True, all tables will be exported as config file written with the python config parser and saved in foldername/cfg
[RunName]
collidingBunches=float/int
lumi=float
file=string
nFiles=int
fill=int
comment=string
dataset=string
- RunName is a unique name used the index the runs and is displayed as name in the output tables
- collidingBunches and lumi are used for calculations and can be obtained form WBM. lumi is the average inst. luminosity in the considered LS range in e30 cm^-2 s^-1.
- comment and dataset are displayed in the output HTML files
- nFiles is needed for some histograms that are normalized to the number of processed events in preprocessing. If this is done on a batch system the normalization is not valid anymore after hadd-ing the files.
- fill will be displayed in a separate overview and is not necessary for any calculations (can be left without value) If a config option is desired to be empty (for example if the section is a placeholder with empty file option), also remove the = sign.
In configs/style
some option for plotting can be set:
[Plotting]
dpi=int
savepdf=bool
For fast code execution savepdf should be set to False and dpi to 200 or lower.
Using ROOTplotting.py
the output of measureOccupancy.py
can be plotted as ROOT TGraph. Use the cfgexport option in the general section of you config to get the tables in a python readable config. The configs are used for the plotting.
python ROOTplotting.py --config [config.cfg ....] --names [legendtext ....] --parameter [internalValueName]
- The --config and --names arguments can be lists (separated with space) and need to be the same length. If only one config is passed, names can also be skipped.
- --parameter need to be one of the options in the config used for plotting.