Analyze.
437 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
438 <<
"[DTDigiTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event() << endl;
461 if (dtdigis->begin() == dtdigis->end()) {
462 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"Event " <<
nevents <<
" empty." << endl;
468 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); dtLayerId_It++) {
469 DTChamberId chId = ((*dtLayerId_It).first).chamberId();
473 hitMap[chId] += (((*dtLayerId_It).second).
second - ((*dtLayerId_It).second).first);
477 map<DTChamberId, int>::const_iterator hitMapIt =
hitMap.begin();
478 map<DTChamberId, int>::const_iterator hitMapEnd =
hitMap.end();
482 for (; hitMapIt != hitMapEnd; ++hitMapIt) {
485 int wh = chId.
wheel();
487 LogTrace(
"DTDQM|DTMonitorModule|DTDigiTask")
488 <<
"[DTDigiTask] Synch noise in chamber: " << chId <<
" with # digis: " << hitMapIt->second << endl;
490 if (chMap.find(wh) == chMap.end()) {
502 map<int, int>::const_iterator chMapIt = chMap.begin();
503 map<int, int>::const_iterator chMapEnd = chMap.end();
504 for (; chMapIt != chMapEnd; ++chMapIt) {
505 wheelHistos[
"SyncNoiseChambs"][(*chMapIt).first]->Fill((*chMapIt).second);
512 LogVerbatim(
"DTDQM|DTMonitorModule|DTDigiTask") <<
"[DTDigiTask] Synch Noise in event: " <<
nevents;
515 <<
"\tnoisy time-boxes and occupancy will not be filled!" << endl;
522 time_t eventTime = time_t(
event.time().value() >> 32);
524 LogVerbatim(
"DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
525 <<
"[DTDigiTask] At least 4 Synch Noisy chambers in Run : " <<
event.id().run()
526 <<
" Lumi : " <<
event.id().luminosityBlock() <<
" Event : " <<
event.id().event()
527 <<
" at time : " << ctime(&eventTime) << endl;
532 stringstream synchNoisyCh;
533 for (; chIt != chEnd; ++chIt) {
534 synchNoisyCh <<
" " << (*chIt);
536 LogVerbatim(
"DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
537 <<
"[DTDigiTask] Chamber List :" << synchNoisyCh.str() << endl;
543 << (
syncNum * 0.1) <<
"% sync noise events in the last 1000 events " << endl;
548 bool isSyncNoisy =
false;
551 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
555 DTChamberId chId = ((*dtLayerId_It).first).chamberId();
562 digiIt != ((*dtLayerId_It).second).
second;
565 bool isNoisy =
false;
566 bool isFEMasked =
false;
567 bool isTDCMasked =
false;
568 bool isTrigMask =
false;
572 const DTWireId wireId(((*dtLayerId_It).first), (*digiIt).wire());
573 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
577 const DTSuperLayerId dtSLId = ((*dtLayerId_It).first).superlayerId();
578 uint32_t indexSL = dtSLId.
rawId();
580 uint32_t indexCh = dtChId.
rawId();
581 int layer_number = ((*dtLayerId_It).first).layer();
596 int tdcTime = (*digiIt).countsTDC();
599 const DTWireId dtWireId(((*dtLayerId_It).first), (*digiIt).wire());
602 tdcTime +=
int(round(t0));
613 if ((!isNoisy) && (!isSyncNoisy)) {
617 (
digiHistos.find(histoTag)->second).
find(indexSL)->second->Fill(tdcTime);
627 histoTag =
"OccupancyAllHits_perCh";
628 map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
digiHistos[
histoTag].find(indexCh);
637 mappedHisto->second->Fill((*digiIt).wire(), (layer_number + (superlayer_number - 1) * 4) - 1);
640 histoTag =
"OccupancyAllHits";
643 histoPerWheel->second->Fill(dtChId.
sector(), dtChId.
station());
647 if (tdcTime < inTimeHitsLowerBoundCorr) {
652 histoTag =
"OccupancyNoise_perCh";
653 map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
digiHistos[
histoTag].find(indexCh);
655 mappedHisto->second->Fill((*digiIt).wire(), (layer_number + (superlayer_number - 1) * 4) - 1);
659 histoTag =
"OccupancyNoise";
662 histoPerWheel->second->Fill(dtChId.
sector(), dtChId.
station());
667 if (tdcTime > inTimeHitsLowerBoundCorr && tdcTime < inTimeHitsUpperBoundCorr) {
671 histoTag =
"OccupancyInTimeHits_perCh";
672 map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
digiHistos[
histoTag].find(indexCh);
674 mappedHisto->second->Fill((*digiIt).wire(), (layer_number + (superlayer_number - 1) * 4) - 1);
677 histoTag =
"OccupancyInTimeHits";
680 histoPerWheel->second->Fill(dtChId.
sector(), dtChId.
station());
DTChamberId chamberId() const
Return the corresponding ChamberId.
constexpr uint32_t rawId() const
get the raw id
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
std::map< DTChamberId, int > hitMap
edm::ESHandle< DTTtrig > tTrigMap
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
edm::ESHandle< DTT0 > t0Map
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
float tTrig
tTrig from the DB
int tMax
no needs to be precise. Value from PSets will always be used
int superlayer() const
Return the superlayer number (deprecated method name)
bool doAllHitsOccupancies
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
std::vector< DigiType >::const_iterator const_iterator
int cellStatus(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
get content
std::set< DTChamberId > syncNoisyChambers
MonitorElement * nEventMonitor
int station() const
Return the station number.
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
int wheel() const
Return the wheel number.
std::string triggerSource()
get the L1A source
edm::Handle< LTCDigiCollection > ltcdigis
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_