9 #include <tracking/modules/pxdDataReduction/PXDclusterFilterModule.h>
27 setDescription(
"The module produce a StoreArray of PXDClusters inside/overlapping any of the ROIs.");
30 addParam(
"PXDClustersName", m_PXDClustersName,
"The name of the StoreArray of PXDClusters to be filtered", std::string(
""));
31 addParam(
"PXDClustersInsideROIName", m_PXDClustersInsideROIName,
"The name of the StoreArray of Filtered PXDClusters",
32 std::string(
"PXDClustersIN"));
33 addParam(
"PXDClustersOutsideROIName", m_PXDClustersOutsideROIName,
"The name of the StoreArray of Filtered PXDClusters",
34 std::string(
"PXDClustersOUT"));
35 addParam(
"ROIidsName", m_ROIidsName,
"The name of the StoreArray of ROIs", std::string(
""));
36 addParam(
"CreateOutside", m_CreateOutside,
"Create the StoreArray of PXD clusters outside the ROIs",
false);
38 addParam(
"overrideDB", m_overrideDB,
"If set, ROI-finding settings in DB are overwritten",
false);
39 addParam(
"enableFiltering", m_enableFiltering,
"enables/disables ROI-finding if overrideDB=True",
false);
53 m_selectorIN.registerSubset(PXDClusters, m_PXDClustersInsideROIName);
54 m_selectorIN.inheritAllRelations();
56 if (m_CreateOutside) {
57 m_selectorOUT.registerSubset(PXDClusters, m_PXDClustersOutsideROIName);
58 m_selectorOUT.inheritAllRelations();
66 if (m_roiParameters) {
67 m_skipEveryNth = m_roiParameters->getDisableROIforEveryNth();
69 B2ERROR(
"No configuration for the current run found");
85 if (theROI.
getMinUid() <= thePixel.getUCellID() &&
86 theROI.
getMaxUid() >= thePixel.getUCellID() &&
87 theROI.
getMinVid() <= thePixel.getVCellID() &&
88 theROI.
getMaxVid() >= thePixel.getVCellID())
return true;
97 if (m_roiParameters.hasChanged()) {
98 if (m_roiParameters) {
99 m_skipEveryNth = m_roiParameters->getDisableROIforEveryNth();
101 B2ERROR(
"No configuration for the current run found");
108 if (m_enableFiltering) {
119 if (m_skipEveryNth > 0 and m_countNthEvent % m_skipEveryNth == 0) {
136 multimap< VxdID, ROIid > ROIids;
138 for (
auto ROI : ROIids_store_array)
139 ROIids.insert(pair<VxdID, ROIid> (ROI.getSensorID() , ROI));
141 m_selectorIN.select([ROIids,
this](
const PXDCluster * thePxdCluster) {
142 auto ROIidsRange = ROIids.equal_range(thePxdCluster->
getSensorID()) ;
143 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
144 if (Overlaps(theROI->second, *thePxdCluster))
150 if (m_CreateOutside) {
151 m_selectorOUT.select([ROIids,
this](
const PXDCluster * thePxdCluster) {
152 auto ROIidsRange = ROIids.equal_range(thePxdCluster->
getSensorID()) ;
153 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
154 if (Overlaps(theROI->second, *thePxdCluster))
165 m_selectorIN.select([](
const PXDCluster* ) {
return true;});
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
VxdID getSensorID() const
Get the sensor ID.
The module produce a StoreArray of PXDCluster inside the ROIs.
bool Overlaps(const ROIid &theROI, const PXDCluster &thePXDCluster)
Check for cluster overlaps - a pixel shared with two or more clusters.
void initialize() override
Initializer.
void event() override
This method is called for each event.
void filterClusters()
all the actual work is done here
void copyClusters()
all the actual work is done here
void beginRun() override final
Called when entering a new run.
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
int getMaxVid() const
return the maximum V id of the ROI
int getMinVid() const
return the minimum V id of the ROI
VxdID getSensorID() const
return the sensor ID of the ROI
int getMinUid() const
return the minimum U id of the ROI
int getMaxUid() const
return the maximum U id of the ROI
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
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.