1 #ifndef DQMOffline_PFTau_PFJetMonitor_h
2 #define DQMOffline_PFTau_PFJetMonitor_h
20 PFJetMonitor(
float dRMax = 0.3,
bool matchCharge =
true,
28 float ptmax,
float etamin,
float etamax,
32 float ptmin,
float ptmax,
float etamin,
float etamax,
33 float phimin,
float phimax,
bool fracHistoFlag=
true);
48 template<
class T,
class C>
49 void fill(
const T& jetCollection,
50 const C& matchedJetCollection,
float& minVal,
float& maxVal);
52 template<
class T,
class C>
53 void fill(
const T& candidateCollection,
54 const C& matchedCandCollection,
float& minVal,
float& maxVal,
float& jetpT,
80 template<
class T,
class C>
82 const C& matchedJetCollection,
float& minVal,
float& maxVal) {
85 std::vector<int> matchIndices;
88 for (
unsigned int i = 0;
i < (jetCollection).
size();
i++) {
93 int iMatch = matchIndices[
i];
94 assert(iMatch< static_cast<int>(matchedJetCollection.size()));
99 float ptRes = (jet.
pt() - matchedJet.
pt())/matchedJet.
pt();
101 if (ptRes > maxVal) maxVal = ptRes;
102 if (ptRes < minVal) minVal = ptRes;
112 template<
class T,
class C>
114 const C& matchedJetCollection,
float& minVal,
float& maxVal,
float& jetpT,
117 std::vector<int> matchIndices;
121 for(
unsigned i=0;
i<jetCollection.size(); ++
i) {
123 unsigned int highJets = 0;
124 for(
unsigned j=0;
j<jetCollection.size(); ++
j) {
125 if (
j !=
i && jetCollection[
j].
pt() > jetCollection[
i].pt()) highJets++;
133 int iMatch = matchIndices[
i];
134 assert( iMatch < static_cast<int>(matchedJetCollection.size()) );
138 if ( !
isInRange( matchedJet.
pt(), matchedJet.
eta(), matchedJet.
phi() ) )
continue;
140 float ptRes = (jet.
pt() - matchedJet.
pt()) / matchedJet.
pt();
143 if (ptRes > maxVal) maxVal = ptRes;
144 if (ptRes < minVal) minVal = ptRes;
151 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 float eta() const =0
momentum pseudorapidity
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
virtual float phi() const =0
momentum azimuthal angle
bool createPFractionHistos_
TH2F * delta_frac_VS_frac_muon_
MatchCandidateBenchmark matchCandBench_
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual float pt() const =0
transverse momentum
TH2F * delta_frac_VS_frac_neutral_hadron_
void setup()
book histograms
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
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
PFJetMonitor(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
void fillOne(const reco::Jet &jet, const reco::Jet &matchedJet)
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
TH2F * delta_frac_VS_frac_photon_
TH2F * delta_frac_VS_frac_electron_
TH2F * delta_frac_VS_frac_charged_hadron_
virtual float pt() const GCC11_FINAL
transverse momentum
bool isInRange(float pt, float eta, float phi) const
tuple size
Write out results.
ParameterSet const & parameterSet(Provenance const &provenance)