5 #include "TrackToJetIndex.h"
6 #include "TowerToJetIndex.h"
18 , mJets(new TClonesArray(
"StJet",100))
19 , mTrackToJetIndices(new TClonesArray(
"TrackToJetIndex",100))
20 , mTowerToJetIndices(new TClonesArray(
"TowerToJetIndex",100))
27 mTrackToJetIndices->Delete();
28 mTowerToJetIndices->Delete();
31 delete mTrackToJetIndices;
32 delete mTowerToJetIndices;
35 mTrackToJetIndices = 0;
36 mTowerToJetIndices = 0;
39 void StJets::Clear(
bool clearAll)
42 mTrackToJetIndices->Clear();
43 mTowerToJetIndices->Clear();
50 new ((*mTrackToJetIndices)[mTrackToJetIndices->GetEntriesFast()])
TrackToJetIndex(t2j);
55 new ((*mTowerToJetIndices)[mTowerToJetIndices->GetEntriesFast()])
TowerToJetIndex(t2j);
58 void StJets::addJet(
StJet& jet)
66 for (
int i = 0; i < mTrackToJetIndices->GetEntriesFast(); ++i) {
68 if (track->jetIndex() == jetIndex) a.Add(track);
73 TObjArray StJets::towers(
int jetIndex)
const
76 for (
int i = 0; i < mTowerToJetIndices->GetEntriesFast(); ++i) {
78 if (tower->jetIndex() == jetIndex) a.Add(tower);
83 vector<TLorentzVector*> StJets::particles(
int jetIndex)
const
85 vector<TLorentzVector*> v;
86 for (
int i = 0; i < mTrackToJetIndices->GetEntriesFast(); ++i) {
88 if (track->jetIndex() == jetIndex) v.push_back(track);
90 for (
int i = 0; i < mTowerToJetIndices->GetEntriesFast(); ++i) {
92 if (tower->jetIndex() == jetIndex) v.push_back(tower);
97 bool StJets::inBounds(
int i)
99 return (i>0 && i<
nJets());
104 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
105 return (j) ? j->E() : -999.;
108 double StJets::et(
int i)
const
110 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
111 return (j) ? j->et() : -999.;
114 double StJets::p(
int i)
const
116 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
117 return (j) ? j->P() : -999.;
120 double StJets::pt(
int i)
const
122 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
123 return (j) ? j->Pt() : -999.;
126 double StJets::phi(
int i)
const
128 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
129 return (j) ? j->Phi() : -999.;
132 double StJets::eta(
int i)
const
134 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
135 return (j) ? j->Eta() : -999.;
138 int StJets::nCell(
int i)
const
140 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
141 return (j) ? j->
nCell : -999;
144 int StJets::charge(
int i)
const
146 StJet* j =
dynamic_cast<StJet*
>(mJets->UncheckedAt(i));
147 return (j) ? j->
charge : -999;
Int_t nCell
The number of 4-vectors contributing to this jet.
double e(int jetIndex) const
User Interface as per Thomas H's request. Access jet kinematics based on index:
int nJets() const
The number of jets found in this event.
TClonesArray * tracks()
The track/tower to jet indices TClonesArray: this contains all the 4momenta contained in jets for jet...
int charge
The summed coulomb charge of the tracks in this jet.