9 #include <analysis/modules/RestOfEventInterpreter/RestOfEventInterpreterModule.h>
11 #include <analysis/dataobjects/Particle.h>
12 #include <analysis/dataobjects/RestOfEvent.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/core/ModuleParam.templateDetails.h>
39 setDescription(
"Creates a mask (vector of boolean values) for tracks and clusters in RestOfEvent.");
40 setPropertyFlags(c_ParallelProcessingCertified);
43 std::vector<std::tuple<std::string, std::string, std::string, std::string>> emptyROEMask;
45 addParam(
"particleList", m_particleListName,
"Name of the ParticleList");
47 addParam(
"ROEMasks", m_ROEMasks,
48 "List of (maskName, trackSelectionCut, eclClusterSelectionCut) tuples that specify all ROE masks of a specific particle to be created.",
51 addParam(
"update", m_update,
"Set true for updating a-priori charged stable fractions used in calculation of ROE 4-momentum",
56 void RestOfEventInterpreterModule::initialize()
59 m_plist.isRequired(m_particleListName);
61 for (
auto ROEMask : m_ROEMasks) {
64 std::string maskName = get<0>(ROEMask);
65 std::string trackSelection = get<1>(ROEMask);
66 std::string eclClusterSelection = get<2>(ROEMask);
67 std::string klmClusterSelection = get<3>(ROEMask);
69 std::shared_ptr<Variable::Cut> trackCut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(trackSelection));
70 std::shared_ptr<Variable::Cut> eclClusterCut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(eclClusterSelection));
71 std::shared_ptr<Variable::Cut> klmClusterCut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(klmClusterSelection));
73 m_maskNames.push_back(maskName);
74 m_trackCuts.insert(stringAndCutMap::value_type(maskName, trackCut));
75 m_eclClusterCuts.insert(stringAndCutMap::value_type(maskName, eclClusterCut));
76 m_klmClusterCuts.insert(stringAndCutMap::value_type(maskName, klmClusterCut));
78 B2INFO(
"RestOfEventInterpreter added ROEMask with specific fractions under name \'" << maskName <<
"\' with track cuts: " <<
79 trackSelection <<
" and eclCluster cuts: " << eclClusterSelection);
83 void RestOfEventInterpreterModule::event()
85 unsigned int nParts = m_plist->getListSize();
87 for (
unsigned i = 0; i < nParts; i++) {
88 const Particle* particle = m_plist->getParticle(i);
89 auto* roe = particle->getRelatedTo<
RestOfEvent>(
"ALL");
90 for (
auto& maskName : m_maskNames) {
94 roe->updateMaskWithCuts(maskName, m_trackCuts.at(maskName), m_eclClusterCuts.at(maskName), m_klmClusterCuts.at(maskName), m_update);
Class to store reconstructed particles.
Creates a mask (vector of boolean values) for tracks and clusters in RestOfEvent regarding their usag...
This is a general purpose class for collecting reconstructed MDST data objects that are not used in r...
void initializeMask(const std::string &name, const std::string &origin="unknown")
Initialize new mask.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.