10 #include <background/modules/BGOverlayExecutor/BGOverlayExecutorModule.h>
13 #include <framework/datastore/StoreObjPtr.h>
16 #include <framework/logging/Logger.h>
19 #include <pxd/dataobjects/PXDDigit.h>
20 #include <svd/dataobjects/SVDShaperDigit.h>
21 #include <cdc/dataobjects/CDCHit.h>
22 #include <top/dataobjects/TOPDigit.h>
23 #include <arich/dataobjects/ARICHDigit.h>
24 #include <klm/dataobjects/KLMDigit.h>
25 #include <framework/dataobjects/BackgroundInfo.h>
49 setDescription(
"Overlay of measured background with simulated data");
50 setPropertyFlags(c_ParallelProcessingCertified);
53 addParam(
"bkgInfoName", m_BackgroundInfoInstanceName,
"name of the BackgroundInfo StoreObjPtr",
string(
""));
54 addParam(
"PXDDigitsName", m_PXDDigitsName,
55 "name of PXD collection to overlay with BG",
string(
""));
56 addParam(
"SVDShaperDigitsName", m_SVDShaperDigitsName,
57 "name of SVD collection to overlay with BG",
string(
""));
58 addParam(
"CDCHitsName", m_CDCHitsName,
59 "name of CDC collection to overlay with BG",
string(
""));
60 addParam(
"TOPDigitsName", m_TOPDigitsName,
61 "name of TOP collection to overlay with BG",
string(
""));
62 addParam(
"ARICHDigitsName", m_ARICHDigitsName,
63 "name of ARICH collection to overlay with BG",
string(
""));
64 addParam(
"KLMDigitsName", m_KLMDigitsName,
65 "name of KLM collection to overlay with BG",
string(
""));
66 addParam(
"components", m_components,
67 "Detector components to be included in overlay (empty list means all)", m_components);
71 void BGOverlayExecutorModule::initialize()
76 if (bkgInfo->getMethod() == BackgroundInfo::c_Overlay) {
77 m_extensionName = bkgInfo->getExtensionName();
79 B2ERROR(
"BGOverlayExecutor: no BGOverlayInput module in the path");
82 B2ERROR(
"BGOverlayExecutor: no BGOverlayInput module in the path");
86 registerDigits<PXDDigit>(m_PXDDigitsName);
87 registerDigits<SVDShaperDigit>(m_SVDShaperDigitsName);
88 registerDigits<CDCHit>(m_CDCHitsName);
89 registerDigits<TOPDigit>(m_TOPDigitsName);
90 registerDigits<ARICHDigit>(m_ARICHDigitsName);
91 registerDigits<KLMDigit>(m_KLMDigitsName);
94 if (m_components.empty()) {
102 for (
const auto& component : m_components) {
103 if (component ==
"PXD") m_addPXD =
true;
104 else if (component ==
"SVD") m_addSVD =
true;
105 else if (component ==
"CDC") m_addCDC =
true;
106 else if (component ==
"TOP") m_addTOP =
true;
107 else if (component ==
"ARICH") m_addARICH =
true;
108 else if (component ==
"ECL")
continue;
109 else if (component ==
"KLM") m_addKLM =
true;
110 else B2ERROR(
"Unknown detector component '" << component <<
"'");
117 void BGOverlayExecutorModule::event()
121 if (m_addPXD) addBGDigits<PXDDigit>(m_PXDDigitsName);
122 if (m_addSVD) addBGDigits<SVDShaperDigit>(m_SVDShaperDigitsName);
123 if (m_addCDC) addBGDigits<CDCHit>(m_CDCHitsName);
124 if (m_addTOP) addBGDigits<TOPDigit>(m_TOPDigitsName);
125 if (m_addARICH) addBGDigits<ARICHDigit>(m_ARICHDigitsName);
127 if (m_addKLM) addBGDigits<KLMDigit>(m_KLMDigitsName);
Overlay of measured background with simulated data (Digits or Clusters)
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.