File indexing completed on 2024-04-06 12:09:44
0001 #ifndef RecoParticleFlow_Benchmark_CandidateBenchmark_h
0002 #define RecoParticleFlow_Benchmark_CandidateBenchmark_h
0003
0004 #include "DQMOffline/PFTau/interface/Benchmark.h"
0005
0006 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008
0009
0010 class CandidateBenchmark : public Benchmark {
0011 public:
0012 CandidateBenchmark(Mode mode);
0013 ~CandidateBenchmark() override;
0014
0015
0016 void setup(DQMStore::IBooker &b);
0017 void setup(DQMStore::IBooker &b, const edm::ParameterSet ¶meterSet);
0018
0019 template <class C>
0020 void fill(const C &candidates);
0021
0022
0023 void fillOne(const reco::Candidate &candidate);
0024
0025 protected:
0026 TH1F *pt_;
0027 TH1F *eta_;
0028 TH1F *phi_;
0029 TH1F *charge_;
0030
0031 TH1F *pdgId_;
0032
0033 bool histogramBooked_;
0034 };
0035
0036 template <class C>
0037 void CandidateBenchmark::fill(const C &candCollection) {
0038 for (unsigned int i = 0; i < candCollection.size(); i++) {
0039 const reco::Candidate &cand = candCollection[i];
0040 fillOne(cand);
0041 }
0042 }
0043
0044 #endif