CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
edm::EDAnalyzer

Public Member Functions

 DTDigiTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTDigiTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 To reset the MEs. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
void bookHistos (const DTSuperLayerId &dtSL, std::string folder, std::string histoTag)
 Book the ME. More...
 
void bookHistos (const DTChamberId &dtCh, std::string folder, std::string histoTag)
 
void bookHistos (const int wheelId, std::string folder, std::string histoTag)
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup)
 
std::string triggerSource ()
 get the L1A source More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

std::string topFolder () const
 

Private Attributes

bool checkNoisyChannels
 
DQMStoredbe
 
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::InputTag dtDigiLabel
 
bool filterSyncNoise
 
std::map< DTChamberId, int > hitMap
 
int inTimeHitsLowerBound
 
int inTimeHitsUpperBound
 
bool isLocalRun
 
float kFactor
 
bool lookForSyncNoise
 
edm::Handle< LTCDigiCollectionltcdigis
 
int maxTDCCounts
 
int maxTDCHits
 
edm::ESHandle< DTGeometrymuonGeom
 
MonitorElementnEventMonitor
 
int nevents
 
std::map< DTChamberId, int > nSynchNoiseEvents
 
bool readTTrigDB
 
int resetCycle
 
bool subtractT0
 
std::set< DTChamberIdsyncNoisyChambers
 
int syncNum
 
int syncNumTot
 
edm::ESHandle< DTT0t0Map
 
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
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 43 of file DTDigiTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 49 of file DTDigiTask.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogTrace, cmsCodeRules.cppFunctionSkipper::operator, and dtTPAnalyzer_cfg::subtractT0.

49  {
50  // switch for the verbosity
51  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask]: Constructor" << endl;
52 
53  // The label to retrieve the digis
54  dtDigiLabel = ps.getParameter<InputTag>("dtDigiLabel");
55  // Read the configuration parameters
56  maxTDCHits = ps.getUntrackedParameter<int>("maxTDCHitsPerChamber",30000);
57  // Set to true to read the ttrig from DB (useful to determine in-time and out-of-time hits)
58  readTTrigDB = ps.getUntrackedParameter<bool>("readDB", false);
59  // Set to true to subtract t0 from test pulses
60  subtractT0 = ps.getParameter<bool>("performPerWireT0Calibration");
61  // Tmax value (TDC counts)
62  defaultTmax = ps.getParameter<int>("defaultTmax");
63  // Switch from static to dinamic histo booking
64  doStaticBooking = ps.getUntrackedParameter<bool>("staticBooking", true);
65  // Switch for local/global runs
66  isLocalRun = ps.getUntrackedParameter<bool>("localrun", true);
67  // Setting for the reset of the ME after n (= ResetCycle) luminosity sections
68  resetCycle = ps.getUntrackedParameter<int>("ResetCycle", 3);
69  // Check the DB of noisy channels
70  checkNoisyChannels = ps.getUntrackedParameter<bool>("checkNoisyChannels","false");
71  // Default TTrig to be used when not reading the TTrig DB
72  defaultTTrig = ps.getParameter<int>("defaultTtrig");
73  inTimeHitsLowerBound = ps.getParameter<int>("inTimeHitsLowerBound");
74  inTimeHitsUpperBound = ps.getParameter<int>("inTimeHitsUpperBound");
75  timeBoxGranularity = ps.getUntrackedParameter<int>("timeBoxGranularity",4);
76  maxTDCCounts = ps.getUntrackedParameter<int>("maxTDCCounts", 6400);
77 
78  doAllHitsOccupancies = ps.getUntrackedParameter<bool>("doAllHitsOccupancies", true);
79  doNoiseOccupancies = ps.getUntrackedParameter<bool>("doNoiseOccupancies", false);
80  doInTimeOccupancies = ps.getUntrackedParameter<bool>("doInTimeOccupancies", false);
81 
82  // switch on the mode for running on test pulses (different top folder)
83  tpMode = ps.getUntrackedParameter<bool>("testPulseMode", false);
84  // switch on/off the filtering of synchronous noise events (cutting on the # of digis)
85  // time-boxes and occupancy plots are not filled and summary plots are created to report the problem
86  filterSyncNoise = ps.getUntrackedParameter<bool>("filterSyncNoise", false);
87  // look for synch noisy events, produce histograms but do not filter them
88  lookForSyncNoise = ps.getUntrackedParameter<bool>("lookForSyncNoise", false);
89  // switch on production of time-boxes with layer granularity
90  doLayerTimeBoxes = ps.getUntrackedParameter<bool>("doLayerTimeBoxes", false);
91 
93 
94  syncNumTot = 0;
95  syncNum = 0;
96 
97 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int defaultTmax
Definition: DTDigiTask.h:122
bool doStaticBooking
Definition: DTDigiTask.h:125
bool tpMode
Definition: DTDigiTask.h:143
bool doLayerTimeBoxes
Definition: DTDigiTask.h:147
bool filterSyncNoise
Definition: DTDigiTask.h:145
bool readTTrigDB
Definition: DTDigiTask.h:118
bool lookForSyncNoise
Definition: DTDigiTask.h:144
int maxTDCCounts
Definition: DTDigiTask.h:138
bool checkNoisyChannels
Definition: DTDigiTask.h:131
bool isLocalRun
Definition: DTDigiTask.h:127
bool doInTimeOccupancies
Definition: DTDigiTask.h:141
bool doNoiseOccupancies
Definition: DTDigiTask.h:140
int syncNum
Definition: DTDigiTask.h:99
int resetCycle
Definition: DTDigiTask.h:129
int inTimeHitsUpperBound
Definition: DTDigiTask.h:136
DQMStore * dbe
Definition: DTDigiTask.h:103
#define LogTrace(id)
int defaultTTrig
Definition: DTDigiTask.h:133
bool doAllHitsOccupancies
Definition: DTDigiTask.h:139
int maxTDCHits
Definition: DTDigiTask.h:86
bool subtractT0
Definition: DTDigiTask.h:120
int timeBoxGranularity
Definition: DTDigiTask.h:137
int syncNumTot
Definition: DTDigiTask.h:98
int inTimeHitsLowerBound
Definition: DTDigiTask.h:135
edm::InputTag dtDigiLabel
Definition: DTDigiTask.h:116
DTDigiTask::~DTDigiTask ( )
virtual

Destructor.

Definition at line 102 of file DTDigiTask.cc.

References LogTrace, and nevents.

102  {
103  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "DTDigiTask: analyzed " << nevents << " events" << endl;
104 
105 }
int nevents
Definition: DTDigiTask.h:82
#define LogTrace(id)

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 453 of file DTDigiTask.cc.

References bookHistos(), DTSuperLayerId::chamberId(), DTTimeUnits::counts, end, spr::find(), edm::EventSetup::get(), LogTrace, nevents, DetId::rawId(), edm::second(), DTChamberId::sector(), DTChamberId::station(), crabStatusFromReport::statusMap, dtTPAnalyzer_cfg::subtractT0, DTSuperLayerId::superlayer(), edm::EventBase::time(), edm::Timestamp::value(), and DTChamberId::wheel().

453  {
454  nevents++;
456  if (nevents%1000 == 0) {
457  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Analyze #Run: " << event.id().run()
458  << " #Event: " << event.id().event() << endl;
459  }
460 
461  // Get the ingredients from the event
462 
463  // Digi collection
465  event.getByLabel(dtDigiLabel, dtdigis);
466 
467  // LTC digis
468  if (!isLocalRun) event.getByType(ltcdigis);
469 
470  // Status map (for noisy channels)
472  if(checkNoisyChannels) {
473  // Get the map of noisy channels
474  c.get<DTStatusFlagRcd>().get(statusMap);
475  }
476 
477  string histoTag;
478 
479 
480  // Check if the digi container is empty
481  if(dtdigis->begin() == dtdigis->end()) {
482  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "Event " << nevents << " empty." << endl;
483  }
484 
485  if (lookForSyncNoise || filterSyncNoise) { // dosync
486  // Count the # of digis per chamber
488  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); dtLayerId_It++) {
489  DTChamberId chId = ((*dtLayerId_It).first).chamberId();
490  if(hitMap.find(chId) == hitMap.end()) {// new chamber
491  hitMap[chId] = 0;
492  }
493  hitMap[chId] += (((*dtLayerId_It).second).second - ((*dtLayerId_It).second).first);
494  }
495 
496 
497 
498  // check chamber with # of digis above threshold and flag them as noisy
499  map<DTChamberId,int>::const_iterator hitMapIt = hitMap.begin();
500  map<DTChamberId,int>::const_iterator hitMapEnd = hitMap.end();
501 
502  map<int,int> chMap;
503 
504  for (; hitMapIt != hitMapEnd; ++hitMapIt) {
505  if((hitMapIt->second) > maxTDCHits) {
506 
507  DTChamberId chId = hitMapIt->first;
508  int wh = chId.wheel();
509 
510  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Synch noise in chamber: " << chId
511  << " with # digis: " << hitMapIt->second << endl;
512 
513  if(chMap.find(wh) == chMap.end()) { chMap[wh] = 0; }
514  chMap[wh]++ ;
515 
516  syncNoisyChambers.insert(chId);
517 
518  wheelHistos["SyncNoiseEvents"][wh]->Fill(chId.sector(),chId.station());
519 
520  // Only needed in case of ratio map not used right now
521  // FIXME check and optimize
522  // nSynchNoiseEvents[iter->first]++;
523  // FIXME: should update all chambers each event
524  // wheelHistos["SyncNoiseEvents"][(*iter).first.wheel()]->setBinContent((*iter).first.sector(),(*iter).first.station(),
525  // (double)nSynchNoiseEvents[iter->first]/(double)nevents);
526 
527  }
528  }
529 
530  // fill # of noisy ch per wheel plot
531  map<int,int>::const_iterator chMapIt = chMap.begin();
532  map<int,int>::const_iterator chMapEnd = chMap.end();
533  for (; chMapIt != chMapEnd; ++chMapIt) {
534  wheelHistos["SyncNoiseChambs"][(*chMapIt).first]->Fill((*chMapIt).second);
535  }
536 
537  // clear the map of # of digis per chamber: not needed anymore
538  hitMap.clear();
539 
540  if (syncNoisyChambers.size() != 0) {
541  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Synch Noise in event: " << nevents;
542  if(filterSyncNoise) LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << "\tnoisy time-boxes and occupancy will not be filled!" << endl;
543  syncNumTot++;
544  syncNum++;
545  }
546 
547  // Logging of "large" synch Noisy events in private DQM
548  if (syncNoisyChambers.size() > 3) {
549  time_t eventTime = time_t(event.time().value()>>32);
550 
551  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
552  << "[DTDigiTask] At least 4 Synch Noisy chambers in Run : " << event.id().run()
553  << " Lumi : " << event.id().luminosityBlock()
554  << " Event : " << event.id().event()
555  << " at time : " << ctime(&eventTime) << endl;
556 
557  set<DTChamberId>::const_iterator chIt = syncNoisyChambers.begin();
558  set<DTChamberId>::const_iterator chEnd = syncNoisyChambers.end();
559 
560  stringstream synchNoisyCh;
561  for (;chIt!=chEnd;++chIt) { synchNoisyCh << " " << (*chIt); }
562  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise") <<
563  "[DTDigiTask] Chamber List :" << synchNoisyCh.str() << endl;
564 
565  }
566 
567 
568  if (nevents%1000 == 0) {
569  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << (syncNumTot*100./nevents) << "% sync noise events since the beginning \n"
570  << (syncNum*0.1) << "% sync noise events in the last 1000 events " << endl;
571  syncNum = 0;
572  }
573  }
574 
575  bool isSyncNoisy = false;
576 
578  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It) { // Loop over layers
579  isSyncNoisy = false;
580  // check if chamber labeled as synch noisy
581  if (filterSyncNoise) {
582  DTChamberId chId = ((*dtLayerId_It).first).chamberId();
583  if(syncNoisyChambers.find(chId) != syncNoisyChambers.end()) {
584  isSyncNoisy = true;
585  }
586  }
587 
588  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
589  digiIt!=((*dtLayerId_It).second).second; ++digiIt) { // Loop over all digis
590 
591  bool isNoisy = false;
592  bool isFEMasked = false;
593  bool isTDCMasked = false;
594  bool isTrigMask = false;
595  bool isDead = false;
596  bool isNohv = false;
597  if(checkNoisyChannels) {
598  const DTWireId wireId(((*dtLayerId_It).first), (*digiIt).wire());
599  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
600  }
601 
602 
603 
604  // Get the useful IDs
605  const DTSuperLayerId dtSLId = ((*dtLayerId_It).first).superlayerId();
606  uint32_t indexSL = dtSLId.rawId();
607  const DTChamberId dtChId = dtSLId.chamberId();
608  uint32_t indexCh = dtChId.rawId();
609  int layer_number=((*dtLayerId_It).first).layer();
610  int superlayer_number=dtSLId.superlayer();
611  const DTLayerId dtLId = (*dtLayerId_It).first;
612 
613  // Read the ttrig DB or set a rough value from config
614  // ttrig and rms are TDC counts
615  if (readTTrigDB)
616  tTrigMap->get( ((*dtLayerId_It).first).superlayerId(),
618  else tTrig = defaultTTrig;
619 
620  int inTimeHitsLowerBoundCorr = int(round(tTrig)) - inTimeHitsLowerBound;
621  int inTimeHitsUpperBoundCorr = int(round(tTrig)) + tMax + inTimeHitsUpperBound;
622 
623  float t0; float t0RMS;
624  int tdcTime = (*digiIt).countsTDC();
625 
626  if (subtractT0) {
627  const DTWireId dtWireId(((*dtLayerId_It).first), (*digiIt).wire());
628  // t0s and rms are TDC counts
629  t0Map->get(dtWireId, t0, t0RMS, DTTimeUnits::counts) ;
630  tdcTime += int(round(t0));
631  }
632 
633 
634 
635  // Fill Time-Boxes
636  // NOTE: avoid to fill TB and PhotoPeak with noise. Occupancy are filled anyway
637  if (( !isNoisy ) && (!isSyncNoisy)) { // Discard noisy channels
638  // TimeBoxes per SL
639  histoTag = "TimeBox" + triggerSource();
640  if (digiHistos[histoTag].find(indexSL) == digiHistos[histoTag].end())
641  bookHistos( dtSLId, string("TimeBoxes"), histoTag );
642  (digiHistos.find(histoTag)->second).find(indexSL)->second->Fill(tdcTime);
643  if(doLayerTimeBoxes)
644  (digiHistos.find(histoTag)->second).find((*dtLayerId_It).first.rawId())->second->Fill(tdcTime);
645  // FIXME: remove the time distribution for the after-pulses
646  // 2nd - 1st (CathodPhotoPeak) per SL
647  // if ( (*digiIt).number() == 1 ) {
648 
649  // DTDigiCollection::const_iterator firstDigiIt = digiIt;
650  // firstDigiIt--;
651 
652  // histoTag = "CathodPhotoPeak";
653  // if (digiHistos[histoTag].find(indexSL) == digiHistos[histoTag].end())
654  // bookHistos( dtSLId, string("CathodPhotoPeaks"), histoTag );
655  // (digiHistos.find(histoTag)->second).find(indexSL)->second->Fill((*digiIt).countsTDC()-
656  // (*firstDigiIt).countsTDC());
657  // }
658  }
659 
660  // Fill Occupancies
661  if (!isSyncNoisy) { // Discard synch noisy channels
662 
663  if (doAllHitsOccupancies) { // fill occupancies for all hits
664  //Occupancies per chamber & layer
665  histoTag = "OccupancyAllHits_perCh";
666  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
667  digiHistos[histoTag].find(indexCh);
668  if (mappedHisto == digiHistos[histoTag].end()) { // dynamic booking
669  bookHistos(dtChId, string("Occupancies"), histoTag);
670  mappedHisto = digiHistos[histoTag].find(indexCh);
671  }
672  mappedHisto->second->Fill((*digiIt).wire(),(layer_number+(superlayer_number-1)*4)-1);
673 
674 
675  // Fill the chamber occupancy
676  histoTag = "OccupancyAllHits";
677  map<int, MonitorElement*>::const_iterator histoPerWheel =
678  wheelHistos[histoTag].find(dtChId.wheel());
679  if(histoPerWheel == wheelHistos[histoTag].end()) { // dynamic booking
680  bookHistos(dtChId.wheel(), string("Occupancies"), histoTag);
681  histoPerWheel = wheelHistos[histoTag].find(dtChId.wheel());
682  }
683  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
684 
685 
686  }
687 
688  if(doNoiseOccupancies) { // fill occupancies for hits before the ttrig
689  if (tdcTime < inTimeHitsLowerBoundCorr ) {
690  // FIXME: what about tdcTime > inTimeHitsUpperBoundCorr ???
691 
692  // Noise: Before tTrig
693  //Occupancies Noise per chamber & layer
694  histoTag = "OccupancyNoise_perCh";
695  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
696  digiHistos[histoTag].find(indexCh);
697  if(mappedHisto == digiHistos[histoTag].end()) {
698  bookHistos(dtChId, string("Occupancies"), histoTag);
699  mappedHisto = digiHistos[histoTag].find(indexCh);
700  }
701  mappedHisto->second->Fill((*digiIt).wire(),
702  (layer_number+(superlayer_number-1)*4)-1);
703 
704  // Fill the chamber occupancy
705  histoTag = "OccupancyNoise";
706  map<int, MonitorElement*>::const_iterator histoPerWheel =
707  wheelHistos[histoTag].find(dtChId.wheel());
708  if(histoPerWheel == wheelHistos[histoTag].end()) { // dynamic booking
709  bookHistos(dtChId.wheel(), string("Occupancies"), histoTag);
710  histoPerWheel = wheelHistos[histoTag].find(dtChId.wheel());
711  }
712  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
713 
714  }
715  }
716 
717  if(doInTimeOccupancies) { // fill occpunacies for in-time hits only
718  if (tdcTime > inTimeHitsLowerBoundCorr && tdcTime < inTimeHitsUpperBoundCorr) {
719  // Physical hits: within the time window
720 
721  //Occupancies Signal per chamber & layer
722  histoTag = "OccupancyInTimeHits_perCh";
723  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
724  digiHistos[histoTag].find(indexCh);
725  if(mappedHisto == digiHistos[histoTag].end()) {
726  bookHistos(dtChId, string("Occupancies"), histoTag);
727  mappedHisto = digiHistos[histoTag].find(indexCh);
728  }
729  mappedHisto->second->Fill((*digiIt).wire(),
730  (layer_number+(superlayer_number-1)*4)-1);
731 
732  // Fill the chamber occupancy
733  histoTag = "OccupancyInTimeHits";
734  map<int, MonitorElement*>::const_iterator histoPerWheel =
735  wheelHistos[histoTag].find(dtChId.wheel());
736  if(histoPerWheel == wheelHistos[histoTag].end()) { // dynamic booking
737  bookHistos(dtChId.wheel(), string("Occupancies"), histoTag);
738  histoPerWheel = wheelHistos[histoTag].find(dtChId.wheel());
739  }
740  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
741 
742  }
743  }
744  }
745  }
746  }
747 
748  syncNoisyChambers.clear();
749 }
bool doLayerTimeBoxes
Definition: DTDigiTask.h:147
bool filterSyncNoise
Definition: DTDigiTask.h:145
DTChamberId chamberId() const
Return the corresponding ChamberId.
bool readTTrigDB
Definition: DTDigiTask.h:118
bool lookForSyncNoise
Definition: DTDigiTask.h:144
float kFactor
Definition: DTDigiTask.h:91
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTDigiTask.h:107
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
U second(std::pair< T, U > const &p)
void bookHistos(const DTSuperLayerId &dtSL, std::string folder, std::string histoTag)
Book the ME.
bool checkNoisyChannels
Definition: DTDigiTask.h:131
bool isLocalRun
Definition: DTDigiTask.h:127
edm::ESHandle< DTT0 > t0Map
Definition: DTDigiTask.h:108
bool doInTimeOccupancies
Definition: DTDigiTask.h:141
bool doNoiseOccupancies
Definition: DTDigiTask.h:140
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
Definition: DTDigiTask.h:111
int nevents
Definition: DTDigiTask.h:82
#define end
Definition: vmac.h:38
int syncNum
Definition: DTDigiTask.h:99
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int inTimeHitsUpperBound
Definition: DTDigiTask.h:136
#define LogTrace(id)
int defaultTTrig
Definition: DTDigiTask.h:133
float tTrig
tTrig from the DB
Definition: DTDigiTask.h:89
int tMax
no needs to be precise. Value from PSets will always be used
Definition: DTDigiTask.h:85
int superlayer() const
Return the superlayer number (deprecated method name)
bool doAllHitsOccupancies
Definition: DTDigiTask.h:139
int maxTDCHits
Definition: DTDigiTask.h:86
bool subtractT0
Definition: DTDigiTask.h:120
const T & get() const
Definition: EventSetup.h:55
std::vector< DigiType >::const_iterator const_iterator
std::set< DTChamberId > syncNoisyChambers
Definition: DTDigiTask.h:97
int syncNumTot
Definition: DTDigiTask.h:98
MonitorElement * nEventMonitor
Definition: DTDigiTask.h:150
int inTimeHitsLowerBound
Definition: DTDigiTask.h:135
float tTrigRMS
Definition: DTDigiTask.h:90
int sector() const
Definition: DTChamberId.h:63
std::map< DTChamberId, int > hitMap
Definition: DTDigiTask.h:96
int station() const
Return the station number.
Definition: DTChamberId.h:53
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:110
edm::InputTag dtDigiLabel
Definition: DTDigiTask.h:116
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
std::string triggerSource()
get the L1A source
Definition: DTDigiTask.cc:752
edm::Handle< LTCDigiCollection > ltcdigis
Definition: DTDigiTask.h:101
void DTDigiTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 118 of file DTDigiTask.cc.

References LogTrace, and nevents.

118  {
119  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") <<"[DTDigiTask]: BeginJob"<<endl;
120 
121  nevents = 0;
122 }
int nevents
Definition: DTDigiTask.h:82
#define LogTrace(id)
void DTDigiTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::EDAnalyzer.

Definition at line 193 of file DTDigiTask.cc.

References edm::LuminosityBlockBase::id(), LogTrace, and edm::LuminosityBlockID::luminosityBlock().

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  // loop over wheel summaries
213  map<string,map<int,MonitorElement*> >::const_iterator whHistosIt = wheelHistos.begin();
214  map<string,map<int,MonitorElement*> >::const_iterator whHistosEnd = wheelHistos.end();
215  for(; whHistosIt != whHistosEnd ; ++whHistosIt) {
216  if ((*whHistosIt).first.find("Sync") == string::npos) { // FIXME skips synch noise plots
217  map<int,MonitorElement*>::const_iterator histoIt = (*whHistosIt).second.begin();
218  map<int,MonitorElement*>::const_iterator histoEnd = (*whHistosIt).second.end();
219  for(;histoIt != histoEnd; ++histoIt) { (*histoIt).second->Reset(); }
220  }
221  }
222  }
223 
224 }
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
Definition: DTDigiTask.h:111
int resetCycle
Definition: DTDigiTask.h:129
#define LogTrace(id)
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:110
void DTDigiTask::beginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 125 of file DTDigiTask.cc.

References bookHistos(), edm::EventSetup::get(), LogTrace, and dtTPAnalyzer_cfg::subtractT0.

125  {
126  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask]: begin run" << endl;
127 
128  // Get the geometry
129  context.get<MuonGeometryRecord>().get(muonGeom);
130 
131  // tTrig
132  if (readTTrigDB)
133  context.get<DTTtrigRcd>().get(tTrigMap);
134  // t0s
135  if (subtractT0)
136  context.get<DTT0Rcd>().get(t0Map);
137  // FIXME: tMax (not yet from the DB)
138  tMax = defaultTmax;
139 
140  // ----------------------------------------------------------------------
141  if(doStaticBooking) { // Static histo booking
142  // book the event counter
144  nEventMonitor = dbe->bookFloat("nProcessedEvents");
145  for(int wh = -2; wh <= 2; ++wh) { // loop over wheels
146  if(doAllHitsOccupancies) bookHistos(wh,string("Occupancies"),"OccupancyAllHits");
147  if(doNoiseOccupancies) bookHistos(wh,string("Occupancies"),"OccupancyNoiseHits");
148  if(doInTimeOccupancies) bookHistos(wh,string("Occupancies"),"OccupancyInTimeHits");
149 
151  bookHistos(wh,string("SynchNoise"),"SyncNoiseEvents");
152  bookHistos(wh,string("SynchNoise"),"SyncNoiseChambs");
153  }
154 
155  for(int st = 1; st <= 4; ++st) { // loop over stations
156  for(int sect = 1; sect <= 14; ++sect) { // loop over sectors
157  if((sect == 13 || sect == 14) && st != 4) continue;
158  // Get the chamber ID
159  const DTChamberId dtChId(wh,st,sect);
160 
161  // Occupancies
163  bookHistos(dtChId,string("Occupancies"),"OccupancyAllHits_perCh");
164  if(doNoiseOccupancies)
165  bookHistos(dtChId,string("Occupancies"),"OccupancyNoise_perCh");
167  bookHistos(dtChId,string("Occupancies"),"OccupancyInTimeHits_perCh");
168 
169 
170 
171 
172  for(int sl = 1; sl <= 3; ++sl) { // Loop over SLs
173  if(st == 4 && sl == 2) continue;
174  const DTSuperLayerId dtSLId(wh,st,sect,sl);
175  if(isLocalRun) {
176  bookHistos(dtSLId,string("TimeBoxes"),"TimeBox");
177  } else {
178  // TimeBoxes for different triggers
179  bookHistos(dtSLId,string("TimeBoxes"),"TimeBoxDTonly");
180  bookHistos(dtSLId,string("TimeBoxes"),"TimeBoxNoDT");
181  bookHistos(dtSLId,string("TimeBoxes"),"TimeBoxDTalso");
182  }
183  }
184  }
185  }
186  }
187  }
188 }
int defaultTmax
Definition: DTDigiTask.h:122
bool doStaticBooking
Definition: DTDigiTask.h:125
bool filterSyncNoise
Definition: DTDigiTask.h:145
std::string topFolder() const
Definition: DTDigiTask.cc:776
bool readTTrigDB
Definition: DTDigiTask.h:118
bool lookForSyncNoise
Definition: DTDigiTask.h:144
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTDigiTask.h:107
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:451
void bookHistos(const DTSuperLayerId &dtSL, std::string folder, std::string histoTag)
Book the ME.
bool isLocalRun
Definition: DTDigiTask.h:127
edm::ESHandle< DTT0 > t0Map
Definition: DTDigiTask.h:108
bool doInTimeOccupancies
Definition: DTDigiTask.h:141
bool doNoiseOccupancies
Definition: DTDigiTask.h:140
edm::ESHandle< DTGeometry > muonGeom
Definition: DTDigiTask.h:105
DQMStore * dbe
Definition: DTDigiTask.h:103
#define LogTrace(id)
int tMax
no needs to be precise. Value from PSets will always be used
Definition: DTDigiTask.h:85
bool doAllHitsOccupancies
Definition: DTDigiTask.h:139
bool subtractT0
Definition: DTDigiTask.h:120
const T & get() const
Definition: EventSetup.h:55
Definition: DTT0Rcd.h:9
MonitorElement * nEventMonitor
Definition: DTDigiTask.h:150
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void DTDigiTask::bookHistos ( const DTSuperLayerId dtSL,
std::string  folder,
std::string  histoTag 
)
protected

Book the ME.

void DTDigiTask::bookHistos ( const DTChamberId dtCh,
std::string  folder,
std::string  histoTag 
)
protected
void DTDigiTask::bookHistos ( const int  wheelId,
std::string  folder,
std::string  histoTag 
)
protected
void DTDigiTask::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 110 of file DTDigiTask.cc.

References LogTrace.

110  {
111  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") <<"[DTDigiTask] endjob called!"<<endl;
112 
113 }
#define LogTrace(id)
void DTDigiTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 786 of file DTDigiTask.cc.

786  {
787 
788 // To be used for ratio plots not used right now
789 // Update all histos for SynchNoise if needed
790 // if(lookForSyncNoise || filterSyncNoise) {
791 // //loop over chambers with synch noise events and update their entries in the histos
792 // for(map<DTChamberId, int>::const_iterator nEvPerch = nSynchNoiseEvents.begin();
793 // nEvPerch != nSynchNoiseEvents.end(); ++nEvPerch) {
794 // DTChamberId chId = (*nEvPerch).first;
795 // wheelHistos["SyncNoiseEvents"][chId.wheel()]->setBinContent(chId.sector(),chId.station(),
796 // (double)nSynchNoiseEvents[chId]/(double)nevents);
797 // }
798 // }
799 
800 }
string DTDigiTask::topFolder ( ) const
private

Definition at line 776 of file DTDigiTask.cc.

776  {
777 
778  if(tpMode) return string("DT/10-TestPulses/");
779  return string("DT/01-Digi/");
780 
781 }
bool tpMode
Definition: DTDigiTask.h:143
string DTDigiTask::triggerSource ( )
protected

get the L1A source

Definition at line 752 of file DTDigiTask.cc.

752  {
753 
754  string l1ASource;
755 
756  if (!isLocalRun) {
757  for (std::vector<LTCDigi>::const_iterator ltc_it = ltcdigis->begin(); ltc_it != ltcdigis->end(); ltc_it++){
758  int otherTriggerSum=0;
759  for (int i = 1; i < 6; i++)
760  otherTriggerSum += int((*ltc_it).HasTriggered(i));
761 
762  if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
763  l1ASource = "DTonly";
764  else if (!(*ltc_it).HasTriggered(0))
765  l1ASource = "NoDT";
766  else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
767  l1ASource = "DTalso";
768  }
769  }
770 
771  return l1ASource;
772 
773 }
int i
Definition: DBlmapReader.cc:9
bool isLocalRun
Definition: DTDigiTask.h:127
edm::Handle< LTCDigiCollection > ltcdigis
Definition: DTDigiTask.h:101

Member Data Documentation

bool DTDigiTask::checkNoisyChannels
private

Definition at line 131 of file DTDigiTask.h.

DQMStore* DTDigiTask::dbe
private

Definition at line 103 of file DTDigiTask.h.

int DTDigiTask::defaultTmax
private

Definition at line 122 of file DTDigiTask.h.

int DTDigiTask::defaultTTrig
private

Definition at line 133 of file DTDigiTask.h.

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

Definition at line 110 of file DTDigiTask.h.

bool DTDigiTask::doAllHitsOccupancies
private

Definition at line 139 of file DTDigiTask.h.

bool DTDigiTask::doInTimeOccupancies
private

Definition at line 141 of file DTDigiTask.h.

bool DTDigiTask::doLayerTimeBoxes
private

Definition at line 147 of file DTDigiTask.h.

bool DTDigiTask::doNoiseOccupancies
private

Definition at line 140 of file DTDigiTask.h.

bool DTDigiTask::doStaticBooking
private

Definition at line 125 of file DTDigiTask.h.

edm::InputTag DTDigiTask::dtDigiLabel
private

Definition at line 116 of file DTDigiTask.h.

bool DTDigiTask::filterSyncNoise
private

Definition at line 145 of file DTDigiTask.h.

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

Definition at line 96 of file DTDigiTask.h.

int DTDigiTask::inTimeHitsLowerBound
private

Definition at line 135 of file DTDigiTask.h.

int DTDigiTask::inTimeHitsUpperBound
private

Definition at line 136 of file DTDigiTask.h.

bool DTDigiTask::isLocalRun
private

Definition at line 127 of file DTDigiTask.h.

float DTDigiTask::kFactor
private

Definition at line 91 of file DTDigiTask.h.

bool DTDigiTask::lookForSyncNoise
private

Definition at line 144 of file DTDigiTask.h.

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

Definition at line 101 of file DTDigiTask.h.

int DTDigiTask::maxTDCCounts
private

Definition at line 138 of file DTDigiTask.h.

int DTDigiTask::maxTDCHits
private

Definition at line 86 of file DTDigiTask.h.

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

Definition at line 105 of file DTDigiTask.h.

MonitorElement* DTDigiTask::nEventMonitor
private

Definition at line 150 of file DTDigiTask.h.

int DTDigiTask::nevents
private

Definition at line 82 of file DTDigiTask.h.

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

Definition at line 149 of file DTDigiTask.h.

bool DTDigiTask::readTTrigDB
private

Definition at line 118 of file DTDigiTask.h.

int DTDigiTask::resetCycle
private

Definition at line 129 of file DTDigiTask.h.

bool DTDigiTask::subtractT0
private

Definition at line 120 of file DTDigiTask.h.

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

Definition at line 97 of file DTDigiTask.h.

int DTDigiTask::syncNum
private

Definition at line 99 of file DTDigiTask.h.

int DTDigiTask::syncNumTot
private

Definition at line 98 of file DTDigiTask.h.

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

Definition at line 108 of file DTDigiTask.h.

int DTDigiTask::timeBoxGranularity
private

Definition at line 137 of file DTDigiTask.h.

int DTDigiTask::tMax
private

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

Definition at line 85 of file DTDigiTask.h.

bool DTDigiTask::tpMode
private

Definition at line 143 of file DTDigiTask.h.

float DTDigiTask::tTrig
private

tTrig from the DB

Definition at line 89 of file DTDigiTask.h.

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

Definition at line 107 of file DTDigiTask.h.

float DTDigiTask::tTrigRMS
private

Definition at line 90 of file DTDigiTask.h.

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

Definition at line 111 of file DTDigiTask.h.