CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTDigiTask Class Reference

#include <DTDigiTask.h>

Inheritance diagram for DTDigiTask:
one::DQMEDAnalyzer< edm::one::WatchLuminosityBlocks > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 DTDigiTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTDigiTask () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< edm::one::WatchLuminosityBlocks >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) override
 To reset the MEs. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookHistos (DQMStore::IBooker &ibooker, const DTSuperLayerId &dtSL, std::string folder, std::string histoTag)
 Book the ME. More...
 
void bookHistos (DQMStore::IBooker &ibooker, const DTChamberId &dtCh, std::string folder, std::string histoTag)
 
void bookHistos (DQMStore::IBooker &ibooker, const int wheelId, std::string folder, std::string histoTag)
 
void channelsMap (const DTChamberId &dtCh, std::string histoTag)
 To map real channels. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) final
 
std::string triggerSource ()
 get the L1A source More...
 

Private Member Functions

std::string topFolder () const
 

Private Attributes

bool checkNoisyChannels
 
int defaultTmax
 
int defaultTTrig
 
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
 
bool doAllHitsOccupancies
 
bool doInTimeOccupancies
 
bool doLayerTimeBoxes
 
bool doNoiseOccupancies
 
bool doStaticBooking
 
edm::EDGetTokenT< DTDigiCollectiondtDigiToken_
 
bool filterSyncNoise
 
std::map< DTChamberId, int > hitMap
 
int inTimeHitsLowerBound
 
int inTimeHitsUpperBound
 
bool isLocalRun
 
float kFactor
 
bool lookForSyncNoise
 
edm::EDGetTokenT< LTCDigiCollectionltcDigiCollectionToken_
 
edm::Handle< LTCDigiCollectionltcdigis
 
edm::ESHandle< DTReadOutMappingmapping
 
int maxTDCHits
 
int maxTTMounts
 
edm::ESHandle< DTGeometrymuonGeom
 
MonitorElementnEventMonitor
 
int nevents
 
std::map< DTChamberId, int > nSynchNoiseEvents
 
bool readTTrigDB
 
int resetCycle
 
bool sliceTestMode
 
bool subtractT0
 
std::set< DTChamberIdsyncNoisyChambers
 
int syncNum
 
int syncNumTot
 
edm::ESHandle< DTT0t0Map
 
int tdcPedestal
 
int timeBoxGranularity
 
int tMax
 no needs to be precise. Value from PSets will always be used More...
 
bool tpMode
 
float tTrig
 tTrig from the DB More...
 
edm::ESHandle< DTTtrigtTrigMap
 
float tTrigRMS
 
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
 

Detailed Description

Definition at line 52 of file DTDigiTask.h.

Constructor & Destructor Documentation

DTDigiTask::DTDigiTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 46 of file DTDigiTask.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and LogTrace.

46  {
47  // switch for the verbosity
48  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask]: Constructor" << endl;
49 
50  // The label to retrieve the digis
51  dtDigiToken_ = consumes<DTDigiCollection>(
52  ps.getParameter<InputTag>("dtDigiLabel"));
53  // Read the configuration parameters
54  maxTDCHits = ps.getUntrackedParameter<int>("maxTDCHitsPerChamber",30000);
55  // Set to true to read the ttrig from DB (useful to determine in-time and out-of-time hits)
56  readTTrigDB = ps.getUntrackedParameter<bool>("readDB", false);
57  // Set to true to subtract t0 from test pulses
58  subtractT0 = ps.getParameter<bool>("performPerWireT0Calibration");
59  // Tmax value (TDC counts)
60  defaultTmax = ps.getParameter<int>("defaultTmax");
61  // Switch from static to dinamic histo booking
62  doStaticBooking = ps.getUntrackedParameter<bool>("staticBooking", true);
63 
64  // Switch for local/global runs
65  isLocalRun = ps.getUntrackedParameter<bool>("localrun", true);
66  if (!isLocalRun) {
67  ltcDigiCollectionToken_ = consumes<LTCDigiCollection>(
68  ps.getParameter<edm::InputTag>("ltcDigiCollectionTag"));
69  }
70 
71  // Setting for the reset of the ME after n (= ResetCycle) luminosity sections
72  resetCycle = ps.getUntrackedParameter<int>("ResetCycle", 3);
73  // Check the DB of noisy channels
74  checkNoisyChannels = ps.getUntrackedParameter<bool>("checkNoisyChannels",false);
75  // Default TTrig to be used when not reading the TTrig DB
76  defaultTTrig = ps.getParameter<int>("defaultTtrig");
77  inTimeHitsLowerBound = ps.getParameter<int>("inTimeHitsLowerBound");
78  inTimeHitsUpperBound = ps.getParameter<int>("inTimeHitsUpperBound");
79  timeBoxGranularity = ps.getUntrackedParameter<int>("timeBoxGranularity",4);
80  maxTTMounts = ps.getUntrackedParameter<int>("maxTTMounts", 6400);
81 
82  doAllHitsOccupancies = ps.getUntrackedParameter<bool>("doAllHitsOccupancies", true);
83  doNoiseOccupancies = ps.getUntrackedParameter<bool>("doNoiseOccupancies", false);
84  doInTimeOccupancies = ps.getUntrackedParameter<bool>("doInTimeOccupancies", false);
85 
86  // switch on the mode for running on test pulses (different top folder)
87  tpMode = ps.getUntrackedParameter<bool>("testPulseMode", false);
88  // switch on/off the filtering of synchronous noise events (cutting on the # of digis)
89  // time-boxes and occupancy plots are not filled and summary plots are created to report the problem
90  filterSyncNoise = ps.getUntrackedParameter<bool>("filterSyncNoise", false);
91  // look for synch noisy events, produce histograms but do not filter them
92  lookForSyncNoise = ps.getUntrackedParameter<bool>("lookForSyncNoise", false);
93 
94  // switch on the mode for running on slice test (different top folder and other customizations)
95  sliceTestMode = ps.getUntrackedParameter<bool>("sliceTestMode", false);
96  // time pedestal to be subtracted if sliceTestMode is true
97  tdcPedestal = ps.getUntrackedParameter<int>("tdcPedestal", 105100);
98 
99  // switch on production of time-boxes with layer granularity
100  doLayerTimeBoxes = ps.getUntrackedParameter<bool>("doLayerTimeBoxes", false);
101 
102  syncNumTot = 0;
103  syncNum = 0;
104 
105 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int defaultTmax
Definition: DTDigiTask.h:134
bool doStaticBooking
Definition: DTDigiTask.h:137
bool tpMode
Definition: DTDigiTask.h:155
bool doLayerTimeBoxes
Definition: DTDigiTask.h:162
bool filterSyncNoise
Definition: DTDigiTask.h:157
int maxTTMounts
Definition: DTDigiTask.h:150
bool readTTrigDB
Definition: DTDigiTask.h:130
bool lookForSyncNoise
Definition: DTDigiTask.h:156
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTDigiTask.h:125
bool checkNoisyChannels
Definition: DTDigiTask.h:143
bool isLocalRun
Definition: DTDigiTask.h:139
bool doInTimeOccupancies
Definition: DTDigiTask.h:153
bool doNoiseOccupancies
Definition: DTDigiTask.h:152
int resetCycle
Definition: DTDigiTask.h:141
int inTimeHitsUpperBound
Definition: DTDigiTask.h:148
#define LogTrace(id)
int defaultTTrig
Definition: DTDigiTask.h:145
int tdcPedestal
Definition: DTDigiTask.h:160
bool doAllHitsOccupancies
Definition: DTDigiTask.h:151
int maxTDCHits
Definition: DTDigiTask.h:97
bool subtractT0
Definition: DTDigiTask.h:132
int timeBoxGranularity
Definition: DTDigiTask.h:149
int syncNumTot
Definition: DTDigiTask.h:108
int inTimeHitsLowerBound
Definition: DTDigiTask.h:147
bool sliceTestMode
Definition: DTDigiTask.h:159
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_
Definition: DTDigiTask.h:127
DTDigiTask::~DTDigiTask ( )
override

Destructor.

Definition at line 110 of file DTDigiTask.cc.

References LogTrace.

110  {
111  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "DTDigiTask: analyzed " << nevents << " events" << endl;
112 
113 }
int nevents
Definition: DTDigiTask.h:93
#define LogTrace(id)

Member Function Documentation

void DTDigiTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Analyze.

Definition at line 455 of file DTDigiTask.cc.

References DTStatusFlag::cellStatus(), DTSuperLayerId::chamberId(), DTTimeUnits::counts, spr::find(), edm::EventSetup::get(), createfilelist::int, DTAnalyzerDetailed_cfi::kFactor, LogTrace, SiStripPI::max, min(), DetId::rawId(), edm::second(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superlayer(), genVertex_cff::t0, edm::EventBase::time(), edm::Timestamp::value(), and DTChamberId::wheel().

Referenced by endLuminosityBlock().

455  {
456  nevents++;
458  if (nevents%1000 == 0) {
459  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Analyze #Run: " << event.id().run()
460  << " #Event: " << event.id().event() << endl;
461  }
462 
463  // Get the ingredients from the event
464 
465  // Digi collection
467  event.getByToken(dtDigiToken_, dtdigis);
468 
469  // LTC digis
470  if (!isLocalRun) event.getByToken(ltcDigiCollectionToken_, ltcdigis);
471 
472  // Status map (for noisy channels)
473  ESHandle<DTStatusFlag> statusMap;
474  if(checkNoisyChannels) {
475  // Get the map of noisy channels
476  c.get<DTStatusFlagRcd>().get(statusMap);
477  }
478 
479  string histoTag;
480 
481  // Check if the digi container is empty
482  if(dtdigis->begin() == dtdigis->end()) {
483  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "Event " << nevents << " empty." << endl;
484  }
485 
486  if (lookForSyncNoise || filterSyncNoise) { // dosync
487  // Count the # of digis per chamber
489  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); dtLayerId_It++) {
490  DTChamberId chId = ((*dtLayerId_It).first).chamberId();
491  if(hitMap.find(chId) == hitMap.end()) {// new chamber
492  hitMap[chId] = 0;
493  }
494  hitMap[chId] += (((*dtLayerId_It).second).second - ((*dtLayerId_It).second).first);
495  }
496 
497 
498 
499  // check chamber with # of digis above threshold and flag them as noisy
500  map<DTChamberId,int>::const_iterator hitMapIt = hitMap.begin();
501  map<DTChamberId,int>::const_iterator hitMapEnd = hitMap.end();
502 
503  map<int,int> chMap;
504 
505  for (; hitMapIt != hitMapEnd; ++hitMapIt) {
506  if((hitMapIt->second) > maxTDCHits) {
507 
508  DTChamberId chId = hitMapIt->first;
509  int wh = chId.wheel();
510 
511  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Synch noise in chamber: " << chId
512  << " with # digis: " << hitMapIt->second << endl;
513 
514  if(chMap.find(wh) == chMap.end()) { chMap[wh] = 0; }
515  chMap[wh]++ ;
516 
517  syncNoisyChambers.insert(chId);
518 
519  wheelHistos["SyncNoiseEvents"][wh]->Fill(chId.sector(),chId.station());
520 
521  }
522  }
523 
524  // fill # of noisy ch per wheel plot
525  map<int,int>::const_iterator chMapIt = chMap.begin();
526  map<int,int>::const_iterator chMapEnd = chMap.end();
527  for (; chMapIt != chMapEnd; ++chMapIt) {
528  wheelHistos["SyncNoiseChambs"][(*chMapIt).first]->Fill((*chMapIt).second);
529  }
530 
531  // clear the map of # of digis per chamber: not needed anymore
532  hitMap.clear();
533 
534  if (!syncNoisyChambers.empty()) {
535  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Synch Noise in event: " << nevents;
536  if(filterSyncNoise) LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << "\tnoisy time-boxes and occupancy will not be filled!" << endl;
537  syncNumTot++;
538  syncNum++;
539  }
540 
541  // Logging of "large" synch Noisy events in private DQM
542  if (syncNoisyChambers.size() > 3) {
543  time_t eventTime = time_t(event.time().value()>>32);
544 
545  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
546  << "[DTDigiTask] At least 4 Synch Noisy chambers in Run : " << event.id().run()
547  << " Lumi : " << event.id().luminosityBlock()
548  << " Event : " << event.id().event()
549  << " at time : " << ctime(&eventTime) << endl;
550 
551  set<DTChamberId>::const_iterator chIt = syncNoisyChambers.begin();
552  set<DTChamberId>::const_iterator chEnd = syncNoisyChambers.end();
553 
554  stringstream synchNoisyCh;
555  for (;chIt!=chEnd;++chIt) { synchNoisyCh << " " << (*chIt); }
556  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise") <<
557  "[DTDigiTask] Chamber List :" << synchNoisyCh.str() << endl;
558  }
559 
560  if (nevents%1000 == 0) {
561  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << (syncNumTot*100./nevents) << "% sync noise events since the beginning \n"
562  << (syncNum*0.1) << "% sync noise events in the last 1000 events " << endl;
563  syncNum = 0;
564  }
565  }
566 
567  bool isSyncNoisy = false;
568 
570  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It) { // Loop over layers
571  isSyncNoisy = false;
572  // check if chamber labeled as synch noisy
573  if (filterSyncNoise) {
574  DTChamberId chId = ((*dtLayerId_It).first).chamberId();
575  if(syncNoisyChambers.find(chId) != syncNoisyChambers.end()) {
576  isSyncNoisy = true;
577  }
578  }
579 
580  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
581  digiIt!=((*dtLayerId_It).second).second; ++digiIt) { // Loop over all digis
582 
583  bool isNoisy = false;
584  bool isFEMasked = false;
585  bool isTDCMasked = false;
586  bool isTrigMask = false;
587  bool isDead = false;
588  bool isNohv = false;
589  if(checkNoisyChannels) {
590  const DTWireId wireId(((*dtLayerId_It).first), (*digiIt).wire());
591  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
592  }
593 
594  // Get the useful IDs
595  const DTSuperLayerId dtSLId = ((*dtLayerId_It).first).superlayerId();
596  uint32_t indexSL = dtSLId.rawId();
597  const DTChamberId dtChId = dtSLId.chamberId();
598  uint32_t indexCh = dtChId.rawId();
599  int layer_number=((*dtLayerId_It).first).layer();
600  int superlayer_number=dtSLId.superlayer();
601 
602  // Read the ttrig DB or set a rough value from config
603  // ttrig and rms are TDC counts
604  if (readTTrigDB)
605  tTrigMap->get( ((*dtLayerId_It).first).superlayerId(),
607  else tTrig = defaultTTrig;
608 
609  int inTimeHitsLowerBoundCorr = int(round(tTrig)) - inTimeHitsLowerBound;
610  int inTimeHitsUpperBoundCorr = int(round(tTrig)) + tMax + inTimeHitsUpperBound;
611 
612  float t0; float t0RMS;
613  int tdcTime = (*digiIt).countsTDC();
614 
615  if (subtractT0) {
616  const DTWireId dtWireId(((*dtLayerId_It).first), (*digiIt).wire());
617  // t0s and rms are TDC counts
618  t0Map->get(dtWireId, t0, t0RMS, DTTimeUnits::counts) ;
619  tdcTime += int(round(t0));
620  }
621 
622  if (sliceTestMode)
623  {
624  tdcTime -= tdcPedestal;
625  tdcTime = std::max(1,std::min(maxTTMounts-1,tdcTime));
626  // std::cout << tdcTime << std::endl;
627  }
628 
629  // Fill Time-Boxes
630  // NOTE: avoid to fill TB and PhotoPeak with noise. Occupancy are filled anyway
631  if (( !isNoisy ) && (!isSyncNoisy)) { // Discard noisy channels
632  // TimeBoxes per SL
633  histoTag = "TimeBox" + triggerSource();
634 
635  (digiHistos.find(histoTag)->second).find(indexSL)->second->Fill(tdcTime);
636  if(doLayerTimeBoxes)
637  (digiHistos.find(histoTag)->second).find((*dtLayerId_It).first.rawId())->second->Fill(tdcTime);
638  }
639 
640  // Fill Occupancies
641  if (!isSyncNoisy) { // Discard synch noisy channels
642 
643  if (doAllHitsOccupancies) { // fill occupancies for all hits
644  //Occupancies per chamber & layer
645  histoTag = "OccupancyAllHits_perCh";
646  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
647  digiHistos[histoTag].find(indexCh);
648 
649  //FR comment the following cannot pass ibooker to analyze method!
650  /*
651  if (mappedHisto == digiHistos[histoTag].end()) { // dynamic booking
652  bookHistos(ibooker, dtChId, string("Occupancies"), histoTag);
653  mappedHisto = digiHistos[histoTag].find(indexCh);
654  }
655  */
656  mappedHisto->second->Fill((*digiIt).wire(),(layer_number+(superlayer_number-1)*4)-1);
657 
658 
659  // Fill the chamber occupancy
660  histoTag = "OccupancyAllHits";
661  map<int, MonitorElement*>::const_iterator histoPerWheel =
662  wheelHistos[histoTag].find(dtChId.wheel());
663 
664  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
665  }
666 
667  if(doNoiseOccupancies) { // fill occupancies for hits before the ttrig
668  if (tdcTime < inTimeHitsLowerBoundCorr ) {
669  // FIXME: what about tdcTime > inTimeHitsUpperBoundCorr ???
670 
671  // Noise: Before tTrig
672  //Occupancies Noise per chamber & layer
673  histoTag = "OccupancyNoise_perCh";
674  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
675  digiHistos[histoTag].find(indexCh);
676 
677  mappedHisto->second->Fill((*digiIt).wire(),
678  (layer_number+(superlayer_number-1)*4)-1);
679 
680  // Fill the chamber occupancy
681 
682  histoTag = "OccupancyNoise";
683  map<int, MonitorElement*>::const_iterator histoPerWheel =
684  wheelHistos[histoTag].find(dtChId.wheel());
685 
686  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
687  }
688  }
689 
690  if(doInTimeOccupancies) { // fill occpunacies for in-time hits only
691  if (tdcTime > inTimeHitsLowerBoundCorr && tdcTime < inTimeHitsUpperBoundCorr) {
692  // Physical hits: within the time window
693 
694  //Occupancies Signal per chamber & layer
695  histoTag = "OccupancyInTimeHits_perCh";
696  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
697  digiHistos[histoTag].find(indexCh);
698 
699  mappedHisto->second->Fill((*digiIt).wire(),
700  (layer_number+(superlayer_number-1)*4)-1);
701 
702  // Fill the chamber occupancy
703  histoTag = "OccupancyInTimeHits";
704  map<int, MonitorElement*>::const_iterator histoPerWheel =
705  wheelHistos[histoTag].find(dtChId.wheel());
706 
707  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
708 
709  }
710  }
711  }
712  }
713  }
714 
715  syncNoisyChambers.clear();
716 }
bool doLayerTimeBoxes
Definition: DTDigiTask.h:162
bool filterSyncNoise
Definition: DTDigiTask.h:157
int maxTTMounts
Definition: DTDigiTask.h:150
DTChamberId chamberId() const
Return the corresponding ChamberId.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
bool readTTrigDB
Definition: DTDigiTask.h:130
bool lookForSyncNoise
Definition: DTDigiTask.h:156
float kFactor
Definition: DTDigiTask.h:102
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:67
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTDigiTask.h:116
void Fill(long long x)
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTDigiTask.h:125
bool checkNoisyChannels
Definition: DTDigiTask.h:143
bool isLocalRun
Definition: DTDigiTask.h:139
edm::ESHandle< DTT0 > t0Map
Definition: DTDigiTask.h:117
bool doInTimeOccupancies
Definition: DTDigiTask.h:153
bool doNoiseOccupancies
Definition: DTDigiTask.h:152
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
Definition: DTDigiTask.h:120
int nevents
Definition: DTDigiTask.h:93
T min(T a, T b)
Definition: MathUtil.h:58
int inTimeHitsUpperBound
Definition: DTDigiTask.h:148
#define LogTrace(id)
int defaultTTrig
Definition: DTDigiTask.h:145
float tTrig
tTrig from the DB
Definition: DTDigiTask.h:100
int tMax
no needs to be precise. Value from PSets will always be used
Definition: DTDigiTask.h:96
int superlayer() const
Return the superlayer number (deprecated method name)
int tdcPedestal
Definition: DTDigiTask.h:160
bool doAllHitsOccupancies
Definition: DTDigiTask.h:151
int maxTDCHits
Definition: DTDigiTask.h:97
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
Definition: DTTtrig.cc:85
bool subtractT0
Definition: DTDigiTask.h:132
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
Definition: DTStatusFlag.h:100
std::set< DTChamberId > syncNoisyChambers
Definition: DTDigiTask.h:107
int syncNumTot
Definition: DTDigiTask.h:108
MonitorElement * nEventMonitor
Definition: DTDigiTask.h:165
int inTimeHitsLowerBound
Definition: DTDigiTask.h:147
float tTrigRMS
Definition: DTDigiTask.h:101
int sector() const
Definition: DTChamberId.h:61
T get() const
Definition: EventSetup.h:71
std::map< DTChamberId, int > hitMap
Definition: DTDigiTask.h:106
int station() const
Return the station number.
Definition: DTChamberId.h:51
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:119
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::string triggerSource()
get the L1A source
Definition: DTDigiTask.cc:719
edm::Handle< LTCDigiCollection > ltcdigis
Definition: DTDigiTask.h:111
bool sliceTestMode
Definition: DTDigiTask.h:159
Definition: event.py:1
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_
Definition: DTDigiTask.h:127
void DTDigiTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotected

To reset the MEs.

Definition at line 193 of file DTDigiTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), bookHistos(), DTTimeUnits::counts, printsummarytable::folder, mps_fire::i, edm::LuminosityBlockBase::id(), createfilelist::int, DTAnalyzerDetailed_cfi::kFactor, label, LogTrace, edm::LuminosityBlockID::luminosityBlock(), DetId::rawId(), DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamber::superLayers(), runGCPTkAlMap::title, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

193  {
194 
195  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask]: Begin of LS transition" << endl;
196 
197  // Reset the MonitorElements every n (= ResetCycle) Lumi Blocks
198  int lumiBlock = lumiSeg.id().luminosityBlock();
199  if(lumiBlock % resetCycle == 0) {
200  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask")
201  <<"[DTDigiTask]: Reset at the LS transition : "
202  << lumiBlock << endl;
203  // Loop over all ME
204  map<string,map<uint32_t,MonitorElement*> >::const_iterator histosIt = digiHistos.begin();
205  map<string,map<uint32_t,MonitorElement*> >::const_iterator histosEnd = digiHistos.end();
206  for(;histosIt != histosEnd ; ++histosIt) {
207  map<uint32_t,MonitorElement*>::const_iterator histoIt = (*histosIt).second.begin();
208  map<uint32_t,MonitorElement*>::const_iterator histoEnd = (*histosIt).second.end();
209  for(;histoIt != histoEnd; ++histoIt) { (*histoIt).second->Reset(); }
210  }
211 
212  // re-set mapping for not real channels in the occupancyHits per chamber
213  for(int wh=-2; wh<=2; wh++) {
214  for(int sect=1; sect<=14; sect++) {
215  for(int st=1; st<=4; st++) {
216  if( (sect == 13 || sect == 14) && st != 4 ) {continue;}
217  const DTChamberId dtChId(wh,st,sect);
218  channelsMap(dtChId, "OccupancyAllHits_perCh");
219  }
220  }
221  }
222 
223  // loop over wheel summaries
224  map<string,map<int,MonitorElement*> >::const_iterator whHistosIt = wheelHistos.begin();
225  map<string,map<int,MonitorElement*> >::const_iterator whHistosEnd = wheelHistos.end();
226  for(; whHistosIt != whHistosEnd ; ++whHistosIt) {
227  if ((*whHistosIt).first.find("Sync") == string::npos) { // FIXME skips synch noise plots
228  map<int,MonitorElement*>::const_iterator histoIt = (*whHistosIt).second.begin();
229  map<int,MonitorElement*>::const_iterator histoEnd = (*whHistosIt).second.end();
230  for(;histoIt != histoEnd; ++histoIt) { (*histoIt).second->Reset(); }
231  }
232  }
233  }
234 
235 }
void channelsMap(const DTChamberId &dtCh, std::string histoTag)
To map real channels.
Definition: DTDigiTask.cc:755
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
Definition: DTDigiTask.h:120
int resetCycle
Definition: DTDigiTask.h:141
#define LogTrace(id)
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:119
void DTDigiTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  context 
)
overrideprotected

Definition at line 139 of file DTDigiTask.cc.

References DQMStore::IBooker::bookFloat(), bookHistos(), and DQMStore::IBooker::setCurrentFolder().

139  {
140 
141  if(doStaticBooking) { // Static histo booking
142  // book the event counter
143  ibooker.setCurrentFolder("DT/EventInfo/Counters");
144  nEventMonitor = ibooker.bookFloat(tpMode ? "nProcessedEventsDigiTP" : "nProcessedEventsDigi" );
145  ibooker.setCurrentFolder(topFolder());
146  for(int wh = -2; wh <= 2; ++wh) { // loop over wheels
147  if(doAllHitsOccupancies) bookHistos(ibooker, wh,string("Occupancies"),"OccupancyAllHits");
148 
149  if(doNoiseOccupancies) bookHistos(ibooker, wh,string("Occupancies"),"OccupancyNoise");
150  if(doInTimeOccupancies) bookHistos(ibooker, wh,string("Occupancies"),"OccupancyInTimeHits");
151 
153  bookHistos(ibooker, wh,string("SynchNoise"),"SyncNoiseEvents");
154  bookHistos(ibooker, wh,string("SynchNoise"),"SyncNoiseChambs");
155  }
156 
157  for(int st = 1; st <= 4; ++st) { // loop over stations
158  for(int sect = 1; sect <= 14; ++sect) { // loop over sectors
159  if((sect == 13 || sect == 14) && st != 4) continue;
160  // Get the chamber ID
161  const DTChamberId dtChId(wh,st,sect);
162 
163  // Occupancies
164  if (doAllHitsOccupancies) {
165  bookHistos(ibooker, dtChId,string("Occupancies"),"OccupancyAllHits_perCh");
166  // set channel mapping
167  channelsMap(dtChId, "OccupancyAllHits_perCh");
168  }
170  bookHistos(ibooker, dtChId,string("Occupancies"),"OccupancyNoise_perCh");
172  bookHistos(ibooker, dtChId,string("Occupancies"),"OccupancyInTimeHits_perCh");
173 
174  for(int sl = 1; sl <= 3; ++sl) { // Loop over SLs
175  if(st == 4 && sl == 2) continue;
176  const DTSuperLayerId dtSLId(wh,st,sect,sl);
177  if(isLocalRun) {
178  bookHistos(ibooker, dtSLId,string("TimeBoxes"),"TimeBox");
179  } else {
180  // TimeBoxes for different triggers
181  bookHistos(ibooker, dtSLId,string("TimeBoxes"),"TimeBoxDTonly");
182  bookHistos(ibooker, dtSLId,string("TimeBoxes"),"TimeBoxNoDT");
183  bookHistos(ibooker, dtSLId,string("TimeBoxes"),"TimeBoxDTalso");
184  }
185  }
186  }
187  }
188  }
189  }
190 }
bool doStaticBooking
Definition: DTDigiTask.h:137
void channelsMap(const DTChamberId &dtCh, std::string histoTag)
To map real channels.
Definition: DTDigiTask.cc:755
bool tpMode
Definition: DTDigiTask.h:155
bool filterSyncNoise
Definition: DTDigiTask.h:157
std::string topFolder() const
Definition: DTDigiTask.cc:743
bool lookForSyncNoise
Definition: DTDigiTask.h:156
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
bool isLocalRun
Definition: DTDigiTask.h:139
bool doInTimeOccupancies
Definition: DTDigiTask.h:153
bool doNoiseOccupancies
Definition: DTDigiTask.h:152
bool doAllHitsOccupancies
Definition: DTDigiTask.h:151
void bookHistos(DQMStore::IBooker &ibooker, const DTSuperLayerId &dtSL, std::string folder, std::string histoTag)
Book the ME.
MonitorElement * nEventMonitor
Definition: DTDigiTask.h:165
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
void DTDigiTask::bookHistos ( DQMStore::IBooker ibooker,
const DTSuperLayerId dtSL,
std::string  folder,
std::string  histoTag 
)
protected

Book the ME.

Referenced by beginLuminosityBlock().

void DTDigiTask::bookHistos ( DQMStore::IBooker ibooker,
const DTChamberId dtCh,
std::string  folder,
std::string  histoTag 
)
protected
void DTDigiTask::bookHistos ( DQMStore::IBooker ibooker,
const int  wheelId,
std::string  folder,
std::string  histoTag 
)
protected
void DTDigiTask::channelsMap ( const DTChamberId dtCh,
std::string  histoTag 
)
protected

To map real channels.

Definition at line 755 of file DTDigiTask.cc.

References taus_updatedMVAIds_cff::mapping, DetId::rawId(), DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by endLuminosityBlock().

755  {
756 
757  // n max channels
758  int nWires_max = (digiHistos[histoTag])[dtCh.rawId()] -> getNbinsX();
759 
760  // set bin content = -1 for each not real channel. For visualization purposes
761  for(int sl=1; sl<=3; sl++) {
762  for(int ly=1; ly<=4; ly++) {
763  for(int ch=1; ch<=nWires_max; ch++) {
764 
765  int dduId = -1, rosId = -1, robId = -1, tdcId = -1, channelId = -1;
766  int realCh = mapping->geometryToReadOut(dtCh.wheel(),dtCh.station(),dtCh.sector(),sl,ly,ch,dduId,rosId,robId,tdcId,channelId);
767 
768  // realCh = 0 if the channel exists, while realCh = 1 if it does not exist
769  if( realCh ) {
770 
771  int lybin = (4*sl - 4) + ly;
772  (digiHistos[histoTag])[dtCh.rawId()] -> setBinContent(ch,lybin,-1.);
773 
774  }
775 
776  }
777  }
778  }
779 
780 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDigiTask.h:114
int geometryToReadOut(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:119
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void DTDigiTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotected

Definition at line 116 of file DTDigiTask.cc.

References edm::EventSetup::get(), LogTrace, and taus_updatedMVAIds_cff::mapping.

116  {
117 
118  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask]: begin run" << endl;
119  nevents = 0;
120 
121  // Get the geometry
122  context.get<MuonGeometryRecord>().get(muonGeom);
123 
124  // map of the channels
125  context.get<DTReadOutMappingRcd>().get(mapping);
126 
127  // tTrig
128  if (readTTrigDB)
129  context.get<DTTtrigRcd>().get(tTrigMap);
130  // t0s
131  if (subtractT0)
132  context.get<DTT0Rcd>().get(t0Map);
133  // FIXME: tMax (not yet from the DB)
134  tMax = defaultTmax;
135 
136  // ----------------------------------------------------------------------
137 }
int defaultTmax
Definition: DTDigiTask.h:134
bool readTTrigDB
Definition: DTDigiTask.h:130
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDigiTask.h:114
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTDigiTask.h:116
edm::ESHandle< DTT0 > t0Map
Definition: DTDigiTask.h:117
int nevents
Definition: DTDigiTask.h:93
edm::ESHandle< DTGeometry > muonGeom
Definition: DTDigiTask.h:113
#define LogTrace(id)
int tMax
no needs to be precise. Value from PSets will always be used
Definition: DTDigiTask.h:96
bool subtractT0
Definition: DTDigiTask.h:132
Definition: DTT0Rcd.h:9
T get() const
Definition: EventSetup.h:71
void DTDigiTask::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
inlinefinalprotected
string DTDigiTask::topFolder ( ) const
private

Definition at line 743 of file DTDigiTask.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by endLuminosityBlock().

743  {
744 
745  if(tpMode) return string("DT/10-TestPulses/");
746  else if(sliceTestMode) return string("DT/01-SliceTestDigi/");
747  return string("DT/01-Digi/");
748 
749 }
bool tpMode
Definition: DTDigiTask.h:155
bool sliceTestMode
Definition: DTDigiTask.h:159
string DTDigiTask::triggerSource ( )
protected

get the L1A source

Definition at line 719 of file DTDigiTask.cc.

References mps_fire::i.

Referenced by endLuminosityBlock().

719  {
720 
721  string l1ASource;
722  if (isLocalRun)
723  return l1ASource;
724 
725  for (std::vector<LTCDigi>::const_iterator ltc_it = ltcdigis->begin(); ltc_it != ltcdigis->end(); ltc_it++){
726  size_t otherTriggerSum=0;
727  for (size_t i = 1; i < 6; i++)
728  otherTriggerSum += size_t((*ltc_it).HasTriggered(i));
729 
730  if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
731  l1ASource = "DTonly";
732  else if (!(*ltc_it).HasTriggered(0))
733  l1ASource = "NoDT";
734  else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
735  l1ASource = "DTalso";
736  }
737 
738  return l1ASource;
739 
740 }
bool isLocalRun
Definition: DTDigiTask.h:139
edm::Handle< LTCDigiCollection > ltcdigis
Definition: DTDigiTask.h:111

Member Data Documentation

bool DTDigiTask::checkNoisyChannels
private

Definition at line 143 of file DTDigiTask.h.

int DTDigiTask::defaultTmax
private

Definition at line 134 of file DTDigiTask.h.

int DTDigiTask::defaultTTrig
private

Definition at line 145 of file DTDigiTask.h.

std::map<std::string, std::map<uint32_t, MonitorElement*> > DTDigiTask::digiHistos
private

Definition at line 119 of file DTDigiTask.h.

bool DTDigiTask::doAllHitsOccupancies
private

Definition at line 151 of file DTDigiTask.h.

bool DTDigiTask::doInTimeOccupancies
private

Definition at line 153 of file DTDigiTask.h.

bool DTDigiTask::doLayerTimeBoxes
private

Definition at line 162 of file DTDigiTask.h.

bool DTDigiTask::doNoiseOccupancies
private

Definition at line 152 of file DTDigiTask.h.

bool DTDigiTask::doStaticBooking
private

Definition at line 137 of file DTDigiTask.h.

edm::EDGetTokenT<DTDigiCollection> DTDigiTask::dtDigiToken_
private

Definition at line 125 of file DTDigiTask.h.

bool DTDigiTask::filterSyncNoise
private

Definition at line 157 of file DTDigiTask.h.

std::map<DTChamberId,int> DTDigiTask::hitMap
private

Definition at line 106 of file DTDigiTask.h.

int DTDigiTask::inTimeHitsLowerBound
private

Definition at line 147 of file DTDigiTask.h.

int DTDigiTask::inTimeHitsUpperBound
private

Definition at line 148 of file DTDigiTask.h.

bool DTDigiTask::isLocalRun
private

Definition at line 139 of file DTDigiTask.h.

float DTDigiTask::kFactor
private

Definition at line 102 of file DTDigiTask.h.

bool DTDigiTask::lookForSyncNoise
private

Definition at line 156 of file DTDigiTask.h.

edm::EDGetTokenT<LTCDigiCollection> DTDigiTask::ltcDigiCollectionToken_
private

Definition at line 127 of file DTDigiTask.h.

edm::Handle<LTCDigiCollection> DTDigiTask::ltcdigis
private

Definition at line 111 of file DTDigiTask.h.

edm::ESHandle<DTReadOutMapping> DTDigiTask::mapping
private

Definition at line 114 of file DTDigiTask.h.

int DTDigiTask::maxTDCHits
private

Definition at line 97 of file DTDigiTask.h.

int DTDigiTask::maxTTMounts
private

Definition at line 150 of file DTDigiTask.h.

edm::ESHandle<DTGeometry> DTDigiTask::muonGeom
private

Definition at line 113 of file DTDigiTask.h.

MonitorElement* DTDigiTask::nEventMonitor
private

Definition at line 165 of file DTDigiTask.h.

int DTDigiTask::nevents
private

Definition at line 93 of file DTDigiTask.h.

std::map<DTChamberId, int> DTDigiTask::nSynchNoiseEvents
private

Definition at line 164 of file DTDigiTask.h.

bool DTDigiTask::readTTrigDB
private

Definition at line 130 of file DTDigiTask.h.

int DTDigiTask::resetCycle
private

Definition at line 141 of file DTDigiTask.h.

bool DTDigiTask::sliceTestMode
private

Definition at line 159 of file DTDigiTask.h.

bool DTDigiTask::subtractT0
private

Definition at line 132 of file DTDigiTask.h.

std::set<DTChamberId> DTDigiTask::syncNoisyChambers
private

Definition at line 107 of file DTDigiTask.h.

int DTDigiTask::syncNum
private

Definition at line 109 of file DTDigiTask.h.

int DTDigiTask::syncNumTot
private

Definition at line 108 of file DTDigiTask.h.

edm::ESHandle<DTT0> DTDigiTask::t0Map
private

Definition at line 117 of file DTDigiTask.h.

int DTDigiTask::tdcPedestal
private

Definition at line 160 of file DTDigiTask.h.

int DTDigiTask::timeBoxGranularity
private

Definition at line 149 of file DTDigiTask.h.

int DTDigiTask::tMax
private

no needs to be precise. Value from PSets will always be used

Definition at line 96 of file DTDigiTask.h.

bool DTDigiTask::tpMode
private

Definition at line 155 of file DTDigiTask.h.

float DTDigiTask::tTrig
private

tTrig from the DB

Definition at line 100 of file DTDigiTask.h.

edm::ESHandle<DTTtrig> DTDigiTask::tTrigMap
private

Definition at line 116 of file DTDigiTask.h.

float DTDigiTask::tTrigRMS
private

Definition at line 101 of file DTDigiTask.h.

std::map<std::string, std::map<int, MonitorElement*> > DTDigiTask::wheelHistos
private

Definition at line 120 of file DTDigiTask.h.