1 #ifndef DQMOffline_PFTau_PFCandidateMonitor_h
2 #define DQMOffline_PFTau_PFCandidateMonitor_h
27 float ptmin,
float ptmax,
float etamin,
float etamax,
41 template<
class T,
class C>
44 void fill(
const T& candidateCollection,
45 const C& matchedCandCollection,
float& minVal,
float& maxVal,
47 template<
class T,
class C,
class M>
48 void fill(
const T& candidateCollection,
49 const C& matchedCandCollection,
float& minVal,
float& maxVal,
77 template<
class T,
class C>
79 const C& matchedCandCollection,
float& minVal,
float& maxVal,
84 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
85 if( !
isInRange(candCollection[
i].
pt(), candCollection[
i].
eta(), candCollection[
i].
phi() ) )
continue;
88 for(
unsigned j=0;
j<matchedCandCollection.size(); ++
j)
93 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;
134 template<
class T,
class C,
class M>
138 const C& matchedCandCollection,
float& minVal,
float& maxVal,
144 for(
unsigned i=0;
i<candCollection.size(); ++
i) {
145 if( !
isInRange(candCollection[
i].
pt(), candCollection[
i].
eta(), candCollection[
i].
phi() ) )
continue;
148 for(
unsigned j=0;
j<matchedCandCollection.size(); ++
j)
153 std::vector<int> matchIndices;
160 for (
unsigned int i = 0;
i < (candCollection).
size();
i++) {
165 int iMatch = matchIndices[
i];
166 assert(iMatch< static_cast<int>(matchedCandCollection.size()));
173 float ptRes = (cand.
pt() - matchedCand.
pt()) / matchedCand.
pt();
175 if (ptRes > maxVal) maxVal = ptRes;
176 if (ptRes < minVal) minVal = ptRes;
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 double pt() const =0
transverse momentum
void fillOne(const reco::Candidate &candidate)
fill histograms with a given particle
void setup(DQMStore::IBooker &b)
book histograms
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
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)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
PFCandidateMonitor(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)