11 #include <svd/modules/svdCalibration/SVDLocalCalibrationsMonitorModule.h>
12 #include <vxd/geometry/GeoCache.h>
13 #include <svd/geometry/SensorInfo.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/dataobjects/EventMetaData.h>
31 setDescription(
"Module to produce a list of histograms showing the uploaded calibration constants");
34 addParam(
"outputFileName", m_rootFileName,
"Name of output root file.", std::string(
"SVDLocalCalibrationMonitor_output.root"));
44 m_tree =
new TTree(
"calibLocal",
"RECREATE");
95 B2WARNING(
"No valid SVDFADCMaskedStrip for the requested IoV");
97 B2WARNING(
"No valid SVDNoiseCalibration for the requested IoV");
99 B2FATAL(
"No valid SVDDetectorConfiguration for the requested IoV");
101 B2WARNING(
"No valid SVDPedestalCalibration for the requested IoV");
103 B2WARNING(
"No valid SVDPulseShapeCalibrations for the requested IoV");
111 TH1F hOccupancy(
"occupancy_L@layerL@ladderS@sensor@view",
112 "occupancy in hits/evt in @layer.@ladder.@sensor @view/@side",
114 hOccupancy.GetXaxis()->SetTitle(
"strip occupancy ()");
117 TH2F h2Occupancy_512(
"occupancy2D_512_L@layerL@ladderS@sensor@view",
118 "occupancy in HITS/EVT in @layer.@ladder.@sensor @view/@side VS cellID",
119 128 * 4, -0.5, 128 * 4 - 0.5, 1500, 0.0, 0.006);
120 h2Occupancy_512.GetYaxis()->SetTitle(
"strip occupancy (HITS/EVT)");
121 h2Occupancy_512.GetXaxis()->SetTitle(
"cellID");
123 TH2F h2Occupancy_768(
"occupancy2D_768_L@layerL@ladderS@sensor@view",
124 "occupancy in HITS/EVT in @layer.@ladder.@sensor @view/@side VS cellID",
125 128 * 6, -0.5, 128 * 6 - 0.5, 1500, 0.0, 0.006);
126 h2Occupancy_768.GetYaxis()->SetTitle(
"strip occupancy (HITS/EVT)");
127 h2Occupancy_768.GetXaxis()->SetTitle(
"cellID");
132 TH1F hHotstrips(
"hotstrips_L@layerL@ladderS@sensor@view",
133 "hot strips in @layer.@ladder.@sensor @view/@side",
135 hHotstrips.GetXaxis()->SetTitle(
"isHotStrips");
139 TH1F hHotStrips768(
"HotStrips768_L@layerL@ladderS@sensor@view",
"Hot Strips of @layer.@ladder.@sensor @view/@side side", 768, 0,
141 hHotStrips768.GetXaxis()->SetTitle(
"cellID");
142 TH1F hHotStrips512(
"HotStrips512_L@layerL@ladderS@sensor@view",
"Hot Strips of @layer.@ladder.@sensor @view/@side side", 512, 0,
144 hHotStrips512.GetXaxis()->SetTitle(
"cellID");
147 TH2F h2Hotstrips_512(
"hotstrips2D_512_L@layerL@ladderS@sensor@view",
148 "hot strips in @layer.@ladder.@sensor @view/@side VS cellID",
149 128 * 4, -0.5, 128 * 4 - 0.5, 2, -0.5, 1.5);
150 h2Hotstrips_512.GetYaxis()->SetTitle(
"isHotStrips");
151 h2Hotstrips_512.GetXaxis()->SetTitle(
"cellID");
153 TH2F h2Hotstrips_768(
"hotstrips2D_768_L@layerL@ladderS@sensor@view",
154 "hot strips in @layer.@ladder.@sensor @view/@side VS cellID",
155 128 * 6, -0.5, 128 * 6 - 0.5, 2, -0.5, 1.5);
156 h2Hotstrips_768.GetYaxis()->SetTitle(
"isHotStrips");
157 h2Hotstrips_768.GetXaxis()->SetTitle(
"cellID");
166 TH1F hMask(
"masked_L@layerL@ladderS@sensor@view",
167 "masked strip in @layer.@ladder.@sensor @view/@side",
169 hMask.GetXaxis()->SetTitle(
"isMasked");
172 TH2F h2Mask_512(
"masked2D_512_L@layerL@ladderS@sensor@view",
173 "masked strip in @layer.@ladder.@sensor @view/@side VS cellID",
174 128 * 4, -0.5, 128 * 4 - 0.5, 2, -0.5, 1.5);
175 h2Mask_512.GetYaxis()->SetTitle(
"isMasked");
176 h2Mask_512.GetXaxis()->SetTitle(
"cellID");
178 TH2F h2Mask_768(
"masked2D_768_L@layerL@ladderS@sensor@view",
179 "masked strip in @layer.@ladder.@sensor @view/@side VS cellID",
180 128 * 6, -0.5, 128 * 6 - 0.5, 2, -0.5, 1.5);
181 h2Mask_768.GetYaxis()->SetTitle(
"isMasked");
182 h2Mask_768.GetXaxis()->SetTitle(
"cellID");
187 TH1F hNoise(
"noiseADC_L@layerL@ladderS@sensor@view",
188 "noise in ADC in @layer.@ladder.@sensor @view/@side",
190 hNoise.GetXaxis()->SetTitle(
"strip noise (ADC)");
193 TH2F h2Noise_512(
"noise2D_512_L@layerL@ladderS@sensor@view",
194 "noise in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
195 128 * 4, -0.5, 128 * 4 - 0.5, 80, -0.5, 9.5);
196 h2Noise_512.GetYaxis()->SetTitle(
"strip noise (ADC)");
197 h2Noise_512.GetXaxis()->SetTitle(
"cellID");
199 TH2F h2Noise_768(
"noise2D_768_L@layerL@ladderS@sensor@view",
200 "noise in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
201 128 * 6, -0.5, 128 * 6 - 0.5, 80, -0.5, 9.5);
202 h2Noise_768.GetYaxis()->SetTitle(
"strip noise (ADC)");
203 h2Noise_768.GetXaxis()->SetTitle(
"cellID");
209 TH1F hNoiseEl(
"noiseEl_L@layerL@ladderS@sensor@view",
210 "noise in e- in @layer.@ladder.@sensor @view/@side",
211 600, -199.5, 1499.5);
212 hNoiseEl.GetXaxis()->SetTitle(
"strip noise (e-)");
215 TH2F h2NoiseEl_512(
"noiseEl2D_512_L@layerL@ladderS@sensor@view",
216 "noise in e- in @layer.@ladder.@sensor @view/@side VS cellID",
217 128 * 4, -0.5, 128 * 4 - 0.5, 600, -199.5, 1499.5);
218 h2NoiseEl_512.GetYaxis()->SetTitle(
"strip noise (e-)");
219 h2NoiseEl_512.GetXaxis()->SetTitle(
"cellID");
221 TH2F h2NoiseEl_768(
"noiseEl2D_768_L@layerL@ladderS@sensor@view",
222 "noise in e- in @layer.@ladder.@sensor @view/@side VS cellID",
223 128 * 6, -0.5, 128 * 6 - 0.5, 600, -199.5, 1499.5);
224 h2NoiseEl_768.GetYaxis()->SetTitle(
"strip noise (e-)");
225 h2NoiseEl_768.GetXaxis()->SetTitle(
"cellID");
231 TH1F hPedestal(
"pedestalADC_L@layerL@ladderS@sensor@view",
232 "pedestal in ADC in @layer.@ladder.@sensor @view/@side",
234 hPedestal.GetXaxis()->SetTitle(
"strip pedestal (ADC)");
237 TH2F h2Pedestal_512(
"pedestal2D_512_L@layerL@ladderS@sensor@view",
238 "pedestal in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
239 128 * 4, -0.5, 128 * 4 - 0.5, 200, -199.5, 599.5);
240 h2Pedestal_512.GetYaxis()->SetTitle(
"strip pedestal (ADC)");
241 h2Pedestal_512.GetXaxis()->SetTitle(
"cellID");
243 TH2F h2Pedestal_768(
"pedestal2D_768_L@layerL@ladderS@sensor@view",
244 "pedestal in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
245 128 * 6, -0.5, 128 * 6 - 0.5, 200, -199.5, 599.5);
246 h2Pedestal_768.GetYaxis()->SetTitle(
"strip pedestal (ADC)");
247 h2Pedestal_768.GetXaxis()->SetTitle(
"cellID");
252 TH1F hGain(
"gainADC_L@layerL@ladderS@sensor@view",
253 "1/gain in @layer.@ladder.@sensor @view/@side",
255 hGain.GetXaxis()->SetTitle(
"strip 1/gain (e-/ADC)");
258 TH2F h2Gain_512(
"gain2D_512_L@layerL@ladderS@sensor@view",
259 "1/gain in @layer.@ladder.@sensor @view/@side VS cellID",
260 128 * 4, -0.5, 128 * 4 - 0.5, 300, -0.5, 499.5);
261 h2Gain_512.GetYaxis()->SetTitle(
"strip 1/gain (e-/ADC)");
262 h2Gain_512.GetXaxis()->SetTitle(
"cellID");
264 TH2F h2Gain_768(
"gain2D_768_L@layerL@ladderS@sensor@view",
265 "1/gain in @layer.@ladder.@sensor @view/@side VS cellID",
266 128 * 6, -0.5, 128 * 6 - 0.5, 300, -0.5, 499.5);
267 h2Gain_768.GetYaxis()->SetTitle(
"strip 1/gain (e-/ADC)");
268 h2Gain_768.GetXaxis()->SetTitle(
"cellID");
273 TH1F hCalPeakTime(
"calPeakTime_L@layerL@ladderS@sensor@view",
274 "calPeakTime in @layer.@ladder.@sensor @view/@side",
276 hCalPeakTime.GetXaxis()->SetTitle(
"strip calPeakTime (ns)");
279 TH2F h2CalPeakTime_512(
"calPeakTime2D_512_L@layerL@ladderS@sensor@view",
280 "calPeakTime in @layer.@ladder.@sensor @view/@side VS cellID",
281 128 * 4, -0.5, 128 * 4 - 0.5, 255, -0.5, 254.5);
282 h2CalPeakTime_512.GetYaxis()->SetTitle(
"strip calPeakTime (ns)");
283 h2CalPeakTime_512.GetXaxis()->SetTitle(
"cellID");
285 TH2F h2CalPeakTime_768(
"calPeakTime2D_768_L@layerL@ladderS@sensor@view",
286 "calPeakTime in @layer.@ladder.@sensor @view/@side VS cellID",
287 128 * 6, -0.5, 128 * 6 - 0.5, 255, -0.5, 254.5);
288 h2CalPeakTime_768.GetYaxis()->SetTitle(
"strip calPeakTime (ns)");
289 h2CalPeakTime_768.GetXaxis()->SetTitle(
"cellID");
294 TH1F hCalPeakADC(
"calPeakADC_L@layerL@ladderS@sensor@view",
295 "calPeakADC in @layer.@ladder.@sensor @view/@side",
297 hCalPeakADC.GetXaxis()->SetTitle(
"strip calPeakADC (ADC)");
300 TH2F h2CalPeakADC_512(
"calPeakADC2D_512_L@layerL@ladderS@sensor@view",
301 "calPeakADC in @layer.@ladder.@sensor @view/@side VS cellID",
302 128 * 4, -0.5, 128 * 4 - 0.5, 80, 44.5, 124.5);
303 h2CalPeakADC_512.GetYaxis()->SetTitle(
"strip calPeakADC (ADC)");
304 h2CalPeakADC_512.GetXaxis()->SetTitle(
"cellID");
306 TH2F h2CalPeakADC_768(
"calPeakADC2D_768_L@layerL@ladderS@sensor@view",
307 "calPeakADC in @layer.@ladder.@sensor @view/@side VS cellID",
308 128 * 6, -0.5, 128 * 6 - 0.5, 80, 44.5, 124.5);
309 h2CalPeakADC_768.GetYaxis()->SetTitle(
"strip calPeakADC (ADC)");
310 h2CalPeakADC_768.GetXaxis()->SetTitle(
"cellID");
315 TH1F hPulseWidth(
"pulseWidth_L@layerL@ladderS@sensor@view",
316 "pulseWidth in @layer.@ladder.@sensor @view/@side",
318 hPulseWidth.GetXaxis()->SetTitle(
"strip pulseWidth (ns)");
321 TH2F h2PulseWidth_512(
"pulseWidth2D_512_L@layerL@ladderS@sensor@view",
322 "pulseWidth in @layer.@ladder.@sensor @view/@side VS cellID",
323 128 * 4, -0.5, 128 * 4 - 0.5, 255, -0.5, 254.5);
324 h2PulseWidth_512.GetYaxis()->SetTitle(
"strip pulseWidth (ns)");
325 h2PulseWidth_512.GetXaxis()->SetTitle(
"cellID");
327 TH2F h2PulseWidth_768(
"pulseWidth2D_768_L@layerL@ladderS@sensor@view",
328 "pulseWidth in @layer.@ladder.@sensor @view/@side VS cellID",
329 128 * 6, -0.5, 128 * 6 - 0.5, 255, -0.5, 254.5);
330 h2PulseWidth_768.GetYaxis()->SetTitle(
"strip pulseWidth (ns)");
331 h2PulseWidth_768.GetXaxis()->SetTitle(
"cellID");
341 m_exp = meta->getExperiment();
342 m_run = meta->getRun();
351 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
353 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
355 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
356 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
358 while (itSvdLadders != svdLadders.end()) {
360 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
361 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
362 B2DEBUG(1,
" svd sensor info " << * (svdSensors.begin()));
364 while (itSvdSensors != svdSensors.end()) {
365 B2DEBUG(1,
" svd sensor info " << *itSvdSensors);
367 int layer = itSvdSensors->getLayerNumber();
368 int ladder = itSvdSensors->getLadderNumber();
369 int sensor = itSvdSensors->getSensorNumber();
378 int Ncells = currentSensorInfo->
getUCells();
450 B2INFO(
"now computing Mean and RMS of local calibration constants");
454 itSvdLayers = svdLayers.begin();
456 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
458 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
459 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
461 while (itSvdLadders != svdLadders.end()) {
463 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
464 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
465 B2DEBUG(1,
" svd sensor info " << * (svdSensors.begin()));
467 while (itSvdSensors != svdSensors.end()) {
468 B2DEBUG(1,
" svd sensor info " << *itSvdSensors);
470 m_layer = itSvdSensors->getLayerNumber();
471 m_ladder = itSvdSensors->getLadderNumber();
472 m_sensor = itSvdSensors->getSensorNumber();
515 B2RESULT(
"******************************************");
516 B2RESULT(
"** UNIQUE IDs of calibration DB objects **");
533 B2WARNING(
"No valid SVDFADCMaskedStrips for the requested IoV");
538 B2WARNING(
"No valid SVDNoiseCalibrations for the requested IoV");
543 B2WARNING(
"No valid SVDPedestalCalibrations for the requested IoV");
548 B2WARNING(
"No valid SVDPulseShapeCalibrations for the requested IoV");
577 for (
auto ladder : geoCache.getLadders(layer))
655 B2RESULT(
"The rootfile containing the list of histograms has been filled and closed [Local].");