43 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"[DTDigiTask]: Constructor" << endl;
101 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"DTDigiTask: analyzed " <<
nevents <<
" events" << endl;
105 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"[DTDigiTask]: begin run" << endl;
132 for (
int wh = -2; wh <= 2; ++wh) {
137 bookHistos(ibooker, wh,
string(
"Occupancies"),
"OccupancyAllHits");
140 bookHistos(ibooker, wh,
string(
"Occupancies"),
"OccupancyNoise");
142 bookHistos(ibooker, wh,
string(
"Occupancies"),
"OccupancyInTimeHits");
145 bookHistos(ibooker, wh,
string(
"SynchNoise"),
"SyncNoiseEvents");
146 bookHistos(ibooker, wh,
string(
"SynchNoise"),
"SyncNoiseChambs");
149 for (
int st = 1; st <= 4; ++st) {
150 for (
int sect = 1; sect <= 14; ++sect) {
151 if ((sect == 13 || sect == 14) && st != 4)
162 bookHistos(ibooker, dtChId,
string(
"Occupancies"),
"OccupancyAllHits_perCh");
167 bookHistos(ibooker, dtChId,
string(
"Occupancies"),
"OccupancyNoise_perCh");
169 bookHistos(ibooker, dtChId,
string(
"Occupancies"),
"OccupancyInTimeHits_perCh");
171 for (
int sl = 1; sl <= 3; ++sl) {
172 if (st == 4 && sl == 2)
176 bookHistos(ibooker, dtSLId,
string(
"TimeBoxes"),
"TimeBox");
179 bookHistos(ibooker, dtSLId,
string(
"TimeBoxes"),
"TimeBoxDTonly");
180 bookHistos(ibooker, dtSLId,
string(
"TimeBoxes"),
"TimeBoxNoDT");
181 bookHistos(ibooker, dtSLId,
string(
"TimeBoxes"),
"TimeBoxDTalso");
191 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"[DTDigiTask]: Begin of LS transition" << endl;
197 <<
"[DTDigiTask]: Reset at the LS transition : " << lumiBlock << endl;
199 map<string, map<uint32_t, MonitorElement*> >::const_iterator histosIt =
digiHistos.begin();
200 map<string, map<uint32_t, MonitorElement*> >::const_iterator histosEnd =
digiHistos.end();
201 for (; histosIt != histosEnd; ++histosIt) {
202 map<uint32_t, MonitorElement*>::const_iterator histoIt = (*histosIt).second.begin();
203 map<uint32_t, MonitorElement*>::const_iterator histoEnd = (*histosIt).second.end();
204 for (; histoIt != histoEnd; ++histoIt) {
205 (*histoIt).second->Reset();
210 for (
int wh = -2; wh <= 2; wh++) {
211 for (
int sect = 1; sect <= 14; sect++) {
212 for (
int st = 1; st <= 4; st++) {
216 if ((sect == 13 || sect == 14) && st != 4) {
226 map<string, map<int, MonitorElement*> >::const_iterator whHistosIt =
wheelHistos.begin();
227 map<string, map<int, MonitorElement*> >::const_iterator whHistosEnd =
wheelHistos.end();
228 for (; whHistosIt != whHistosEnd; ++whHistosIt) {
229 if ((*whHistosIt).first.find(
"Sync") == string::npos) {
230 map<int, MonitorElement*>::const_iterator histoIt = (*whHistosIt).second.begin();
231 map<int, MonitorElement*>::const_iterator histoEnd = (*whHistosIt).second.end();
232 for (; histoIt != histoEnd; ++histoIt) {
233 (*histoIt).second->Reset();
248 stringstream superLayer;
254 histoTag +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str();
256 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
257 <<
"[DTDigiTask]: booking SL histo:" <<
histoName <<
" (tag: " <<
histoTag <<
") folder: "
267 if (
folder ==
"TimeBoxes") {
268 string histoTitle =
histoName +
" (TDC Counts)";
276 stringstream layerHistoName;
279 layerHistoName.str(),
292 stringstream layerHistoName;
301 if (
folder ==
"CathodPhotoPeaks") {
321 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
322 <<
"[DTDigiTask]: booking chamber histo:"
324 <<
") folder: " <<
topFolder() +
"Wheel" +
wheel.str() +
"/Station" +
station.str() +
"/Sector" + sector.str()
327 if (
folder ==
"Occupancies") {
329 const std::vector<const DTSuperLayer*>& dtSupLylist = dtchamber->
superLayers();
330 std::vector<const DTSuperLayer*>::const_iterator suly = dtSupLylist.begin();
331 std::vector<const DTSuperLayer*>::const_iterator sulyend = dtSupLylist.end();
337 while (suly != sulyend) {
338 const std::vector<const DTLayer*> dtLyList = (*suly)->layers();
339 std::vector<const DTLayer*>::const_iterator ly = dtLyList.begin();
340 std::vector<const DTLayer*>::const_iterator lyend = dtLyList.end();
341 stringstream superLayer;
342 superLayer << (*suly)->id().superlayer();
344 while (ly != lyend) {
345 nWires =
muonGeom->
layer((*ly)->id())->specificTopology().channels();
346 firstWire =
muonGeom->
layer((*ly)->id())->specificTopology().firstChannel();
348 layer << (*ly)->id().layer();
349 string histoName_layer =
histoName +
"_SL" + superLayer.str() +
"_L" +
layer.str();
350 if (
histoTag ==
"OccupancyAllHits_perL" ||
histoTag ==
"OccupancyNoise_perL" ||
351 histoTag ==
"OccupancyInTimeHits_perL")
353 ibooker.
book1D(histoName_layer, histoName_layer, nWires, firstWire, nWires + firstWire);
355 if ((nWires + firstWire) > nWires_max)
356 nWires_max = (nWires + firstWire);
361 if (
histoTag !=
"OccupancyAllHits_perL" &&
histoTag !=
"OccupancyNoise_perL" &&
362 histoTag !=
"OccupancyInTimeHits_perL") {
369 title <<
"Occ. digis in time [" << inTimeHitsLowerBoundCorr <<
", " << inTimeHitsUpperBoundCorr
371 histoTitle =
title.str();
374 ibooker.
book2D(
histoName, histoTitle, nWires_max, 1, nWires_max + 1, 12, 0, 12);
376 for (
int i = 1;
i <= 12;
i++) {
382 string label =
"SL1: L" + layer_name;
384 }
else if (
i > 4 &&
i < 9) {
389 string label =
"SL2: L" + layer_name;
391 }
else if (
i > 8 &&
i < 13) {
396 string label =
"SL3: L" + layer_name;
412 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
414 <<
") folder: " <<
topFolder() +
"Wheel" +
wheel.str() +
"/" << endl;
416 if (
folder ==
"Occupancies") {
418 string histoTitle =
"# of digis per chamber WHEEL: " +
wheel.str();
425 }
else if (
folder ==
"SynchNoise") {
427 if (
histoTag ==
"SyncNoiseEvents") {
428 string histoTitle =
"# of Syncronous-noise events WHEEL: " +
wheel.str();
435 }
else if (
histoTag ==
"SyncNoiseChambs") {
436 string histoTitle =
"# of Synchornous-noise chamb per evt. WHEEL: " +
wheel.str();
448 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
449 <<
"[DTDigiTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event() << endl;
471 if (dtdigis->begin() == dtdigis->end()) {
472 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"Event " <<
nevents <<
" empty." << endl;
478 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); dtLayerId_It++) {
479 DTChamberId chId = ((*dtLayerId_It).first).chamberId();
483 hitMap[chId] += (((*dtLayerId_It).second).
second - ((*dtLayerId_It).second).first);
487 map<DTChamberId, int>::const_iterator hitMapIt =
hitMap.begin();
488 map<DTChamberId, int>::const_iterator hitMapEnd =
hitMap.end();
492 for (; hitMapIt != hitMapEnd; ++hitMapIt) {
495 int wh = chId.
wheel();
497 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
498 <<
"[DTDigiTask] Synch noise in chamber: " << chId <<
" with # digis: " << hitMapIt->second << endl;
500 if (chMap.find(wh) == chMap.end()) {
512 map<int, int>::const_iterator chMapIt = chMap.begin();
513 map<int, int>::const_iterator chMapEnd = chMap.end();
514 for (; chMapIt != chMapEnd; ++chMapIt) {
515 wheelHistos[
"SyncNoiseChambs"][(*chMapIt).first]->Fill((*chMapIt).second);
522 LogVerbatim(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"[DTDigiTask] Synch Noise in event: " <<
nevents;
525 <<
"\tnoisy time-boxes and occupancy will not be filled!" << endl;
532 time_t eventTime = time_t(
event.time().value() >> 32);
534 LogVerbatim(
"DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
535 <<
"[DTDigiTask] At least 4 Synch Noisy chambers in Run : " <<
event.id().run()
536 <<
" Lumi : " <<
event.id().luminosityBlock() <<
" Event : " <<
event.id().event()
537 <<
" at time : " << ctime(&eventTime) << endl;
542 stringstream synchNoisyCh;
543 for (; chIt != chEnd; ++chIt) {
544 synchNoisyCh <<
" " << (*chIt);
546 LogVerbatim(
"DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
547 <<
"[DTDigiTask] Chamber List :" << synchNoisyCh.str() << endl;
553 << (
syncNum * 0.1) <<
"% sync noise events in the last 1000 events " << endl;
558 bool isSyncNoisy =
false;
561 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
565 DTChamberId chId = ((*dtLayerId_It).first).chamberId();
572 digiIt != ((*dtLayerId_It).second).
second;
575 bool isNoisy =
false;
576 bool isFEMasked =
false;
577 bool isTDCMasked =
false;
578 bool isTrigMask =
false;
582 const DTWireId wireId(((*dtLayerId_It).first), (*digiIt).wire());
583 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
587 const DTSuperLayerId dtSLId = ((*dtLayerId_It).first).superlayerId();
588 uint32_t indexSL = dtSLId.
rawId();
590 uint32_t indexCh = dtChId.
rawId();
591 int layer_number = ((*dtLayerId_It).first).
layer();
606 int tdcTime = (*digiIt).countsTDC();
609 const DTWireId dtWireId(((*dtLayerId_It).first), (*digiIt).wire());
612 tdcTime +=
int(round(
t0));
622 if ((!isNoisy) && (!isSyncNoisy)) {
636 histoTag =
"OccupancyAllHits_perCh";
637 map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
digiHistos[
histoTag].find(indexCh);
646 mappedHisto->second->Fill((*digiIt).wire(), (layer_number + (superlayer_number - 1) * 4) - 1);
652 histoPerWheel->second->Fill(dtChId.
sector(), dtChId.
station());
656 if (tdcTime < inTimeHitsLowerBoundCorr) {
662 map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
digiHistos[
histoTag].find(indexCh);
664 mappedHisto->second->Fill((*digiIt).wire(), (layer_number + (superlayer_number - 1) * 4) - 1);
671 histoPerWheel->second->Fill(dtChId.
sector(), dtChId.
station());
676 if (tdcTime > inTimeHitsLowerBoundCorr && tdcTime < inTimeHitsUpperBoundCorr) {
680 histoTag =
"OccupancyInTimeHits_perCh";
681 map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
digiHistos[
histoTag].find(indexCh);
683 mappedHisto->second->Fill((*digiIt).wire(), (layer_number + (superlayer_number - 1) * 4) - 1);
689 histoPerWheel->second->Fill(dtChId.
sector(), dtChId.
station());
704 for (std::vector<LTCDigi>::const_iterator ltc_it =
ltcdigis->begin(); ltc_it !=
ltcdigis->end(); ltc_it++) {
705 size_t otherTriggerSum = 0;
706 for (
size_t i = 1;
i < 6;
i++)
707 otherTriggerSum +=
size_t((*ltc_it).HasTriggered(
i));
709 if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
710 l1ASource =
"DTonly";
711 else if (!(*ltc_it).HasTriggered(0))
713 else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
714 l1ASource =
"DTalso";
722 return string(
"DT/10-TestPulses/");
724 return string(
"DT/01-SliceTestDigi/");
725 return string(
"DT/01-Digi/");
733 for (
int sl = 1; sl <= 3; sl++) {
734 for (
int ly = 1; ly <= 4; ly++) {
735 for (
int ch = 1; ch <= nWires_max; ch++) {
736 int dduId = -1, rosId = -1, robId = -1, tdcId = -1, channelId = -1;
738 dtCh.
wheel(), dtCh.
station(), dtCh.
sector(), sl, ly, ch, dduId, rosId, robId, tdcId, channelId);
742 int lybin = (4 * sl - 4) + ly;