9#include <pxd/modules/pxdHotPixelMaskCollector/PXDHotPixelMaskCollectorModule.h>
10#include <vxd/geometry/GeoCache.h>
11#include <pxd/dataobjects/PXDDigit.h>
13#include <boost/format.hpp>
34 setDescription(
"Calibration Collector Module for PXD hot pixel masking from digits");
37 addParam(
"zeroSuppressionCut",
m_0cut,
"Minimum charge (in ADU) for detecting a hit", 0);
47 if (gTools->getNumberOfPXDLayers() == 0) {
48 B2WARNING(
"Missing geometry for PXD, PXD-masking is skipped.");
54 auto hPXDHits =
new TH1I(
"hPXDHits",
55 "Number of hits in PXD per events used for masking, distribution parameters found by PXDHotPixelMaskCollectorModule", 200000, 0,
57 hPXDHits->GetXaxis()->SetTitle(
"Number of hits");
58 hPXDHits->GetYaxis()->SetTitle(
"Events");
64 int nPXDSensors = gTools->getNumberOfPXDSensors();
65 auto hPXDHitCounts =
new TH1I(
"hPXDHitCounts",
66 "Number of hits in PXD sensors for masking, distribution parameters found by PXDHotPixelMaskCollectorModule", nPXDSensors, 0,
69 hPXDHitCounts->GetXaxis()->SetTitle(
"SensorID");
70 hPXDHitCounts->GetYaxis()->SetTitle(
"Number of hits");
71 for (
int i = 0; i < nPXDSensors; i++) {
72 VxdID id = gTools->getSensorIDFromPXDIndex(i);
73 string sensorDescr = id;
74 hPXDHitCounts->GetXaxis()->SetBinLabel(i + 1, str(format(
"%1%") % sensorDescr).c_str());
79 for (
int i = 0; i < nPXDSensors; i++) {
80 VxdID id = gTools->getSensorIDFromPXDIndex(i);
81 string sensorDescr = id;
86 string name = str(format(
"PXD_%1%_PixelHitmap") %
id.
getID());
87 string title = str(format(
"PXD Sensor %1% Pixel Hitmap from PXDHotPixelMaskCollector") % sensorDescr);
90 auto hsensorhitmap =
new TH1I(name.c_str(), title.c_str(), 250 * 768, 0, 250 * 768);
106 collector_hits->Fill(0);
108 collector_hits->Fill(
m_pxdDigit.getEntries());
111 auto gTools = geo.getGeoTools();
118 if (digit.getCharge() <
m_0cut)
continue;
121 string name = str(format(
"PXD_%1%_PixelHitmap") % digit.getSensorID().getID());
123 collector_sensorhitmap->Fill(digit.getUCellID() * 768 + digit.getVCellID());
124 collector_pxdhitcounts->Fill(gTools->getPXDSensorIndex(digit.getSensorID()));
void registerObject(std::string name, T *obj)
Register object with a name, takes ownership, do not access the pointer beyond prepare()
CalibrationCollectorModule()
Constructor. Sets the default prefix for calibration dataobjects.
T * getObjectPtr(std::string name)
Calls the CalibObjManager to get the requested stored collector data.
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...
void prepare() override final
Prepare.
int m_0cut
Minimum charge (ADU) for detecting a hit.
void collect() override final
Collect.
PXDHotPixelMaskCollectorModule()
Constructor: Sets the description, the properties and the parameters of the module.
StoreArray< PXDDigit > m_pxdDigit
< Required input for PXDigits
std::string m_storeDigitsName
Name of the collection to use for PXDDigits.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
Class to uniquely identify a any structure of the PXD and SVD.
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.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Abstract base class for different kinds of events.