![]() |
eventAnalysis
7.0-49-g0ac7482
|
A basic introduction on how to read the eventAnalysis files to perform an analysis
Some sample macros can be found in the macros directory. Extensive use is made of analysisUtilityToolsLibrary, written in C++.
For first time users, the Browser (do TBrowser b;
after opening a file in ROOT) is probably the best way to investigate what is contained in the output trees. This is not how you would do an analysis, but it will give you an idea what is there.
All eventAnalysis output that is saved in the trees must be browsable.
ccqeAnalysis.py is an example of using Python to look at analysis files and create histograms etc. It can be copied and changed to provide a template for a user analysis.
Being written in python, it is extremely easy to access the objects saved in the eventAnalysis files, while at the same time PyROOT is used to make all the ROOT classes directly available. See eventAnalysisReadoutScripts for more details
runAnalysis.py runs such analysis files.
./runAnalyses.py –help will print out a usage message:
Usage: runAnalyses.py [options] files When successful, always writes a file "eventAnalysisReadInit.C", which can be executed in ROOT to manually initialise it for browsing eventAnalysis files (but not when just showing the help message). Options: -h, --help show this help message and exit -nNEVENTS Set the number of events to process. Default is 1000000000. -sNSKIP Set the number of events to skip. Default is 0. -aANALYSISNAME Set the analysis script to read (analysisName.py) and the default output name (analysisName.root). The latter can be overridden with the -o option. The default analysisName is 'ccqeAnalysis'. --neut Force code to assume NEUT as the interaction generator. --genie Force code to assume GENIE as the interaction generator. By default the generator names use the file catalogue, or are guessed. --nuance Force code to assume NUANCE as the interaction generator. By default the generator names use the file catalogue, or are guessed. -oOUTPUT Set output file, overriding analysisName.root. -c Compile the C++ macros for use by ROOT macros. An input eventAnalysis file needs to be specified. Not needed when using the python-based analyses because compilation is automatic. --noisyROOT Show all ROOT standard output, including those that are unnecessary and often misleading in normal usage.
If the readout library libReadeventAnalysis/libReadeventAnalysis.so does not exist, it uses the first input file specified to create and compile the library.
If you have errors related to libReadeventAnalysis, it might be a good idea to remove the libReadeventAnalysis directory and try again.
The specifics of the analysis are contained in a separate file, which by default is ccqeAnalysis.py. The -a option allows one to choose this name.
Sets up the eventChain, and loads headers as listed at the top of the external analysis file.
Python analyses with C++ utility scripts appear to run fast enough to be used for large-scale analyses.
(This is very much a condensed overview showing where to look when trying to read out the eventAnalysis files. For more in-depth documentation, go to analysisUtilityToolsLibrary eventAnalysisReadoutScripts and howTheReadOutLibrariesAreCompiled)