Thanks to visit codestin.com
Credit goes to github.com

Skip to content
jottCern edited this page Dec 5, 2014 · 3 revisions

Running

After installing and compiling, you can run the first example. In general, there are two possibilities of how to run your code: within SFrame or within CMSSW. The central class to provide in both cases is an implementation of the abstract class AnalysisModule, which will be constructed for each dataset and whose process method will be called for each event.

Running with SFrame

Running with SFrame is only possible on the ntuple format. As output, a new ntuple can be created (possibly with some new, user-defined branches in the output). Running is done via SFrame, so all instructions relevant for SFrame in general also applies here. In particular, to run SFrame, a xml configuration file should be provided, which specifies input data and some options. For example, running one of the examples locally, change to UHH2/examples and execute:

sframe_main config/Example.xml

This will construct the ExampleModule class (which is an implementation of the abstract AnalysisModule) and execute its process method each time.

For available options, see the comments in UHH2/examples/config/Example.xml. In particular, the options in the UserConfig section in the xml file control which branches are read and which AnalysisModule is run. Besides these UHH2-specific options, the xml files are usual SFrame xml configurations, so in particular for specifying the input dataset, running mode (local vs. proof), logging and other things, refer to the SFrame documentation. Some comments for frequently used options exist in Example.xml.

Miscellaneous notes for running SFrame

  • In the xml file, the only Library and Package to declare is the one which contains your AnalysisModule. This is because in UHH2 (in contrast to UHHAnalysis), the library dependencies are explicitly given when building already
  • par file created for running with proof is a dummy file which does not compile anything, so this will work only when running on a cluster with a shared filesystem and the UHH2 binaries are located on that shared filesystem.

Running with CMSSW

Running with CMSSW requires miniAOD (or, with some changes, AOD) as input. As output, either CMSSW output (=miniAOD, possibly with some more data), the ntuple format, or a combination of both is possible. Note that the AnalysisModule cannot create output to be saved in the CMSSW data format; this is only possible for the ntuple format.

To run a module within CMSSW, use UHH2/core/python/ntuplewriter_only.py as template and change the settings in the AnalysisModule section to load the right library and AnalysisModule class. Then, run cmsRun on the configuration file. The NtupleWriter CMSSW plugin will convert the miniAOD format on the fly and call the constructor and process method of the specified AnalysisModule.

Clone this wiki locally