12 #include <analysis/modules/RestOfEventPrinter/RestOfEventPrinterModule.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/datastore/StoreObjPtr.h>
19 #include <framework/logging/Logger.h>
22 #include <analysis/dataobjects/RestOfEvent.h>
23 #include <mdst/dataobjects/MCParticle.h>
48 setDescription(
"Prints basic or detailed RestOfEvent info to screen. It is possible to print out ROEMasks for specific mask names as well.");
49 setPropertyFlags(c_ParallelProcessingCertified);
52 std::vector<std::string> emptyVector;
54 addParam(
"maskNames", m_maskNames,
"List of all mask names for which the info will be printed.", emptyVector);
55 addParam(
"whichMask", m_whichMask,
"Print Track mask (track), ECLCluster mask (cluster), or (both)?", std::string(
"both"));
56 addParam(
"fullPrint", m_fullPrint,
"True: Print whole masks content.",
false);
59 void RestOfEventPrinterModule::initialize()
64 void RestOfEventPrinterModule::event()
66 B2INFO(
"[RestOfEventPrinterModule] START ----------------------------------------");
75 unsigned int nAllTracks = roe->getNTracks();
76 unsigned int nAllECLClusters = roe->getNECLClusters();
77 unsigned int nAllKLMClusters = roe->getNKLMClusters();
78 int relatedPDG = part->getPDGCode();
81 relatedMCPDG = mcpart->getPDG();
86 B2INFO(
" - " <<
"ROE related to particle with PDG: " << relatedPDG);
87 B2INFO(
" - " <<
"ROE related to MC particle with PDG: " << relatedMCPDG);
88 B2INFO(
" - " <<
"No. of Tracks in ROE: " << nAllTracks);
89 B2INFO(
" - " <<
"No. of ECLClusters in ROE: " << nAllECLClusters);
90 B2INFO(
" - " <<
"No. of KLMClusters in ROE: " << nAllKLMClusters);
92 for (
const auto& maskName : m_maskNames) {
93 unsigned int nTracks = roe->getNTracks(maskName);
94 unsigned int nECLClusters = roe->getNECLClusters(maskName);
97 B2INFO(
" - " <<
"Info for ROEMask with name: \'" << maskName <<
"\'");
99 B2INFO(
" o) " <<
"No. of Tracks which pass the mask: " << nTracks);
101 B2INFO(
" o) " <<
"No. of ECLClusters which pass the mask: " << nECLClusters);
103 printMaskParticles(roe->getParticles(maskName));
107 B2ERROR(
"RestOfEvent object not valid! Did you build ROE?");
109 B2INFO(
"[RestOfEventPrinterModule] END ------------------------------------------");
111 void RestOfEventPrinterModule::printMaskParticles(
const std::vector<const Particle*>& maskParticles)
const
113 for (
auto* particle : maskParticles) {