Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoParticleFlow_Benchmark_PFTauElecRejectionBenchmark_h
0002 #define RecoParticleFlow_Benchmark_PFTauElecRejectionBenchmark_h
0003 
0004 #include "DataFormats/TauReco/interface/PFTau.h"
0005 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h"
0006 #include "DataFormats/TauReco/interface/PFTauDiscriminatorByIsolation.h"
0007 
0008 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0009 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0010 
0011 #include "Math/GenVector/VectorUtil.h"
0012 #include "Math/GenVector/PxPyPzE4D.h"
0013 #include "TLorentzVector.h"
0014 
0015 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0016 #include "TH1F.h"
0017 #include "TH2F.h"
0018 #include <string>
0019 #include <TFile.h>
0020 
0021 #include "DQMServices/Core/interface/DQMStore.h"
0022 
0023 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0024 
0025 class PFTauElecRejectionBenchmark;
0026 
0027 class PFTauElecRejectionBenchmark {
0028 public:
0029   typedef dqm::legacy::DQMStore DQMStore;
0030   typedef dqm::legacy::MonitorElement MonitorElement;
0031 
0032   PFTauElecRejectionBenchmark();
0033   virtual ~PFTauElecRejectionBenchmark();
0034 
0035   void setup(std::string Filename,
0036              std::string benchmarkLabel,
0037              double maxDeltaR,
0038              double minRecoPt,
0039              double maxRecoAbsEta,
0040              double minMCPt,
0041              double maxMCAbsEta,
0042              std::string sGenMatchObjectLabel,
0043              bool applyEcalCrackCut,
0044              DQMStore *db_store);
0045   void process(edm::Handle<edm::HepMCProduct> mcevt,
0046                edm::Handle<reco::PFTauCollection> pfTaus,
0047                edm::Handle<reco::PFTauDiscriminator> pfTauIsoDiscr,
0048                edm::Handle<reco::PFTauDiscriminator> pfTauElecDiscr);
0049   void write();
0050 
0051 private:
0052   bool isInEcalCrack(double eta) const;
0053 
0054   TFile *file_;
0055   std::string outputFile_;
0056   std::string benchmarkLabel_;
0057   double maxDeltaR_;
0058   double minMCPt_;
0059   double maxMCAbsEta_;
0060   double minRecoPt_;
0061   double maxRecoAbsEta_;
0062   std::string sGenMatchObjectLabel_;
0063   bool applyEcalCrackCut_;
0064 
0065   // histograms
0066   TH1F *hEoverP;
0067   TH1F *hHoverP;
0068   TH1F *hEmfrac;
0069 
0070   TH1F *hEoverP_barrel;
0071   TH1F *hHoverP_barrel;
0072   TH1F *hEmfrac_barrel;
0073 
0074   TH1F *hEoverP_endcap;
0075   TH1F *hHoverP_endcap;
0076   TH1F *hEmfrac_endcap;
0077 
0078   TH1F *hEoverP_preid0;
0079   TH1F *hHoverP_preid0;
0080   TH1F *hEmfrac_preid0;
0081 
0082   TH1F *hEoverP_preid1;
0083   TH1F *hHoverP_preid1;
0084   TH1F *hEmfrac_preid1;
0085 
0086   TH1F *hElecPreID;
0087   TH1F *hElecMVA;
0088   TH1F *hTauElecDiscriminant;
0089 
0090   TH2F *hHoPvsEoP;
0091   TH2F *hHoPvsEoP_preid0;
0092   TH2F *hHoPvsEoP_preid1;
0093 
0094   TH2F *hEmfracvsEoP;
0095   TH2F *hEmfracvsEoP_preid0;
0096   TH2F *hEmfracvsEoP_preid1;
0097 
0098   TH1F *hpfcand_deltaEta;
0099   TH1F *hpfcand_deltaEta_weightE;
0100   TH1F *hpfcand_deltaPhiOverQ;
0101   TH1F *hpfcand_deltaPhiOverQ_weightE;
0102 
0103   TH1F *hleadTk_pt;
0104   TH1F *hleadTk_eta;
0105   TH1F *hleadTk_phi;
0106 
0107   // to be filled yet!
0108   TH1F *hleadGsfTk_pt;
0109   TH1F *hleadGsfTk_eta;
0110   TH1F *hleadGsfTk_phi;
0111 
0112   std::vector<TLorentzVector> _GenObjects;
0113 
0114 protected:
0115   DQMStore *db_;
0116 };
0117 
0118 #endif  // RecoParticleFlow_Benchmark_PFTauElecRejectionBenchmark_h