9 #include <tracking/modules/pxdDataReduction/PXDdigiFilterModule.h>
10 #include <tracking/dataobjects/ROIid.h>
28 setDescription(
"The module produce a StoreArray of PXDDigit inside the ROIs.");
29 setPropertyFlags(c_ParallelProcessingCertified);
32 addParam(
"PXDDigitsName", m_PXDDigitsName,
"The name of the StoreArray of PXDDigits to be filtered", std::string(
""));
33 addParam(
"PXDDigitsInsideROIName", m_PXDDigitsInsideROIName,
"The name of the StoreArray of Filtered PXDDigits",
34 std::string(
"PXDDigitsIN"));
35 addParam(
"PXDDigitsOutsideROIName", m_PXDDigitsOutsideROIName,
"The name of the StoreArray of Filtered PXDDigits",
36 std::string(
"PXDDigitsOUT"));
37 addParam(
"ROIidsName", m_ROIidsName,
"The name of the StoreArray of ROIs", std::string(
""));
38 addParam(
"CreateOutside", m_CreateOutside,
"Create the StoreArray of PXD pixel outside the ROIs",
false);
40 addParam(
"overrideDB", m_overrideDB,
"If set, ROI-filtering settings in DB are overwritten",
false);
41 addParam(
"usePXDDataReduction", m_usePXDDataReduction,
"enables/disables ROI-filtering if overrideDB=True",
false);
52 if (m_PXDDigitsName == m_PXDDigitsInsideROIName) {
53 m_selectorIN.registerSubset(PXDDigits);
56 m_selectorIN.inheritAllRelations();
59 if (m_CreateOutside) {
60 if (m_PXDDigitsName == m_PXDDigitsOutsideROIName) {
61 m_selectorOUT.registerSubset(PXDDigits);
63 m_selectorOUT.registerSubset(PXDDigits, m_PXDDigitsOutsideROIName);
64 m_selectorOUT.inheritAllRelations();
73 if (m_roiParameters) {
74 m_skipEveryNth = m_roiParameters->getDisableROIforEveryNth();
76 B2ERROR(
"No configuration for the current run found");
84 if (m_roiParameters.hasChanged()) {
85 if (m_roiParameters) {
86 m_skipEveryNth = m_roiParameters->getDisableROIforEveryNth();
88 B2ERROR(
"No configuration for the current run found");
95 if (m_usePXDDataReduction) {
106 if (m_skipEveryNth > 0 and m_countNthEvent % m_skipEveryNth == 0) {
122 multimap< VxdID, ROIid > ROIids;
124 for (
auto ROI : ROIids_store_array)
125 ROIids.insert(pair<VxdID, ROIid> (ROI.getSensorID() , ROI));
127 m_selectorIN.select([ROIids](
const PXDDigit * thePxdDigit) {
128 auto ROIidsRange = ROIids.equal_range(thePxdDigit->
getSensorID()) ;
129 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
130 if (theROI->second.Contains(*thePxdDigit))
136 if (m_CreateOutside) {
137 m_selectorOUT.select([ROIids](
const PXDDigit * thePxdDigit) {
138 auto ROIidsRange = ROIids.equal_range(thePxdDigit->
getSensorID()) ;
139 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
140 if (theROI->second.Contains(*thePxdDigit))
151 m_selectorIN.select([](
const PXDDigit* ) {
return true;});
@ c_WriteOut
Object/array should be saved by output modules.
VxdID getSensorID() const
Get the sensor ID.
The module produce a StoreArray of PXDDigit inside the ROIs.
void initialize() override final
Initializer.
void copyDigits()
all the actual work is done here
void event() override final
This method is called for each event.
void beginRun() override final
Called when entering a new run.
void filterDigits()
all the actual work is done here
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.