Running
Setup¶
If you are in a new shell, you need to setup SimpleAnalysis again. Follow the steps in the "On every login" part of the setup. If you have done the previous part of the tutorial already in your shell, you should be good to go without having to setup everything again.
Command line interface¶
Once setup, you will have the simpleAnalysis
command available. Test this by entering simpleAnalysis --help
into your shell. This should reveal the following set of options and arguments:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Running over a list of analyses and some inputfiles is as easy as running:
1 |
|
listOfAnalysis
is a comma-separated list of analysis (or all analyses if none are given). This will, for each analysis, provide acceptance results in a text file as well as a ROOT file containing all the histograms defined in the analysis routine.
Here is a short list of very useful command line arguments:
-
Ntuple output¶
If the
-n
option is provided, the output ROOT file will also contain an ntuple of all the variables defined in the analysis code. -
Output format when using multiple analyses¶
By default, one pair of files (a text file and a ROOT file) is produced per analysis. If the option
-o
is provided, only one total pair of files is produced. In this case, everything inside these two files is prefixed by the analysis names in order to prevent naming clashes. -
MC event weight settings¶
The option
-w
allows to change which event weight index is used to fill ntuple branches and histograms as well as compute the acceptances. You can disable event weights completely by setting this to-w -1
.
If you have not already copied the inputs, please go ahead and do this now. The inputs section in the setup guide describes where and how to get the necessary inputs.
Local running¶
Let's run the analysis locally on the provided input:
1 |
|
Output ntuples
We use the option -n
in order to not only output the acceptances and histograms, but also the ntuple with the variables we have filled in the analysis routine.
The input file has only 6000 MC events, so this should be rather quick. Once the process has finished, you should see two output files: MyAnalysisName.root
and MyAnalysisName.txt
. Printing the MyAnalysisName.txt
file, we see:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
All
is included, providing the total number of events processed, the sum of all event weights as well as the sum of the squares of the event weights. This can be used for normalisation and merging results.
Since the option -n
has been provided, the MyAnalysisName.root
file does not only contain the defined histograms and regions, but also the ntuple variables:
1 2 3 4 5 6 7 8 |
|
ntuple
tree, you can see that it not only contains the defined regions and variables, but also two branches called Event
and eventWeight
. While the Event
branch containes event numbers (starting from 1) for each event, the eventWeight
branch contains the MC event weight. In the region branches, each event that passed the region selection will be in 1, while the ones failing the region selection will be in 0.
Grid submission¶
Submission on the grid is rather straightforward
1 2 3 4 5 |
|