11 #include <pxd/modules/pxdHotPixelMaskCollector/PXDHotPixelMaskCollectorModule.h>
12 #include <vxd/geometry/GeoCache.h>
14 #include <boost/format.hpp>
35 setDescription(
"Calibration Collector Module for PXD hot pixel masking from digits");
36 setPropertyFlags(c_ParallelProcessingCertified);
38 addParam(
"zeroSuppressionCut", m_0cut,
"Minimum charge (in ADU) for detecting a hit", 0);
39 addParam(
"digitsName", m_storeDigitsName,
"PXDDigit collection name",
string(
""));
42 void PXDHotPixelMaskCollectorModule::prepare()
44 m_pxdDigit.isRequired();
46 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
48 if (gTools->getNumberOfPXDLayers() == 0) {
49 B2WARNING(
"Missing geometry for PXD, PXD-masking is skiped.");
55 auto hPXDHits =
new TH1I(
"hPXDHits",
56 "Number of hits in PXD per events used for masking, distribution parameters found by PXDHotPixelMaskCollectorModule", 200000, 0,
58 hPXDHits->GetXaxis()->SetTitle(
"Number of hits");
59 hPXDHits->GetYaxis()->SetTitle(
"Events");
60 registerObject<TH1I>(
"PXDHits", hPXDHits);
65 int nPXDSensors = gTools->getNumberOfPXDSensors();
66 auto hPXDHitCounts =
new TH1I(
"hPXDHitCounts",
67 "Number of hits in PXD sensors for masking, distribution parameters found by PXDHotPixelMaskCollectorModule", nPXDSensors, 0,
70 hPXDHitCounts->GetXaxis()->SetTitle(
"SensorID");
71 hPXDHitCounts->GetYaxis()->SetTitle(
"Number of hits");
72 for (
int i = 0; i < nPXDSensors; i++) {
73 VxdID id = gTools->getSensorIDFromPXDIndex(i);
74 string sensorDescr = id;
75 hPXDHitCounts->GetXaxis()->SetBinLabel(i + 1, str(format(
"%1%") % sensorDescr).c_str());
77 registerObject<TH1I>(
"PXDHitCounts", hPXDHitCounts);
80 for (
int i = 0; i < nPXDSensors; i++) {
81 VxdID id = gTools->getSensorIDFromPXDIndex(i);
82 string sensorDescr = id;
87 string name = str(format(
"PXD_%1%_PixelHitmap") %
id.
getID());
88 string title = str(format(
"PXD Sensor %1% Pixel Hitmap from PXDHotPixelMaskCollector") % sensorDescr);
91 auto hsensorhitmap =
new TH1I(name.c_str(), title.c_str(), 250 * 768, 0, 250 * 768);
94 registerObject<TH1I>(name.c_str(), hsensorhitmap);
99 void PXDHotPixelMaskCollectorModule::collect()
103 TH1I* collector_hits = getObjectPtr<TH1I>(
"PXDHits");
107 collector_hits->Fill(0);
109 collector_hits->Fill(m_pxdDigit.getEntries());
111 auto& geo = VXD::GeoCache::getInstance();
112 auto gTools = geo.getGeoTools();
115 TH1I* collector_pxdhitcounts = getObjectPtr<TH1I>(
"PXDHitCounts");
117 for (
auto& digit : m_pxdDigit) {
119 if (digit.getCharge() < m_0cut)
continue;
122 string name = str(format(
"PXD_%1%_PixelHitmap") % digit.getSensorID().getID());
123 TH1I* collector_sensorhitmap = getObjectPtr<TH1I>(name.c_str());
124 collector_sensorhitmap->Fill(digit.getUCellID() * 768 + digit.getVCellID());
125 collector_pxdhitcounts->Fill(gTools->getPXDSensorIndex(digit.getSensorID()));