23 debug =
pset.getUntrackedParameter<
bool>(
"debug",
false);
25 dtDigiToken_ = consumes<DTDigiCollection>(
edm::InputTag(
pset.getParameter<
string>(
"digiLabel")));
27 recHits4DToken_ = consumes<DTRecSegment4DCollection>(
edm::InputTag(
pset.getParameter<
string>(
"recHits4DLabel")));
29 recHitToken_ = consumes<DTRecHitCollection>(
edm::InputTag(
pset.getParameter<
string>(
"recHitLabel")));
42 string station_s = to_string(
station);
44 string wheel_s = to_string(
wheel);
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;
56 string station_s = to_string(
station);
58 string wheel_s = to_string(
wheel);
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;
70 timeBoxesPerEvent = ibooker.
book1D(
"timeBoxesPerEvent",
"TDC counts per event", 400, 0, 1600);
73 digisPerEvent = ibooker.
book1D(
"digisPerEvent",
"Number of digis per event", 100, 0, 900);
76 recHitsPerEvent = ibooker.
book1D(
"recHitsPerEvent",
"Number of RecHits per event", 100, 0, 250);
79 segments4DPerEvent = ibooker.
book1D(
"segments4DPerEvent",
"Number of 4D Segments per event", 50, 0, 50);
81 recHitsPer4DSegment = ibooker.
book1D(
"recHitsPer4DSegment",
"Number of RecHits per segment", 16, 0.5, 16.5);
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);
90 cout <<
"[DTOccupancyEfficiency] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event() << endl;
94 event.getByToken(dtDigiToken_, dtdigis);
96 int numberOfDigis = 0;
97 std::map<int, std::map<int, int>> numberOfDigisPerRing;
100 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
102 digiIt != ((*dtLayerId_It).second).
second;
105 int wheelId = ((*dtLayerId_It).first).
wheel();
106 int stationId = ((*dtLayerId_It).first).
station();
107 (numberOfDigisPerRing[stationId])[wheelId] += 1;
109 timeBoxesPerEvent->Fill((*digiIt).countsTDC());
110 (timeBoxesPerRing[stationId])[wheelId]->
Fill((*digiIt).countsTDC());
115 digisPerEvent->Fill(numberOfDigis);
124 event.getByToken(recHits4DToken_, all4DSegments);
126 segments4DPerEvent->Fill(all4DSegments->size());
130 event.getByToken(recHitToken_, dtRecHits);
132 recHitsPerEvent->Fill(dtRecHits->size());
138 unsigned int nHits = (segment->hasPhi() ? (segment->phiSegment())->
recHits().size() : 0);
139 nHits += (segment->hasZed() ? (segment->zSegment())->
recHits().size() : 0);
140 recHitsPer4DSegment->Fill(nHits);
142 if (segment->hasPhi()) {
143 double segmentPhiT0 = segment->phiSegment()->t0();
144 if (segment->phiSegment()->ist0Valid())
145 t0From4DPhiSegment->Fill(segmentPhiT0);
147 if (segment->hasZed()) {
148 double segmentZT0 = segment->zSegment()->t0();
149 if (segment->zSegment()->ist0Valid())
150 t0From4DZSegment->Fill(segmentZT0);