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 channelsMap (const DTChamberId &dtCh, std::string histoTag)
 To map real channels. More...
 
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
 
edm::ESHandle< DTReadOutMappingmapping
 
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)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 45 of file DTDigiTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 50 of file DTDigiTask.cc.

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

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

Destructor.

Definition at line 103 of file DTDigiTask.cc.

References LogTrace, and nevents.

103  {
104  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "DTDigiTask: analyzed " << nevents << " events" << endl;
105 
106 }
int nevents
Definition: DTDigiTask.h:87
#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 472 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().

472  {
473  nevents++;
475  if (nevents%1000 == 0) {
476  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Analyze #Run: " << event.id().run()
477  << " #Event: " << event.id().event() << endl;
478  }
479 
480  // Get the ingredients from the event
481 
482  // Digi collection
484  event.getByLabel(dtDigiLabel, dtdigis);
485 
486  // LTC digis
487  if (!isLocalRun) event.getByType(ltcdigis);
488 
489  // Status map (for noisy channels)
491  if(checkNoisyChannels) {
492  // Get the map of noisy channels
493  c.get<DTStatusFlagRcd>().get(statusMap);
494  }
495 
496  string histoTag;
497 
498 
499  // Check if the digi container is empty
500  if(dtdigis->begin() == dtdigis->end()) {
501  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "Event " << nevents << " empty." << endl;
502  }
503 
504  if (lookForSyncNoise || filterSyncNoise) { // dosync
505  // Count the # of digis per chamber
507  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); dtLayerId_It++) {
508  DTChamberId chId = ((*dtLayerId_It).first).chamberId();
509  if(hitMap.find(chId) == hitMap.end()) {// new chamber
510  hitMap[chId] = 0;
511  }
512  hitMap[chId] += (((*dtLayerId_It).second).second - ((*dtLayerId_It).second).first);
513  }
514 
515 
516 
517  // check chamber with # of digis above threshold and flag them as noisy
518  map<DTChamberId,int>::const_iterator hitMapIt = hitMap.begin();
519  map<DTChamberId,int>::const_iterator hitMapEnd = hitMap.end();
520 
521  map<int,int> chMap;
522 
523  for (; hitMapIt != hitMapEnd; ++hitMapIt) {
524  if((hitMapIt->second) > maxTDCHits) {
525 
526  DTChamberId chId = hitMapIt->first;
527  int wh = chId.wheel();
528 
529  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Synch noise in chamber: " << chId
530  << " with # digis: " << hitMapIt->second << endl;
531 
532  if(chMap.find(wh) == chMap.end()) { chMap[wh] = 0; }
533  chMap[wh]++ ;
534 
535  syncNoisyChambers.insert(chId);
536 
537  wheelHistos["SyncNoiseEvents"][wh]->Fill(chId.sector(),chId.station());
538 
539  // Only needed in case of ratio map not used right now
540  // FIXME check and optimize
541  // nSynchNoiseEvents[iter->first]++;
542  // FIXME: should update all chambers each event
543  // wheelHistos["SyncNoiseEvents"][(*iter).first.wheel()]->setBinContent((*iter).first.sector(),(*iter).first.station(),
544  // (double)nSynchNoiseEvents[iter->first]/(double)nevents);
545 
546  }
547  }
548 
549  // fill # of noisy ch per wheel plot
550  map<int,int>::const_iterator chMapIt = chMap.begin();
551  map<int,int>::const_iterator chMapEnd = chMap.end();
552  for (; chMapIt != chMapEnd; ++chMapIt) {
553  wheelHistos["SyncNoiseChambs"][(*chMapIt).first]->Fill((*chMapIt).second);
554  }
555 
556  // clear the map of # of digis per chamber: not needed anymore
557  hitMap.clear();
558 
559  if (syncNoisyChambers.size() != 0) {
560  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask] Synch Noise in event: " << nevents;
561  if(filterSyncNoise) LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << "\tnoisy time-boxes and occupancy will not be filled!" << endl;
562  syncNumTot++;
563  syncNum++;
564  }
565 
566  // Logging of "large" synch Noisy events in private DQM
567  if (syncNoisyChambers.size() > 3) {
568  time_t eventTime = time_t(event.time().value()>>32);
569 
570  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise")
571  << "[DTDigiTask] At least 4 Synch Noisy chambers in Run : " << event.id().run()
572  << " Lumi : " << event.id().luminosityBlock()
573  << " Event : " << event.id().event()
574  << " at time : " << ctime(&eventTime) << endl;
575 
576  set<DTChamberId>::const_iterator chIt = syncNoisyChambers.begin();
577  set<DTChamberId>::const_iterator chEnd = syncNoisyChambers.end();
578 
579  stringstream synchNoisyCh;
580  for (;chIt!=chEnd;++chIt) { synchNoisyCh << " " << (*chIt); }
581  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask|DTSynchNoise") <<
582  "[DTDigiTask] Chamber List :" << synchNoisyCh.str() << endl;
583 
584  }
585 
586 
587  if (nevents%1000 == 0) {
588  LogVerbatim("DTDQM|DTMonitorModule|DTDigiTask") << (syncNumTot*100./nevents) << "% sync noise events since the beginning \n"
589  << (syncNum*0.1) << "% sync noise events in the last 1000 events " << endl;
590  syncNum = 0;
591  }
592  }
593 
594  bool isSyncNoisy = false;
595 
597  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It) { // Loop over layers
598  isSyncNoisy = false;
599  // check if chamber labeled as synch noisy
600  if (filterSyncNoise) {
601  DTChamberId chId = ((*dtLayerId_It).first).chamberId();
602  if(syncNoisyChambers.find(chId) != syncNoisyChambers.end()) {
603  isSyncNoisy = true;
604  }
605  }
606 
607  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
608  digiIt!=((*dtLayerId_It).second).second; ++digiIt) { // Loop over all digis
609 
610  bool isNoisy = false;
611  bool isFEMasked = false;
612  bool isTDCMasked = false;
613  bool isTrigMask = false;
614  bool isDead = false;
615  bool isNohv = false;
616  if(checkNoisyChannels) {
617  const DTWireId wireId(((*dtLayerId_It).first), (*digiIt).wire());
618  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
619  }
620 
621 
622 
623  // Get the useful IDs
624  const DTSuperLayerId dtSLId = ((*dtLayerId_It).first).superlayerId();
625  uint32_t indexSL = dtSLId.rawId();
626  const DTChamberId dtChId = dtSLId.chamberId();
627  uint32_t indexCh = dtChId.rawId();
628  int layer_number=((*dtLayerId_It).first).layer();
629  int superlayer_number=dtSLId.superlayer();
630 
631  // Read the ttrig DB or set a rough value from config
632  // ttrig and rms are TDC counts
633  if (readTTrigDB)
634  tTrigMap->get( ((*dtLayerId_It).first).superlayerId(),
636  else tTrig = defaultTTrig;
637 
638  int inTimeHitsLowerBoundCorr = int(round(tTrig)) - inTimeHitsLowerBound;
639  int inTimeHitsUpperBoundCorr = int(round(tTrig)) + tMax + inTimeHitsUpperBound;
640 
641  float t0; float t0RMS;
642  int tdcTime = (*digiIt).countsTDC();
643 
644  if (subtractT0) {
645  const DTWireId dtWireId(((*dtLayerId_It).first), (*digiIt).wire());
646  // t0s and rms are TDC counts
647  t0Map->get(dtWireId, t0, t0RMS, DTTimeUnits::counts) ;
648  tdcTime += int(round(t0));
649  }
650 
651 
652 
653  // Fill Time-Boxes
654  // NOTE: avoid to fill TB and PhotoPeak with noise. Occupancy are filled anyway
655  if (( !isNoisy ) && (!isSyncNoisy)) { // Discard noisy channels
656  // TimeBoxes per SL
657  histoTag = "TimeBox" + triggerSource();
658  if (digiHistos[histoTag].find(indexSL) == digiHistos[histoTag].end())
659  bookHistos( dtSLId, string("TimeBoxes"), histoTag );
660  (digiHistos.find(histoTag)->second).find(indexSL)->second->Fill(tdcTime);
661  if(doLayerTimeBoxes)
662  (digiHistos.find(histoTag)->second).find((*dtLayerId_It).first.rawId())->second->Fill(tdcTime);
663  // FIXME: remove the time distribution for the after-pulses
664  // 2nd - 1st (CathodPhotoPeak) per SL
665  // if ( (*digiIt).number() == 1 ) {
666 
667  // DTDigiCollection::const_iterator firstDigiIt = digiIt;
668  // firstDigiIt--;
669 
670  // histoTag = "CathodPhotoPeak";
671  // if (digiHistos[histoTag].find(indexSL) == digiHistos[histoTag].end())
672  // bookHistos( dtSLId, string("CathodPhotoPeaks"), histoTag );
673  // (digiHistos.find(histoTag)->second).find(indexSL)->second->Fill((*digiIt).countsTDC()-
674  // (*firstDigiIt).countsTDC());
675  // }
676  }
677 
678  // Fill Occupancies
679  if (!isSyncNoisy) { // Discard synch noisy channels
680 
681  if (doAllHitsOccupancies) { // fill occupancies for all hits
682  //Occupancies per chamber & layer
683  histoTag = "OccupancyAllHits_perCh";
684  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
685  digiHistos[histoTag].find(indexCh);
686  if (mappedHisto == digiHistos[histoTag].end()) { // dynamic booking
687  bookHistos(dtChId, string("Occupancies"), histoTag);
688  mappedHisto = digiHistos[histoTag].find(indexCh);
689  }
690  mappedHisto->second->Fill((*digiIt).wire(),(layer_number+(superlayer_number-1)*4)-1);
691 
692 
693  // Fill the chamber occupancy
694  histoTag = "OccupancyAllHits";
695  map<int, MonitorElement*>::const_iterator histoPerWheel =
696  wheelHistos[histoTag].find(dtChId.wheel());
697  if(histoPerWheel == wheelHistos[histoTag].end()) { // dynamic booking
698  bookHistos(dtChId.wheel(), string("Occupancies"), histoTag);
699  histoPerWheel = wheelHistos[histoTag].find(dtChId.wheel());
700  }
701  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
702 
703 
704  }
705 
706  if(doNoiseOccupancies) { // fill occupancies for hits before the ttrig
707  if (tdcTime < inTimeHitsLowerBoundCorr ) {
708  // FIXME: what about tdcTime > inTimeHitsUpperBoundCorr ???
709 
710  // Noise: Before tTrig
711  //Occupancies Noise per chamber & layer
712  histoTag = "OccupancyNoise_perCh";
713  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
714  digiHistos[histoTag].find(indexCh);
715  if(mappedHisto == digiHistos[histoTag].end()) {
716  bookHistos(dtChId, string("Occupancies"), histoTag);
717  mappedHisto = digiHistos[histoTag].find(indexCh);
718  }
719  mappedHisto->second->Fill((*digiIt).wire(),
720  (layer_number+(superlayer_number-1)*4)-1);
721 
722  // Fill the chamber occupancy
723  histoTag = "OccupancyNoise";
724  map<int, MonitorElement*>::const_iterator histoPerWheel =
725  wheelHistos[histoTag].find(dtChId.wheel());
726  if(histoPerWheel == wheelHistos[histoTag].end()) { // dynamic booking
727  bookHistos(dtChId.wheel(), string("Occupancies"), histoTag);
728  histoPerWheel = wheelHistos[histoTag].find(dtChId.wheel());
729  }
730  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
731 
732  }
733  }
734 
735  if(doInTimeOccupancies) { // fill occpunacies for in-time hits only
736  if (tdcTime > inTimeHitsLowerBoundCorr && tdcTime < inTimeHitsUpperBoundCorr) {
737  // Physical hits: within the time window
738 
739  //Occupancies Signal per chamber & layer
740  histoTag = "OccupancyInTimeHits_perCh";
741  map<uint32_t, MonitorElement*>::const_iterator mappedHisto =
742  digiHistos[histoTag].find(indexCh);
743  if(mappedHisto == digiHistos[histoTag].end()) {
744  bookHistos(dtChId, string("Occupancies"), histoTag);
745  mappedHisto = digiHistos[histoTag].find(indexCh);
746  }
747  mappedHisto->second->Fill((*digiIt).wire(),
748  (layer_number+(superlayer_number-1)*4)-1);
749 
750  // Fill the chamber occupancy
751  histoTag = "OccupancyInTimeHits";
752  map<int, MonitorElement*>::const_iterator histoPerWheel =
753  wheelHistos[histoTag].find(dtChId.wheel());
754  if(histoPerWheel == wheelHistos[histoTag].end()) { // dynamic booking
755  bookHistos(dtChId.wheel(), string("Occupancies"), histoTag);
756  histoPerWheel = wheelHistos[histoTag].find(dtChId.wheel());
757  }
758  histoPerWheel->second->Fill(dtChId.sector(),dtChId.station()); // FIXME: normalize to # of layers
759 
760  }
761  }
762  }
763  }
764  }
765 
766  syncNoisyChambers.clear();
767 }
bool doLayerTimeBoxes
Definition: DTDigiTask.h:153
bool filterSyncNoise
Definition: DTDigiTask.h:151
DTChamberId chamberId() const
Return the corresponding ChamberId.
bool readTTrigDB
Definition: DTDigiTask.h:124
bool lookForSyncNoise
Definition: DTDigiTask.h:150
float kFactor
Definition: DTDigiTask.h:96
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:113
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:137
bool isLocalRun
Definition: DTDigiTask.h:133
edm::ESHandle< DTT0 > t0Map
Definition: DTDigiTask.h:114
bool doInTimeOccupancies
Definition: DTDigiTask.h:147
bool doNoiseOccupancies
Definition: DTDigiTask.h:146
std::map< std::string, std::map< int, MonitorElement * > > wheelHistos
Definition: DTDigiTask.h:117
int nevents
Definition: DTDigiTask.h:87
#define end
Definition: vmac.h:38
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:142
#define LogTrace(id)
int defaultTTrig
Definition: DTDigiTask.h:139
float tTrig
tTrig from the DB
Definition: DTDigiTask.h:94
int tMax
no needs to be precise. Value from PSets will always be used
Definition: DTDigiTask.h:90
int superlayer() const
Return the superlayer number (deprecated method name)
bool doAllHitsOccupancies
Definition: DTDigiTask.h:145
int maxTDCHits
Definition: DTDigiTask.h:91
bool subtractT0
Definition: DTDigiTask.h:126
const T & get() const
Definition: EventSetup.h:55
std::vector< DigiType >::const_iterator const_iterator
std::set< DTChamberId > syncNoisyChambers
Definition: DTDigiTask.h:102
int syncNumTot
Definition: DTDigiTask.h:103
MonitorElement * nEventMonitor
Definition: DTDigiTask.h:156
int inTimeHitsLowerBound
Definition: DTDigiTask.h:141
float tTrigRMS
Definition: DTDigiTask.h:95
int sector() const
Definition: DTChamberId.h:63
std::map< DTChamberId, int > hitMap
Definition: DTDigiTask.h:101
int station() const
Return the station number.
Definition: DTChamberId.h:53
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:116
edm::InputTag dtDigiLabel
Definition: DTDigiTask.h:122
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
std::string triggerSource()
get the L1A source
Definition: DTDigiTask.cc:770
edm::Handle< LTCDigiCollection > ltcdigis
Definition: DTDigiTask.h:106
void DTDigiTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file DTDigiTask.cc.

References LogTrace, and nevents.

119  {
120  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") <<"[DTDigiTask]: BeginJob"<<endl;
121 
122  nevents = 0;
123 }
int nevents
Definition: DTDigiTask.h:87
#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 201 of file DTDigiTask.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file DTDigiTask.cc.

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

126  {
127  LogTrace("DTDQM|DTMonitorModule|DTDigiTask") << "[DTDigiTask]: begin run" << endl;
128 
129  // Get the geometry
130  context.get<MuonGeometryRecord>().get(muonGeom);
131 
132  // map of the channels
133  context.get<DTReadOutMappingRcd>().get(mapping);
134 
135  // tTrig
136  if (readTTrigDB)
137  context.get<DTTtrigRcd>().get(tTrigMap);
138  // t0s
139  if (subtractT0)
140  context.get<DTT0Rcd>().get(t0Map);
141  // FIXME: tMax (not yet from the DB)
142  tMax = defaultTmax;
143 
144  // ----------------------------------------------------------------------
145  if(doStaticBooking) { // Static histo booking
146  // book the event counter
147  dbe->setCurrentFolder("DT/EventInfo/Counters");
148  nEventMonitor = dbe->bookFloat(tpMode ? "nProcessedEventsDigiTP" : "nProcessedEventsDigi" );
150  for(int wh = -2; wh <= 2; ++wh) { // loop over wheels
151  if(doAllHitsOccupancies) bookHistos(wh,string("Occupancies"),"OccupancyAllHits");
152  if(doNoiseOccupancies) bookHistos(wh,string("Occupancies"),"OccupancyNoiseHits");
153  if(doInTimeOccupancies) bookHistos(wh,string("Occupancies"),"OccupancyInTimeHits");
154 
156  bookHistos(wh,string("SynchNoise"),"SyncNoiseEvents");
157  bookHistos(wh,string("SynchNoise"),"SyncNoiseChambs");
158  }
159 
160  for(int st = 1; st <= 4; ++st) { // loop over stations
161  for(int sect = 1; sect <= 14; ++sect) { // loop over sectors
162  if((sect == 13 || sect == 14) && st != 4) continue;
163  // Get the chamber ID
164  const DTChamberId dtChId(wh,st,sect);
165 
166  // Occupancies
167  if (doAllHitsOccupancies) {
168  bookHistos(dtChId,string("Occupancies"),"OccupancyAllHits_perCh");
169  // set channel mapping
170  channelsMap(dtChId, "OccupancyAllHits_perCh");
171  }
172  if(doNoiseOccupancies)
173  bookHistos(dtChId,string("Occupancies"),"OccupancyNoise_perCh");
175  bookHistos(dtChId,string("Occupancies"),"OccupancyInTimeHits_perCh");
176 
177 
178 
179 
180  for(int sl = 1; sl <= 3; ++sl) { // Loop over SLs
181  if(st == 4 && sl == 2) continue;
182  const DTSuperLayerId dtSLId(wh,st,sect,sl);
183  if(isLocalRun) {
184  bookHistos(dtSLId,string("TimeBoxes"),"TimeBox");
185  } else {
186  // TimeBoxes for different triggers
187  bookHistos(dtSLId,string("TimeBoxes"),"TimeBoxDTonly");
188  bookHistos(dtSLId,string("TimeBoxes"),"TimeBoxNoDT");
189  bookHistos(dtSLId,string("TimeBoxes"),"TimeBoxDTalso");
190  }
191  }
192  }
193  }
194  }
195  }
196 }
int defaultTmax
Definition: DTDigiTask.h:128
bool doStaticBooking
Definition: DTDigiTask.h:131
void channelsMap(const DTChamberId &dtCh, std::string histoTag)
To map real channels.
Definition: DTDigiTask.cc:820
bool tpMode
Definition: DTDigiTask.h:149
bool filterSyncNoise
Definition: DTDigiTask.h:151
std::string topFolder() const
Definition: DTDigiTask.cc:794
bool readTTrigDB
Definition: DTDigiTask.h:124
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDigiTask.h:111
bool lookForSyncNoise
Definition: DTDigiTask.h:150
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTDigiTask.h:113
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void bookHistos(const DTSuperLayerId &dtSL, std::string folder, std::string histoTag)
Book the ME.
bool isLocalRun
Definition: DTDigiTask.h:133
edm::ESHandle< DTT0 > t0Map
Definition: DTDigiTask.h:114
bool doInTimeOccupancies
Definition: DTDigiTask.h:147
bool doNoiseOccupancies
Definition: DTDigiTask.h:146
edm::ESHandle< DTGeometry > muonGeom
Definition: DTDigiTask.h:110
DQMStore * dbe
Definition: DTDigiTask.h:108
#define LogTrace(id)
int tMax
no needs to be precise. Value from PSets will always be used
Definition: DTDigiTask.h:90
bool doAllHitsOccupancies
Definition: DTDigiTask.h:145
bool subtractT0
Definition: DTDigiTask.h:126
const T & get() const
Definition: EventSetup.h:55
Definition: DTT0Rcd.h:9
MonitorElement * nEventMonitor
Definition: DTDigiTask.h:156
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
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::channelsMap ( const DTChamberId dtCh,
std::string  histoTag 
)
protected

To map real channels.

Definition at line 820 of file DTDigiTask.cc.

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

820  {
821 
822  // n max channels
823  int nWires_max = (digiHistos[histoTag])[dtCh.rawId()] -> getNbinsX();
824 
825  // set bin content = -1 for each not real channel. For visualization purposes
826  for(int sl=1; sl<=3; sl++) {
827  for(int ly=1; ly<=4; ly++) {
828  for(int ch=1; ch<=nWires_max; ch++) {
829 
830  int dduId = -1, rosId = -1, robId = -1, tdcId = -1, channelId = -1;
831  int realCh = mapping->geometryToReadOut(dtCh.wheel(),dtCh.station(),dtCh.sector(),sl,ly,ch,dduId,rosId,robId,tdcId,channelId);
832 
833  // realCh = 0 if the channel exists, while realCh = 1 if it does not exist
834  if( realCh ) {
835 
836  int lybin = (4*sl - 4) + ly;
837  (digiHistos[histoTag])[dtCh.rawId()] -> setBinContent(ch,lybin,-1.);
838 
839  }
840 
841  }
842  }
843  }
844 
845 }
edm::ESHandle< DTReadOutMapping > mapping
Definition: DTDigiTask.h:111
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
std::map< std::string, std::map< uint32_t, MonitorElement * > > digiHistos
Definition: DTDigiTask.h:116
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
void DTDigiTask::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 111 of file DTDigiTask.cc.

References LogTrace.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 804 of file DTDigiTask.cc.

804  {
805 
806  // To be used for ratio plots not used right now
807  // Update all histos for SynchNoise if needed
808  // if(lookForSyncNoise || filterSyncNoise) {
809  // //loop over chambers with synch noise events and update their entries in the histos
810  // for(map<DTChamberId, int>::const_iterator nEvPerch = nSynchNoiseEvents.begin();
811  // nEvPerch != nSynchNoiseEvents.end(); ++nEvPerch) {
812  // DTChamberId chId = (*nEvPerch).first;
813  // wheelHistos["SyncNoiseEvents"][chId.wheel()]->setBinContent(chId.sector(),chId.station(),
814  // (double)nSynchNoiseEvents[chId]/(double)nevents);
815  // }
816  // }
817 
818 }
string DTDigiTask::topFolder ( ) const
private

Definition at line 794 of file DTDigiTask.cc.

794  {
795 
796  if(tpMode) return string("DT/10-TestPulses/");
797  return string("DT/01-Digi/");
798 
799 }
bool tpMode
Definition: DTDigiTask.h:149
string DTDigiTask::triggerSource ( )
protected

get the L1A source

Definition at line 770 of file DTDigiTask.cc.

770  {
771 
772  string l1ASource;
773  if (isLocalRun)
774  return l1ASource;
775 
776  for (std::vector<LTCDigi>::const_iterator ltc_it = ltcdigis->begin(); ltc_it != ltcdigis->end(); ltc_it++){
777  size_t otherTriggerSum=0;
778  for (size_t i = 1; i < 6; i++)
779  otherTriggerSum += size_t((*ltc_it).HasTriggered(i));
780 
781  if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
782  l1ASource = "DTonly";
783  else if (!(*ltc_it).HasTriggered(0))
784  l1ASource = "NoDT";
785  else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
786  l1ASource = "DTalso";
787  }
788 
789  return l1ASource;
790 
791 }
int i
Definition: DBlmapReader.cc:9
bool isLocalRun
Definition: DTDigiTask.h:133
edm::Handle< LTCDigiCollection > ltcdigis
Definition: DTDigiTask.h:106

Member Data Documentation

bool DTDigiTask::checkNoisyChannels
private

Definition at line 137 of file DTDigiTask.h.

DQMStore* DTDigiTask::dbe
private

Definition at line 108 of file DTDigiTask.h.

int DTDigiTask::defaultTmax
private

Definition at line 128 of file DTDigiTask.h.

int DTDigiTask::defaultTTrig
private

Definition at line 139 of file DTDigiTask.h.

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

Definition at line 116 of file DTDigiTask.h.

bool DTDigiTask::doAllHitsOccupancies
private

Definition at line 145 of file DTDigiTask.h.

bool DTDigiTask::doInTimeOccupancies
private

Definition at line 147 of file DTDigiTask.h.

bool DTDigiTask::doLayerTimeBoxes
private

Definition at line 153 of file DTDigiTask.h.

bool DTDigiTask::doNoiseOccupancies
private

Definition at line 146 of file DTDigiTask.h.

bool DTDigiTask::doStaticBooking
private

Definition at line 131 of file DTDigiTask.h.

edm::InputTag DTDigiTask::dtDigiLabel
private

Definition at line 122 of file DTDigiTask.h.

bool DTDigiTask::filterSyncNoise
private

Definition at line 151 of file DTDigiTask.h.

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

Definition at line 101 of file DTDigiTask.h.

int DTDigiTask::inTimeHitsLowerBound
private

Definition at line 141 of file DTDigiTask.h.

int DTDigiTask::inTimeHitsUpperBound
private

Definition at line 142 of file DTDigiTask.h.

bool DTDigiTask::isLocalRun
private

Definition at line 133 of file DTDigiTask.h.

float DTDigiTask::kFactor
private

Definition at line 96 of file DTDigiTask.h.

bool DTDigiTask::lookForSyncNoise
private

Definition at line 150 of file DTDigiTask.h.

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

Definition at line 106 of file DTDigiTask.h.

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

Definition at line 111 of file DTDigiTask.h.

int DTDigiTask::maxTDCCounts
private

Definition at line 144 of file DTDigiTask.h.

int DTDigiTask::maxTDCHits
private

Definition at line 91 of file DTDigiTask.h.

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

Definition at line 110 of file DTDigiTask.h.

MonitorElement* DTDigiTask::nEventMonitor
private

Definition at line 156 of file DTDigiTask.h.

int DTDigiTask::nevents
private

Definition at line 87 of file DTDigiTask.h.

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

Definition at line 155 of file DTDigiTask.h.

bool DTDigiTask::readTTrigDB
private

Definition at line 124 of file DTDigiTask.h.

int DTDigiTask::resetCycle
private

Definition at line 135 of file DTDigiTask.h.

bool DTDigiTask::subtractT0
private

Definition at line 126 of file DTDigiTask.h.

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

Definition at line 102 of file DTDigiTask.h.

int DTDigiTask::syncNum
private

Definition at line 104 of file DTDigiTask.h.

int DTDigiTask::syncNumTot
private

Definition at line 103 of file DTDigiTask.h.

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

Definition at line 114 of file DTDigiTask.h.

int DTDigiTask::timeBoxGranularity
private

Definition at line 143 of file DTDigiTask.h.

int DTDigiTask::tMax
private

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

Definition at line 90 of file DTDigiTask.h.

bool DTDigiTask::tpMode
private

Definition at line 149 of file DTDigiTask.h.

float DTDigiTask::tTrig
private

tTrig from the DB

Definition at line 94 of file DTDigiTask.h.

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

Definition at line 113 of file DTDigiTask.h.

float DTDigiTask::tTrigRMS
private

Definition at line 95 of file DTDigiTask.h.

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

Definition at line 117 of file DTDigiTask.h.