9 #include <pxd/modules/pxdHotPixelMaskCollector/PXDHotPixelMaskCollectorModule.h>
10 #include <vxd/geometry/GeoCache.h>
12 #include <boost/format.hpp>
33 setDescription(
"Calibration Collector Module for PXD hot pixel masking from digits");
34 setPropertyFlags(c_ParallelProcessingCertified);
36 addParam(
"zeroSuppressionCut", m_0cut,
"Minimum charge (in ADU) for detecting a hit", 0);
37 addParam(
"digitsName", m_storeDigitsName,
"PXDDigit collection name",
string(
""));
40 void PXDHotPixelMaskCollectorModule::prepare()
42 m_pxdDigit.isRequired();
44 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
46 if (gTools->getNumberOfPXDLayers() == 0) {
47 B2WARNING(
"Missing geometry for PXD, PXD-masking is skiped.");
53 auto hPXDHits =
new TH1I(
"hPXDHits",
54 "Number of hits in PXD per events used for masking, distribution parameters found by PXDHotPixelMaskCollectorModule", 200000, 0,
56 hPXDHits->GetXaxis()->SetTitle(
"Number of hits");
57 hPXDHits->GetYaxis()->SetTitle(
"Events");
58 registerObject<TH1I>(
"PXDHits", hPXDHits);
63 int nPXDSensors = gTools->getNumberOfPXDSensors();
64 auto hPXDHitCounts =
new TH1I(
"hPXDHitCounts",
65 "Number of hits in PXD sensors for masking, distribution parameters found by PXDHotPixelMaskCollectorModule", nPXDSensors, 0,
68 hPXDHitCounts->GetXaxis()->SetTitle(
"SensorID");
69 hPXDHitCounts->GetYaxis()->SetTitle(
"Number of hits");
70 for (
int i = 0; i < nPXDSensors; i++) {
71 VxdID id = gTools->getSensorIDFromPXDIndex(i);
72 string sensorDescr = id;
73 hPXDHitCounts->GetXaxis()->SetBinLabel(i + 1, str(format(
"%1%") % sensorDescr).c_str());
75 registerObject<TH1I>(
"PXDHitCounts", hPXDHitCounts);
78 for (
int i = 0; i < nPXDSensors; i++) {
79 VxdID id = gTools->getSensorIDFromPXDIndex(i);
80 string sensorDescr = id;
85 string name = str(format(
"PXD_%1%_PixelHitmap") %
id.
getID());
86 string title = str(format(
"PXD Sensor %1% Pixel Hitmap from PXDHotPixelMaskCollector") % sensorDescr);
89 auto hsensorhitmap =
new TH1I(name.c_str(), title.c_str(), 250 * 768, 0, 250 * 768);
92 registerObject<TH1I>(name.c_str(), hsensorhitmap);
97 void PXDHotPixelMaskCollectorModule::collect()
101 TH1I* collector_hits = getObjectPtr<TH1I>(
"PXDHits");
105 collector_hits->Fill(0);
107 collector_hits->Fill(m_pxdDigit.getEntries());
109 auto& geo = VXD::GeoCache::getInstance();
110 auto gTools = geo.getGeoTools();
113 TH1I* collector_pxdhitcounts = getObjectPtr<TH1I>(
"PXDHitCounts");
115 for (
auto& digit : m_pxdDigit) {
117 if (digit.getCharge() < m_0cut)
continue;
120 string name = str(format(
"PXD_%1%_PixelHitmap") % digit.getSensorID().getID());
121 TH1I* collector_sensorhitmap = getObjectPtr<TH1I>(name.c_str());
122 collector_sensorhitmap->Fill(digit.getUCellID() * 768 + digit.getVCellID());
123 collector_pxdhitcounts->Fill(gTools->getPXDSensorIndex(digit.getSensorID()));
Calibration collector module base class.
Calibration Collector Module for PXD hot pixel masking from PXDDigits.
Class to uniquely identify a any structure of the PXD and SVD.
#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.