@@ -11,21 +11,27 @@ L1TStage2EMTF::L1TStage2EMTF(const edm::ParameterSet& ps)
1111 trackToken(consumes<l1t::EMTFTrackCollection>(ps.getParameter<edm::InputTag>(" emtfSource" ))),
1212 muonToken(consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>(" emtfSource" ))),
1313 monitorDir(ps.getUntrackedParameter<std::string>(" monitorDir" , " " )),
14- verbose(ps.getUntrackedParameter<bool >(" verbose" , false )) {}
14+ verbose(ps.getUntrackedParameter<bool >(" verbose" , false )),
15+ isRun3(ps.getUntrackedParameter<bool >(" isRun3" , false )) {}
1516
1617void L1TStage2EMTF::bookHistograms (DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) {
1718 // Monitor Dir
1819 ibooker.setCurrentFolder (monitorDir);
1920
20- const std::array<std::string, 6 > binNamesErrors{
21- {" Corruptions" , " Synch. Err." , " Synch. Mod." , " BX Mismatch" , " Time Misalign" , " FMM != Ready" }};
22-
23- // DAQ Output Monitor Elements
24- emtfErrors = ibooker.book1D (" emtfErrors" , " EMTF Errors" , 6 , 0 , 6 );
21+ emtfErrors = ibooker.book1D (" emtfErrors" , " EMTF Errors" , 5 , 0 , 5 );
2522 emtfErrors->setAxisTitle (" Error Type (Corruptions Not Implemented)" , 1 );
2623 emtfErrors->setAxisTitle (" Number of Errors" , 2 );
27- for (unsigned int bin = 0 ; bin < binNamesErrors.size (); ++bin) {
28- emtfErrors->setBinLabel (bin + 1 , binNamesErrors[bin], 1 );
24+ if (isRun3) {
25+ const std::array<std::string, 4 > binNamesErrors{{" FMM != Ready" , " BSY" , " OSY" , " WOF" }};
26+ for (unsigned int bin = 0 ; bin < binNamesErrors.size (); ++bin) {
27+ emtfErrors->setBinLabel (bin + 1 , binNamesErrors[bin], 1 );
28+ }
29+ } else {
30+ const std::array<std::string, 5 > binNamesErrors{
31+ {" Synch. Err." , " Synch. Mod." , " BX Mismatch" , " Time Misalign" , " FMM != Ready" }};
32+ for (unsigned int bin = 0 ; bin < binNamesErrors.size (); ++bin) {
33+ emtfErrors->setBinLabel (bin + 1 , binNamesErrors[bin], 1 );
34+ }
2935 }
3036
3137 // CSC LCT Monitor Elements
@@ -807,20 +813,30 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
807813
808814 for (auto DaqOut = DaqOutCollection->begin (); DaqOut != DaqOutCollection->end (); ++DaqOut) {
809815 const l1t::emtf::MECollection* MECollection = DaqOut->PtrMECollection ();
810- for (auto ME = MECollection->begin (); ME != MECollection->end (); ++ME) {
811- if (ME->SE ())
816+ const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader ();
817+ if (isRun3) {
818+ if (!EventHeader->Rdy ())
819+ emtfErrors->Fill (0 );
820+ if (EventHeader->BSY ())
812821 emtfErrors->Fill (1 );
813- if (ME-> SM ())
822+ if (EventHeader-> OSY ())
814823 emtfErrors->Fill (2 );
815- if (ME-> BXE ())
824+ if (EventHeader-> WOF ())
816825 emtfErrors->Fill (3 );
817- if (ME->AF ())
818- emtfErrors->Fill (4 );
819- }
820-
821- const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader ();
822- if (!EventHeader->Rdy ())
823- emtfErrors->Fill (5 );
826+ } else {
827+ for (auto ME = MECollection->begin (); ME != MECollection->end (); ++ME) {
828+ if (ME->SE ())
829+ emtfErrors->Fill (0 );
830+ if (ME->SM ())
831+ emtfErrors->Fill (1 );
832+ if (ME->BXE ())
833+ emtfErrors->Fill (2 );
834+ if (ME->AF ())
835+ emtfErrors->Fill (3 );
836+ if (!EventHeader->Rdy ())
837+ emtfErrors->Fill (4 );
838+ }
839+ };
824840
825841 // Fill MPC input link errors
826842 int offset = (EventHeader->Sector () - 1 ) * 9 ;
@@ -999,8 +1015,9 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
9991015 hist_index = (endcap > 0 ) ? 1 : 0 ;
10001016 // Added def of layer
10011017 int layer = Hit->Layer ();
1018+ int GEM_MAX_NROLL = 8 ;
10021019 int phi_part = Hit->Pad () / 64 ; // 0-2
1003- int vfat = phi_part * 8 + Hit->Partition ();
1020+ int vfat = phi_part * 8 - Hit->Partition () + GEM_MAX_NROLL ;
10041021 if (Hit->Neighbor () == false ) {
10051022 gemChamberPad[hist_index]->Fill (chamber, Hit->Pad ());
10061023 gemChamberPartition[hist_index]->Fill (chamber, Hit->Partition ());
0 commit comments