10 #include <analysis/modules/RestOfEventPrinter/RestOfEventPrinterModule.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/datastore/StoreObjPtr.h>
17 #include <framework/logging/Logger.h>
20 #include <analysis/dataobjects/RestOfEvent.h>
21 #include <mdst/dataobjects/MCParticle.h>
46 setDescription(
"Prints basic or detailed RestOfEvent info to screen. It is possible to print out ROEMasks for specific mask names as well.");
47 setPropertyFlags(c_ParallelProcessingCertified);
50 std::vector<std::string> emptyVector;
52 addParam(
"maskNames", m_maskNames,
"List of all mask names for which the info will be printed.", emptyVector);
53 addParam(
"fullPrint", m_fullPrint,
"If true, print whole masks content.",
false);
54 addParam(
"unpackComposites", m_unpackComposites,
"If true, replace composites by their daughters",
true);
57 void RestOfEventPrinterModule::initialize()
62 void RestOfEventPrinterModule::event()
64 B2INFO(
"[RestOfEventPrinterModule] START ----------------------------------------");
73 int relatedPDG = part->getPDGCode();
76 relatedMCPDG = mcpart->getPDG();
81 B2INFO(
" - " <<
"ROE related to particle with PDG: " << relatedPDG);
82 B2INFO(
" - " <<
"ROE related to MC particle with PDG: " << relatedMCPDG);
84 roe->print(
"", m_unpackComposites);
86 for (
const auto& maskName : m_maskNames) {
87 if (!roe->hasMask(maskName))
continue;
88 B2INFO(
" - " <<
"Info for ROEMask with name: \'" << maskName <<
"\'");
89 roe->print(maskName, m_unpackComposites);
92 printMaskParticles(roe->getParticles(maskName));
96 B2ERROR(
"RestOfEvent object not valid! Did you build ROE?");
98 B2INFO(
"[RestOfEventPrinterModule] END ------------------------------------------");
101 void RestOfEventPrinterModule::printMaskParticles(
const std::vector<const Particle*>& maskParticles)
const
103 for (
auto* particle : maskParticles) {
A Class to store the Monte Carlo particle information.
Class to store reconstructed particles.
prints ROE information and masks to screen
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.