StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StChargedPionTrack.cxx
1 // $Id: StChargedPionTrack.cxx,v 1.6 2012/11/09 03:31:34 perev Exp $
2 
3 #include "StChargedPionTrack.h"
4 #include "StPionPlus.hh"
5 
6 #include "TClass.h"
7 
8 ClassImp(StChargedPionTrack)
9 
10 StChargedPionTrack::StChargedPionTrack() : TLorentzVector(),
11  mId(0),mFlag(0),mVertexIndex(0),mVertex(0.,0.,0.),mNHits(0),mNHitsPoss(0),mNHitsDedx(0),mNHitsFit(0),
12  mNSigmaElectron(0),mNSigmaPion(0),mNSigmaKaon(0),mNSigmaProton(0),mdEdx(0),mChi2(0),mChi2Prob(0),
13  mCharge(0),mB(0.),mGlobalLastPoint(0.,0.,0.),
14  mGlobalHelix(StThreeVectorF(0.,0.,0.),StThreeVectorF(0.,0.,0.),0.,0.)
15 { }
16 
17 StChargedPionTrack::~StChargedPionTrack() { /* no-op */ }
18 
19 StChargedPionTrack::StChargedPionTrack(const StChargedPionTrack& t) : TLorentzVector(t)
20 {
21  this->mId = t.mId;
22  this->mFlag = t.mFlag;
23 
24  this->mVertexIndex = t.mVertexIndex;
25  this->mVertex = t.mVertex;
26 
27  this->mNHits = t.mNHits;
28  this->mNHitsPoss = t.mNHitsPoss;
29  this->mNHitsDedx = t.mNHitsDedx;
30  this->mNHitsFit = t.mNHitsFit;
31 
32  this->mNSigmaElectron = t.mNSigmaElectron;
33  this->mNSigmaPion = t.mNSigmaPion;
34  this->mNSigmaKaon = t.mNSigmaKaon;
35  this->mNSigmaProton = t.mNSigmaProton;
36  this->mdEdx = t.mdEdx;
37 
38  this->mChi2 = t.mChi2;
39  this->mChi2Prob = t.mChi2Prob;
40 
41  this->mCharge = t.mCharge;
42  this->mB = t.mB;
43 
44  this->mGlobalLastPoint = t.mGlobalLastPoint;
45  this->mGlobalHelix = t.mGlobalHelix;
46 }
47 
48 void StChargedPionTrack::setPtEtaPhi(float aPt, float aEta, float aPhi) {
49  this->SetPtEtaPhiM(aPt,aEta,aPhi,StPionPlus::instance()->mass());
50 }
51 
52 void StChargedPionTrack::setPt(float aPt) {
53  this->SetPerp(aPt);
54 }
55 
56 void StChargedPionTrack::setPhi(float aPhi) {
57  this->SetPhi(aPhi);
58 }
59 
60 void StChargedPionTrack::setEta(float aEta) {
61  this->SetTheta(2*TMath::ATan(TMath::Exp(-1*aEta)));
62 }
63 
64 double StChargedPionTrack::globalPt() const {
65  return this->globalPt(mGlobalHelix.origin());
66 }
67 
68 double StChargedPionTrack::globalPt(StThreeVectorF position) const {
69  double pathLength = mGlobalHelix.pathLength(position,false);
70  StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
71  return gP.perp();
72 }
73 
74 double StChargedPionTrack::globalPhi() const {
75  return this->globalPhi(mGlobalHelix.origin());
76 }
77 
78 double StChargedPionTrack::globalPhi(StThreeVectorF position) const {
79  double pathLength = mGlobalHelix.pathLength(position,false);
80  StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
81  return gP.phi();
82 }
83 
84 double StChargedPionTrack::globalEta() const {
85  return this->globalEta(mGlobalHelix.origin());
86 }
87 
88 double StChargedPionTrack::globalEta(StThreeVectorF position) const {
89  double pathLength = mGlobalHelix.pathLength(position,false);
90  StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
91  return gP.pseudoRapidity();
92 }
93 
94 TLorentzVector StChargedPionTrack::globalP() const {
95  return this->globalP(mGlobalHelix.origin());
96 }
97 
98 TLorentzVector StChargedPionTrack::globalP(StThreeVectorF position) const {
99  double pathLength = mGlobalHelix.pathLength(position,false);
100  StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
101  TLorentzVector vec;
102  vec.SetPtEtaPhiM(gP.perp(),gP.pseudoRapidity(),gP.phi(),StPionPlus::instance()->mass());
103  return vec;
104 }
105 
107  return this->globalDca(mVertex);
108 }
109 
111  double pathlength = mGlobalHelix.pathLength(position,false);
112  return (mGlobalHelix.at(pathlength) - position);
113 }
114 
116 {
117  double end = mGlobalHelix.pathLength(StThreeVectorD(mGlobalLastPoint));
118  double begin = mGlobalHelix.pathLength(StThreeVectorD(mVertex));
119  return fabs(end - begin);
120 }
121 
123 {
124  double end = mGlobalHelix.pathLength(StThreeVectorD(mGlobalLastPoint));
125  return fabs(end);
126 }
127 
128 /*****************************************************************************
129  * $Log: StChargedPionTrack.cxx,v $
130  * Revision 1.6 2012/11/09 03:31:34 perev
131  * Cleanup
132  *
133  * Revision 1.5 2008/12/29 15:58:31 kocolosk
134  * removed commented code and added $Id: StChargedPionTrack.cxx,v 1.6 2012/11/09 03:31:34 perev Exp $/$Log: StChargedPionTrack.cxx,v $
135  * removed commented code and added $Id$/Revision 1.6 2012/11/09 03:31:34 perev
136  * removed commented code and added $Id$/Cleanup
137  * removed commented code and added $Id$/ as needed
138  *
139  *****************************************************************************/
140 
double lengthMeasured() const
Returns length of track (cm) from first to last measured point.
double length() const
Returns length of track (cm) from primary vertex to last measured point.
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
Definition: StHelix.cc:351
const StThreeVector< double > & origin() const
-sign(q*B);
Definition: StHelix.hh:224
StThreeVectorF globalDca() const
Returns 3D distance of closest approach to primary vertex.