Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:33:42

0001 #ifndef METTESTER_H
0002 #define METTESTER_H
0003 
0004 // author: Mike Schmitt (The University of Florida)
0005 // date: 8/24/2006
0006 // modification: Bobby Scurlock
0007 // date: 03.11.2006
0008 // note: added RMS(METx) vs SumET capability
0009 // modification: Rick Cavanaugh
0010 // date: 05.11.2006
0011 // note: added configuration parameters
0012 // modification: Mike Schmitt
0013 // date: 02.28.2007
0014 // note: code rewrite
0015 
0016 // Rewritten by Viola Sordini, Matthias Artur Weber, Robert Schoefbeck Nov./Dez.
0017 // 2013
0018 
0019 #include "DQMServices/Core/interface/DQMStore.h"
0020 #include "DataFormats/Common/interface/Handle.h"
0021 #include "DataFormats/Common/interface/ValueMap.h"
0022 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0023 #include "DataFormats/METReco/interface/CaloMET.h"
0024 #include "DataFormats/METReco/interface/CaloMETCollection.h"
0025 #include "DataFormats/METReco/interface/GenMET.h"
0026 #include "DataFormats/METReco/interface/GenMETCollection.h"
0027 #include "DataFormats/METReco/interface/MET.h"
0028 #include "DataFormats/METReco/interface/METCollection.h"
0029 #include "DataFormats/METReco/interface/METFwd.h"
0030 #include "DataFormats/METReco/interface/PFMET.h"
0031 #include "DataFormats/METReco/interface/PFMETCollection.h"
0032 #include "DataFormats/MuonReco/interface/Muon.h"
0033 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0034 #include "DataFormats/MuonReco/interface/MuonMETCorrectionData.h"
0035 #include "DataFormats/PatCandidates/interface/MET.h"
0036 #include "DataFormats/TrackReco/interface/Track.h"
0037 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0038 #include "DataFormats/VertexReco/interface/Vertex.h"
0039 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0040 #include "FWCore/Framework/interface/EDAnalyzer.h"
0041 #include "FWCore/Framework/interface/Event.h"
0042 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0043 #include "FWCore/ServiceRegistry/interface/Service.h"
0044 #include "FWCore/Utilities/interface/EDGetToken.h"
0045 #include "FWCore/Utilities/interface/InputTag.h"
0046 #include "TMath.h"
0047 #include <DQMServices/Core/interface/DQMEDAnalyzer.h>
0048 
0049 // class METTester: public edm::EDAnalyzer {
0050 class METTester : public DQMEDAnalyzer {
0051 public:
0052   explicit METTester(const edm::ParameterSet &);
0053 
0054   void analyze(const edm::Event &, const edm::EventSetup &) override;
0055   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0056 
0057 private:
0058   std::map<std::string, MonitorElement *> me;
0059 
0060   // Inputs from Configuration File
0061 
0062   edm::InputTag mInputCollection_;
0063   edm::InputTag inputMETLabel_;
0064   std::string METType_;
0065 
0066   edm::InputTag inputCaloMETLabel_;
0067 
0068   // Tokens
0069   edm::EDGetTokenT<std::vector<reco::Vertex>> pvToken_;
0070   edm::EDGetTokenT<reco::CaloMETCollection> caloMETsToken_;
0071   edm::EDGetTokenT<reco::PFMETCollection> pfMETsToken_;
0072   // edm::EDGetTokenT<reco::METCollection> tcMETsToken_;
0073   edm::EDGetTokenT<reco::GenMETCollection> genMETsToken_;
0074   edm::EDGetTokenT<reco::GenMETCollection> genMETsTrueToken_;
0075   edm::EDGetTokenT<reco::GenMETCollection> genMETsCaloToken_;
0076   edm::EDGetTokenT<pat::METCollection> patMETToken_;
0077 
0078   // Events variables
0079   MonitorElement *mNvertex;
0080 
0081   // Common variables
0082   MonitorElement *mMEx;
0083   MonitorElement *mMEy;
0084   MonitorElement *mMETSig;
0085   MonitorElement *mMET;
0086   MonitorElement *mMETFine;
0087   MonitorElement *mMET_Nvtx;
0088   MonitorElement *mMETPhi;
0089   MonitorElement *mSumET;
0090   MonitorElement *mMETDifference_GenMETTrue;
0091   MonitorElement *mMETDeltaPhi_GenMETTrue;
0092   MonitorElement *mMETDifference_GenMETCalo;
0093   MonitorElement *mMETDeltaPhi_GenMETCalo;
0094 
0095   // MET Uncertainity Variables
0096   MonitorElement *mMETUnc_JetResUp;
0097   MonitorElement *mMETUnc_JetResDown;
0098   MonitorElement *mMETUnc_JetEnUp;
0099   MonitorElement *mMETUnc_JetEnDown;
0100   MonitorElement *mMETUnc_MuonEnUp;
0101   MonitorElement *mMETUnc_MuonEnDown;
0102   MonitorElement *mMETUnc_ElectronEnUp;
0103   MonitorElement *mMETUnc_ElectronEnDown;
0104   MonitorElement *mMETUnc_TauEnUp;
0105   MonitorElement *mMETUnc_TauEnDown;
0106   MonitorElement *mMETUnc_UnclusteredEnUp;
0107   MonitorElement *mMETUnc_UnclusteredEnDown;
0108   MonitorElement *mMETUnc_PhotonEnUp;
0109   MonitorElement *mMETUnc_PhotonEnDown;
0110 
0111   // CaloMET variables
0112 
0113   MonitorElement *mCaloMaxEtInEmTowers;
0114   MonitorElement *mCaloMaxEtInHadTowers;
0115   MonitorElement *mCaloEtFractionHadronic;
0116   MonitorElement *mCaloEmEtFraction;
0117   MonitorElement *mCaloHadEtInHB;
0118   MonitorElement *mCaloHadEtInHO;
0119   MonitorElement *mCaloHadEtInHE;
0120   MonitorElement *mCaloHadEtInHF;
0121   MonitorElement *mCaloHadEtInEB;
0122   MonitorElement *mCaloHadEtInEE;
0123   MonitorElement *mCaloEmEtInHF;
0124   MonitorElement *mCaloSETInpHF;
0125   MonitorElement *mCaloSETInmHF;
0126   MonitorElement *mCaloEmEtInEE;
0127   MonitorElement *mCaloEmEtInEB;
0128 
0129   // GenMET variables
0130   MonitorElement *mNeutralEMEtFraction;
0131   MonitorElement *mNeutralHadEtFraction;
0132   MonitorElement *mChargedEMEtFraction;
0133   MonitorElement *mChargedHadEtFraction;
0134   MonitorElement *mMuonEtFraction;
0135   MonitorElement *mInvisibleEtFraction;
0136 
0137   // MET variables
0138 
0139   // PFMET variables
0140   MonitorElement *mPFphotonEtFraction;
0141   MonitorElement *mPFphotonEt;
0142   MonitorElement *mPFneutralHadronEtFraction;
0143   MonitorElement *mPFneutralHadronEt;
0144   MonitorElement *mPFelectronEtFraction;
0145   MonitorElement *mPFelectronEt;
0146   MonitorElement *mPFchargedHadronEtFraction;
0147   MonitorElement *mPFchargedHadronEt;
0148   MonitorElement *mPFmuonEtFraction;
0149   MonitorElement *mPFmuonEt;
0150   MonitorElement *mPFHFHadronEtFraction;
0151   MonitorElement *mPFHFHadronEt;
0152   MonitorElement *mPFHFEMEtFraction;
0153   MonitorElement *mPFHFEMEt;
0154 
0155   MonitorElement *mMETDifference_GenMETTrue_MET0to20;
0156   MonitorElement *mMETDifference_GenMETTrue_MET20to40;
0157   MonitorElement *mMETDifference_GenMETTrue_MET40to60;
0158   MonitorElement *mMETDifference_GenMETTrue_MET60to80;
0159   MonitorElement *mMETDifference_GenMETTrue_MET80to100;
0160   MonitorElement *mMETDifference_GenMETTrue_MET100to150;
0161   MonitorElement *mMETDifference_GenMETTrue_MET150to200;
0162   MonitorElement *mMETDifference_GenMETTrue_MET200to300;
0163   MonitorElement *mMETDifference_GenMETTrue_MET300to400;
0164   MonitorElement *mMETDifference_GenMETTrue_MET400to500;
0165   MonitorElement *mMETDifference_GenMETTrue_MET500;
0166   // moved into postprocessor
0167   // MonitorElement* mMETDifference_GenMETTrue_METResolution;
0168 
0169   bool isCaloMET;
0170   //  bool isCorMET;
0171   //  bool isTcMET;
0172   bool isPFMET;
0173   bool isGenMET;
0174   bool isMiniAODMET;
0175 };
0176 
0177 #endif  // METTESTER_H