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
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)
virtual double eta() const
momentum pseudorapidity
float hadEnergyInHO() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual double energy() const
energy
float emEnergyInEB() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual double pt() const
transverse momentum
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 double phi() const
momentum azimuthal angle