1 #ifndef DQMOffline_PFTau_PFJetMonitor_h
2 #define DQMOffline_PFTau_PFJetMonitor_h
28 bool fracHistoFlag=
true);
31 float ptmin,
float ptmax,
float etamin,
float etamax,
float phimin,
float phimax,
32 bool fracHistoFlag=
true);
45 template<
class T,
class C>
46 void fill(
const T& jetCollection,
const C& matchedJetCollection,
47 float& minVal,
float& maxVal);
49 template<
class T,
class C>
50 void fill(
const T& candidateCollection,
const C& matchedCandCollection,
51 float& minVal,
float& maxVal,
float& jetpT,
77 template<
class T,
class C>
79 const C& matchedJetCollection,
float& minVal,
float& maxVal) {
82 std::vector<int> matchIndices;
85 for (
unsigned int i = 0;
i < (jetCollection).
size();
i++) {
90 int iMatch = matchIndices[
i];
91 assert(iMatch< static_cast<int>(matchedJetCollection.size()));
96 float ptRes = (jet.
pt() - matchedJet.
pt())/matchedJet.
pt();
98 if (ptRes > maxVal) maxVal = ptRes;
99 if (ptRes < minVal) minVal = ptRes;
109 template<
class T,
class C>
111 const C& matchedJetCollection,
float& minVal,
float& maxVal,
float& jetpT,
114 std::vector<int> matchIndices;
118 for(
unsigned i=0;
i<jetCollection.size(); ++
i) {
120 unsigned int highJets = 0;
121 for(
unsigned j=0;
j<jetCollection.size(); ++
j) {
122 if (
j !=
i && jetCollection[
j].
pt() > jetCollection[
i].pt()) highJets++;
130 int iMatch = matchIndices[
i];
131 assert( iMatch < static_cast<int>(matchedJetCollection.size()) );
135 if ( !
isInRange( matchedJet.
pt(), matchedJet.
eta(), matchedJet.
phi() ) )
continue;
137 float ptRes = (jet.
pt() - matchedJet.
pt()) / matchedJet.
pt();
140 if (ptRes > maxVal) maxVal = ptRes;
141 if (ptRes < minVal) minVal = ptRes;
148 for(
unsigned j=0;
j<matchedJetCollection.size(); ++
j)
To plot Candidate quantities.
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
To plot Candidate quantities.
CandidateBenchmark candBench_
void match(const C &candCollection, const M &matchedCandCollection, std::vector< int > &matchIndices, bool matchCharge=false, float dRMax=-1)
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
virtual double pt() const =0
transverse momentum
void fillOne(const reco::Candidate &candidate)
fill histograms with a given particle
Base class for all types of Jets.
void fill(const T &jetCollection, const C &matchedJetCollection, float &minVal, float &maxVal)
fill histograms with all particle
double deltaR(const T1 &t1, const T2 &t2)
bool createPFractionHistos_
TH2F * delta_frac_VS_frac_muon_
MatchCandidateBenchmark matchCandBench_
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
void setup(DQMStore::IBooker &b)
book histograms
TH2F * delta_frac_VS_frac_neutral_hadron_
void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool fracHistoFlag=true)
set the parameters locally
PFJetMonitor(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
void fillOne(const reco::Jet &jet, const reco::Jet &matchedJet)
TH2F * delta_frac_VS_frac_photon_
TH2F * delta_frac_VS_frac_electron_
TH2F * delta_frac_VS_frac_charged_hadron_
bool isInRange(float pt, float eta, float phi) const
virtual double phi() const
momentum azimuthal angle
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