 |
Belle II Software
release-05-01-25
|
11 #include <pxd/modules/pxdReconstruction/PXDRawHitSorterModule.h>
13 #include <framework/logging/Logger.h>
15 #include <vxd/geometry/GeoCache.h>
17 #include <pxd/reconstruction/Pixel.h>
18 #include <pxd/reconstruction/PXDPixelMasker.h>
36 PXDRawHitSorterModule::PXDRawHitSorterModule() :
Module()
39 setDescription(
"This module converts the input collection of PXDRawHits into "
40 "a collection of PXDDigits sorted, for each half-ladder, by frame, row,"
45 "If true, take maximum charge of multiple instances of the same fired pixel. Otherwise only keep the first.",
true);
46 addParam(
"zeroSuppressionCut",
m_0cut,
"Minimum charge for a digit to carry", 0);
71 std::map<VxdID, std::multiset<Pixel>> sensors;
77 for (
int i = 0; i < nPixels; i++) {
82 B2WARNING(
"Malformed PXDRawHit, VxdID $" << hex << sensorID.
getID() <<
", dropping. (" << sensorID <<
")");
85 if (!usability[sensorID])
continue;
94 if (sensorID.getLayerNumber() && sensorID.getLadderNumber() && sensorID.getSensorNumber()) {
96 sensors[sensorID].insert(px);
101 unsigned int index(0);
103 for (
auto& sensor : sensors) {
105 VxdID sensorID = sensor.first;
108 if (!lastpx || px > *lastpx) {
119 old.getVCellID(), std::max(old.getCharge(),
static_cast<unsigned short>(px.
getCharge())));
Class to uniquely identify a any structure of the PXD and SVD.
float getCharge() const
Return the Charge of the Pixel.
void setDescription(const std::string &description)
Sets the description of the module.
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to represent one pixel, used in clustering for fast access.
baseType getID() const
Get the unique id.
virtual void initialize() override
Initialize the module.
bool m_mergeDuplicates
Mode: if true, merge duplicate pixels, otherwise only keep the first.
bool m_trimOutOfRange
Discard out-of-range hits.
bool validSensorID(Belle2::VxdID id) const
Check that id is a valid sensor number.
The PXD Raw Hit class This class stores information about PXD Pixel hits and makes them available in ...
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
VxdID getSensorID() const
Get the sensor ID.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
virtual void event() override
do the sorting
static GeoCache & getInstance()
Return a reference to the singleton instance.
Abstract base class for different kinds of events.
StoreArray< PXDRawHit > m_storeRawHits
Required input for PXDRawHit.
StoreArray< PXDDigit > m_storeDigits
Output array for PXDDigits.
short getCharge() const
Get collected charge.
unsigned short getV() const
Return the CellID in v.
std::string m_storeRawHitsName
Name of the collection to use for PXDRawHits.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
unsigned short getU() const
Return the CellID in u.
int m_0cut
Minimum charge for a digit to carry.
bool goodHit(const PXDRawHit *const rawhit) const
Utility function to check pixel coordinates.
static PXDPixelMasker & getInstance()
Main (and only) way to access the PXDPixelMasker.
StoreObjPtr< PXDDAQStatus > m_storeDaqStatus
Required input for PXD Daq Status.