11 #include <analysis/modules/RestOfEventInterpreter/RestOfEventInterpreterModule.h>
13 #include <analysis/dataobjects/ParticleList.h>
14 #include <analysis/dataobjects/Particle.h>
15 #include <analysis/dataobjects/RestOfEvent.h>
17 #include <framework/datastore/StoreArray.h>
18 #include <framework/datastore/StoreObjPtr.h>
20 #include <framework/logging/Logger.h>
21 #include <framework/core/ModuleParam.templateDetails.h>
45 setDescription(
"Creates a mask (vector of boolean values) for tracks and clusters in RestOfEvent.");
46 setPropertyFlags(c_ParallelProcessingCertified);
49 std::vector<std::tuple<std::string, std::string, std::string>> emptyROEMask;
51 addParam(
"particleList", m_particleList,
"Name of the ParticleList");
53 addParam(
"ROEMasks", m_ROEMasks,
54 "List of (maskName, trackSelectionCut, eclClusterSelectionCut) tuples that specify all ROE masks of a specific particle to be created.",
57 addParam(
"update", m_update,
"Set true for updating a-priori charged stable fractions used in calculation of ROE 4-momentum",
62 void RestOfEventInterpreterModule::initialize()
67 particles.isRequired();
69 for (
auto ROEMask : m_ROEMasks) {
72 std::string maskName = get<0>(ROEMask);
73 std::string trackSelection = get<1>(ROEMask);
74 std::string eclClusterSelection = get<2>(ROEMask);
76 std::shared_ptr<Variable::Cut> trackCut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(trackSelection));
77 std::shared_ptr<Variable::Cut> eclClusterCut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(eclClusterSelection));
79 m_maskNames.push_back(maskName);
80 m_trackCuts.insert(stringAndCutMap::value_type(maskName, trackCut));
81 m_eclClusterCuts.insert(stringAndCutMap::value_type(maskName, eclClusterCut));
83 B2INFO(
"RestOfEventInterpreter added ROEMask with specific fractions under name \'" << maskName <<
"\' with track cuts: " <<
84 trackSelection <<
" and eclCluster cuts: " << eclClusterSelection);
88 void RestOfEventInterpreterModule::event()
92 unsigned int nParts = plist->getListSize();
94 for (
unsigned i = 0; i < nParts; i++) {
95 const Particle* particle = plist->getParticle(i);
96 auto* roe = particle->getRelatedTo<
RestOfEvent>(
"ALL");
97 for (
auto& maskName : m_maskNames) {
101 roe->updateMaskWithCuts(maskName, m_trackCuts.at(maskName), m_eclClusterCuts.at(maskName),
nullptr, m_update);