1 #ifndef DQMOffline_PFTau_PFJetMonitor_h 2 #define DQMOffline_PFTau_PFJetMonitor_h 31 bool fracHistoFlag =
true);
43 bool fracHistoFlag =
true);
56 template <
class T,
class C>
57 void fill(
const T &jetCollection,
const C &matchedJetCollection,
float &minVal,
float &maxVal);
59 template <
class T,
class C>
60 void fill(
const T &candidateCollection,
61 const C &matchedCandCollection,
88 template <
class T,
class C>
89 void PFJetMonitor::fill(
const T &jetCollection,
const C &matchedJetCollection,
float &minVal,
float &maxVal) {
90 std::vector<int> matchIndices;
93 for (
unsigned int i = 0;
i < (jetCollection).
size();
i++) {
99 int iMatch = matchIndices[
i];
100 assert(iMatch < static_cast<int>(matchedJetCollection.size()));
106 float ptRes = (jet.
pt() - matchedJet.
pt()) / matchedJet.
pt();
116 fillOne(jet, matchedJetCollection[iMatch]);
121 template <
class T,
class C>
123 const C &matchedJetCollection,
128 std::vector<int> matchIndices;
132 for (
unsigned i = 0;
i < jetCollection.size(); ++
i) {
134 unsigned int highJets = 0;
135 for (
unsigned j = 0; j < jetCollection.size(); ++j) {
136 if (j !=
i && jetCollection[j].
pt() > jetCollection[
i].pt())
147 int iMatch = matchIndices[
i];
148 assert(iMatch < static_cast<int>(matchedJetCollection.size()));
155 float ptRes = (jet.
pt() - matchedJet.
pt()) / matchedJet.
pt();
165 matchedJetCollection[iMatch],
169 matchedJetCollection[iMatch]);
173 for (
unsigned j = 0; j < matchedJetCollection.size(); ++j)
void setDirectory(TDirectory *dir) override
set directory (to use in ROOT)
To plot Candidate quantities.
double eta() const final
momentum pseudorapidity
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 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 pt() const final
transverse momentum
bool createPFractionHistos_
TH2F * delta_frac_VS_frac_muon_
MatchCandidateBenchmark matchCandBench_
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)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
TH2F * delta_frac_VS_frac_photon_
TH2F * delta_frac_VS_frac_electron_
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
TH2F * delta_frac_VS_frac_charged_hadron_
bool isInRange(float pt, float eta, float phi) const
double phi() const final
momentum azimuthal angle
virtual double phi() const =0
momentum azimuthal angle
ParameterSet const & parameterSet(Provenance const &provenance)