9#include <tracking/modules/roiFinding/pxd/PXDclusterFilterModule.h>
10#include <tracking/dataobjects/ROIid.h>
11#include <simulation/dbobjects/ROISimulationParameters.h>
29 setDescription(
"The module produce a StoreArray of PXDClusters inside/overlapping any of the ROIs.");
32 addParam(
"PXDClustersName",
m_PXDClustersName,
"The name of the StoreArray of PXDClusters to be filtered", std::string(
""));
34 std::string(
"PXDClustersIN"));
36 std::string(
"PXDClustersOUT"));
40 addParam(
"overrideDB",
m_overrideDB,
"If set, ROI-finding settings in DB are overwritten",
false);
67 B2ERROR(
"No configuration for the current run found");
83 if (theROI.
getMinUid() <= thePixel.getUCellID() &&
84 theROI.
getMaxUid() >= thePixel.getUCellID() &&
85 theROI.
getMinVid() <= thePixel.getVCellID() &&
86 theROI.
getMaxVid() >= thePixel.getVCellID())
return true;
99 B2ERROR(
"No configuration for the current run found");
130 std::multimap< VxdID, ROIid > ROIids;
133 ROIids.insert(std::pair<VxdID, ROIid> (ROI.getSensorID(), ROI));
136 auto ROIidsRange = ROIids.equal_range(thePxdCluster->
getSensorID()) ;
137 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
138 if (
Overlaps(theROI->second, *thePxdCluster))
146 auto ROIidsRange = ROIids.equal_range(thePxdCluster->
getSensorID()) ;
147 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
148 if (
Overlaps(theROI->second, *thePxdCluster))
void setDescription(const std::string &description)
Sets the description of the module.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
VxdID getSensorID() const
Get the sensor ID.
SelectSubset< PXDCluster > m_selectorOUT
selector of the subset of PXDClusters NOT contained in the ROIs
bool Overlaps(const ROIid &theROI, const PXDCluster &thePXDCluster)
Check for cluster overlaps - a pixel shared with two or more clusters.
bool m_overrideDB
if set, overwrites ROI-finding settings in DB
void initialize() override
Initializer.
std::string m_PXDClustersOutsideROIName
The name of the StoreArray of Filtered PXDClusters.
void event() override
This method is called for each event.
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.
DBObjPtr< ROISimulationParameters > m_ROISimulationParameters
Configuration parameters for ROIs.
void filterClusters()
all the actual work is done here
std::string m_PXDClustersName
The name of the StoreArray of PXDClusters to be filtered.
StoreArray< PXDCluster > m_PXDClusters
StoreArray containing the input PXDClusters.
std::string m_PXDClustersInsideROIName
The name of the StoreArray of Filtered PXDClusters.
void copyClusters()
all the actual work is done here
std::string m_ROIidsName
The name of the StoreArray of ROIs.
void beginRun() override final
Called when entering a new run.
PXDclusterFilterModule()
Constructor: Sets the description, the properties and the parameters of the module.
bool m_enableFiltering
enables/disables ROI-finding if overwriteDB=True
bool m_CreateOutside
if set, create list of outside pixels, too
SelectSubset< PXDCluster > m_selectorIN
selector of the subset of PXDClusters contained in the ROIs
StoreArray< ROIid > m_ROIs
StoreArray containing the ROIs.
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.
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.