9#include <pxd/modules/pxdReconstruction/PXDRawHitSorterModule.h>
11#include <framework/logging/Logger.h>
13#include <vxd/geometry/GeoCache.h>
15#include <pxd/reconstruction/Pixel.h>
16#include <pxd/reconstruction/PXDPixelMasker.h>
37 setDescription(
"This module converts the input collection of PXDRawHits into "
38 "a collection of PXDDigits sorted, for each half-ladder, by frame, row,"
43 "If true, take maximum charge of multiple instances of the same fired pixel. Otherwise only keep the first.",
true);
44 addParam(
"zeroSuppressionCut",
m_0cut,
"Minimum charge for a digit to carry", 0);
69 std::map<VxdID, std::multiset<Pixel>> sensors;
75 for (
int i = 0; i < nPixels; i++) {
80 B2WARNING(
"Malformed PXDRawHit, VxdID $" << hex << sensorID.
getID() <<
", dropping. (" << sensorID <<
")");
83 if (!usability[sensorID])
continue;
94 sensors[sensorID].insert(px);
99 unsigned int index(0);
101 for (
auto& sensor : sensors) {
103 VxdID sensorID = sensor.first;
106 if (!lastpx || px > *lastpx) {
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...
unsigned short getVCellID() const
Get cell ID in v.
unsigned short getUCellID() const
Get cell ID in u.
unsigned short getCharge() const
Get collected charge.
VxdID getSensorID() const
Get the sensor ID.
The PXD Raw Hit class This class stores information about PXD Pixel hits and makes them available in ...
short getCharge() const
Get collected charge.
VxdID getSensorID() const
Get the sensor ID.
static PXDPixelMasker & getInstance()
Main (and only) way to access the PXDPixelMasker.
int m_0cut
Minimum charge for a digit to carry.
bool m_trimOutOfRange
Discard out-of-range hits.
virtual void initialize() override
Initialize the module.
bool m_mergeDuplicates
Mode: if true, merge duplicate pixels, otherwise only keep the first.
virtual void event() override
do the sorting
StoreObjPtr< PXDDAQStatus > m_storeDaqStatus
Required input for PXD Daq Status.
std::string m_storeRawHitsName
Name of the collection to use for PXDRawHits.
bool goodHit(const PXDRawHit *const rawhit) const
Utility function to check pixel coordinates.
PXDRawHitSorterModule()
Constructor defining the parameters.
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
StoreArray< PXDRawHit > m_storeRawHits
Required input for PXDRawHit.
StoreArray< PXDDigit > m_storeDigits
Output array for PXDDigits.
Class to represent one pixel, used in clustering for fast access.
unsigned short getU() const
Return the CellID in u.
float getCharge() const
Return the Charge of the Pixel.
unsigned short getV() const
Return the CellID in v.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
static GeoCache & getInstance()
Return a reference to the singleton instance.
bool validSensorID(Belle2::VxdID id) const
Check that id is a valid sensor number.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getID() const
Get the unique id.
baseType getSensorNumber() const
Get the sensor id.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
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.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.