UserUtils
|
Additional examples of how to allow a edm plugins to process run/lumi level production could be found in the CMSSW EventCountProducer Class.
The rational of this class is that the sum-of-weights is frequently used for calculating the selection efficiency and for isolating the impacts of generator uncertainties (PDF and QCD scale) on acceptance and theoretical cross sections.
As the framework is setup such that run-level data can only be accessed at the end fo the run, the user must define the weight families that needs to be summed in the parameter set with the type vint32
and under the name "idlist". Weights listed in EDM files under the specified id's would first be be divided by the weight under the central ID (i.e. the first id in the provided list, then the normalized weights would be summed and stored at cache level.
One nuance that needs to be taken care of is the sign of the weights, since using negative weights is a common strategy to correct for higher order behaviours. The "divide" operation described earlier would only scale by the absolute value of the central weight, leaving the sign of the various weights untouched.
Note that in the case that the user provides the weight id of 0, the input file is assumed to be for data, and the sum of events will be calculated instead (no additional PDF/QCD weights would be calculated).
For reading the outputs of this plugin, read the deatiled sections of the constructor.
Public Member Functions | |
GenWeightCounter (const edm::ParameterSet &) | |
defining the requirements as wells as defining the output names. More... | |
![]() | |
PluginAlias (const edm::ParameterSet &config) | |
Private Attributes | |
const edm::EDGetToken | _lhesrc |
std::vector< int > | _idlist |
double | _evtsum |
std::map< int, double > | _sumlist |
Additional Inherited Members | |
![]() | |
edm::EDGetToken | GetToken (const std::string &configtag) |
template class for getting the EdmToken from the initializer configuration parameter set. More... | |
edm::EDGetToken | GetRunToken (const std::string &configtag) |
Same template function as GetToken() except for getting Run level objects. | |
edm::Handle< TYPE > | MakeHandle (const edm::Event &event, const edm::EDGetToken tok) |
Construction for a handle. | |
TObject * | GetFileObj (const std::string &filetag, const std::string objtag) |
getting a clone of an object described in a file. See static function for full documentation. | |
std::string | GetFilePath (const std::string &filetag) |
getting the full path to a file. See static function for full documentation. | |
![]() | |
static TObject * | GetFileObj (const edm::ParameterSet &config, const std::string &filetag, const std::string &objtag) |
Given a file path in the form of an EDM::FileInPath, and a object key as a parameter set string. More... | |
static std::string | GetFilePath (const edm::ParameterSet &config, const std::string &filetag) |
returing the string to a path in the parameterset if an EDM::FileInPath was used. | |
|
explicit |
The parameterset passed to the plugins requires two things:
vint32
telling the plugin which weight variation to take into calculation. If you unsure which weight variations you should use, see this page for more information. If you unsure which weight variations is contained in your edm file, consider the DumpLHERunInfo command provided by yours truly.The output is stored in the form of the new usr::Counter class in the run level, under the name "EventsCount" (for the simple sum of events), and the "WeightSum<id>" for the sum-of-weight of a specific variation.