StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TrackToJetIndex.cxx
1 // $Id: TrackToJetIndex.cxx,v 1.5 2009/09/05 18:18:05 pibero Exp $
2 #include "StJet.h"
3 #include "TrackToJetIndex.h"
4 
5 ClassImp(TrackToJetIndex)
6 
7 TrackToJetIndex::TrackToJetIndex(int jetIndex, int trackIndex, StDetectorId detId, StJet* jet)
8  : mJetIndex(jetIndex)
9  , mTrackIndex(trackIndex)
10  , mDetId(detId)
11  , mCharge(0)
12  , mNhits(0)
13  , mNhitsPoss(0)
14  , mNhitsDedx(0)
15  , mNhitsFit(0)
16  , mNsigmaPion(0)
17  , mTdca(0)
18  , mTdcaz(0)
19  , mTdcaxy(0)
20  , metaext(0)
21  , mphiext(0)
22  , mdEdx(0)
23  , mTrackId(0)
24  , mJet(jet)
25 {
26 }
27 
28 TVector3 TrackToJetIndex::localMomentum() const
29 {
30  TVector3 longUnit = jet()->Vect().Unit();
31  TVector3 normUnit = TVector3(0,0,1).Cross(longUnit).Unit();
32  TVector3 sideUnit = longUnit.Cross(normUnit);
33  TVector3 mom = momentum();
34  return TVector3(mom.Dot(sideUnit),mom.Dot(normUnit),mom.Dot(longUnit));
35 }
36 
37 double TrackToJetIndex::frag() const
38 {
39  return Vect().Mag() / jet()->Vect().Mag();
40 }
Definition: StJet.h:91