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);
96 if (caljets->size()==0)
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)
100 e = i_caljet->energy();
102 phi = i_caljet->phi();
103 eta = i_caljet->eta();
104 emEB = i_caljet->emEnergyInEB();
105 emEE = i_caljet->emEnergyInEE();
106 emHF = i_caljet->emEnergyInHF();
107 hadHB = i_caljet->hadEnergyInHB();
108 hadHE = i_caljet->hadEnergyInHE();
109 hadHO = i_caljet->hadEnergyInHO();
110 hadHF = i_caljet->hadEnergyInHF();
114 p4jet[jetInd] = i_caljet->p4();
120 FillHist1D(
"emEnergyFraction",i_caljet->emEnergyFraction());
145 FillHist1D(
"m2jCalo",(p4jet[0]+p4jet[1]).mass());
148 evt.getByLabel(
genAlgo,genjets);
149 evt.getByLabel(
"genEventScale",genEventScale);
150 pthat = *genEventScale;
154 if (genjets->size()==0)
155 cout<<
"WARNING: NO gen jets in event "<<evt.id().event()<<
", Run "<<evt.id().run()<<
" !!!!"<<endl;
156 for(i_genjet = genjets->begin(); i_genjet != genjets->end() && jetInd<
Njets; ++i_genjet)
159 p4jet[jetInd] = i_genjet->p4();
165 for(i_caljet = caljets->begin(); i_caljet != caljets->end(); ++i_caljet)
167 dR =
deltaR(i_caljet->eta(),i_caljet->phi(),i_genjet->eta(),i_genjet->phi());
171 MatchedJet = *i_caljet;
176 pt = MatchedJet.
pt();
177 eta = MatchedJet.
eta();
178 phi = MatchedJet.
phi();
186 if (dRmin<dRmatch && pt>
PtMin)
189 FillHistProfile(
"emErespVsEta",eta,(emEB+emEE+emHF)/i_genjet->energy());
190 FillHistProfile(
"hadErespVsEta",eta,(hadHB+hadHO+hadHE+hadHF)/i_genjet->energy());
191 if (fabs(i_genjet->eta())<1.)
198 FillHist1D(
"m2jGen",(p4jet[0]+p4jet[1]).mass());
float hadEnergyInHE() const
float emEnergyInEE() const
virtual double energy() const GCC11_FINAL
energy
Jets made from CaloTowers.
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.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
float emEnergyInEB() const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double deltaR(double eta1, double eta2, double phi1, double phi2)
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
virtual float pt() const GCC11_FINAL
transverse momentum