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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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.

References debug, HLT_2022v14_cff::InputTag, and muonDTDigis_cfi::pset.

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

◆ ~DTOccupancyEfficiency()

DTOccupancyEfficiency::~DTOccupancyEfficiency ( )
override

Destructor.

Definition at line 35 of file DTOccupancyEfficiency.cc.

35 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 89 of file DTOccupancyEfficiency.cc.

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

89  {
90  if (debug)
91  cout << "[DTOccupancyEfficiency] Analyze #Run: " << event.id().run() << " #Event: " << event.id().event() << endl;
92 
93  // Digi collection
95  event.getByToken(dtDigiToken_, dtdigis);
96 
97  int numberOfDigis = 0;
98  std::map<int, std::map<int, int>> numberOfDigisPerRing;
99 
101  for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) { // Loop over layers
102  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
103  digiIt != ((*dtLayerId_It).second).second;
104  ++digiIt) {
105  numberOfDigis++;
106  int wheelId = ((*dtLayerId_It).first).wheel();
107  int stationId = ((*dtLayerId_It).first).station();
108  (numberOfDigisPerRing[stationId])[wheelId] += 1;
109 
110  timeBoxesPerEvent->Fill((*digiIt).countsTDC());
111  (timeBoxesPerRing[stationId])[wheelId]->Fill((*digiIt).countsTDC());
112  }
113  }
114 
115  // Total number of Digis per Event
116  digisPerEvent->Fill(numberOfDigis);
117 
118  // Digis per Ring in every wheel
119  for (int station = 1; station < 5; station++)
120  for (int wheel = -2; wheel < 3; wheel++)
121  (digisPerRing[station])[wheel]->Fill((numberOfDigisPerRing[station])[wheel]);
122 
123  // Get the 4D segment collection from the event
125  event.getByToken(recHits4DToken_, all4DSegments);
126 
127  segments4DPerEvent->Fill(all4DSegments->size());
128 
129  // Get the rechit collection from the event
130  Handle<DTRecHitCollection> dtRecHits;
131  event.getByToken(recHitToken_, dtRecHits);
132 
133  recHitsPerEvent->Fill(dtRecHits->size());
134 
135  // Number of RecHits per segment and t0 from Segment
136  // Loop on all segments
137  for (DTRecSegment4DCollection::const_iterator segment = all4DSegments->begin(); segment != all4DSegments->end();
138  ++segment) {
139  unsigned int nHits = (segment->hasPhi() ? (segment->phiSegment())->recHits().size() : 0);
140  nHits += (segment->hasZed() ? (segment->zSegment())->recHits().size() : 0);
142 
143  if (segment->hasPhi()) {
144  double segmentPhiT0 = segment->phiSegment()->t0();
145  if (segment->phiSegment()->ist0Valid())
146  t0From4DPhiSegment->Fill(segmentPhiT0);
147  }
148  if (segment->hasZed()) {
149  double segmentZT0 = segment->zSegment()->t0();
150  if (segment->zSegment()->ist0Valid())
151  t0From4DZSegment->Fill(segmentZT0);
152  }
153  }
154 }
MonitorElement * timeBoxesPerEvent
std::map< int, std::map< int, MonitorElement * > > digisPerRing
MonitorElement * recHitsPer4DSegment
std::map< int, std::map< int, MonitorElement * > > timeBoxesPerRing
MonitorElement * t0From4DPhiSegment
void Fill(long long x)
U second(std::pair< T, U > const &p)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
MonitorElement * digisPerEvent
MonitorElement * recHitsPerEvent
std::vector< DigiType >::const_iterator const_iterator
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
MonitorElement * segments4DPerEvent
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
MonitorElement * t0From4DZSegment

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 37 of file DTOccupancyEfficiency.cc.

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

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

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.