Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:19

0001 #ifndef RecoParticleFlow_Benchmark_PFMETBenchmark_h
0002 #define RecoParticleFlow_Benchmark_PFMETBenchmark_h
0003 
0004 #include "RecoParticleFlow/Benchmark/interface/PFBenchmarkAlgo.h"
0005 
0006 #include "DataFormats/METReco/interface/PFMETCollection.h"
0007 #include "DataFormats/METReco/interface/PFMET.h"
0008 #include "DataFormats/METReco/interface/METCollection.h"
0009 #include "DataFormats/METReco/interface/MET.h"
0010 #include "DataFormats/METReco/interface/GenMETCollection.h"
0011 #include "DataFormats/METReco/interface/GenMET.h"
0012 #include "DataFormats/METReco/interface/CaloMETCollection.h"
0013 #include "DataFormats/METReco/interface/CaloMET.h"
0014 #include "DataFormats/Candidate/interface/Candidate.h"
0015 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0016 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0017 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
0018 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0019 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0020 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0021 
0022 //#include "FWCore/ServiceRegistry/interface/Service.h"
0023 
0024 #include "TH1F.h"
0025 #include "TH2F.h"
0026 #include "DQMServices/Core/interface/DQMStore.h"
0027 #include <string>
0028 #include <TFile.h>
0029 
0030 class PFMETBenchmark {
0031 public:
0032   typedef dqm::legacy::DQMStore DQMStore;
0033   typedef dqm::legacy::MonitorElement MonitorElement;
0034 
0035   PFMETBenchmark();
0036   virtual ~PFMETBenchmark();
0037 
0038   void setup(std::string Filename,
0039              bool debug,
0040              bool plotAgainstReco = false,
0041              std::string benchmarkLabel_ = "ParticleFlow",
0042              DQMStore* dbe_store = nullptr);
0043   void process(const reco::PFMETCollection&,
0044                const reco::GenParticleCollection&,
0045                const reco::CaloMETCollection&,
0046                const reco::METCollection&);
0047   void calculateQuantities(const reco::PFMETCollection&,
0048                            const reco::GenParticleCollection&,
0049                            const reco::CaloMETCollection&,
0050                            const reco::METCollection&);
0051   void calculateQuantities(const reco::PFMETCollection&,
0052                            const reco::GenParticleCollection&,
0053                            const reco::CaloMETCollection&,
0054                            const reco::METCollection&,
0055                            const std::vector<reco::CaloJet>&,
0056                            const std::vector<reco::CaloJet>&);
0057   float getTrueMET() { return true_met; }
0058   float getTruePhi() { return true_phi; }
0059   float getTrueSET() { return true_set; }
0060   float getPFMET() { return rec_met; }
0061   float getPFMEX() { return rec_mex - true_mex; }
0062   float getPFMEY() { return rec_mey - true_mey; }
0063   float getPFPhi() { return rec_phi; }
0064   float getPFSET() { return rec_set; }
0065   float getCaloMET() { return calo_met; }
0066   float getCaloMEX() { return calo_mex - true_mex; }
0067   float getCaloMEY() { return calo_mey - true_mey; }
0068   float getCaloPhi() { return calo_phi; }
0069   float getCaloSET() { return calo_set; }
0070   float getTCMET() { return tc_met; }
0071   float getTCMEX() { return tc_mex - true_mex; }
0072   float getTCMEY() { return tc_mey - true_mey; }
0073   float getTCPhi() { return tc_phi; }
0074   float getTCSET() { return tc_set; }
0075   float getDeltaPFMET() { return rec_met - true_met; }
0076   float getDeltaPFPhi() { return mpi_pi(rec_phi - true_phi); }
0077   float getDeltaPFSET() { return rec_set - true_set; }
0078   float getDeltaCaloMET() { return calo_met - true_met; }
0079   float getDeltaCaloPhi() { return mpi_pi(calo_phi - true_phi); }
0080   float getDeltaCaloSET() { return calo_set - true_set; }
0081   float getDeltaTCMET() { return tc_met - true_met; }
0082   float getDeltaTCPhi() { return mpi_pi(tc_phi - true_phi); }
0083   float getDeltaTCSET() { return tc_set - true_set; }
0084   double mpi_pi(double angle);
0085   void analyse();
0086   //void FitSlicesInY(TH2F*, TH1F*, TH1F*, bool, int);
0087   void write();
0088 
0089 private:
0090   TFile* file_;
0091 
0092   // histograms
0093   // delta Pt or E quantities for Barrel
0094   TProfile* profileSETvsSETresp;
0095   TProfile* profileMETvsMETresp;
0096   TH2F* hSETvsDeltaSET;
0097   TH2F* hSETvsDeltaMET;
0098   TH1F* hMEX;
0099   TH1F* hDeltaMEX;
0100   TH1F* hDeltaMET;
0101   TH1F* hDeltaPhi;
0102   TH1F* hDeltaSET;
0103 
0104   TH2F* hDeltaPFMETvstrueMET;
0105   TH2F* hDeltaCaloMETvstrueMET;
0106   TH2F* hDeltaPFPhivstrueMET;
0107   TH2F* hDeltaCaloPhivstrueMET;
0108   TH2F* hCaloMETvstrueMET;
0109   TH2F* hPFMETvstrueMET;
0110   TH2F* hDeltaCaloMEXvstrueSET;
0111   TH2F* hDeltaPFMEXvstrueSET;
0112   TH1F* hTrueMET;
0113   TH1F* hCaloMET;
0114   TH1F* hPFMET;
0115   TH1F* hTCMET;
0116   TH2F* hDeltaTCMETvstrueMET;
0117   TH2F* hDeltaTCPhivstrueMET;
0118 
0119   TProfile* profileCaloSETvsCaloSETresp;
0120   TProfile* profileCaloMETvsCaloMETresp;
0121   TH2F* hCaloSETvsDeltaCaloSET;
0122   TH2F* hCaloSETvsDeltaCaloMET;
0123   TH1F* hCaloMEX;
0124   TH1F* hDeltaCaloMEX;
0125   TH1F* hDeltaCaloMET;
0126   TH1F* hDeltaCaloPhi;
0127   TH1F* hDeltaCaloSET;
0128 
0129   TProfile* profileTCSETvsTCSETresp;
0130   TProfile* profileTCMETvsTCMETresp;
0131   TH2F* hTCSETvsDeltaTCSET;
0132   TH2F* hTCSETvsDeltaTCMET;
0133   TH1F* hTCMEX;
0134   TH1F* hDeltaTCMEX;
0135   TH1F* hDeltaTCMET;
0136   TH1F* hDeltaTCPhi;
0137   TH1F* hDeltaTCSET;
0138 
0139   TH2F* hDeltaTCMEXvstrueSET;
0140   TH2F* hTCMETvstrueMET;
0141 
0142   //TH1F *hmeanPF;
0143   //TH1F *hmeanCalo;
0144   //TH1F *hsigmaPF;
0145   //TH1F *hsigmaCalo;
0146   //TH1F *hrmsPF;
0147   //TH1F *hrmsCalo;
0148 
0149   std::string outputFile_;
0150 
0151   double true_set;
0152   double true_met;
0153   double true_mex;
0154   double true_mey;
0155   double true_phi;
0156   double rec_met;
0157   double rec_mex;
0158   double rec_mey;
0159   double rec_phi;
0160   double rec_set;
0161   double calo_met;
0162   double calo_mex;
0163   double calo_mey;
0164   double calo_phi;
0165   double calo_set;
0166   double tc_met;
0167   double tc_mex;
0168   double tc_mey;
0169   double tc_phi;
0170   double tc_set;
0171 
0172 protected:
0173   PFBenchmarkAlgo* algo_;
0174   bool debug_;
0175   bool plotAgainstReco_;
0176   DQMStore* dbe_;
0177 };
0178 
0179 #endif  // RecoParticleFlow_Benchmark_PFMETBenchmark_h