Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:09

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 /// To plot Candidate quantities
0010 class CandidateBenchmark : public Benchmark {
0011 public:
0012   CandidateBenchmark(Mode mode);
0013   ~CandidateBenchmark() override;
0014 
0015   /// book histograms
0016   void setup(DQMStore::IBooker &b);
0017   void setup(DQMStore::IBooker &b, const edm::ParameterSet &parameterSet);
0018 
0019   template <class C>
0020   void fill(const C &candidates);
0021 
0022   /// fill histograms with a given particle
0023   void fillOne(const reco::Candidate &candidate);
0024 
0025 protected:
0026   TH1F *pt_;
0027   TH1F *eta_;
0028   TH1F *phi_;
0029   TH1F *charge_;
0030   /// COLIN add this histo
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