CMS 3D CMS Logo

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

#include <DTOccupancyEfficiency.h>

Inheritance diagram for DTOccupancyEfficiency:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
 DTOccupancyEfficiency (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTOccupancyEfficiency () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

bool debug
 
MonitorElementdigisPerEvent
 
std::map< int, std::map< int, MonitorElement * > > digisPerRing
 
edm::EDGetTokenT< DTDigiCollectiondtDigiToken_
 
edm::ParameterSet parameters
 
edm::EDGetTokenT< DTRecSegment4DCollectionrecHits4DToken_
 
MonitorElementrecHitsPer4DSegment
 
MonitorElementrecHitsPerEvent
 
edm::EDGetTokenT< DTRecHitCollectionrecHitToken_
 
MonitorElementsegments4DPerEvent
 
MonitorElementt0From4DPhiSegment
 
MonitorElementt0From4DZSegment
 
MonitorElementtimeBoxesPerEvent
 
std::map< int, std::map< int, MonitorElement * > > timeBoxesPerRing
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

DQM Analysis of 4D DT segments, DTdigis and DTRecHits :

Definition at line 25 of file DTOccupancyEfficiency.h.

Constructor & Destructor Documentation

◆ DTOccupancyEfficiency()

DTOccupancyEfficiency::DTOccupancyEfficiency ( const edm::ParameterSet pset)

Constructor.

Definition at line 22 of file DTOccupancyEfficiency.cc.

22  {
23  debug = pset.getUntrackedParameter<bool>("debug", false);
24  // label for dtDigis
25  dtDigiToken_ = consumes<DTDigiCollection>(edm::InputTag(pset.getParameter<string>("digiLabel")));
26  // the name of the 4D rec hits collection
27  recHits4DToken_ = consumes<DTRecSegment4DCollection>(edm::InputTag(pset.getParameter<string>("recHits4DLabel")));
28  // the name of the rechits collection
29  recHitToken_ = consumes<DTRecHitCollection>(edm::InputTag(pset.getParameter<string>("recHitLabel")));
30 
31  parameters = pset;
32 }

References debug, and muonDTDigis_cfi::pset.

◆ ~DTOccupancyEfficiency()

DTOccupancyEfficiency::~DTOccupancyEfficiency ( )
override

Destructor.

Definition at line 34 of file DTOccupancyEfficiency.cc.

34 {}

Member Function Documentation

◆ analyze()

void DTOccupancyEfficiency::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 88 of file DTOccupancyEfficiency.cc.

88  {
89  if (debug)
90  cout << "[DTOccupancyEfficiency] Analyze #Run: " << event.id().run() << " #Event: " << event.id().event() << endl;
91 
92  // Digi collection
94  event.getByToken(dtDigiToken_, dtdigis);
95 
96  int numberOfDigis = 0;
97  std::map<int, std::map<int, int>> numberOfDigisPerRing;
98 
100  for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) { // Loop over layers
101  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
102  digiIt != ((*dtLayerId_It).second).second;
103  ++digiIt) {
104  numberOfDigis++;
105  int wheelId = ((*dtLayerId_It).first).wheel();
106  int stationId = ((*dtLayerId_It).first).station();
107  (numberOfDigisPerRing[stationId])[wheelId] += 1;
108 
109  timeBoxesPerEvent->Fill((*digiIt).countsTDC());
110  (timeBoxesPerRing[stationId])[wheelId]->Fill((*digiIt).countsTDC());
111  }
112  }
113 
114  // Total number of Digis per Event
115  digisPerEvent->Fill(numberOfDigis);
116 
117  // Digis per Ring in every wheel
118  for (int station = 1; station < 5; station++)
119  for (int wheel = -2; wheel < 3; wheel++)
120  (digisPerRing[station])[wheel]->Fill((numberOfDigisPerRing[station])[wheel]);
121 
122  // Get the 4D segment collection from the event
124  event.getByToken(recHits4DToken_, all4DSegments);
125 
126  segments4DPerEvent->Fill(all4DSegments->size());
127 
128  // Get the rechit collection from the event
129  Handle<DTRecHitCollection> dtRecHits;
130  event.getByToken(recHitToken_, dtRecHits);
131 
132  recHitsPerEvent->Fill(dtRecHits->size());
133 
134  // Number of RecHits per segment and t0 from Segment
135  // Loop on all segments
136  for (DTRecSegment4DCollection::const_iterator segment = all4DSegments->begin(); segment != all4DSegments->end();
137  ++segment) {
138  unsigned int nHits = (segment->hasPhi() ? (segment->phiSegment())->recHits().size() : 0);
139  nHits += (segment->hasZed() ? (segment->zSegment())->recHits().size() : 0);
140  recHitsPer4DSegment->Fill(nHits);
141 
142  if (segment->hasPhi()) {
143  double segmentPhiT0 = segment->phiSegment()->t0();
144  if (segment->phiSegment()->ist0Valid())
145  t0From4DPhiSegment->Fill(segmentPhiT0);
146  }
147  if (segment->hasZed()) {
148  double segmentZT0 = segment->zSegment()->t0();
149  if (segment->zSegment()->ist0Valid())
150  t0From4DZSegment->Fill(segmentZT0);
151  }
152  }
153 }

References gather_cfg::cout, debug, HcalObjRepresent::Fill(), FastTrackerRecHitMaskProducer_cfi::recHits, edm::second(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

◆ bookHistograms()

void DTOccupancyEfficiency::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 36 of file DTOccupancyEfficiency.cc.

38  {
39  ibooker.setCurrentFolder("DT/04-OccupancyEfficiency/digisPerRing");
40  // Digis per ring
41  for (int station = 1; station < 5; station++) {
42  string station_s = to_string(station);
43  for (int wheel = -2; wheel < 3; wheel++) {
44  string wheel_s = to_string(wheel);
45  if (wheel > 0)
46  wheel_s = "+" + wheel_s;
47  string histoName = "digisPerMB" + station_s + "W" + wheel_s;
48  string histoTitle = "Number of digis in MB" + station_s + "YB" + wheel_s;
49  (digisPerRing[station])[wheel] = ibooker.book1D(histoName, histoTitle, 100, 0, 150);
50  }
51  }
52 
53  ibooker.setCurrentFolder("DT/04-OccupancyEfficiency/timeBoxesPerRing");
54  // TimeBoxes per ring
55  for (int station = 1; station < 5; station++) {
56  string station_s = to_string(station);
57  for (int wheel = -2; wheel < 3; wheel++) {
58  string wheel_s = to_string(wheel);
59  if (wheel > 0)
60  wheel_s = "+" + wheel_s;
61  string histoName = "timeBoxesPerMB" + station_s + "W" + wheel_s;
62  string histoTitle = "Number of TDC counts in MB" + station_s + "YB" + wheel_s;
63  (timeBoxesPerRing[station])[wheel] = ibooker.book1D(histoName, histoTitle, 400, 0, 1600);
64  }
65  }
66 
67  ibooker.setCurrentFolder("DT/04-OccupancyEfficiency");
68 
69  // TimeBoxes
70  timeBoxesPerEvent = ibooker.book1D("timeBoxesPerEvent", "TDC counts per event", 400, 0, 1600);
71 
72  // Digis
73  digisPerEvent = ibooker.book1D("digisPerEvent", "Number of digis per event", 100, 0, 900);
74 
75  // RecHits
76  recHitsPerEvent = ibooker.book1D("recHitsPerEvent", "Number of RecHits per event", 100, 0, 250);
77 
78  // 4D segments
79  segments4DPerEvent = ibooker.book1D("segments4DPerEvent", "Number of 4D Segments per event", 50, 0, 50);
80 
81  recHitsPer4DSegment = ibooker.book1D("recHitsPer4DSegment", "Number of RecHits per segment", 16, 0.5, 16.5);
82 
83  // T0 from segements
84  t0From4DPhiSegment = ibooker.book1D("t0From4DPhiSegment", "T0 from 4D Phi segments", 100, -150, 150);
85  t0From4DZSegment = ibooker.book1D("t0From4DZSegment", "T0 from 4D Z segments", 100, -150, 150);
86 }

References dqm::implementation::IBooker::book1D(), HltBtagPostValidation_cff::histoName, dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Member Data Documentation

◆ debug

bool DTOccupancyEfficiency::debug
private

◆ digisPerEvent

MonitorElement* DTOccupancyEfficiency::digisPerEvent
private

Definition at line 56 of file DTOccupancyEfficiency.h.

◆ digisPerRing

std::map<int, std::map<int, MonitorElement*> > DTOccupancyEfficiency::digisPerRing
private

Definition at line 64 of file DTOccupancyEfficiency.h.

◆ dtDigiToken_

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

Definition at line 45 of file DTOccupancyEfficiency.h.

◆ parameters

edm::ParameterSet DTOccupancyEfficiency::parameters
private

Definition at line 53 of file DTOccupancyEfficiency.h.

◆ recHits4DToken_

edm::EDGetTokenT<DTRecSegment4DCollection> DTOccupancyEfficiency::recHits4DToken_
private

Definition at line 48 of file DTOccupancyEfficiency.h.

◆ recHitsPer4DSegment

MonitorElement* DTOccupancyEfficiency::recHitsPer4DSegment
private

Definition at line 59 of file DTOccupancyEfficiency.h.

◆ recHitsPerEvent

MonitorElement* DTOccupancyEfficiency::recHitsPerEvent
private

Definition at line 58 of file DTOccupancyEfficiency.h.

◆ recHitToken_

edm::EDGetTokenT<DTRecHitCollection> DTOccupancyEfficiency::recHitToken_
private

Definition at line 51 of file DTOccupancyEfficiency.h.

◆ segments4DPerEvent

MonitorElement* DTOccupancyEfficiency::segments4DPerEvent
private

Definition at line 57 of file DTOccupancyEfficiency.h.

◆ t0From4DPhiSegment

MonitorElement* DTOccupancyEfficiency::t0From4DPhiSegment
private

Definition at line 60 of file DTOccupancyEfficiency.h.

◆ t0From4DZSegment

MonitorElement* DTOccupancyEfficiency::t0From4DZSegment
private

Definition at line 61 of file DTOccupancyEfficiency.h.

◆ timeBoxesPerEvent

MonitorElement* DTOccupancyEfficiency::timeBoxesPerEvent
private

Definition at line 55 of file DTOccupancyEfficiency.h.

◆ timeBoxesPerRing

std::map<int, std::map<int, MonitorElement*> > DTOccupancyEfficiency::timeBoxesPerRing
private

Definition at line 63 of file DTOccupancyEfficiency.h.

DTOccupancyEfficiency::recHitToken_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
Definition: DTOccupancyEfficiency.h:51
DTOccupancyEfficiency::segments4DPerEvent
MonitorElement * segments4DPerEvent
Definition: DTOccupancyEfficiency.h:57
relativeConstraints.station
station
Definition: relativeConstraints.py:67
gather_cfg.cout
cout
Definition: gather_cfg.py:144
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DTOccupancyEfficiency::recHits4DToken_
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTOccupancyEfficiency.h:48
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DTOccupancyEfficiency::t0From4DZSegment
MonitorElement * t0From4DZSegment
Definition: DTOccupancyEfficiency.h:61
DTOccupancyEfficiency::digisPerRing
std::map< int, std::map< int, MonitorElement * > > digisPerRing
Definition: DTOccupancyEfficiency.h:64
edm::Handle< DTDigiCollection >
DTOccupancyEfficiency::dtDigiToken_
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTOccupancyEfficiency.h:45
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DTOccupancyEfficiency::t0From4DPhiSegment
MonitorElement * t0From4DPhiSegment
Definition: DTOccupancyEfficiency.h:60
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
DTOccupancyEfficiency::parameters
edm::ParameterSet parameters
Definition: DTOccupancyEfficiency.h:53
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
DTOccupancyEfficiency::timeBoxesPerEvent
MonitorElement * timeBoxesPerEvent
Definition: DTOccupancyEfficiency.h:55
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTOccupancyEfficiency::timeBoxesPerRing
std::map< int, std::map< int, MonitorElement * > > timeBoxesPerRing
Definition: DTOccupancyEfficiency.h:63
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
DTOccupancyEfficiency::recHitsPerEvent
MonitorElement * recHitsPerEvent
Definition: DTOccupancyEfficiency.h:58
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
DTOccupancyEfficiency::recHitsPer4DSegment
MonitorElement * recHitsPer4DSegment
Definition: DTOccupancyEfficiency.h:59
DigiContainerIterator
Definition: MuonDigiCollection.h:30
DTOccupancyEfficiency::digisPerEvent
MonitorElement * digisPerEvent
Definition: DTOccupancyEfficiency.h:56
DTOccupancyEfficiency::debug
bool debug
Definition: DTOccupancyEfficiency.h:42
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98