1 #ifndef DQMOffline_PFTau_PFCandidateMonitor_h
2 #define DQMOffline_PFTau_PFCandidateMonitor_h
27 float ptmin,
float ptmax,
float etamin,
float etamax,
43 template<
class T,
class C>
47 void fill(
const T& candidateCollection,
48 const C& matchedCandCollection,
float& minVal,
float& maxVal,
76 template<
class T,
class C>
80 const C& matchedCandCollection,
float& minVal,
float& maxVal,
85 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
86 if( !
isInRange(candCollection[
i].
pt(), candCollection[
i].
eta(), candCollection[
i].
phi() ) )
continue;
89 for(
unsigned j=0;
j<matchedCandCollection.size(); ++
j)
94 std::vector<int> matchIndices;
99 for (
unsigned int i = 0;
i < (candCollection).
size();
i++) {
104 int iMatch = matchIndices[
i];
105 assert(iMatch< static_cast<int>(matchedCandCollection.size()));
112 float ptRes = (cand.
pt() - matchedCand.
pt()) / matchedCand.
pt();
114 if (ptRes > maxVal) maxVal = ptRes;
115 if (ptRes < minVal) minVal = ptRes;
void setup()
book histograms
To plot Candidate quantities.
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
To plot Candidate quantities.
bool createReferenceHistos_
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
virtual float eta() const =0
momentum pseudorapidity
void fillOne(const reco::Candidate &candidate)
fill histograms with a given particle
virtual float phi() const =0
momentum azimuthal angle
void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool refHistoFlag)
set the parameters locally
virtual float pt() const =0
transverse momentum
void fill(const T &candidateCollection, const C &matchedCandCollection, float &minVal, float &maxVal, const edm::ParameterSet ¶meterSet)
fill histograms with all particle
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
virtual ~PFCandidateMonitor()
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
CandidateBenchmark candBench_
bool createEfficiencyHistos_
void fillOne(const reco::Candidate &cand)
MatchCandidateBenchmark matchCandBench_
bool isInRange(float pt, float eta, float phi) const
tuple size
Write out results.
ParameterSet const & parameterSet(Provenance const &provenance)
PFCandidateMonitor(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)