67 LogInfo(
"PixelDQM") <<
"SiPixelRawDataErrorSource::SiPixelRawDataErrorSource:"
68 " Got DQM BackEnd interface"
77 LogInfo(
"PixelDQM") <<
"SiPixelRawDataErrorSource::~SiPixelRawDataErrorSource: Destructor" << endl;
81 LogInfo(
"PixelDQM") <<
" SiPixelRawDataErrorSource::beginRun - Initialisation ... " << std::endl;
111 if (!rawDataHandle.
isValid()) {
112 edm::LogInfo(
"SiPixelRawDataErrorSource") <<
"inputsource is empty";
115 for (
int i = 0;
i != 40;
i++) {
124 if (!
input.isValid())
127 int lumiSection = (
int)
iEvent.luminosityBlock();
129 int nEventBPIXModuleErrors = 0;
130 int nEventFPIXModuleErrors = 0;
131 int nEventBPIXFEDErrors = 0;
132 int nEventFPIXFEDErrors = 0;
135 std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter;
136 std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter2;
140 nEventBPIXModuleErrors = nEventBPIXModuleErrors + numberOfModuleErrors;
142 nEventFPIXModuleErrors = nEventFPIXModuleErrors + numberOfModuleErrors;
145 nErrors = nErrors + numberOfModuleErrors;
149 int numberOfFEDErrors = (*struct_iter2).second->fillFED(*
input, &
meMapFEDs_);
150 if ((*struct_iter2).first <= 31)
151 nEventBPIXFEDErrors = nEventBPIXFEDErrors + numberOfFEDErrors;
153 if ((*struct_iter2).first >= 32 && (*struct_iter2).first <= 39)
154 nEventFPIXFEDErrors = nEventFPIXFEDErrors + numberOfFEDErrors;
157 nErrors = nErrors + numberOfFEDErrors;
164 if (nEventBPIXModuleErrors + nEventBPIXFEDErrors > 0)
166 if (nEventFPIXModuleErrors + nEventFPIXFEDErrors > 0)
186 LogInfo(
"PixelDQM") <<
" SiPixelRawDataErrorSource::buildStructure";
196 LogVerbatim(
"PixelDQM") <<
" *** Geometry node for TrackerGeom is " << &(*pDD) << std::endl;
197 LogVerbatim(
"PixelDQM") <<
" *** I have " << pDD->
detsPXB().size() <<
" barrel pixel detectors" << std::endl;
198 LogVerbatim(
"PixelDQM") <<
" *** I have " << pDD->
detsPXF().size() <<
" endcap pixel detectors" << std::endl;
202 for (TrackerGeometry::DetContainer::const_iterator it = pDD->
detsPXB().begin(); it != pDD->
detsPXB().end(); it++) {
203 const GeomDetUnit *geoUnit = dynamic_cast<const GeomDetUnit *>(*it);
205 if (geoUnit ==
nullptr)
206 LogError(
"PixelDQM") <<
"Pixel GeomDet is not a GeomDetUnit!" << std::endl;
207 const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(geoUnit);
213 DetId detId = (*it)->geographicalId();
214 LogDebug(
"PixelDQM") <<
" ---> Adding Barrel Module " << detId.
rawId() << endl;
215 uint32_t
id = detId();
217 thePixelStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(
id, theModule));
220 for (TrackerGeometry::DetContainer::const_iterator it = pDD->
detsPXF().begin(); it != pDD->
detsPXF().end(); it++) {
221 const GeomDetUnit *geoUnit = dynamic_cast<const GeomDetUnit *>(*it);
223 if (geoUnit ==
nullptr)
224 LogError(
"PixelDQM") <<
"Pixel GeomDet is not a GeomDetUnit!" << std::endl;
225 const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(geoUnit);
229 DetId detId = (*it)->geographicalId();
230 LogDebug(
"PixelDQM") <<
" ---> Adding Endcap Module " << detId.
rawId() << endl;
231 uint32_t
id = detId();
241 sprintf(sside,
"HalfCylinder_%i", side);
243 sprintf(sdisk,
"Disk_%i", disk);
245 sprintf(sblade,
"Blade_%02i", blade);
247 sprintf(spanel,
"Panel_%i", panel);
249 sprintf(smodule,
"Module_%i",
module);
252 bool mask = side_str.find(
"HalfCylinder_1") != string::npos || side_str.find(
"HalfCylinder_2") != string::npos ||
253 side_str.find(
"HalfCylinder_4") != string::npos || disk_str.find(
"Disk_2") != string::npos;
259 thePixelStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(
id, theModule));
262 LogDebug(
"PixelDQM") <<
" ---> Adding Module for Additional Errors " << endl;
270 uint32_t
id = static_cast<uint32_t>(
fedId);
272 theFEDStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(
id, theModule));
281 iBooker.setCurrentFolder(
topFolderName_ +
"/EventInfo/DAQContents");
283 sprintf(title0,
"FED isPresent;FED ID;isPresent");
284 fedcounter = iBooker.book1D(
"fedcounter", title0, 40, -0.5, 39.5);
285 iBooker.setCurrentFolder(
topFolderName_ +
"/AdditionalPixelErrors");
287 sprintf(
title,
"By-LumiSection Error counters");
293 sprintf(title1,
"Errors per LumiSection;LumiSection;NErrors");
294 errorRate = iBooker.book1D(
"errorRate", title1, 5000, 0., 5000.);
296 std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter;
297 std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter2;
309 throw cms::Exception(
"LogicError") <<
"[SiPixelRawDataErrorSource::bookMEs] Creation of DQM folder "
316 LogDebug(
"PixelDQM") <<
"PROBLEM WITH LADDER-FOLDER\n";
322 LogDebug(
"PixelDQM") <<
"PROBLEM WITH BLADE-FOLDER\n";
330 if (!theSiPixelFolder.
setFedFolder(iBooker, (*struct_iter2).first)) {
331 throw cms::Exception(
"LogicError") <<
"[SiPixelRawDataErrorSource::bookMEs] Creation of DQM folder "
342 for (uint32_t
id = 0;
id < 40;
id++) {
347 hid = theHistogramId->setHistoId(
"errorType",
id);
348 meErrorType_[
id] = iBooker.book1D(hid,
"Type of errors", 15, 24.5, 39.5);
351 hid = theHistogramId->setHistoId(
"NErrors",
id);
352 meNErrors_[
id] = iBooker.book1D(hid,
"Number of errors", 36, 0., 36.);
357 hid = theHistogramId->setHistoId(
"fullType",
id);
358 meFullType_[
id] = iBooker.book1D(hid,
"Type of FIFO full", 7, 0.5, 7.5);
364 hid = theHistogramId->setHistoId(
"TBMMessage",
id);
365 meTBMMessage_[
id] = iBooker.book1D(hid,
"TBM trailer message", 8, -0.5, 7.5);
370 hid = theHistogramId->setHistoId(
"TBMType",
id);
371 meTBMType_[
id] = iBooker.book1D(hid,
"Type of TBM trailer", 5, -0.5, 4.5);
374 hid = theHistogramId->setHistoId(
"EvtNbr",
id);
375 meEvtNbr_[
id] = iBooker.book1D(hid,
"Event number", 1, 0, 1);
377 hid = theHistogramId->setHistoId(
"evtSize",
id);
378 meEvtSize_[
id] = iBooker.book1D(hid,
"Event size", 1, 0, 1);
380 hid = theHistogramId->setHistoId(
"FedChNErr",
id);
381 meFedChNErr_[
id] = iBooker.book1D(hid,
"Number of errors per FED channel", 37, 0, 37);
384 hid = theHistogramId->setHistoId(
"FedChLErr",
id);
385 meFedChLErr_[
id] = iBooker.book1D(hid,
"Last error per FED channel", 37, 0, 37);
388 hid = theHistogramId->setHistoId(
"FedETypeNErr",
id);
389 meFedETypeNErr_[
id] = iBooker.book1D(hid,
"Number of errors per type", 21, 0, 21);