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");
91 B2WARNING(
"No valid SVDFADCMaskedStrip for the requested IoV");
93 B2WARNING(
"No valid SVDNoiseCalibration for the requested IoV");
95 B2WARNING(
"No valid SVDPedestalCalibration for the requested IoV");
97 B2WARNING(
"No valid SVDPulseShapeCalibrations for the requested IoV");
105 TH1F hOccupancy(
"occupancy_L@layerL@ladderS@sensor@view",
106 "occupancy in hits/evt in @layer.@ladder.@sensor @view/@side",
108 hOccupancy.GetXaxis()->SetTitle(
"strip occupancy ()");
111 TH2F h2Occupancy_512(
"occupancy2D_512_L@layerL@ladderS@sensor@view",
112 "occupancy in HITS/EVT in @layer.@ladder.@sensor @view/@side VS cellID",
113 128 * 4, -0.5, 128 * 4 - 0.5, 1500, 0.0, 0.006);
114 h2Occupancy_512.GetYaxis()->SetTitle(
"strip occupancy (HITS/EVT)");
115 h2Occupancy_512.GetXaxis()->SetTitle(
"cellID");
117 TH2F h2Occupancy_768(
"occupancy2D_768_L@layerL@ladderS@sensor@view",
118 "occupancy in HITS/EVT in @layer.@ladder.@sensor @view/@side VS cellID",
119 128 * 6, -0.5, 128 * 6 - 0.5, 1500, 0.0, 0.006);
120 h2Occupancy_768.GetYaxis()->SetTitle(
"strip occupancy (HITS/EVT)");
121 h2Occupancy_768.GetXaxis()->SetTitle(
"cellID");
126 TH1F hHotstrips(
"hotstrips_L@layerL@ladderS@sensor@view",
127 "hot strips in @layer.@ladder.@sensor @view/@side",
129 hHotstrips.GetXaxis()->SetTitle(
"isHotStrips");
133 TH1F hHotStrips768(
"HotStrips768_L@layerL@ladderS@sensor@view",
"Hot Strips of @layer.@ladder.@sensor @view/@side side", 768, 0,
135 hHotStrips768.GetXaxis()->SetTitle(
"cellID");
136 TH1F hHotStrips512(
"HotStrips512_L@layerL@ladderS@sensor@view",
"Hot Strips of @layer.@ladder.@sensor @view/@side side", 512, 0,
138 hHotStrips512.GetXaxis()->SetTitle(
"cellID");
141 TH2F h2Hotstrips_512(
"hotstrips2D_512_L@layerL@ladderS@sensor@view",
142 "hot strips in @layer.@ladder.@sensor @view/@side VS cellID",
143 128 * 4, -0.5, 128 * 4 - 0.5, 2, -0.5, 1.5);
144 h2Hotstrips_512.GetYaxis()->SetTitle(
"isHotStrips");
145 h2Hotstrips_512.GetXaxis()->SetTitle(
"cellID");
147 TH2F h2Hotstrips_768(
"hotstrips2D_768_L@layerL@ladderS@sensor@view",
148 "hot strips in @layer.@ladder.@sensor @view/@side VS cellID",
149 128 * 6, -0.5, 128 * 6 - 0.5, 2, -0.5, 1.5);
150 h2Hotstrips_768.GetYaxis()->SetTitle(
"isHotStrips");
151 h2Hotstrips_768.GetXaxis()->SetTitle(
"cellID");
160 TH1F hMask(
"masked_L@layerL@ladderS@sensor@view",
161 "masked strip in @layer.@ladder.@sensor @view/@side",
163 hMask.GetXaxis()->SetTitle(
"isMasked");
166 TH2F h2Mask_512(
"masked2D_512_L@layerL@ladderS@sensor@view",
167 "masked strip in @layer.@ladder.@sensor @view/@side VS cellID",
168 128 * 4, -0.5, 128 * 4 - 0.5, 2, -0.5, 1.5);
169 h2Mask_512.GetYaxis()->SetTitle(
"isMasked");
170 h2Mask_512.GetXaxis()->SetTitle(
"cellID");
172 TH2F h2Mask_768(
"masked2D_768_L@layerL@ladderS@sensor@view",
173 "masked strip in @layer.@ladder.@sensor @view/@side VS cellID",
174 128 * 6, -0.5, 128 * 6 - 0.5, 2, -0.5, 1.5);
175 h2Mask_768.GetYaxis()->SetTitle(
"isMasked");
176 h2Mask_768.GetXaxis()->SetTitle(
"cellID");
181 TH1F hNoise(
"noiseADC_L@layerL@ladderS@sensor@view",
182 "noise in ADC in @layer.@ladder.@sensor @view/@side",
184 hNoise.GetXaxis()->SetTitle(
"strip noise (ADC)");
187 TH2F h2Noise_512(
"noise2D_512_L@layerL@ladderS@sensor@view",
188 "noise in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
189 128 * 4, -0.5, 128 * 4 - 0.5, 80, -0.5, 9.5);
190 h2Noise_512.GetYaxis()->SetTitle(
"strip noise (ADC)");
191 h2Noise_512.GetXaxis()->SetTitle(
"cellID");
193 TH2F h2Noise_768(
"noise2D_768_L@layerL@ladderS@sensor@view",
194 "noise in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
195 128 * 6, -0.5, 128 * 6 - 0.5, 80, -0.5, 9.5);
196 h2Noise_768.GetYaxis()->SetTitle(
"strip noise (ADC)");
197 h2Noise_768.GetXaxis()->SetTitle(
"cellID");
203 TH1F hNoiseEl(
"noiseEl_L@layerL@ladderS@sensor@view",
204 "noise in e- in @layer.@ladder.@sensor @view/@side",
205 600, -199.5, 1499.5);
206 hNoiseEl.GetXaxis()->SetTitle(
"strip noise (e-)");
209 TH2F h2NoiseEl_512(
"noiseEl2D_512_L@layerL@ladderS@sensor@view",
210 "noise in e- in @layer.@ladder.@sensor @view/@side VS cellID",
211 128 * 4, -0.5, 128 * 4 - 0.5, 600, -199.5, 1499.5);
212 h2NoiseEl_512.GetYaxis()->SetTitle(
"strip noise (e-)");
213 h2NoiseEl_512.GetXaxis()->SetTitle(
"cellID");
215 TH2F h2NoiseEl_768(
"noiseEl2D_768_L@layerL@ladderS@sensor@view",
216 "noise in e- in @layer.@ladder.@sensor @view/@side VS cellID",
217 128 * 6, -0.5, 128 * 6 - 0.5, 600, -199.5, 1499.5);
218 h2NoiseEl_768.GetYaxis()->SetTitle(
"strip noise (e-)");
219 h2NoiseEl_768.GetXaxis()->SetTitle(
"cellID");
225 TH1F hPedestal(
"pedestalADC_L@layerL@ladderS@sensor@view",
226 "pedestal in ADC in @layer.@ladder.@sensor @view/@side",
228 hPedestal.GetXaxis()->SetTitle(
"strip pedestal (ADC)");
231 TH2F h2Pedestal_512(
"pedestal2D_512_L@layerL@ladderS@sensor@view",
232 "pedestal in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
233 128 * 4, -0.5, 128 * 4 - 0.5, 200, -199.5, 599.5);
234 h2Pedestal_512.GetYaxis()->SetTitle(
"strip pedestal (ADC)");
235 h2Pedestal_512.GetXaxis()->SetTitle(
"cellID");
237 TH2F h2Pedestal_768(
"pedestal2D_768_L@layerL@ladderS@sensor@view",
238 "pedestal in ADC in @layer.@ladder.@sensor @view/@side VS cellID",
239 128 * 6, -0.5, 128 * 6 - 0.5, 200, -199.5, 599.5);
240 h2Pedestal_768.GetYaxis()->SetTitle(
"strip pedestal (ADC)");
241 h2Pedestal_768.GetXaxis()->SetTitle(
"cellID");
246 TH1F hGain(
"gainADC_L@layerL@ladderS@sensor@view",
247 "1/gain in @layer.@ladder.@sensor @view/@side",
249 hGain.GetXaxis()->SetTitle(
"strip 1/gain (e-/ADC)");
252 TH2F h2Gain_512(
"gain2D_512_L@layerL@ladderS@sensor@view",
253 "1/gain in @layer.@ladder.@sensor @view/@side VS cellID",
254 128 * 4, -0.5, 128 * 4 - 0.5, 300, -0.5, 499.5);
255 h2Gain_512.GetYaxis()->SetTitle(
"strip 1/gain (e-/ADC)");
256 h2Gain_512.GetXaxis()->SetTitle(
"cellID");
258 TH2F h2Gain_768(
"gain2D_768_L@layerL@ladderS@sensor@view",
259 "1/gain in @layer.@ladder.@sensor @view/@side VS cellID",
260 128 * 6, -0.5, 128 * 6 - 0.5, 300, -0.5, 499.5);
261 h2Gain_768.GetYaxis()->SetTitle(
"strip 1/gain (e-/ADC)");
262 h2Gain_768.GetXaxis()->SetTitle(
"cellID");
267 TH1F hCalPeakTime(
"calPeakTime_L@layerL@ladderS@sensor@view",
268 "calPeakTime in @layer.@ladder.@sensor @view/@side",
270 hCalPeakTime.GetXaxis()->SetTitle(
"strip calPeakTime (ns)");
273 TH2F h2CalPeakTime_512(
"calPeakTime2D_512_L@layerL@ladderS@sensor@view",
274 "calPeakTime in @layer.@ladder.@sensor @view/@side VS cellID",
275 128 * 4, -0.5, 128 * 4 - 0.5, 255, -0.5, 254.5);
276 h2CalPeakTime_512.GetYaxis()->SetTitle(
"strip calPeakTime (ns)");
277 h2CalPeakTime_512.GetXaxis()->SetTitle(
"cellID");
279 TH2F h2CalPeakTime_768(
"calPeakTime2D_768_L@layerL@ladderS@sensor@view",
280 "calPeakTime in @layer.@ladder.@sensor @view/@side VS cellID",
281 128 * 6, -0.5, 128 * 6 - 0.5, 255, -0.5, 254.5);
282 h2CalPeakTime_768.GetYaxis()->SetTitle(
"strip calPeakTime (ns)");
283 h2CalPeakTime_768.GetXaxis()->SetTitle(
"cellID");
288 TH1F hCalPeakADC(
"calPeakADC_L@layerL@ladderS@sensor@view",
289 "calPeakADC in @layer.@ladder.@sensor @view/@side",
291 hCalPeakADC.GetXaxis()->SetTitle(
"strip calPeakADC (ADC)");
294 TH2F h2CalPeakADC_512(
"calPeakADC2D_512_L@layerL@ladderS@sensor@view",
295 "calPeakADC in @layer.@ladder.@sensor @view/@side VS cellID",
296 128 * 4, -0.5, 128 * 4 - 0.5, 80, 44.5, 124.5);
297 h2CalPeakADC_512.GetYaxis()->SetTitle(
"strip calPeakADC (ADC)");
298 h2CalPeakADC_512.GetXaxis()->SetTitle(
"cellID");
300 TH2F h2CalPeakADC_768(
"calPeakADC2D_768_L@layerL@ladderS@sensor@view",
301 "calPeakADC in @layer.@ladder.@sensor @view/@side VS cellID",
302 128 * 6, -0.5, 128 * 6 - 0.5, 80, 44.5, 124.5);
303 h2CalPeakADC_768.GetYaxis()->SetTitle(
"strip calPeakADC (ADC)");
304 h2CalPeakADC_768.GetXaxis()->SetTitle(
"cellID");
309 TH1F hPulseWidth(
"pulseWidth_L@layerL@ladderS@sensor@view",
310 "pulseWidth in @layer.@ladder.@sensor @view/@side",
312 hPulseWidth.GetXaxis()->SetTitle(
"strip pulseWidth (ns)");
315 TH2F h2PulseWidth_512(
"pulseWidth2D_512_L@layerL@ladderS@sensor@view",
316 "pulseWidth in @layer.@ladder.@sensor @view/@side VS cellID",
317 128 * 4, -0.5, 128 * 4 - 0.5, 255, -0.5, 254.5);
318 h2PulseWidth_512.GetYaxis()->SetTitle(
"strip pulseWidth (ns)");
319 h2PulseWidth_512.GetXaxis()->SetTitle(
"cellID");
321 TH2F h2PulseWidth_768(
"pulseWidth2D_768_L@layerL@ladderS@sensor@view",
322 "pulseWidth in @layer.@ladder.@sensor @view/@side VS cellID",
323 128 * 6, -0.5, 128 * 6 - 0.5, 255, -0.5, 254.5);
324 h2PulseWidth_768.GetYaxis()->SetTitle(
"strip pulseWidth (ns)");
325 h2PulseWidth_768.GetXaxis()->SetTitle(
"cellID");
335 m_exp = meta->getExperiment();
336 m_run = meta->getRun();
343 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
345 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
347 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
348 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
350 while (itSvdLadders != svdLadders.end()) {
352 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
353 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
354 B2DEBUG(1,
" svd sensor info " << * (svdSensors.begin()));
356 while (itSvdSensors != svdSensors.end()) {
357 B2DEBUG(1,
" svd sensor info " << *itSvdSensors);
359 int layer = itSvdSensors->getLayerNumber();
360 int ladder = itSvdSensors->getLadderNumber();
361 int sensor = itSvdSensors->getSensorNumber();
370 int Ncells = currentSensorInfo->
getUCells();
442 B2INFO(
"now computing Mean and RMS of local calibration constants");
446 itSvdLayers = svdLayers.begin();
448 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
450 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
451 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
453 while (itSvdLadders != svdLadders.end()) {
455 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
456 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
457 B2DEBUG(1,
" svd sensor info " << * (svdSensors.begin()));
459 while (itSvdSensors != svdSensors.end()) {
460 B2DEBUG(1,
" svd sensor info " << *itSvdSensors);
462 m_layer = itSvdSensors->getLayerNumber();
463 m_ladder = itSvdSensors->getLadderNumber();
464 m_sensor = itSvdSensors->getSensorNumber();
505 B2RESULT(
"******************************************");
506 B2RESULT(
"** UNIQUE IDs of calibration DB objects **");
523 B2WARNING(
"No valid SVDFADCMaskedStrips for the requested IoV");
528 B2WARNING(
"No valid SVDNoiseCalibrations for the requested IoV");
533 B2WARNING(
"No valid SVDPedestalCalibrations for the requested IoV");
538 B2WARNING(
"No valid SVDPulseShapeCalibrations for the requested IoV");
567 for (
auto ladder : geoCache.getLadders(layer))
645 B2RESULT(
"The rootfile containing the list of histograms has been filled and closed [Local].");