13 monitorDir(ps.getUntrackedParameter<
std::
string>(
"monitorDir",
"")),
26 const std::array<std::string, 6> binNamesErrors{{
"Corruptions",
"Synch. Err.",
"Synch. Mod.",
"BX Mismatch",
"Time Misalign",
"FMM != Ready"}};
32 for (
unsigned int bin = 0;
bin < binNamesErrors.size(); ++
bin) {
37 int nChambs, nWires, nStrips;
39 const std::array<std::string, 10> suffix_name{{
"42",
"41",
"32",
"31",
"22",
"21",
"13",
"12",
"11b",
"11a"}};
40 const std::array<std::string, 10> suffix_label{{
"4/2",
"4/1",
"3/2",
"3/1",
" 2/2",
"2/1",
"1/3",
"1/2",
"1/1b",
"1/1a"}};
41 const std::array<std::string, 12> binNames{{
"ME-N",
"ME-4",
"ME-3",
"ME-2",
"ME-1b",
"ME-1a",
"ME+1a",
"ME+1b",
"ME+2",
"ME+3",
"ME+4",
"ME+N"}};
43 cscLCTBX = ibooker.
book2D(
"cscLCTBX",
"CSC LCT BX", 7, -3, 4, 20, 0, 20);
45 for (
int xbin = 1, xbin_label = -3; xbin <= 7; ++xbin, ++xbin_label) {
48 for (
int ybin = 1; ybin <= 10; ++ybin) {
55 for (
int xbin = 1; xbin < 7; ++xbin) {
58 for (
unsigned int ybin = 0; ybin < binNames.size(); ++ybin) {
66 for (
int xbin=1; xbin < 43; ++xbin) {
68 if (xbin==2 || xbin==9 || xbin==16 || xbin==23 || xbin==30 ||xbin==37 ) {
74 for (
int ybin = 1; ybin <= 10; ++ybin) {
82 for (
int xbin = 1; xbin < 7; ++xbin) {
85 for (
unsigned int ybin = 0; ybin < binNames.size(); ++ybin) {
89 mpcLinkGood = ibooker.
book2D(
"mpcLinkGood",
"MPC Good Links", 54, 1, 55, 12, -6, 6);
91 for (
int xbin = 1; xbin < 7; ++xbin) {
94 for (
unsigned int ybin = 0; ybin < binNames.size(); ++ybin) {
99 const std::array<std::string, 6> rpc_name{{
"43",
"42",
"33",
"32",
"22",
"12"}};
100 const std::array<std::string, 6> rpc_label{{
"4/3",
"4/2",
"3/3",
"3/2",
"2/2",
"1/2"}};
102 rpcHitBX = ibooker.
book2D(
"rpcHitBX",
"RPC Hit BX", 7, -3, 4, 12, 0, 12);
104 for (
int xbin = 1, xbin_label = -3; xbin <= 7; ++xbin, ++xbin_label) {
107 for (
int ybin = 1; ybin <= 6; ++ybin) {
123 emtfnTracks = ibooker.
book1D(
"emtfnTracks",
"Number of EMTF Tracks per Event", 11, 0, 11);
124 for (
int xbin = 1; xbin <= 10; ++xbin) {
130 for (
int xbin = 1; xbin <= 5; ++xbin) {
134 emtfTrackBX = ibooker.
book2D(
"emtfTrackBX",
"EMTF Track Bunch Crossing", 12, -6, 6, 7, -3, 4);
136 for (
int xbin = 0; xbin < 6; ++xbin) {
141 for (
int ybin = 1,
i = -3; ybin <= 7; ++ybin, ++
i) {
154 emtfTrackOccupancy = ibooker.
book2D(
"emtfTrackOccupancy",
"EMTF Track Occupancy", 100, -2.5, 2.5, 126, -3.15, 3.15);
219 name =
"MENeg" + suffix_name[
i];
220 label =
"ME-" + suffix_label[
i];
222 name =
"MEPos" + suffix_name[9 -
i];
223 label =
"ME+" + suffix_label[9 -
i];
227 nChambs = (i % 2) ? 18 : 36;
228 }
else if (
hist >13) {
229 nChambs = (i % 2) ? 36 : 18;
234 const std::array<int, 10> wiregroups{{64, 96, 64, 96, 64, 112, 32, 64, 48, 48}};
235 const std::array<int, 10> halfstrips{{160, 160, 160, 160, 160, 160, 128, 160, 128, 96}};
238 nWires = wiregroups[
hist];
239 nStrips = halfstrips[
hist];
241 nWires = wiregroups[19 -
hist];
242 nStrips = halfstrips[19 -
hist];
245 cscLCTStrip[
hist] = ibooker.
book1D(
"cscLCTStrip" + name,
"CSC Halfstrip " + label, nStrips, 0, nStrips);
248 cscLCTWire[
hist] = ibooker.
book1D(
"cscLCTWire" + name,
"CSC Wiregroup " + label, nWires, 0, nWires);
251 cscChamberStrip[
hist] = ibooker.
book2D(
"cscChamberStrip" + name,
"CSC Halfstrip " + label, nChambs, 1, 1+nChambs, nStrips, 0, nStrips);
255 cscChamberWire[
hist] = ibooker.
book2D(
"cscChamberWire" + name,
"CSC Wiregroup " + label, nChambs, 1, 1+nChambs, nWires, 0, nWires);
259 for (
int bin = 1;
bin <= nChambs; ++
bin) {
270 name =
"RENeg" + rpc_name[
i];
271 label =
"RE-" + rpc_label[
i];
273 name =
"REPos" + rpc_name[5 -
i];
274 label =
"RE+" + rpc_label[5 -
i];
276 rpcHitPhi[
hist] = ibooker.
book1D(
"rpcHitPhi" + name,
"RPC Hit Phi " + label, 1250, 0, 1250);
280 rpcChamberPhi[
hist] = ibooker.
book2D(
"rpcChamberPhi" + name,
"RPC Chamber Phi " + label, 36, 1, 37, 1250, 0, 1250);
286 for (
int xbin = 1; xbin < 37; ++xbin) {
295 cscTimingTot = ibooker.
book2D(
"cscTimingTotal",
"CSC Total BX ", 42, 1, 43, 20, 0, 20);
300 const std::array<std::string, 5> nameBX{{
"BXNeg1",
"BXPos1",
"BXNeg2",
"BXPos2",
"BX0"}};
301 const std::array<std::string, 5> labelBX{{
"BX -1",
"BX +1",
"BX -2",
"BX +2",
"BX 0"}};
306 cscLCTTiming[
hist] = ibooker.
book2D(
"cscLCTTiming" + nameBX[
hist],
"CSC Chamber Occupancy " + labelBX[hist], 42, 1, 43, 20, 0, 20);
309 for (
int xbin=1; xbin < 43; ++xbin) {
312 if (xbin==2 || xbin==9 || xbin==16 || xbin==23 || xbin==30 ||xbin==37 ) {
320 for (
int ybin = 1; ybin <= 10; ++ybin) {
329 rpcHitTiming[
hist] = ibooker.
book2D(
"rpcHitTiming" + nameBX[hist],
"RPC Chamber Occupancy " + labelBX[hist], 42, 1, 43, 12, 0, 12);
350 cscLCTTimingFrac[
hist] = ibooker.
book2D(
"cscLCTTimingFrac" + nameBX[hist],
"CSC Chamber Occupancy " + labelBX[hist], 42, 1, 43, 20, 0, 20);
352 for (
int xbin=1; xbin < 43; ++xbin) {
354 if (xbin==2 || xbin==9 || xbin==16 || xbin==23 || xbin==30 || xbin==37 ) {
360 for (
int ybin = 1; ybin <= 10; ++ybin) {
366 rpcHitTimingFrac[
hist] = ibooker.
book2D(
"rpcHitTimingFrac" + nameBX[hist],
"RPC Chamber Fraction in " + labelBX[hist], 42, 1, 43, 12, 0, 12);
377 rpcHitTimingInTrack = ibooker.
book2D(
"rpcHitTimingInTrack",
"RPC Hit Timing (matched to track in BX 0)", 7, -3, 4, 12, 0, 12);
379 for (
int xbin = 1, xbin_label = -3; xbin <= 7; ++xbin, ++xbin_label) {
382 for (
int ybin = 1; ybin <= 6; ++ybin) {
387 const std::array<std::string, 3> nameNumStation{{
"4Station",
"3Station",
"2Station"}};
388 const std::array<std::string, 3> labelNumStation{{
"4 Station Track",
"3 Station Track",
"2 Station Track"}};
392 "EMTF " + labelNumStation[hist] +
" BX vs CSC LCT BX", 7, -3, 4, 7, -3, 4);
395 for (
int bin = 1, bin_label = -3;
bin <= 7; ++
bin, ++bin_label) {
400 "EMTF " + labelNumStation[hist] +
" BX vs RPC Hit BX", 7, -3, 4, 7, -3, 4);
403 for (
int bin = 1, bin_label = -3;
bin <= 7; ++
bin, ++bin_label) {
415 for (
int xbin = 1, bin_label = -3; xbin <= 7; ++xbin, ++bin_label) {
430 for (
int xbin = 1; xbin <= 16; ++xbin) {
437 int chamber_bin_index = 0;
438 if (station > 1 && (ring % 2) == 1) {
439 chamber_bin_index = (chamber * 2) + ((chamber + 1) / 3);
441 chamber_bin_index = chamber + ((chamber + 3) / 6);
443 return chamber_bin_index;
455 for (
auto DaqOut = DaqOutCollection->begin(); DaqOut != DaqOutCollection->end(); ++DaqOut ) {
457 for (
auto ME = MECollection->begin();
ME != MECollection->end(); ++
ME ) {
471 const std::array<std::array<int,9>,5> counters {{
478 for (
int i = 0;
i < 5;
i++) {
479 for (
int j = 0; j < 9; j++) {
480 if (counters.at(
i).at(j) != 0)
mpcLinkErrors->
Fill(j + 1 + offset, endcap * (
i + 0.5), counters.at(
i).at(j));
509 const std::map<std::pair<int,int>,
int> histIndexCSC = { {{1,4}, 9}, {{1,1}, 8}, {{1,2}, 7}, {{1,3}, 6},
510 {{2,1}, 5}, {{2,2}, 4},
511 {{3,1}, 3}, {{3,2}, 2},
512 {{4,1}, 1}, {{4,2}, 0} };
515 const std::map<std::pair<int, int>,
int> histIndexRPC = { {{4,3}, 0}, {{4,2}, 1}, {{3,3}, 2}, {{3,2}, 3}, {{2,2}, 4}, {{1,2}, 5} };
517 for (
auto Hit = HitCollection->begin();
Hit != HitCollection->end(); ++
Hit) {
519 int sector =
Hit->Sector();
522 int cscid =
Hit->CSC_ID();
525 int wire =
Hit->Wire();
526 int cscid_offset = (sector - 1) * 9;
529 if (ring == 4 && strip >= 128) strip -= 128;
531 if (
Hit->Is_CSC() ==
true) {
532 hist_index = histIndexCSC.at( {
station, ring} );
533 if (endcap > 0) hist_index = 19 - hist_index;
535 float evt_wgt = (
Hit->Station() > 1 &&
Hit->Ring() == 1) ? 0.5 : 1.0;
536 if (
Hit->Neighbor() ==
false) {
539 if (station>1 && (ring % 2)==1) {
546 if (
Hit->Subsector() == 1) {
553 int cscid_n = (station == 1 ? (cscid / 3) : (station * 2) + ((cscid - 3) / 6) );
556 if (
Hit->Neighbor() ==
true) {
561 if (
Hit->Is_RPC() ==
true) {
562 hist_index = histIndexRPC.at( {
station, ring} );
563 if (endcap > 0) hist_index = 11 - hist_index;
567 if (
Hit->Neighbor() ==
false) {
573 }
else if (
Hit->Neighbor() ==
true) {
583 int nTracks = TrackCollection->size();
587 for (
auto Track = TrackCollection->begin(); Track != TrackCollection->end(); ++Track) {
588 int endcap = Track->Endcap();
589 int sector = Track->Sector();
590 float eta = Track->Eta();
591 float phi_glob_rad = Track->Phi_glob() *
M_PI / 180.;
592 int mode = Track->Mode();
593 int quality = Track->GMT_quality();
594 int numHits = Track->NumHits();
595 int modeNeighbor = Track->Mode_neighbor();
596 int modeRPC = Track->Mode_RPC();
597 int singleMuQuality = 12;
601 if (modeNeighbor >= 2 && modeNeighbor != 4 && modeNeighbor != 8)
continue;
615 if (quality >= singleMuQuality) {
620 if (Track->Pt()>= singleMuPT) {
633 if (numHits < 2 || numHits > 4)
continue;
635 int numHitsInTrack_BX0 = 0;
636 unsigned int hist_index2 = 4 - numHits;
638 for (
const auto & iTrkHit: Track->Hits()) {
639 if (iTrkHit.Is_CSC() ==
true) {
642 else if (iTrkHit.Is_RPC() ==
true) {
648 if (numHits < 3)
continue;
649 for (
const auto & jTrkHit: Track->Hits()) {
650 if (jTrkHit.BX() == 0)
651 numHitsInTrack_BX0++;
653 if (numHitsInTrack_BX0 < numHits - 1)
continue;
655 for (
const auto & TrkHit: Track->Hits()) {
657 int trackHitBX = TrkHit.BX();
659 int ring = TrkHit.Ring();
660 int station = TrkHit.Station();
661 int sector = TrkHit.Sector();
662 int subsector = TrkHit.Subsector();
664 int neighbor = TrkHit.Neighbor();
665 int endcap = TrkHit.Endcap();
666 int chamber = TrkHit.Chamber();
669 float evt_wgt = (TrkHit.Station() > 1 && TrkHit.Ring() == 1) ? 0.5 : 1.0;
671 const std::map<int, int> histIndexBX = {{0, 4}, {-1, 0}, {1, 1}, {-2, 2}, {2, 3}};
672 if (
std::abs(trackHitBX) > 2)
continue;
674 if (TrkHit.Is_CSC() ==
true) {
675 hist_index = histIndexCSC.at( {
station, ring} );
676 if (endcap > 0) hist_index = 19 - hist_index;
677 if (neighbor ==
false) {
680 if (station>1 && (ring % 2)==1) {
688 cscLCTTiming[histIndexBX.at(trackHitBX)]->
Fill(sector*7-4,hist_index,evt_wgt);
693 if (trackHitBX == 0 && ring == 2) {
694 for (
auto Hit = HitCollection->begin();
Hit != HitCollection->end(); ++
Hit) {
695 if (
Hit->Is_RPC() ==
false || neighbor ==
true )
continue;
696 if (
std::abs(Track->Eta() -
Hit->Eta()) > 0.1 )
continue;
697 if (
Hit->Endcap() != endcap ||
698 Hit->Station() != station ||
702 hist_index = histIndexRPC.at( {
Hit->Station(),
Hit->Ring()} );
703 if (
Hit->Endcap() > 0) hist_index = 11 - hist_index;
712 const std::map<std::pair<int, int>,
int> histIndexRPC = { {{4,3}, 0}, {{4,2}, 1}, {{3,3}, 2}, {{3,2}, 3}, {{2,2}, 4}, {{1,2}, 5}};
714 if (TrkHit.Is_RPC() ==
true && neighbor ==
false) {
715 hist_index = histIndexRPC.at( {
station, ring} );
716 if (endcap > 0) hist_index = 11 - hist_index;
719 rpcHitTiming[histIndexBX.at(trackHitBX)]->
Fill((TrkHit.Sector_RPC() - 1) * 7 + subsector, hist_index + 0.5);
722 if (TrkHit.Is_RPC() ==
true && neighbor ==
true) {
723 hist_index = histIndexRPC.at( {
station, ring} );
724 if (endcap > 0) hist_index = 11 - hist_index;
725 rpcHitTiming[histIndexBX.at(trackHitBX)]->
Fill((TrkHit.Sector_RPC() - 1) * 7, hist_index + 0.5);
736 for (
int hist_index = 0; hist_index < 5; ++hist_index) {
745 for (
int itBX = MuonBxCollection->
getFirstBX(); itBX <= MuonBxCollection->
getLastBX(); ++itBX) {
MonitorElement * cscChamberWire[20]
MonitorElement * rpcHitTheta[12]
const_iterator end(int bx) const
const unsigned int nTracks(const reco::Vertex &sv)
MonitorElement * rpcChamberPhi[12]
MonitorElement * emtfTrackBXVsCSCLCT[3]
MonitorElement * cscTimingTot
MonitorElement * emtfMuonhwEta
edm::EDGetTokenT< l1t::EMTFHitCollection > hitToken
MonitorElement * rpcChamberTheta[12]
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * RPCvsEMTFTrackMode
MonitorElement * emtfTrackPhiHighQualityHighPT
MonitorElement * cscLCTBX
MonitorElement * mpcLinkGood
std::vector< Track > TrackCollection
collection of Tracks
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * cscLCTTimingFrac[5]
MonitorElement * rpcHitTimingFrac[5]
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
MonitorElement * mpcLinkErrors
MonitorElement * emtfMuonhwPhi
MonitorElement * cscChamberStrip[20]
l1t::EMTFTrackCollection EMTFTrackCollection
MonitorElement * rpcHitTimingTot
MonitorElement * emtfTrackPhi
MonitorElement * cscLCTTiming[5]
MonitorElement * emtfMuonBX
void setCurrentFolder(std::string const &fullpath)
MonitorElement * emtfTrackPtHighQuality
MonitorElement * emtfTrackQuality
MonitorElement * cscDQMOccupancy
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< ME > MECollection
MonitorElement * emtfTrackQualityVsMode
MonitorElement * emtfTrackOccupancyHighQualityHighPT
MonitorElement * emtfMuonhwPt
std::vector< EMTFHit > EMTFHitCollection
MonitorElement * book1D(Args &&...args)
std::vector< EMTFDaqOut > EMTFDaqOutCollection
Abs< T >::type abs(const T &t)
MonitorElement * cscLCTWire[20]
l1t::EMTFHitCollection EMTFHitCollection
MonitorElement * cscLCTOccupancy
edm::EDGetTokenT< l1t::EMTFTrackCollection > trackToken
MonitorElement * emtfTrackMode
SeedingHitSet::ConstRecHitPointer Hit
void analyze(const edm::Event &, const edm::EventSetup &) override
bin
set the eta bin as selection string.
BXVector< Muon > MuonBxCollection
MonitorElement * rpcHitTiming[5]
MonitorElement * cscLCTStrip[20]
MonitorElement * emtfTrackEtaHighQualityHighPT
MonitorElement * book2D(Args &&...args)
edm::EDGetTokenT< l1t::EMTFDaqOutCollection > daqToken
~L1TStage2EMTF() override
MonitorElement * emtfTrackBX
MonitorElement * rpcHitOccupancy
MonitorElement * emtfMuonhwQual
MonitorElement * emtfTrackPtHighQualityHighPT
MonitorElement * emtfErrors
MonitorElement * rpcHitPhi[12]
MonitorElement * emtfnTracks
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > muonToken
MonitorElement * emtfTrackOccupancy
MonitorElement * emtfTrackEta
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * emtfTrackEtaHighQuality
MonitorElement * emtfTrackBXVsRPCHit[3]
MonitorElement * emtfTracknHits
L1TStage2EMTF(const edm::ParameterSet &ps)
MonitorElement * emtfTrackPt
MonitorElement * rpcHitBX
const_iterator begin(int bx) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * emtfTrackPhiHighQuality
MonitorElement * rpcHitTimingInTrack
std::vector< RegionalMuonCand >::const_iterator const_iterator
int chamber_bin(int station, int ring, int chamber)
MonitorElement * emtfTrackOccupancyHighQuality