62 #include "TrackToJetIndex.h"
68 : TLorentzVector(0,0,0,0)
85 StJet::StJet(
double lE,
double lpx,
double lpy,
double lpz, Int_t size,
int c)
86 : TLorentzVector(lpx, lpy, lpz, lE)
106 for (
int iTrack = 0; iTrack < numberOfTracks(); ++iTrack) {
108 if (!lcp || t->Pt() > lcp->Pt()) lcp = t;
113 Float_t StJet::detEta()
const {
118 Float_t StJet::detEta(
float vz,
float r)
const {
119 float hold(0.),denom(0.);
120 if (Theta()==TMath::PiOver2()) {
121 if (vz==0) {hold = TMath::PiOver2();}
122 else {hold = atan2(r,vz);}
126 denom = (r/tan(Theta()))+vz;
127 if (denom==0.) {hold = TMath::PiOver2();}
128 if (denom!=0.) {hold = atan2(r,denom);}
130 return -TMath::Log(TMath::Tan(hold/2));
133 void StJet::addGeomTrigger(
int trigId) {
135 for(
unsigned int i=0; i<mGeomTriggers.size(); i++) {
136 if (mGeomTriggers[i] == trigId)
return;
138 mGeomTriggers.push_back(trigId);
141 bool StJet::geomTrigger(
int trigId)
const {
142 for(
unsigned int i=0; i<mGeomTriggers.size(); i++) {
143 if (mGeomTriggers[i] == trigId)
return true;
148 bool StJet::getJetPatchEtaPhi(
int jetPatch,
float& eta,
float& phi)
157 if (jetPatch < 0 || jetPatch >= 12)
return false;
187 eta = (jetPatch < 6) ? 0.5 : -0.5;
188 phi = 150 - (jetPatch % 6) * 60;
191 phi *= TMath::DegToRad();
194 phi = TVector2::Phi_mpi_pi(phi);
199 bool StJet::getJetPatchId(
float eta,
float phi,
int&
id)
211 if (eta < -1 || eta > 1)
return false;
214 if (phi < -M_PI || phi > M_PI) phi = TVector2::Phi_mpi_pi(phi);
217 static const double PI_OVER_3 = M_PI/3;
219 if (0 <= eta && eta <= 1) {
220 if ( 2*PI_OVER_3 <= phi && phi < M_PI)
id = 0;
221 if ( PI_OVER_3 <= phi && phi < 2*PI_OVER_3)
id = 1;
222 if ( 0 <= phi && phi < PI_OVER_3)
id = 2;
223 if ( -PI_OVER_3 <= phi && phi < 0)
id = 3;
224 if (-2*PI_OVER_3 <= phi && phi < -PI_OVER_3)
id = 4;
225 if ( -M_PI <= phi && phi < -2*PI_OVER_3)
id = 5;
228 if (-1 <= eta && eta < 0) {
229 if ( 2*PI_OVER_3 <= phi && phi < M_PI)
id = 6;
230 if ( PI_OVER_3 <= phi && phi < 2*PI_OVER_3)
id = 7;
231 if ( 0 <= phi && phi < PI_OVER_3)
id = 8;
232 if ( -PI_OVER_3 <= phi && phi < 0)
id = 9;
233 if (-2*PI_OVER_3 <= phi && phi < -PI_OVER_3)
id = 10;
234 if ( -M_PI <= phi && phi < -2*PI_OVER_3)
id = 11;
237 return (0 <=
id &&
id < 12);
float zVertex
position of vertex used to reconstruct jet