Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:33:08

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/Event.h"
0041 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0042 #include "FWCore/ServiceRegistry/interface/Service.h"
0043 #include "FWCore/Utilities/interface/EDGetToken.h"
0044 #include "FWCore/Utilities/interface/InputTag.h"
0045 #include "TMath.h"
0046 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0047 
0048 class METTester : public DQMEDAnalyzer {
0049 public:
0050   explicit METTester(const edm::ParameterSet &);
0051 
0052   void analyze(const edm::Event &, const edm::EventSetup &) override;
0053   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0054 
0055 private:
0056   std::map<std::string, MonitorElement *> me;
0057 
0058   // Inputs from Configuration File
0059 
0060   edm::InputTag mInputCollection_;
0061   edm::InputTag inputMETLabel_;
0062   std::string METType_;
0063 
0064   edm::InputTag inputCaloMETLabel_;
0065 
0066   // Tokens
0067   edm::EDGetTokenT<std::vector<reco::Vertex>> pvToken_;
0068   edm::EDGetTokenT<reco::CaloMETCollection> caloMETsToken_;
0069   edm::EDGetTokenT<reco::PFMETCollection> pfMETsToken_;
0070   // edm::EDGetTokenT<reco::METCollection> tcMETsToken_;
0071   edm::EDGetTokenT<reco::GenMETCollection> genMETsToken_;
0072   edm::EDGetTokenT<reco::GenMETCollection> genMETsTrueToken_;
0073   edm::EDGetTokenT<reco::GenMETCollection> genMETsCaloToken_;
0074   edm::EDGetTokenT<pat::METCollection> patMETToken_;
0075 
0076   // Events variables
0077   MonitorElement *mNvertex;
0078 
0079   // Common variables
0080   MonitorElement *mMEx;
0081   MonitorElement *mMEy;
0082   MonitorElement *mMETSig;
0083   MonitorElement *mMET;
0084   MonitorElement *mMETFine;
0085   MonitorElement *mMET_Nvtx;
0086   MonitorElement *mMETPhi;
0087   MonitorElement *mSumET;
0088   MonitorElement *mMETDifference_GenMETTrue;
0089   MonitorElement *mMETDeltaPhi_GenMETTrue;
0090   MonitorElement *mMETDifference_GenMETCalo;
0091   MonitorElement *mMETDeltaPhi_GenMETCalo;
0092 
0093   // MET Uncertainity Variables
0094   MonitorElement *mMETUnc_JetResUp;
0095   MonitorElement *mMETUnc_JetResDown;
0096   MonitorElement *mMETUnc_JetEnUp;
0097   MonitorElement *mMETUnc_JetEnDown;
0098   MonitorElement *mMETUnc_MuonEnUp;
0099   MonitorElement *mMETUnc_MuonEnDown;
0100   MonitorElement *mMETUnc_ElectronEnUp;
0101   MonitorElement *mMETUnc_ElectronEnDown;
0102   MonitorElement *mMETUnc_TauEnUp;
0103   MonitorElement *mMETUnc_TauEnDown;
0104   MonitorElement *mMETUnc_UnclusteredEnUp;
0105   MonitorElement *mMETUnc_UnclusteredEnDown;
0106   MonitorElement *mMETUnc_PhotonEnUp;
0107   MonitorElement *mMETUnc_PhotonEnDown;
0108 
0109   // CaloMET variables
0110 
0111   MonitorElement *mCaloMaxEtInEmTowers;
0112   MonitorElement *mCaloMaxEtInHadTowers;
0113   MonitorElement *mCaloEtFractionHadronic;
0114   MonitorElement *mCaloEmEtFraction;
0115   MonitorElement *mCaloHadEtInHB;
0116   MonitorElement *mCaloHadEtInHO;
0117   MonitorElement *mCaloHadEtInHE;
0118   MonitorElement *mCaloHadEtInHF;
0119   MonitorElement *mCaloHadEtInEB;
0120   MonitorElement *mCaloHadEtInEE;
0121   MonitorElement *mCaloEmEtInHF;
0122   MonitorElement *mCaloSETInpHF;
0123   MonitorElement *mCaloSETInmHF;
0124   MonitorElement *mCaloEmEtInEE;
0125   MonitorElement *mCaloEmEtInEB;
0126 
0127   // GenMET variables
0128   MonitorElement *mNeutralEMEtFraction;
0129   MonitorElement *mNeutralHadEtFraction;
0130   MonitorElement *mChargedEMEtFraction;
0131   MonitorElement *mChargedHadEtFraction;
0132   MonitorElement *mMuonEtFraction;
0133   MonitorElement *mInvisibleEtFraction;
0134 
0135   // MET variables
0136 
0137   // PFMET variables
0138   MonitorElement *mPFphotonEtFraction;
0139   MonitorElement *mPFphotonEt;
0140   MonitorElement *mPFneutralHadronEtFraction;
0141   MonitorElement *mPFneutralHadronEt;
0142   MonitorElement *mPFelectronEtFraction;
0143   MonitorElement *mPFelectronEt;
0144   MonitorElement *mPFchargedHadronEtFraction;
0145   MonitorElement *mPFchargedHadronEt;
0146   MonitorElement *mPFmuonEtFraction;
0147   MonitorElement *mPFmuonEt;
0148   MonitorElement *mPFHFHadronEtFraction;
0149   MonitorElement *mPFHFHadronEt;
0150   MonitorElement *mPFHFEMEtFraction;
0151   MonitorElement *mPFHFEMEt;
0152 
0153   MonitorElement *mMETDifference_GenMETTrue_MET0to20;
0154   MonitorElement *mMETDifference_GenMETTrue_MET20to40;
0155   MonitorElement *mMETDifference_GenMETTrue_MET40to60;
0156   MonitorElement *mMETDifference_GenMETTrue_MET60to80;
0157   MonitorElement *mMETDifference_GenMETTrue_MET80to100;
0158   MonitorElement *mMETDifference_GenMETTrue_MET100to150;
0159   MonitorElement *mMETDifference_GenMETTrue_MET150to200;
0160   MonitorElement *mMETDifference_GenMETTrue_MET200to300;
0161   MonitorElement *mMETDifference_GenMETTrue_MET300to400;
0162   MonitorElement *mMETDifference_GenMETTrue_MET400to500;
0163   MonitorElement *mMETDifference_GenMETTrue_MET500;
0164   // moved into postprocessor
0165   // MonitorElement* mMETDifference_GenMETTrue_METResolution;
0166 
0167   bool isCaloMET;
0168   //  bool isCorMET;
0169   //  bool isTcMET;
0170   bool isPFMET;
0171   bool isGenMET;
0172   bool isMiniAODMET;
0173 };
0174 
0175 #endif  // METTESTER_H