84 int jetInd, jetCounter,
nTracks;
85 double dRmin, dR,
e,
eta, emEB, emEE, emHF, hadHB, hadHE, hadHO, hadHF,
pt,
phi, pthat, chf;
90 CaloJetCollection::const_iterator i_caljet;
91 GenJetCollection::const_iterator i_genjet;
92 evt.getByLabel(
calAlgo, caljets);
97 cout <<
"WARNING: NO calo jets in event " << evt.id().event() <<
", Run " << evt.id().run() <<
" !!!!" << endl;
98 for (i_caljet = caljets->begin(); i_caljet != caljets->end() && jetInd <
Njets; ++i_caljet) {
99 e = i_caljet->energy();
101 phi = i_caljet->phi();
102 eta = i_caljet->eta();
103 emEB = i_caljet->emEnergyInEB();
104 emEE = i_caljet->emEnergyInEE();
105 emHF = i_caljet->emEnergyInHF();
106 hadHB = i_caljet->hadEnergyInHB();
107 hadHE = i_caljet->hadEnergyInHE();
108 hadHO = i_caljet->hadEnergyInHO();
109 hadHF = i_caljet->hadEnergyInHF();
113 p4jet[jetInd] = i_caljet->p4();
118 FillHist1D(
"emEnergyFraction", i_caljet->emEnergyFraction());
145 evt.getByLabel(
genAlgo, genjets);
146 evt.getByLabel(
"genEventScale", genEventScale);
147 pthat = *genEventScale;
151 if (genjets->empty())
152 cout <<
"WARNING: NO gen jets in event " << evt.id().event() <<
", Run " << evt.id().run() <<
" !!!!" << endl;
153 for (i_genjet = genjets->begin(); i_genjet != genjets->end() && jetInd <
Njets; ++i_genjet) {
155 p4jet[jetInd] = i_genjet->p4();
159 FillHistProfile(
"GenEnergyVsEta", i_genjet->eta(), i_genjet->energy());
161 for (i_caljet = caljets->begin(); i_caljet != caljets->end(); ++i_caljet) {
162 dR =
deltaR(i_caljet->eta(), i_caljet->phi(), i_genjet->eta(), i_genjet->phi());
165 MatchedJet = *i_caljet;
170 pt = MatchedJet.
pt();
171 eta = MatchedJet.
eta();
179 if (dRmin < dRmatch && pt >
PtMin) {
181 FillHistProfile(
"emErespVsEta", eta, (emEB + emEE + emHF) / i_genjet->energy());
182 FillHistProfile(
"hadErespVsEta", eta, (hadHB + hadHO + hadHE + hadHF) / i_genjet->energy());
183 if (fabs(i_genjet->eta()) < 1.)
184 FillHistProfile(
"respVsPtBarrel", i_genjet->pt(), pt / i_genjet->pt());
float hadEnergyInHE() const
float emEnergyInEE() const
Jets made from CaloTowers.
double pt() const final
transverse momentum
float emEnergyInHF() const
void FillHist1D(const TString &histName, const Double_t &x)
void FillHistProfile(const TString &histName, const Double_t &x, const Double_t &y)
float hadEnergyInHO() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
float emEnergyInEB() const
std::string jetTracksAssociator
LorentzVector tracksP4(const Container &, const reco::JetBaseRef)
Get LorentzVector as sum of all tracks associated with jet.
float hadEnergyInHB() const
int tracksNumber(const Container &, const reco::JetBaseRef)
Get number of tracks associated with jet.
float hadEnergyInHF() const
double energy() const final
energy
double eta() const final
momentum pseudorapidity