File indexing completed on 2024-04-06 12:27:19
0001 #ifndef RecoParticleFlow_Benchmark_PFJetBenchmark_h
0002 #define RecoParticleFlow_Benchmark_PFJetBenchmark_h
0003
0004 #include "RecoParticleFlow/Benchmark/interface/PFBenchmarkAlgo.h"
0005
0006 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0007 #include "DataFormats/JetReco/interface/PFJet.h"
0008 #include "DataFormats/JetReco/interface/GenJetCollection.h"
0009 #include "DataFormats/JetReco/interface/GenJet.h"
0010 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0011 #include "DataFormats/JetReco/interface/BasicJetCollection.h"
0012 #include "DataFormats/Candidate/interface/Candidate.h"
0013 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0014 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0015 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
0016 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0017 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0018
0019
0020
0021 #include "TH1F.h"
0022 #include "TH2F.h"
0023 #include "DQMServices/Core/interface/DQMStore.h"
0024 #include <string>
0025 #include <TFile.h>
0026 #include <vector>
0027
0028 class PFJetBenchmark {
0029 public:
0030 typedef dqm::legacy::DQMStore DQMStore;
0031 typedef dqm::legacy::MonitorElement MonitorElement;
0032
0033 PFJetBenchmark();
0034 virtual ~PFJetBenchmark();
0035
0036 void setup(std::string Filename,
0037 bool debug,
0038 bool plotAgainstReco = false,
0039 bool onlyTwoJets = true,
0040 double deltaRMax = 0.1,
0041 std::string benchmarkLabel_ = "ParticleFlow",
0042 double recPt = -1,
0043 double maxEta = -1,
0044 DQMStore *dbe_store = nullptr);
0045 void process(const reco::PFJetCollection &, const reco::GenJetCollection &);
0046 void gettrue(const reco::GenJet *truth,
0047 double &true_ChargedHadEnergy,
0048 double &true_NeutralHadEnergy,
0049 double &true_NeutralEmEnergy);
0050 void printPFJet(const reco::PFJet *);
0051 void printGenJet(const reco::GenJet *);
0052 double resPtMax() const { return resPtMax_; };
0053 double resChargedHadEnergyMax() const { return resChargedHadEnergyMax_; };
0054 double resNeutralHadEnergyMax() const { return resNeutralHadEnergyMax_; };
0055 double resNeutralEmEnergyMax() const { return resNeutralEmEnergyMax_; };
0056
0057 void write();
0058
0059 private:
0060 TFile *file_;
0061
0062
0063
0064 TH1F *hNjets;
0065 TH1F *hjetsPt;
0066 TH1F *hjetsEta;
0067 TH2F *hRPtvsEta;
0068 TH2F *hDEtavsEta;
0069 TH2F *hDPhivsEta;
0070 TH2F *hRNeutvsEta;
0071 TH2F *hRNEUTvsEta;
0072 TH2F *hRNONLvsEta;
0073 TH2F *hRHCALvsEta;
0074 TH2F *hRHONLvsEta;
0075 TH2F *hRCHEvsEta;
0076 TH2F *hNCHvsEta;
0077 TH2F *hNCH0vsEta;
0078 TH2F *hNCH1vsEta;
0079 TH2F *hNCH2vsEta;
0080 TH2F *hNCH3vsEta;
0081 TH2F *hNCH4vsEta;
0082 TH2F *hNCH5vsEta;
0083 TH2F *hNCH6vsEta;
0084 TH2F *hNCH7vsEta;
0085
0086
0087 TH1F *hBRPt;
0088 TH1F *hBRPt20_40;
0089 TH1F *hBRPt40_60;
0090 TH1F *hBRPt60_80;
0091 TH1F *hBRPt80_100;
0092 TH1F *hBRPt100_150;
0093 TH1F *hBRPt150_200;
0094 TH1F *hBRPt200_250;
0095 TH1F *hBRPt250_300;
0096 TH1F *hBRPt300_400;
0097 TH1F *hBRPt400_500;
0098 TH1F *hBRPt500_750;
0099 TH1F *hBRPt750_1250;
0100 TH1F *hBRPt1250_2000;
0101 TH1F *hBRPt2000_5000;
0102 TH1F *hBRCHE;
0103 TH1F *hBRNHE;
0104 TH1F *hBRNEE;
0105 TH1F *hBRneut;
0106 TH2F *hBRPtvsPt;
0107 TH2F *hBRCHEvsPt;
0108 TH2F *hBRNHEvsPt;
0109 TH2F *hBRNEEvsPt;
0110 TH2F *hBRneutvsPt;
0111 TH2F *hBRNEUTvsP;
0112 TH2F *hBRNONLvsP;
0113 TH2F *hBRHCALvsP;
0114 TH2F *hBRHONLvsP;
0115 TH2F *hBDEtavsPt;
0116 TH2F *hBDPhivsPt;
0117 TH2F *hBNCHvsPt;
0118 TH1F *hBNCH;
0119 TH2F *hBNCH0vsPt;
0120 TH2F *hBNCH1vsPt;
0121 TH2F *hBNCH2vsPt;
0122 TH2F *hBNCH3vsPt;
0123 TH2F *hBNCH4vsPt;
0124 TH2F *hBNCH5vsPt;
0125 TH2F *hBNCH6vsPt;
0126 TH2F *hBNCH7vsPt;
0127
0128
0129 TH1F *hERPt;
0130 TH1F *hERPt20_40;
0131 TH1F *hERPt40_60;
0132 TH1F *hERPt60_80;
0133 TH1F *hERPt80_100;
0134 TH1F *hERPt100_150;
0135 TH1F *hERPt150_200;
0136 TH1F *hERPt200_250;
0137 TH1F *hERPt250_300;
0138 TH1F *hERPt300_400;
0139 TH1F *hERPt400_500;
0140 TH1F *hERPt500_750;
0141 TH1F *hERPt750_1250;
0142 TH1F *hERPt1250_2000;
0143 TH1F *hERPt2000_5000;
0144 TH1F *hERCHE;
0145 TH1F *hERNHE;
0146 TH1F *hERNEE;
0147 TH1F *hERneut;
0148 TH2F *hERPtvsPt;
0149 TH2F *hERCHEvsPt;
0150 TH2F *hERNHEvsPt;
0151 TH2F *hERNEEvsPt;
0152 TH2F *hERneutvsPt;
0153 TH2F *hERNEUTvsP;
0154 TH2F *hERNONLvsP;
0155 TH2F *hERHCALvsP;
0156 TH2F *hERHONLvsP;
0157 TH2F *hEDEtavsPt;
0158 TH2F *hEDPhivsPt;
0159 TH2F *hENCHvsPt;
0160 TH1F *hENCH;
0161 TH2F *hENCH0vsPt;
0162 TH2F *hENCH1vsPt;
0163 TH2F *hENCH2vsPt;
0164 TH2F *hENCH3vsPt;
0165 TH2F *hENCH4vsPt;
0166 TH2F *hENCH5vsPt;
0167 TH2F *hENCH6vsPt;
0168 TH2F *hENCH7vsPt;
0169
0170
0171 TH1F *hFRPt;
0172 TH1F *hFRPt20_40;
0173 TH1F *hFRPt40_60;
0174 TH1F *hFRPt60_80;
0175 TH1F *hFRPt80_100;
0176 TH1F *hFRPt100_150;
0177 TH1F *hFRPt150_200;
0178 TH1F *hFRPt200_250;
0179 TH1F *hFRPt250_300;
0180 TH1F *hFRPt300_400;
0181 TH1F *hFRPt400_500;
0182 TH1F *hFRPt500_750;
0183 TH1F *hFRPt750_1250;
0184 TH1F *hFRPt1250_2000;
0185 TH1F *hFRPt2000_5000;
0186 TH1F *hFRCHE;
0187 TH1F *hFRNHE;
0188 TH1F *hFRNEE;
0189 TH1F *hFRneut;
0190 TH2F *hFRPtvsPt;
0191 TH2F *hFRCHEvsPt;
0192 TH2F *hFRNHEvsPt;
0193 TH2F *hFRNEEvsPt;
0194 TH2F *hFRneutvsPt;
0195 TH2F *hFRNEUTvsP;
0196 TH2F *hFRNONLvsP;
0197 TH2F *hFRHCALvsP;
0198 TH2F *hFRHONLvsP;
0199 TH2F *hFDEtavsPt;
0200 TH2F *hFDPhivsPt;
0201 TH2F *hFNCHvsPt;
0202 TH1F *hFNCH;
0203 TH2F *hFNCH0vsPt;
0204 TH2F *hFNCH1vsPt;
0205 TH2F *hFNCH2vsPt;
0206 TH2F *hFNCH3vsPt;
0207 TH2F *hFNCH4vsPt;
0208 TH2F *hFNCH5vsPt;
0209 TH2F *hFNCH6vsPt;
0210 TH2F *hFNCH7vsPt;
0211
0212 std::string outputFile_;
0213
0214 protected:
0215 PFBenchmarkAlgo *algo_;
0216 bool debug_;
0217 bool plotAgainstReco_;
0218 bool onlyTwoJets_;
0219 double deltaRMax_;
0220 double resPtMax_;
0221 double resChargedHadEnergyMax_;
0222 double resNeutralHadEnergyMax_;
0223 double resNeutralEmEnergyMax_;
0224 double recPt_cut;
0225 double maxEta_cut;
0226 unsigned int entry_;
0227 DQMStore *dbe_;
0228 };
0229
0230 #endif