3 #ifndef TRACKTOJETINDEX_H
4 #define TRACKTOJETINDEX_H
8 #include "TLorentzVector.h"
14 #ifndef StEnumerations_hh
15 #define StEnumerations_hh
17 #define kUnknownIdentifier 0
18 #define kTpcIdentifier 1
19 #define kBarrelEmcTowerIdentifier 9
20 #define kEndcapEmcTowerIdentifier 13
23 kUnknownId = kUnknownIdentifier,
24 kTpcId = kTpcIdentifier,
25 kBarrelEmcTowerId = kBarrelEmcTowerIdentifier,
26 kEndcapEmcTowerId = kEndcapEmcTowerIdentifier,
29 #endif // StEnumerations_hh
34 TrackToJetIndex(
int jetIndex = -1,
int trackIndex = -1, StDetectorId detId = kUnknownId,
StJet* jet = 0);
36 int jetIndex()
const {
return mJetIndex; }
37 int trackIndex()
const {
return mTrackIndex; }
38 StJet* jet()
const {
return (
StJet*)mJet.GetObject(); }
40 short trackId()
const {
return mTrackId; }
41 StDetectorId detectorId()
const {
return mDetId ; }
42 short flag()
const {
return mFlag; }
43 short charge()
const {
return mCharge; }
44 unsigned short nHits()
const {
return mNhits; }
45 unsigned short nHitsPoss()
const {
return mNhitsPoss; }
46 unsigned short nHitsDedx()
const {
return mNhitsDedx; }
47 unsigned short nHitsFit()
const {
return mNhitsFit; }
48 double nSigmaPion()
const {
return mNsigmaPion; }
49 double nSigmaElectron()
const {
return mNsigmaElectron; }
50 double nSigmaKaon()
const {
return mNsigmaKaon; }
51 double nSigmaProton()
const {
return mNsigmaProton; }
52 double Tdca()
const {
return mTdca; }
53 double Tdcaz()
const {
return mTdcaz; }
54 double Tdcaxy()
const {
return mTdcaxy; }
55 double etaext()
const {
return metaext; }
56 double phiext()
const {
return mphiext; }
57 double dEdx()
const {
return mdEdx; }
58 double jt()
const {
return localMomentum().Perp(); }
59 double ps()
const {
return localMomentum().Px (); }
60 double pn()
const {
return localMomentum().Py (); }
61 double pl()
const {
return localMomentum().Pz (); }
64 TVector3 momentum()
const {
return Vect(); }
65 TVector3 localMomentum()
const;
68 short id ()
const {
return trackIndex(); }
69 short pdg ()
const {
return trackId(); }
70 short status()
const {
return flag(); }
72 void setJetIndex(
int n) { mJetIndex = n; }
73 void setTrackIndex(
int n) { mTrackIndex = n; }
74 void setDetectorId(StDetectorId v) { mDetId = v; }
75 void setFlag(
short v) { mFlag = v; }
76 void setCharge(
short v) { mCharge = v; }
77 void setNhits(
unsigned short v) { mNhits = v; }
78 void setNhitsPoss(
unsigned short v) { mNhitsPoss = v; }
79 void setNhitsDedx(
unsigned short v) { mNhitsDedx = v; }
80 void setNhitsFit(
unsigned short v) { mNhitsFit = v; }
81 void setNsigmaPion(
double v) { mNsigmaPion = v; }
82 void setNsigmaElectron(
double v) { mNsigmaElectron = v; }
83 void setNsigmaKaon(
double v) { mNsigmaKaon = v; }
84 void setNsigmaProton(
double v) { mNsigmaProton = v; }
85 void setTdca(
double v) { mTdca = v; }
86 void setTdcaz(
double v) { mTdcaz = v; }
87 void setTdcaxy(
double v) { mTdcaxy = v; }
88 void setetaext(
double v) { metaext = v; }
89 void setphiext(
double v) { mphiext = v; }
90 void setdEdx(
double v) { mdEdx = v; }
91 void setTrackId(
int v) { mTrackId = v; }
94 void setId(
short v) { setTrackIndex(v); }
95 void setPdg(
short v) { setTrackId(v); }
96 void setStatus(
short v) { setFlag(v); }
104 unsigned short mNhits;
105 unsigned short mNhitsPoss;
106 unsigned short mNhitsDedx;
107 unsigned short mNhitsFit;
109 double mNsigmaElectron;
111 double mNsigmaProton;
124 inline std::ostream& operator<<(std::ostream& os,
const TrackToJetIndex& t)
126 std::string idstring;
127 StDetectorId mDetId = t.detectorId();
128 if (mDetId==kTpcId) {
131 else if (mDetId==kBarrelEmcTowerId) {
132 idstring =
"kBarrelEmcTowerId";
134 else if (mDetId==kEndcapEmcTowerId) {
135 idstring =
"kEndcapEmcTowerId";
138 idstring =
"kUnknown";
141 return os <<
"jetIndex:\t"<<t.jetIndex()<<
"\ttrackIndex:\t"<<t.trackIndex()<<
"\tdetId:\t"<<t.detectorId()<<
"\t"<<idstring;
144 #endif // TRACKTOJETINDEX_H