Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-10 01:53:46

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1Trigger/L1TGloba
0004 // Class:      L1TGlobalAnalyzer
0005 //
0006 /**\class L1TGlobalAnalyzer L1TGlobalAnalyzer.cc L1Trigger/L1TGlobal/plugins/L1TGlobalAnalyzer.cc
0007 
0008  Description: [one line class summary]
0009 
0010  Implementation:
0011      [Notes on implementation]
0012 */
0013 //
0014 // Original Author:  James Brooke
0015 //         Created:  Tue, 11 Mar 2014 14:55:45 GMT
0016 //
0017 // Modifying Author:  Brian Winer
0018 //         Created: Tue, 10 Mar 2015 based off L1TCaloAnalyzer
0019 //
0020 
0021 // system include files
0022 #include <memory>
0023 
0024 // user include files
0025 #include "FWCore/Framework/interface/Frameworkfwd.h"
0026 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0027 
0028 #include "FWCore/Framework/interface/Event.h"
0029 #include "FWCore/Framework/interface/MakerMacros.h"
0030 
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 
0033 #include "FWCore/ServiceRegistry/interface/Service.h"
0034 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0035 
0036 #include "DataFormats/L1TGlobal/interface/GlobalAlgBlk.h"
0037 #include "DataFormats/L1TGlobal/interface/GlobalExtBlk.h"
0038 #include "DataFormats/L1Trigger/interface/Muon.h"
0039 #include "DataFormats/L1Trigger/interface/EGamma.h"
0040 #include "DataFormats/L1Trigger/interface/Tau.h"
0041 #include "DataFormats/L1Trigger/interface/Jet.h"
0042 #include "DataFormats/L1Trigger/interface/EtSum.h"
0043 
0044 #include "TH1F.h"
0045 #include "TH2F.h"
0046 
0047 //
0048 // class declaration
0049 //
0050 
0051 namespace l1t {
0052 
0053   class L1TGlobalAnalyzer : public edm::one::EDAnalyzer<> {
0054   public:
0055     explicit L1TGlobalAnalyzer(const edm::ParameterSet&);
0056     ~L1TGlobalAnalyzer() override;
0057 
0058     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0059 
0060   private:
0061     void beginJob() override;
0062     void analyze(const edm::Event&, const edm::EventSetup&) override;
0063     void endJob() override;
0064 
0065     //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
0066     //virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
0067     //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0068     //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0069 
0070     // ----------member data ---------------------------
0071     edm::EDGetToken m_gmuToken;
0072     edm::EDGetToken m_dmxEGToken;
0073     edm::EDGetToken m_dmxTauToken;
0074     edm::EDGetToken m_dmxJetToken;
0075     edm::EDGetToken m_dmxSumToken;
0076     edm::EDGetToken m_muToken;
0077     edm::EDGetToken m_egToken;
0078     edm::EDGetToken m_tauToken;
0079     edm::EDGetToken m_jetToken;
0080     edm::EDGetToken m_sumToken;
0081 
0082     edm::EDGetToken m_gtAlgToken;
0083     edm::EDGetToken m_emulGtAlgToken;
0084     edm::EDGetToken m_emulDxAlgToken;
0085 
0086     bool m_dogMUs;
0087     bool m_doDmxEGs;
0088     bool m_doDmxTaus;
0089     bool m_doDmxJets;
0090     bool m_doDmxSums;
0091     bool m_doMUs;
0092     bool m_doEGs;
0093     bool m_doTaus;
0094     bool m_doJets;
0095     bool m_doSums;
0096 
0097     bool m_doGtAlg;
0098     bool m_doEmulGtAlg;
0099     bool m_doEmulDxAlg;
0100 
0101     bool doText_;
0102     bool doHistos_;
0103 
0104     enum ObjectType {
0105       MU = 0x1,
0106       EG = 0x2,
0107       Tau = 0x3,
0108       Jet = 0x4,
0109       Sum = 0x5,
0110       DmxEG = 0x6,
0111       DmxTau = 0x7,
0112       DmxJet = 0x8,
0113       DmxSum = 0x9,
0114       GtAlg = 0xA,
0115       EmulGtAlg = 0xB,
0116       gMU = 0xC
0117     };
0118 
0119     std::vector<ObjectType> types_;
0120     std::vector<std::string> typeStr_;
0121 
0122     std::map<ObjectType, TFileDirectory> dirs_;
0123     std::map<ObjectType, TH1F*> het_;
0124     std::map<ObjectType, TH1F*> heta_;
0125     std::map<ObjectType, TH1F*> hphi_;
0126     std::map<ObjectType, TH1F*> hbx_;
0127     std::map<ObjectType, TH2F*> hetaphi_;
0128 
0129     TFileDirectory evtDispDir_;
0130     TFileDirectory algDir_;
0131     TFileDirectory dmxVGtDir_;
0132     TH1F* hAlgoBits_;
0133     TH1F* hEmulGtAlgoBits_;
0134     TH1F* hEmulDxAlgoBits_;
0135     TH2F* hAlgoBitsEmulGtVsHw_;
0136     TH2F* hAlgoBitsEmulDxVsHw_;
0137     TH2F* hGmtVsGTMUEt_;
0138     TH2F* hGmtVsGTMUEta_;
0139     TH2F* hGmtVsGTMUPhi_;
0140     TH2F* hDmxVsGTEGEt_;
0141     TH2F* hDmxVsGTEGEta_;
0142     TH2F* hDmxVsGTEGPhi_;
0143     TH2F* hDmxVsGTTauEt_;
0144     TH2F* hDmxVsGTTauEta_;
0145     TH2F* hDmxVsGTTauPhi_;
0146     TH2F* hDmxVsGTJetEt_;
0147     TH2F* hDmxVsGTJetEta_;
0148     TH2F* hDmxVsGTJetPhi_;
0149     TH2F* hDmxVsGTSumEt_ETT_;
0150     TH2F* hDmxVsGTSumEt_ETTem_;
0151     TH2F* hDmxVsGTSumEt_HTT_;
0152     TH2F* hDmxVsGTSumEt_ETM_;
0153     TH2F* hDmxVsGTSumPhi_ETM_;
0154     TH2F* hDmxVsGTSumEt_ETMHF_;
0155     TH2F* hDmxVsGTSumPhi_ETMHF_;
0156     TH2F* hDmxVsGTSumEt_HTM_;
0157     TH2F* hDmxVsGTSumPhi_HTM_;
0158     TH2F* hDmxVsGTSumEt_HFP0_;
0159     TH2F* hDmxVsGTSumEt_HFM0_;
0160     TH2F* hDmxVsGTSumEt_HFP1_;
0161     TH2F* hDmxVsGTSumEt_HFM1_;
0162   };
0163 
0164   //
0165   // constants, enums and typedefs
0166   //
0167 
0168   //
0169   // static data member definitions
0170   //
0171 
0172   //
0173   // constructors and destructor
0174   //
0175   L1TGlobalAnalyzer::L1TGlobalAnalyzer(const edm::ParameterSet& iConfig)
0176       : doText_(iConfig.getUntrackedParameter<bool>("doText", true)),
0177         doHistos_(iConfig.getUntrackedParameter<bool>("doHistos", true)) {
0178     //now do what ever initialization is needed
0179 
0180     // register what you consume and keep token for later access:
0181     edm::InputTag nullTag("None");
0182 
0183     edm::InputTag gmuTag = iConfig.getParameter<edm::InputTag>("gmuToken");
0184     m_gmuToken = consumes<l1t::MuonBxCollection>(gmuTag);
0185     m_dogMUs = !(gmuTag == nullTag);
0186 
0187     edm::InputTag dmxEGTag = iConfig.getParameter<edm::InputTag>("dmxEGToken");
0188     m_dmxEGToken = consumes<l1t::EGammaBxCollection>(dmxEGTag);
0189     m_doDmxEGs = !(dmxEGTag == nullTag);
0190 
0191     edm::InputTag dmxTauTag = iConfig.getParameter<edm::InputTag>("dmxTauToken");
0192     m_dmxTauToken = consumes<l1t::TauBxCollection>(dmxTauTag);
0193     m_doDmxTaus = !(dmxTauTag == nullTag);
0194 
0195     edm::InputTag dmxJetTag = iConfig.getParameter<edm::InputTag>("dmxJetToken");
0196     m_dmxJetToken = consumes<l1t::JetBxCollection>(dmxJetTag);
0197     m_doDmxJets = !(dmxJetTag == nullTag);
0198 
0199     edm::InputTag dmxSumTag = iConfig.getParameter<edm::InputTag>("dmxEtSumToken");
0200     m_dmxSumToken = consumes<l1t::EtSumBxCollection>(dmxSumTag);
0201     m_doDmxSums = !(dmxSumTag == nullTag);
0202 
0203     edm::InputTag muTag = iConfig.getParameter<edm::InputTag>("muToken");
0204     m_muToken = consumes<l1t::MuonBxCollection>(muTag);
0205     m_doMUs = !(muTag == nullTag);
0206 
0207     edm::InputTag egTag = iConfig.getParameter<edm::InputTag>("egToken");
0208     m_egToken = consumes<l1t::EGammaBxCollection>(egTag);
0209     m_doEGs = !(egTag == nullTag);
0210 
0211     edm::InputTag tauTag = iConfig.getParameter<edm::InputTag>("tauToken");
0212     m_tauToken = consumes<l1t::TauBxCollection>(tauTag);
0213     m_doTaus = !(tauTag == nullTag);
0214 
0215     edm::InputTag jetTag = iConfig.getParameter<edm::InputTag>("jetToken");
0216     m_jetToken = consumes<l1t::JetBxCollection>(jetTag);
0217     m_doJets = !(jetTag == nullTag);
0218 
0219     edm::InputTag sumTag = iConfig.getParameter<edm::InputTag>("etSumToken");
0220     m_sumToken = consumes<l1t::EtSumBxCollection>(sumTag);
0221     m_doSums = !(sumTag == nullTag);
0222 
0223     edm::InputTag gtAlgTag = iConfig.getParameter<edm::InputTag>("gtAlgToken");
0224     m_gtAlgToken = consumes<GlobalAlgBlkBxCollection>(gtAlgTag);
0225     m_doGtAlg = !(gtAlgTag == nullTag);
0226 
0227     edm::InputTag emulGtAlgTag = iConfig.getParameter<edm::InputTag>("emulGtAlgToken");
0228     m_emulGtAlgToken = consumes<GlobalAlgBlkBxCollection>(emulGtAlgTag);
0229     m_doEmulGtAlg = !(emulGtAlgTag == nullTag);
0230 
0231     edm::InputTag emulDxAlgTag = iConfig.getParameter<edm::InputTag>("emulDxAlgToken");
0232     m_emulDxAlgToken = consumes<GlobalAlgBlkBxCollection>(emulDxAlgTag);
0233     m_doEmulDxAlg = !(emulDxAlgTag == nullTag);
0234 
0235     types_.push_back(gMU);
0236     types_.push_back(DmxEG);
0237     types_.push_back(DmxTau);
0238     types_.push_back(DmxJet);
0239     types_.push_back(DmxSum);
0240     types_.push_back(MU);
0241     types_.push_back(EG);
0242     types_.push_back(Tau);
0243     types_.push_back(Jet);
0244     types_.push_back(Sum);
0245 
0246     typeStr_.push_back("gmtmu");
0247     typeStr_.push_back("dmxeg");
0248     typeStr_.push_back("dmxtau");
0249     typeStr_.push_back("dmxjet");
0250     typeStr_.push_back("dmxsum");
0251     typeStr_.push_back("mu");
0252     typeStr_.push_back("eg");
0253     typeStr_.push_back("tau");
0254     typeStr_.push_back("jet");
0255     typeStr_.push_back("sum");
0256   }
0257 
0258   L1TGlobalAnalyzer::~L1TGlobalAnalyzer() {
0259     // do anything here that needs to be done at desctruction time
0260     // (e.g. close files, deallocate resources etc.)
0261   }
0262 
0263   //
0264   // member functions
0265   //
0266 
0267   // ------------ method called for each event  ------------
0268   void L1TGlobalAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0269     using namespace edm;
0270 
0271     std::stringstream text;
0272 
0273     // get gmt Muons
0274     if (m_dogMUs) {
0275       Handle<BXVector<l1t::Muon> > gmuons;
0276       iEvent.getByToken(m_gmuToken, gmuons);
0277 
0278       for (int ibx = gmuons->getFirstBX(); ibx <= gmuons->getLastBX(); ++ibx) {
0279         for (auto itr = gmuons->begin(ibx); itr != gmuons->end(ibx); ++itr) {
0280           hbx_.at(gMU)->Fill(ibx);
0281           het_.at(gMU)->Fill(itr->hwPt());
0282           heta_.at(gMU)->Fill(itr->hwEtaAtVtx());
0283           hphi_.at(gMU)->Fill(itr->hwPhiAtVtx());
0284           hetaphi_.at(gMU)->Fill(itr->hwEtaAtVtx(), itr->hwPhiAtVtx(), itr->hwPt());
0285 
0286           text << "Muon : "
0287                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEtaAtVtx()
0288                << " iphi=" << itr->hwPhiAtVtx() << std::endl;
0289         }
0290       }
0291     }
0292 
0293     // get EG
0294     if (m_doDmxEGs) {
0295       Handle<BXVector<l1t::EGamma> > dmxegs;
0296       iEvent.getByToken(m_dmxEGToken, dmxegs);
0297 
0298       for (int ibx = dmxegs->getFirstBX(); ibx <= dmxegs->getLastBX(); ++ibx) {
0299         for (auto itr = dmxegs->begin(ibx); itr != dmxegs->end(ibx); ++itr) {
0300           hbx_.at(DmxEG)->Fill(ibx);
0301           het_.at(DmxEG)->Fill(itr->hwPt());
0302           heta_.at(DmxEG)->Fill(itr->hwEta());
0303           hphi_.at(DmxEG)->Fill(itr->hwPhi());
0304           hetaphi_.at(DmxEG)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0305 
0306           text << "Dmx EG : "
0307                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi()
0308                << std::endl;
0309         }
0310       }
0311     }
0312 
0313     // get tau
0314     if (m_doDmxTaus) {
0315       Handle<BXVector<l1t::Tau> > dmxtaus;
0316       iEvent.getByToken(m_dmxTauToken, dmxtaus);
0317 
0318       for (int ibx = dmxtaus->getFirstBX(); ibx <= dmxtaus->getLastBX(); ++ibx) {
0319         for (auto itr = dmxtaus->begin(ibx); itr != dmxtaus->end(ibx); ++itr) {
0320           hbx_.at(DmxTau)->Fill(ibx);
0321           het_.at(DmxTau)->Fill(itr->hwPt());
0322           heta_.at(DmxTau)->Fill(itr->hwEta());
0323           hphi_.at(DmxTau)->Fill(itr->hwPhi());
0324           hetaphi_.at(DmxTau)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0325 
0326           text << "Dmx Tau : "
0327                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi()
0328                << std::endl;
0329         }
0330       }
0331     }
0332 
0333     // get jet
0334     if (m_doDmxJets) {
0335       Handle<BXVector<l1t::Jet> > dmxjets;
0336       iEvent.getByToken(m_dmxJetToken, dmxjets);
0337 
0338       for (int ibx = dmxjets->getFirstBX(); ibx <= dmxjets->getLastBX(); ++ibx) {
0339         for (auto itr = dmxjets->begin(ibx); itr != dmxjets->end(ibx); ++itr) {
0340           hbx_.at(DmxJet)->Fill(ibx);
0341           het_.at(DmxJet)->Fill(itr->hwPt());
0342           heta_.at(DmxJet)->Fill(itr->hwEta());
0343           hphi_.at(DmxJet)->Fill(itr->hwPhi());
0344           hetaphi_.at(DmxJet)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0345 
0346           text << "Dmx Jet : "
0347                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi()
0348                << std::endl;
0349         }
0350       }
0351     }
0352 
0353     // get sums
0354     if (m_doDmxSums) {
0355       Handle<BXVector<l1t::EtSum> > dmxsums;
0356       iEvent.getByToken(m_dmxSumToken, dmxsums);
0357 
0358       for (int ibx = dmxsums->getFirstBX(); ibx <= dmxsums->getLastBX(); ++ibx) {
0359         for (auto itr = dmxsums->begin(ibx); itr != dmxsums->end(ibx); ++itr) {
0360           hbx_.at(DmxSum)->Fill(ibx);
0361           het_.at(DmxSum)->Fill(itr->hwPt());
0362           heta_.at(DmxSum)->Fill(itr->hwEta());
0363           hphi_.at(DmxSum)->Fill(itr->hwPhi());
0364           hetaphi_.at(DmxSum)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0365 
0366           text << "Dmx Sum : "
0367                << " type=" << itr->getType() << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta()
0368                << " iphi=" << itr->hwPhi() << std::endl;
0369         }
0370       }
0371     }
0372 
0373     // get Muons
0374     if (m_doMUs) {
0375       Handle<BXVector<l1t::Muon> > muons;
0376       iEvent.getByToken(m_muToken, muons);
0377 
0378       for (int ibx = muons->getFirstBX(); ibx <= muons->getLastBX(); ++ibx) {
0379         for (auto itr = muons->begin(ibx); itr != muons->end(ibx); ++itr) {
0380           hbx_.at(MU)->Fill(ibx);
0381           het_.at(MU)->Fill(itr->hwPt());
0382           heta_.at(MU)->Fill(itr->hwEtaAtVtx());
0383           hphi_.at(MU)->Fill(itr->hwPhiAtVtx());
0384           hetaphi_.at(MU)->Fill(itr->hwEtaAtVtx(), itr->hwPhiAtVtx(), itr->hwPt());
0385 
0386           text << "Muon : "
0387                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEtaAtVtx()
0388                << " iphi=" << itr->hwPhiAtVtx() << std::endl;
0389         }
0390       }
0391     }
0392 
0393     // get EG
0394     if (m_doEGs) {
0395       Handle<BXVector<l1t::EGamma> > egs;
0396       iEvent.getByToken(m_egToken, egs);
0397 
0398       for (int ibx = egs->getFirstBX(); ibx <= egs->getLastBX(); ++ibx) {
0399         for (auto itr = egs->begin(ibx); itr != egs->end(ibx); ++itr) {
0400           hbx_.at(EG)->Fill(ibx);
0401           het_.at(EG)->Fill(itr->hwPt());
0402           heta_.at(EG)->Fill(itr->hwEta());
0403           hphi_.at(EG)->Fill(itr->hwPhi());
0404           hetaphi_.at(EG)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0405 
0406           text << "EG : "
0407                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi()
0408                << std::endl;
0409         }
0410       }
0411     }
0412 
0413     // get tau
0414     if (m_doTaus) {
0415       Handle<BXVector<l1t::Tau> > taus;
0416       iEvent.getByToken(m_tauToken, taus);
0417 
0418       for (int ibx = taus->getFirstBX(); ibx <= taus->getLastBX(); ++ibx) {
0419         for (auto itr = taus->begin(ibx); itr != taus->end(ibx); ++itr) {
0420           hbx_.at(Tau)->Fill(ibx);
0421           het_.at(Tau)->Fill(itr->hwPt());
0422           heta_.at(Tau)->Fill(itr->hwEta());
0423           hphi_.at(Tau)->Fill(itr->hwPhi());
0424           hetaphi_.at(Tau)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0425 
0426           text << "Tau : "
0427                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi()
0428                << std::endl;
0429         }
0430       }
0431     }
0432 
0433     // get jet
0434     if (m_doJets) {
0435       Handle<BXVector<l1t::Jet> > jets;
0436       iEvent.getByToken(m_jetToken, jets);
0437 
0438       for (int ibx = jets->getFirstBX(); ibx <= jets->getLastBX(); ++ibx) {
0439         for (auto itr = jets->begin(ibx); itr != jets->end(ibx); ++itr) {
0440           hbx_.at(Jet)->Fill(ibx);
0441           het_.at(Jet)->Fill(itr->hwPt());
0442           heta_.at(Jet)->Fill(itr->hwEta());
0443           hphi_.at(Jet)->Fill(itr->hwPhi());
0444           hetaphi_.at(Jet)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0445 
0446           text << "Jet : "
0447                << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi()
0448                << std::endl;
0449         }
0450       }
0451     }
0452 
0453     // get sums
0454     if (m_doSums) {
0455       Handle<BXVector<l1t::EtSum> > sums;
0456       iEvent.getByToken(m_sumToken, sums);
0457 
0458       for (int ibx = sums->getFirstBX(); ibx <= sums->getLastBX(); ++ibx) {
0459         for (auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr) {
0460           hbx_.at(Sum)->Fill(ibx);
0461           het_.at(Sum)->Fill(itr->hwPt());
0462           heta_.at(Sum)->Fill(itr->hwEta());
0463           hphi_.at(Sum)->Fill(itr->hwPhi());
0464           hetaphi_.at(Sum)->Fill(itr->hwEta(), itr->hwPhi(), itr->hwPt());
0465           text << "Sum : "
0466                << " type=" << itr->getType() << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta()
0467                << " iphi=" << itr->hwPhi() << std::endl;
0468         }
0469       }
0470     }
0471 
0472     //Algorithm Bits
0473     if (m_doGtAlg) {
0474       Handle<BXVector<GlobalAlgBlk> > algs;
0475       iEvent.getByToken(m_gtAlgToken, algs);
0476 
0477       for (int ibx = algs->getFirstBX(); ibx <= algs->getLastBX(); ++ibx) {
0478         for (auto itr = algs->begin(ibx); itr != algs->end(ibx); ++itr) {
0479           for (int algBit = 0; algBit < 128;
0480                algBit++) {  //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
0481             if (itr->getAlgoDecisionFinal(algBit)) {
0482               hAlgoBits_->Fill(algBit);
0483               text << "HW Fired Alg Bit : " << algBit << std::endl;
0484             }
0485           }
0486         }
0487       }
0488     }
0489 
0490     //Algorithm Bits (Emulation seeded by GT input)
0491     if (m_doEmulGtAlg) {
0492       Handle<BXVector<GlobalAlgBlk> > emulGtAlgs;
0493       iEvent.getByToken(m_emulGtAlgToken, emulGtAlgs);
0494 
0495       for (int ibx = emulGtAlgs->getFirstBX(); ibx <= emulGtAlgs->getLastBX(); ++ibx) {
0496         for (auto itr = emulGtAlgs->begin(ibx); itr != emulGtAlgs->end(ibx); ++itr) {
0497           for (int algBit = 0; algBit < 128;
0498                algBit++) {  //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
0499             if (itr->getAlgoDecisionFinal(algBit)) {
0500               hEmulGtAlgoBits_->Fill(algBit);
0501               text << "Emul w/ GTInput Fired Alg Bit : " << algBit << std::endl;
0502             }
0503           }
0504         }
0505       }
0506     }
0507 
0508     //Algorithm Bits (Emulation seeded by Demux Output)
0509     if (m_doEmulDxAlg) {
0510       Handle<BXVector<GlobalAlgBlk> > emulDxAlgs;
0511       iEvent.getByToken(m_emulDxAlgToken, emulDxAlgs);
0512 
0513       for (int ibx = emulDxAlgs->getFirstBX(); ibx <= emulDxAlgs->getLastBX(); ++ibx) {
0514         for (auto itr = emulDxAlgs->begin(ibx); itr != emulDxAlgs->end(ibx); ++itr) {
0515           for (int algBit = 0; algBit < 128;
0516                algBit++) {  //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
0517             if (itr->getAlgoDecisionFinal(algBit)) {
0518               hEmulDxAlgoBits_->Fill(algBit);
0519               text << "Emul w/ Demux output Fired Alg Bit : " << algBit << std::endl;
0520             }
0521           }
0522         }
0523       }
0524     }
0525 
0526     // Mu (gmt vs GT)
0527     if (m_doMUs & m_dogMUs) {
0528       Handle<BXVector<l1t::Muon> > mus;
0529       iEvent.getByToken(m_muToken, mus);
0530 
0531       Handle<BXVector<l1t::Muon> > gmtmus;
0532       iEvent.getByToken(m_gmuToken, gmtmus);
0533 
0534       for (int ibx = mus->getFirstBX(); ibx <= mus->getLastBX(); ++ibx) {
0535         // Cycle through all GT MUs
0536         for (unsigned int igtMU = 0; igtMU < mus->size(ibx); igtMU++) {
0537           double gtMUEt = mus->at(ibx, igtMU).hwPt();
0538           double gmtMUEt = 0.0;
0539           if (gmtmus->size(ibx) > igtMU)
0540             gmtMUEt = gmtmus->at(ibx, igtMU).hwPt();
0541           hGmtVsGTMUEt_->Fill(gtMUEt, gmtMUEt);
0542 
0543           double gtMUEta = mus->at(ibx, igtMU).hwEtaAtVtx();
0544           double gmtMUEta = 0.0;
0545           if (gmtmus->size(ibx) > igtMU)
0546             gmtMUEta = gmtmus->at(ibx, igtMU).hwEtaAtVtx();
0547           hGmtVsGTMUEta_->Fill(gtMUEta, gmtMUEta);
0548 
0549           double gtMUPhi = mus->at(ibx, igtMU).hwPhiAtVtx();
0550           double gmtMUPhi = 0.0;
0551           if (gmtmus->size(ibx) > igtMU)
0552             gmtMUPhi = gmtmus->at(ibx, igtMU).hwPhiAtVtx();
0553           hGmtVsGTMUPhi_->Fill(gtMUPhi, gmtMUPhi);
0554         }
0555         // if there are extra MUs in the dmx record them
0556         for (unsigned int igmtMU = mus->size(ibx); igmtMU < gmtmus->size(ibx); igmtMU++) {
0557           double gtMUEt = 0.0;  //no GT jet exists
0558           double gmtMUEt = gmtmus->at(ibx, igmtMU).hwPt();
0559           hGmtVsGTMUEt_->Fill(gtMUEt, gmtMUEt);
0560 
0561           double gtMUEta = 0.0;
0562           double gmtMUEta = gmtmus->at(ibx, igmtMU).hwEtaAtVtx();
0563           hGmtVsGTMUEta_->Fill(gtMUEta, gmtMUEta);
0564 
0565           double gtMUPhi = 0.0;
0566           double gmtMUPhi = gmtmus->at(ibx, igmtMU).hwPhiAtVtx();
0567           hGmtVsGTMUPhi_->Fill(gtMUPhi, gmtMUPhi);
0568         }
0569       }
0570     }
0571 
0572     // EG (Dmx vs GT)
0573     if (m_doEGs & m_doDmxEGs) {
0574       Handle<BXVector<l1t::EGamma> > egs;
0575       iEvent.getByToken(m_egToken, egs);
0576 
0577       Handle<BXVector<l1t::EGamma> > dmxegs;
0578       iEvent.getByToken(m_dmxEGToken, dmxegs);
0579 
0580       for (int ibx = egs->getFirstBX(); ibx <= egs->getLastBX(); ++ibx) {
0581         // Cycle through all GT egs
0582         for (unsigned int igtEG = 0; igtEG < egs->size(ibx); igtEG++) {
0583           double gtEGEt = egs->at(ibx, igtEG).hwPt();
0584           double dmxEGEt = 0.0;
0585           if (dmxegs->size(ibx) > igtEG)
0586             dmxEGEt = dmxegs->at(ibx, igtEG).hwPt();
0587           hDmxVsGTEGEt_->Fill(gtEGEt, dmxEGEt);
0588 
0589           double gtEGEta = egs->at(ibx, igtEG).hwEta();
0590           double dmxEGEta = 0.0;
0591           if (dmxegs->size(ibx) > igtEG)
0592             dmxEGEta = dmxegs->at(ibx, igtEG).hwEta();
0593           hDmxVsGTEGEta_->Fill(gtEGEta, dmxEGEta);
0594 
0595           double gtEGPhi = egs->at(ibx, igtEG).hwPhi();
0596           double dmxEGPhi = 0.0;
0597           if (dmxegs->size(ibx) > igtEG)
0598             dmxEGPhi = dmxegs->at(ibx, igtEG).hwPhi();
0599           hDmxVsGTEGPhi_->Fill(gtEGPhi, dmxEGPhi);
0600         }
0601         // if there are extra egs in the dmx record them
0602         for (unsigned int idmEG = egs->size(ibx); idmEG < dmxegs->size(ibx); idmEG++) {
0603           double gtEGEt = 0.0;  //no GT jet exists
0604           double dmxEGEt = dmxegs->at(ibx, idmEG).hwPt();
0605           hDmxVsGTEGEt_->Fill(gtEGEt, dmxEGEt);
0606 
0607           double gtEGEta = 0.0;
0608           double dmxEGEta = dmxegs->at(ibx, idmEG).hwEta();
0609           hDmxVsGTEGEta_->Fill(gtEGEta, dmxEGEta);
0610 
0611           double gtEGPhi = 0.0;
0612           double dmxEGPhi = dmxegs->at(ibx, idmEG).hwPhi();
0613           hDmxVsGTEGPhi_->Fill(gtEGPhi, dmxEGPhi);
0614         }
0615       }
0616     }
0617 
0618     // Tau (Dmx vs GT)
0619     if (m_doTaus & m_doDmxTaus) {
0620       Handle<BXVector<l1t::Tau> > taus;
0621       iEvent.getByToken(m_tauToken, taus);
0622 
0623       Handle<BXVector<l1t::Tau> > dmxtaus;
0624       iEvent.getByToken(m_dmxTauToken, dmxtaus);
0625 
0626       for (int ibx = taus->getFirstBX(); ibx <= taus->getLastBX(); ++ibx) {
0627         // Cycle through all GT taus
0628         for (unsigned int igtTau = 0; igtTau < taus->size(ibx); igtTau++) {
0629           double gtTauEt = taus->at(ibx, igtTau).hwPt();
0630           double dmxTauEt = 0.0;
0631           if (dmxtaus->size(ibx) > igtTau)
0632             dmxTauEt = dmxtaus->at(ibx, igtTau).hwPt();
0633           hDmxVsGTTauEt_->Fill(gtTauEt, dmxTauEt);
0634 
0635           double gtTauEta = taus->at(ibx, igtTau).hwEta();
0636           double dmxTauEta = 0.0;
0637           if (dmxtaus->size(ibx) > igtTau)
0638             dmxTauEta = dmxtaus->at(ibx, igtTau).hwEta();
0639           hDmxVsGTTauEta_->Fill(gtTauEta, dmxTauEta);
0640 
0641           double gtTauPhi = taus->at(ibx, igtTau).hwPhi();
0642           double dmxTauPhi = 0.0;
0643           if (dmxtaus->size(ibx) > igtTau)
0644             dmxTauPhi = dmxtaus->at(ibx, igtTau).hwPhi();
0645           hDmxVsGTTauPhi_->Fill(gtTauPhi, dmxTauPhi);
0646         }
0647         // if there are extra taus in the dmx record them
0648         for (unsigned int idmTau = taus->size(ibx); idmTau < dmxtaus->size(ibx); idmTau++) {
0649           double gtTauEt = 0.0;  //no GT jet exists
0650           double dmxTauEt = dmxtaus->at(ibx, idmTau).hwPt();
0651           hDmxVsGTTauEt_->Fill(gtTauEt, dmxTauEt);
0652 
0653           double gtTauEta = 0.0;
0654           double dmxTauEta = dmxtaus->at(ibx, idmTau).hwEta();
0655           hDmxVsGTTauEta_->Fill(gtTauEta, dmxTauEta);
0656 
0657           double gtTauPhi = 0.0;
0658           double dmxTauPhi = dmxtaus->at(ibx, idmTau).hwPhi();
0659           hDmxVsGTTauPhi_->Fill(gtTauPhi, dmxTauPhi);
0660         }
0661       }
0662     }
0663 
0664     // Jets (Dmx vs GT)
0665     if (m_doJets & m_doDmxJets) {
0666       Handle<BXVector<l1t::Jet> > jets;
0667       iEvent.getByToken(m_jetToken, jets);
0668 
0669       Handle<BXVector<l1t::Jet> > dmxjets;
0670       iEvent.getByToken(m_dmxJetToken, dmxjets);
0671 
0672       for (int ibx = jets->getFirstBX(); ibx <= jets->getLastBX(); ++ibx) {
0673         // Cycle through all GT jets
0674         for (unsigned int igtJ = 0; igtJ < jets->size(ibx); igtJ++) {
0675           double gtJetEt = jets->at(ibx, igtJ).hwPt();
0676           double dmxJetEt = 0.0;
0677           if (dmxjets->size(ibx) > igtJ)
0678             dmxJetEt = dmxjets->at(ibx, igtJ).hwPt();
0679           hDmxVsGTJetEt_->Fill(gtJetEt, dmxJetEt);
0680 
0681           double gtJetEta = jets->at(ibx, igtJ).hwEta();
0682           double dmxJetEta = 0.0;
0683           if (dmxjets->size(ibx) > igtJ)
0684             dmxJetEta = dmxjets->at(ibx, igtJ).hwEta();
0685           hDmxVsGTJetEta_->Fill(gtJetEta, dmxJetEta);
0686 
0687           double gtJetPhi = jets->at(ibx, igtJ).hwPhi();
0688           double dmxJetPhi = 0.0;
0689           if (dmxjets->size(ibx) > igtJ)
0690             dmxJetPhi = dmxjets->at(ibx, igtJ).hwPhi();
0691           hDmxVsGTJetPhi_->Fill(gtJetPhi, dmxJetPhi);
0692         }
0693         // if there are extra jets in the dmx record them
0694         for (unsigned int idmJ = jets->size(ibx); idmJ < dmxjets->size(ibx); idmJ++) {
0695           double gtJetEt = 0.0;  //no GT jet exists
0696           double dmxJetEt = dmxjets->at(ibx, idmJ).hwPt();
0697           hDmxVsGTJetEt_->Fill(gtJetEt, dmxJetEt);
0698 
0699           double gtJetEta = 0.0;
0700           double dmxJetEta = dmxjets->at(ibx, idmJ).hwEta();
0701           hDmxVsGTJetEta_->Fill(gtJetEta, dmxJetEta);
0702 
0703           double gtJetPhi = 0.0;
0704           double dmxJetPhi = dmxjets->at(ibx, idmJ).hwPhi();
0705           hDmxVsGTJetPhi_->Fill(gtJetPhi, dmxJetPhi);
0706         }
0707       }
0708     }
0709 
0710     // Sums (Dmx vs GT)
0711     if (m_doSums & m_doDmxSums) {
0712       Handle<BXVector<l1t::EtSum> > sums;
0713       iEvent.getByToken(m_sumToken, sums);
0714 
0715       Handle<BXVector<l1t::EtSum> > dmxSums;
0716       iEvent.getByToken(m_dmxSumToken, dmxSums);
0717 
0718       for (int ibx = sums->getFirstBX(); ibx <= sums->getLastBX(); ++ibx) {
0719         // Cycle through all GT sums
0720         for (unsigned int igtS = 0; igtS < sums->size(ibx); igtS++) {
0721           double gtSumEt = sums->at(ibx, igtS).hwPt();
0722           double dmxSumEt = 0.0;
0723           if (dmxSums->size(ibx) > igtS)
0724             dmxSumEt = dmxSums->at(ibx, igtS).hwPt();
0725 
0726           double gtSumPhi = sums->at(ibx, igtS).hwPhi();
0727           double dmxSumPhi = 0.0;
0728           if (dmxSums->size(ibx) > igtS)
0729             dmxSumPhi = dmxSums->at(ibx, igtS).hwPhi();
0730 
0731           if (sums->at(ibx, igtS).getType() == dmxSums->at(ibx, igtS).getType()) {
0732             switch (sums->at(ibx, igtS).getType()) {
0733               case l1t::EtSum::EtSumType::kTotalEt:
0734                 hDmxVsGTSumEt_ETT_->Fill(gtSumEt, dmxSumEt);
0735 
0736                 break;
0737               case l1t::EtSum::EtSumType::kTotalEtEm:
0738                 hDmxVsGTSumEt_ETTem_->Fill(gtSumEt, dmxSumEt);
0739 
0740                 break;
0741               case l1t::EtSum::EtSumType::kTotalHt:
0742                 hDmxVsGTSumEt_HTT_->Fill(gtSumEt, dmxSumEt);
0743 
0744                 break;
0745               case l1t::EtSum::EtSumType::kMissingEt:
0746                 hDmxVsGTSumEt_ETM_->Fill(gtSumEt, dmxSumEt);
0747                 hDmxVsGTSumPhi_ETM_->Fill(gtSumPhi, dmxSumPhi);
0748                 break;
0749               case l1t::EtSum::EtSumType::kMissingEtHF:
0750                 hDmxVsGTSumEt_ETMHF_->Fill(gtSumEt, dmxSumEt);
0751                 hDmxVsGTSumPhi_ETMHF_->Fill(gtSumPhi, dmxSumPhi);
0752                 break;
0753               case l1t::EtSum::EtSumType::kMissingHt:
0754                 hDmxVsGTSumEt_HTM_->Fill(gtSumEt, dmxSumEt);
0755                 hDmxVsGTSumPhi_HTM_->Fill(gtSumPhi, dmxSumPhi);
0756                 break;
0757               case l1t::EtSum::EtSumType::kMinBiasHFP0:
0758                 hDmxVsGTSumEt_HFP0_->Fill(gtSumEt, dmxSumEt);
0759                 break;
0760               case l1t::EtSum::EtSumType::kMinBiasHFM0:
0761                 hDmxVsGTSumEt_HFM0_->Fill(gtSumEt, dmxSumEt);
0762                 break;
0763               case l1t::EtSum::EtSumType::kMinBiasHFP1:
0764                 hDmxVsGTSumEt_HFP1_->Fill(gtSumEt, dmxSumEt);
0765                 break;
0766               case l1t::EtSum::EtSumType::kMinBiasHFM1:
0767                 hDmxVsGTSumEt_HFM1_->Fill(gtSumEt, dmxSumEt);
0768                 break;
0769               default:
0770                 break;
0771             }
0772           } else {
0773             text << "WARNING:  EtSum Types do not line up between DeMux and uGT " << std::endl;
0774           }
0775         }
0776         // if there are extra sumss in the dmx record them...should not be any...but let's check
0777         for (unsigned int idmS = sums->size(ibx); idmS < dmxSums->size(ibx); idmS++) {
0778           double gtSumEt = -1.0;  //no GT jet exists
0779           double dmxSumEt = dmxSums->at(ibx, idmS).hwPt();
0780 
0781           double gtSumPhi = -1.0;
0782           double dmxSumPhi = dmxSums->at(ibx, idmS).hwPhi();
0783 
0784           switch (dmxSums->at(ibx, idmS).getType()) {
0785             case l1t::EtSum::EtSumType::kTotalEt:
0786               hDmxVsGTSumEt_ETT_->Fill(gtSumEt, dmxSumEt);
0787 
0788               break;
0789             case l1t::EtSum::EtSumType::kTotalEtEm:
0790               hDmxVsGTSumEt_ETTem_->Fill(gtSumEt, dmxSumEt);
0791 
0792               break;
0793             case l1t::EtSum::EtSumType::kTotalHt:
0794               hDmxVsGTSumEt_HTT_->Fill(gtSumEt, dmxSumEt);
0795 
0796               break;
0797             case l1t::EtSum::EtSumType::kMissingEt:
0798               hDmxVsGTSumEt_ETM_->Fill(gtSumEt, dmxSumEt);
0799               hDmxVsGTSumPhi_ETM_->Fill(gtSumPhi, dmxSumPhi);
0800               break;
0801             case l1t::EtSum::EtSumType::kMissingEtHF:
0802               hDmxVsGTSumEt_ETMHF_->Fill(gtSumEt, dmxSumEt);
0803               hDmxVsGTSumPhi_ETMHF_->Fill(gtSumPhi, dmxSumPhi);
0804               break;
0805             case l1t::EtSum::EtSumType::kMissingHt:
0806               hDmxVsGTSumEt_HTM_->Fill(gtSumEt, dmxSumEt);
0807               hDmxVsGTSumPhi_HTM_->Fill(gtSumPhi, dmxSumPhi);
0808               break;
0809             default:
0810               break;
0811           }
0812         }
0813       }
0814     }
0815 
0816     //Algorithm Bits (Emulation vs HW)
0817     if (m_doGtAlg && m_doEmulGtAlg) {
0818       Handle<BXVector<GlobalAlgBlk> > hwalgs;
0819       iEvent.getByToken(m_gtAlgToken, hwalgs);
0820 
0821       Handle<BXVector<GlobalAlgBlk> > emulAlgs;
0822       iEvent.getByToken(m_emulGtAlgToken, emulAlgs);
0823 
0824       //for ( int ibx=hwalgs->getFirstBX(); ibx<=hwalgs->getLastBX(); ++ibx) {
0825       int ibx = 0;
0826 
0827       auto itr = hwalgs->begin(ibx);
0828       auto itr_emul = emulAlgs->begin(ibx);
0829 
0830       for (int algBit = 0; algBit < 128;
0831            algBit++) {  //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
0832         bool hw = itr->getAlgoDecisionFinal(algBit);
0833         bool em = itr_emul->getAlgoDecisionFinal(algBit);
0834         if (hw & em) {
0835           hAlgoBitsEmulGtVsHw_->Fill(algBit, algBit);
0836         } else if (hw & !em) {
0837           hAlgoBitsEmulGtVsHw_->Fill(algBit, -1.0);
0838           text << "WARNING:  HW Fnd Alg Bit " << algBit << " but emulation did not " << std::endl;
0839         } else if (!hw & em) {
0840           hAlgoBitsEmulGtVsHw_->Fill(-1.0, algBit);
0841           text << "WARNING:  Emul. Fnd Alg Bit " << algBit << " but hardware did not " << std::endl;
0842         }
0843       }
0844 
0845       // }
0846     }
0847 
0848     //Algorithm Bits (Emulation vs HW)
0849     if (m_doGtAlg && m_doEmulDxAlg) {
0850       Handle<BXVector<GlobalAlgBlk> > hwalgs;
0851       iEvent.getByToken(m_gtAlgToken, hwalgs);
0852 
0853       Handle<BXVector<GlobalAlgBlk> > emulAlgs;
0854       iEvent.getByToken(m_emulDxAlgToken, emulAlgs);
0855 
0856       //for ( int ibx=hwalgs->getFirstBX(); ibx<=hwalgs->getLastBX(); ++ibx) {
0857       int ibx = 0;
0858 
0859       auto itr = hwalgs->begin(ibx);
0860       auto itr_emul = emulAlgs->begin(ibx);
0861 
0862       for (int algBit = 0; algBit < 128;
0863            algBit++) {  //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
0864         bool hw = itr->getAlgoDecisionFinal(algBit);
0865         bool em = itr_emul->getAlgoDecisionFinal(algBit);
0866         if (hw & em) {
0867           hAlgoBitsEmulDxVsHw_->Fill(algBit, algBit);
0868         } else if (hw & !em) {
0869           hAlgoBitsEmulDxVsHw_->Fill(algBit, -1.0);
0870         } else if (!hw & em) {
0871           hAlgoBitsEmulDxVsHw_->Fill(-1.0, algBit);
0872         }
0873       }
0874 
0875       // }
0876     }
0877 
0878     if (doText_)
0879       edm::LogInfo("L1TGlobalEvents") << text.str();
0880   }
0881 
0882   // ------------ method called once each job just before starting event loop  ------------
0883   void L1TGlobalAnalyzer::beginJob() {
0884     edm::Service<TFileService> fs;
0885 
0886     auto itr = types_.cbegin();
0887     auto str = typeStr_.cbegin();
0888 
0889     for (; itr != types_.end(); ++itr, ++str) {
0890       if (*itr == Jet || *itr == DmxJet || *itr == Sum || *itr == DmxSum || *itr == DmxEG || *itr == EG ||
0891           *itr == DmxTau || *itr == Tau) {
0892         double etmax = 99.5;
0893         if (*itr == Jet || *itr == DmxJet || *itr == Sum || *itr == DmxSum)
0894           etmax = 499.5;
0895 
0896         dirs_.insert(std::pair<ObjectType, TFileDirectory>(*itr, fs->mkdir(*str)));
0897 
0898         het_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("et", "", 500, -0.5, etmax)));
0899 
0900         hbx_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("bx", "", 11, -5.5, 5.5)));
0901 
0902         heta_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("eta", "", 229, -114.5, 114.5)));
0903         hphi_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("phi", "", 144, -0.5, 143.5)));
0904         hetaphi_.insert(std::pair<ObjectType, TH2F*>(
0905             *itr, dirs_.at(*itr).make<TH2F>("etaphi", "", 229, -114.5, 114.5, 144, -0.5, 143.5)));
0906       } else if (*itr == MU || *itr == gMU) {
0907         double etmax = 511.5;
0908         dirs_.insert(std::pair<ObjectType, TFileDirectory>(*itr, fs->mkdir(*str)));
0909 
0910         het_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("et", "", 512, -0.5, etmax)));
0911 
0912         hbx_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("bx", "", 11, -5.5, 5.5)));
0913 
0914         heta_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("eta", "", 549, -224.5, 224.5)));
0915         hphi_.insert(std::pair<ObjectType, TH1F*>(*itr, dirs_.at(*itr).make<TH1F>("phi", "", 576, -0.5, 575.5)));
0916         hetaphi_.insert(std::pair<ObjectType, TH2F*>(
0917             *itr, dirs_.at(*itr).make<TH2F>("etaphi", "", 549, -224.5, 224.5, 576, -0.5, 575.5)));
0918       }
0919     }
0920 
0921     algDir_ = fs->mkdir("Algorithms");
0922     hAlgoBits_ = algDir_.make<TH1F>("hAlgoBits", "Algorithm Bits", 100, -0.5, 99.5);
0923     hEmulGtAlgoBits_ = algDir_.make<TH1F>("hEmulGtAlgoBits", "GT Emulated Algorithm Bits", 100, -0.5, 99.5);
0924     hAlgoBitsEmulGtVsHw_ = algDir_.make<TH2F>(
0925         "hAlgoBitsEmulGtVsHw", "Algorithm Bits (GT) Emulation vs Hardware", 129, -1.5, 127.5, 129, -1.5, 127.5);
0926     hEmulDxAlgoBits_ = algDir_.make<TH1F>("hEmulDxAlgoBits", "Dx Emulated Algorithm Bits", 100, -0.5, 99.5);
0927     hAlgoBitsEmulDxVsHw_ = algDir_.make<TH2F>(
0928         "hAlgoBitsEmulDxVsHw", "Algorithm Bits (Dx) Emulation vs Hardware", 129, -1.5, 127.5, 129, -1.5, 127.5);
0929 
0930     dmxVGtDir_ = fs->mkdir("SourceVsGT");
0931 
0932     hGmtVsGTMUEt_ =
0933         dmxVGtDir_.make<TH2F>("hGmtVsGTMUEt", "Gmt MU Et versus GT MU Et", 512, -0.5, 511.5, 512, -0.5, 511.5);
0934     hGmtVsGTMUEta_ =
0935         dmxVGtDir_.make<TH2F>("hGmtVsGTMUEta", "Gmt MU Eta versus GT MU Eta", 549, -224.5, 224.5, 549, -224.5, 224.5);
0936     hGmtVsGTMUPhi_ =
0937         dmxVGtDir_.make<TH2F>("hGmtVsGTMUPhi", "Gmt MU Phi versus GT MU Phi", 576, -0.5, 575.5, 576, -0.5, 575.5);
0938 
0939     hDmxVsGTEGEt_ =
0940         dmxVGtDir_.make<TH2F>("hDmxVsGTEGEt", "Dmx EG Et versus GT EG Et", 500, -0.5, 499.5, 500, -0.5, 499.5);
0941     hDmxVsGTEGEta_ =
0942         dmxVGtDir_.make<TH2F>("hDmxVsGTEGEta", "Dmx EG Eta versus GT EG Eta", 229, -114.5, 114.5, 229, -114.5, 114.5);
0943     hDmxVsGTEGPhi_ =
0944         dmxVGtDir_.make<TH2F>("hDmxVsGTEGPhi", "Dmx EG Phi versus GT EG Phi", 144, -0.5, 143.5, 144, -0.5, 143.5);
0945 
0946     hDmxVsGTTauEt_ =
0947         dmxVGtDir_.make<TH2F>("hDmxVsGTTauEt", "Dmx Tau Et versus GT Tau Et", 500, -0.5, 499.5, 500, -0.5, 499.5);
0948     hDmxVsGTTauEta_ = dmxVGtDir_.make<TH2F>(
0949         "hDmxVsGTTauEta", "Dmx Tau Eta versus GT Tau Eta", 229, -114.5, 114.5, 229, -114.5, 114.5);
0950     hDmxVsGTTauPhi_ =
0951         dmxVGtDir_.make<TH2F>("hDmxVsGTTauPhi", "Dmx Tau Phi versus GT Tau Phi", 144, -0.5, 143.5, 144, -0.5, 143.5);
0952 
0953     hDmxVsGTJetEt_ =
0954         dmxVGtDir_.make<TH2F>("hDmxVsGTJetEt", "Dmx Jet Et versus GT Jet Et", 500, -0.5, 499.5, 500, -0.5, 499.5);
0955     hDmxVsGTJetEta_ = dmxVGtDir_.make<TH2F>(
0956         "hDmxVsGTJetEta", "Dmx Jet Eta versus GT Jet Eta", 229, -114.5, 114.5, 229, -114.5, 114.5);
0957     hDmxVsGTJetPhi_ =
0958         dmxVGtDir_.make<TH2F>("hDmxVsGTJetPhi", "Dmx Jet Phi versus GT Jet Phi", 144, -0.5, 143.5, 144, -0.5, 143.5);
0959 
0960     hDmxVsGTSumEt_ETT_ =
0961         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_ETT", "Dmx ETT versus GT ETT", 256, -0.5, 2047.5, 256, -0.5, 2047.5);
0962     hDmxVsGTSumEt_ETTem_ =
0963         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_ETTem", "Dmx ETTem versus GT ETTem", 256, -0.5, 2047.5, 256, -0.5, 2047.5);
0964     hDmxVsGTSumEt_HTT_ =
0965         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_HTT", "Dmx HTT versus GT HTT", 256, -0.5, 2047.5, 256, -0.5, 2047.5);
0966     hDmxVsGTSumEt_ETM_ =
0967         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_ETM", "Dmx ETM versus GT ETM", 500, -0.5, 499.5, 500, -0.5, 499.5);
0968     hDmxVsGTSumPhi_ETM_ = dmxVGtDir_.make<TH2F>(
0969         "hDmxVsGTSumPhi_ETM", "Dmx ETM Phi versus GT ETM Phi", 144, -0.5, 143.5, 144, -0.5, 143.5);
0970     hDmxVsGTSumEt_ETMHF_ =
0971         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_ETMHF", "Dmx ETMHF versus GT ETMHF", 500, -0.5, 499.5, 500, -0.5, 499.5);
0972     hDmxVsGTSumPhi_ETMHF_ = dmxVGtDir_.make<TH2F>(
0973         "hDmxVsGTSumPhi_ETMHF", "Dmx ETMHF Phi versus GT ETMHF Phi", 144, -0.5, 143.5, 144, -0.5, 143.5);
0974     hDmxVsGTSumEt_HTM_ =
0975         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_HTM", "Dmx HTM versus GT HTM", 500, -0.5, 499.5, 500, -0.5, 499.5);
0976     hDmxVsGTSumPhi_HTM_ = dmxVGtDir_.make<TH2F>(
0977         "hDmxVsGTSumPhi_HTM", "Dmx HTM Phi versus GT HTM Phi", 144, -0.5, 143.5, 144, -0.5, 143.5);
0978 
0979     hDmxVsGTSumEt_HFP0_ =
0980         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_HFP0", "Dmx versus GT HFP0", 16, -0.5, 15.5, 16, -0.5, 15.5);
0981     hDmxVsGTSumEt_HFM0_ =
0982         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_HFM0", "Dmx versus GT HFM0", 16, -0.5, 15.5, 16, -0.5, 15.5);
0983     hDmxVsGTSumEt_HFP1_ =
0984         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_HFP1", "Dmx versus GT HFP1", 16, -0.5, 15.5, 16, -0.5, 15.5);
0985     hDmxVsGTSumEt_HFM1_ =
0986         dmxVGtDir_.make<TH2F>("hDmxVsGTSumEt_HFM1", "Dmx versus GT HFM1", 16, -0.5, 15.5, 16, -0.5, 15.5);
0987   }
0988 
0989   // ------------ method called once each job just after ending the event loop  ------------
0990   void L1TGlobalAnalyzer::endJob() {}
0991 
0992   // ------------ method called when starting to processes a run  ------------
0993   /*
0994 void 
0995 L1TGlobalAnalyzer::beginRun(edm::Run const&, edm::EventSetup const&)
0996 {
0997 }
0998 */
0999 
1000   // ------------ method called when ending the processing of a run  ------------
1001   /*
1002 void 
1003 L1TGlobalAnalyzer::endRun(edm::Run const&, edm::EventSetup const&)
1004 {
1005 }
1006 */
1007 
1008   // ------------ method called when starting to processes a luminosity block  ------------
1009   /*
1010 void 
1011 L1TGlobalAnalyzer::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
1012 {
1013 }
1014 */
1015 
1016   // ------------ method called when ending the processing of a luminosity block  ------------
1017   /*
1018 void 
1019 L1TGlobalAnalyzer::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
1020 {
1021 }
1022 */
1023 
1024   // ------------ method fills 'descriptions' with the allowed parameters for the module  ------------
1025   void L1TGlobalAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
1026     //The following says we do not know what parameters are allowed so do no validation
1027     // Please change this to state exactly what you do use, even if it is no parameters
1028     edm::ParameterSetDescription desc;
1029     desc.setUnknown();
1030     descriptions.addDefault(desc);
1031   }
1032 
1033 }  // namespace l1t
1034 
1035 using namespace l1t;
1036 
1037 //define this as a plug-in
1038 DEFINE_FWK_MODULE(L1TGlobalAnalyzer);