@@ -11,23 +11,32 @@ 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 )) {}
15-
14+ verbose(ps.getUntrackedParameter<bool >(" verbose" , false )),
15+ isRun3(ps.getUntrackedParameter<bool >(" isRun3" , false )) {}
16+
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 == true ) {
25+ const std::array<std::string, 10 > binNamesErrors{
26+ {" Corruptions" , " FMM != Ready" , " BSY" , " OSY" , " WOF" }};
27+ for (unsigned int bin = 0 ; bin < binNamesErrors.size (); ++bin) {
28+ emtfErrors->setBinLabel (bin + 1 , binNamesErrors[bin], 1 );
29+ }
2930 }
30-
31+ if (isRun3 == false ) {
32+ const std::array<std::string, 10 > binNamesErrors{
33+ {" Corruptions" , " Synch. Err." , " Synch. Mod." , " BX Mismatch" , " Time Misalign" }};
34+ for (unsigned int bin = 0 ; bin < binNamesErrors.size (); ++bin) {
35+ emtfErrors->setBinLabel (bin + 1 , binNamesErrors[bin], 1 );
36+ }
37+ }
38+
39+
3140 // CSC LCT Monitor Elements
3241 int nChambs, nWires, nStrips; // Number of chambers, wiregroups, and halfstrips in each station/ring pair
3342 std::string name, label;
@@ -805,8 +814,11 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
805814 edm::Handle<l1t::EMTFDaqOutCollection> DaqOutCollection;
806815 e.getByToken (daqToken, DaqOutCollection);
807816
817+
808818 for (auto DaqOut = DaqOutCollection->begin (); DaqOut != DaqOutCollection->end (); ++DaqOut) {
809819 const l1t::emtf::MECollection* MECollection = DaqOut->PtrMECollection ();
820+ const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader ();
821+ if (isRun3==false ){
810822 for (auto ME = MECollection->begin (); ME != MECollection->end (); ++ME) {
811823 if (ME->SE ())
812824 emtfErrors->Fill (1 );
@@ -816,12 +828,18 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
816828 emtfErrors->Fill (3 );
817829 if (ME->AF ())
818830 emtfErrors->Fill (4 );
819- }
820-
821- const l1t::emtf::EventHeader* EventHeader = DaqOut-> PtrEventHeader ();
831+ }};
832+
833+ if (isRun3== true ){
822834 if (!EventHeader->Rdy ())
823- emtfErrors->Fill (5 );
824-
835+ emtfErrors->Fill (1 );
836+ if (EventHeader->BSY ())
837+ emtfErrors->Fill (2 );
838+ if (EventHeader->OSY ())
839+ emtfErrors->Fill (3 );
840+ if (EventHeader->WOF ())
841+ emtfErrors->Fill (4 );
842+ };
825843 // Fill MPC input link errors
826844 int offset = (EventHeader->Sector () - 1 ) * 9 ;
827845 int endcap = EventHeader->Endcap ();
0 commit comments