9 #include <tracking/modules/pxdDataReduction/PXDclusterFilterModule.h>
26 setDescription(
"The module produce a StoreArray of PXDClusters inside/overlapping any of the ROIs.");
29 addParam(
"PXDClustersName",
m_PXDClustersName,
"The name of the StoreArray of PXDClusters to be filtered", std::string(
""));
31 std::string(
"PXDClustersIN"));
33 std::string(
"PXDClustersOUT"));
37 addParam(
"overrideDB",
m_overrideDB,
"If set, ROI-finding settings in DB are overwritten",
false);
64 B2ERROR(
"No configuration for the current run found");
80 if (theROI.
getMinUid() <= thePixel.getUCellID() &&
81 theROI.
getMaxUid() >= thePixel.getUCellID() &&
82 theROI.
getMinVid() <= thePixel.getVCellID() &&
83 theROI.
getMaxVid() >= thePixel.getVCellID())
return true;
96 B2ERROR(
"No configuration for the current run found");
127 std::multimap< VxdID, ROIid > ROIids;
130 ROIids.insert(std::pair<VxdID, ROIid> (ROI.getSensorID(), ROI));
133 auto ROIidsRange = ROIids.equal_range(thePxdCluster->
getSensorID()) ;
134 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
135 if (
Overlaps(theROI->second, *thePxdCluster))
143 auto ROIidsRange = ROIids.equal_range(thePxdCluster->
getSensorID()) ;
144 for (
auto theROI = ROIidsRange.first ; theROI != ROIidsRange.second; theROI ++)
145 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.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Abstract base class for different kinds of events.