9#include <tracking/modules/roiFinding/pxd/PXDdigiFilterModule.h>
10#include <simulation/dbobjects/ROISimulationParameters.h>
11#include <tracking/dataobjects/ROIid.h>
29 setDescription(
"The module produce a StoreArray of PXDDigit inside the ROIs. A second StoreArray with PXDDigits outside the ROI can be created on demand.");
33 addParam(
"PXDDigitsName",
m_PXDDigitsName,
"The name of the StoreArray of PXDDigits to be filtered", std::string(
""));
35 std::string(
"PXDDigitsIN"));
37 std::string(
"PXDDigitsOUT"));
41 addParam(
"overrideDB",
m_overrideDB,
"If set, ROI-filtering settings in DB are overwritten",
false);
74 B2ERROR(
"No configuration for the current run found");
86 B2ERROR(
"No configuration for the current run found");
117 std::multimap< VxdID, ROIid > ROIids;
120 ROIids.insert(std::pair<VxdID, ROIid> (ROI.getSensorID(), ROI));
123 auto ROIidsRange = ROIids.equal_range(thePxdDigit->
getSensorID()) ;
124 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
125 if (theROI->second.Contains(*thePxdDigit))
133 auto ROIidsRange = ROIids.equal_range(thePxdDigit->
getSensorID()) ;
134 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
135 if (theROI->second.Contains(*thePxdDigit))
@ c_WriteOut
Object/array should be saved by output modules.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
VxdID getSensorID() const
Get the sensor ID.
void initialize() override final
Initializer.
bool m_overrideDB
if set, overwrites ROI-finding settings in DB
int m_countNthEvent
Event counter to be able to disable data reduction for every Nth event.
int m_skipEveryNth
Parameter from DB for how many events to skip data reduction.
void copyDigits()
all the actual work is done here
DBObjPtr< ROISimulationParameters > m_ROISimulationParameters
Configuration parameters for ROIs.
SelectSubset< PXDDigit > m_selectorIN
selector of the subset of PXDDigits contained in the ROIs
bool m_usePXDDataReduction
enables/disables ROI-finding if overwriteDB=True
void event() override final
This method is called for each event.
std::string m_PXDDigitsOutsideROIName
The name of the StoreArray of Filtered PXDDigits.
std::string m_ROIidsName
The name of the StoreArray of ROIs.
StoreArray< PXDDigit > m_PXDDigits
StoreArray containing the input PXDDigits.
void beginRun() override final
Called when entering a new run.
std::string m_PXDDigitsName
The name of the StoreArray of PXDDigits to be filtered.
void filterDigits()
all the actual work is done here
PXDdigiFilterModule()
Constructor: Sets the description, the properties and the parameters of the module.
bool m_CreateOutside
if set, create list of outside pixels, too
std::string m_PXDDigitsInsideROIName
The name of the StoreArray of Filtered PXDDigits.
SelectSubset< PXDDigit > m_selectorOUT
selector of the subset of PXDDigits NOT contained in the ROIs
StoreArray< ROIid > m_ROIs
StoreArray containing the ROIs.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.