Design overview - ntuhep/bprimeKit GitHub Wiki

bprimeKit main code design overview

Dependencies

The bprimeKit should be designed to be as stand-alone as possible, and attempt the functions already available in the CMS software suite. The format.h file and TriggerBooking.h file containing the tree structure should always be singular files for ease of use for the end user.

TTree handling - Ntuplizer classes

This package defines multiple classes. The bprimeKit class is the only EDAnalyzer class, and is used to interface with the configuration class, own the TTree object used to store the ntuple results, and store the list of Ntuplizer classes to be used.

The Ntuplizer classes derived from NtuplizerBase is used to handle the code for actual ntuplization of data formats. The splitting of the Ntuplizer classes allows for more modular code for different physics objects stored in the MiniAOD, such as one class for jets and another for leptons... etc. Notice that a pointer to the base bprimeKit instance is required, since only EDAnalyzer classes (and similar) could initialize EDGetTokens via the consume call. A template wrapper function for getting EDGetTokens for Ntuplizer classes has been implemented in NtuplizerBase for cleaner coding.

The Ntuplizer themselves are initialized at the constructor of the bprimeKit class, have the TTree registered along with the TTree construction, and have their Analyzer function called for each iteration of the bprimeKit::analyze call. Other than the above, there should be no interaction between the Ntuplizer classes and the bprimeKit class, and the ntuplization process should be contained withing each class.

Configuration file handling

The master configuration file to be called by the cmsRun command should always be the production/bprimeKit_cfg.py file.

To account for different objects required for different production eras of both MC and data, the bprimeKit instances should be defined in the various python/bprimeKit_*.py. The option DataProcessing will be used to load different bprimeKit processes. The python/bprimeKit_*.py file should also contain additional information to make the master production/bprimeKit_cfg.py file contain as little if statements as possible.

Submission scripts

Submission scripts are located in production/submitsample.py and production/submitlist.py, used to automatically generate the configuration files required for crab submission.

The detection of which DataProcessing input to use is handled by python/datasetparser.py, and should throw an exception if the input dataset is not a version that is this particular version of the bprimeKit is designed to take in.

versioning

Each version of the bprimeKit intended for a mass production run by the joint effort of NTU and SOPHIA group should be frozen by a git tag.