00001
00002
00003 #include "StChargedPionTrack.h"
00004 #include "StPionPlus.hh"
00005
00006 #include "TClass.h"
00007
00008 ClassImp(StChargedPionTrack)
00009
00010 StChargedPionTrack::StChargedPionTrack() : TLorentzVector(),
00011 mId(0),mFlag(0),mVertexIndex(0),mVertex(0.,0.,0.),mNHits(0),mNHitsPoss(0),mNHitsDedx(0),mNHitsFit(0),
00012 mNSigmaElectron(0),mNSigmaPion(0),mNSigmaKaon(0),mNSigmaProton(0),mdEdx(0),mChi2(0),mChi2Prob(0),
00013 mCharge(0),mB(0.),mGlobalLastPoint(0.,0.,0.),
00014 mGlobalHelix(StThreeVectorF(0.,0.,0.),StThreeVectorF(0.,0.,0.),0.,0.)
00015 { }
00016
00017 StChargedPionTrack::~StChargedPionTrack() { }
00018
00019 StChargedPionTrack::StChargedPionTrack(const StChargedPionTrack& t) : TLorentzVector(t)
00020 {
00021 this->mId = t.mId;
00022 this->mFlag = t.mFlag;
00023
00024 this->mVertexIndex = t.mVertexIndex;
00025 this->mVertex = t.mVertex;
00026
00027 this->mNHits = t.mNHits;
00028 this->mNHitsPoss = t.mNHitsPoss;
00029 this->mNHitsDedx = t.mNHitsDedx;
00030 this->mNHitsFit = t.mNHitsFit;
00031
00032 this->mNSigmaElectron = t.mNSigmaElectron;
00033 this->mNSigmaPion = t.mNSigmaPion;
00034 this->mNSigmaKaon = t.mNSigmaKaon;
00035 this->mNSigmaProton = t.mNSigmaProton;
00036 this->mdEdx = t.mdEdx;
00037
00038 this->mChi2 = t.mChi2;
00039 this->mChi2Prob = t.mChi2Prob;
00040
00041 this->mCharge = t.mCharge;
00042 this->mB = t.mB;
00043
00044 this->mGlobalLastPoint = t.mGlobalLastPoint;
00045 this->mGlobalHelix = t.mGlobalHelix;
00046 }
00047
00048 void StChargedPionTrack::setPtEtaPhi(float aPt, float aEta, float aPhi) {
00049 this->SetPtEtaPhiM(aPt,aEta,aPhi,StPionPlus::instance()->mass());
00050 }
00051
00052 void StChargedPionTrack::setPt(float aPt) {
00053 this->SetPerp(aPt);
00054 }
00055
00056 void StChargedPionTrack::setPhi(float aPhi) {
00057 this->SetPhi(aPhi);
00058 }
00059
00060 void StChargedPionTrack::setEta(float aEta) {
00061 this->SetTheta(2*TMath::ATan(TMath::Exp(-1*aEta)));
00062 }
00063
00064 double StChargedPionTrack::globalPt() const {
00065 return this->globalPt(mGlobalHelix.origin());
00066 }
00067
00068 double StChargedPionTrack::globalPt(StThreeVectorF position) const {
00069 double pathLength = mGlobalHelix.pathLength(position,false);
00070 StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
00071 return gP.perp();
00072 }
00073
00074 double StChargedPionTrack::globalPhi() const {
00075 return this->globalPhi(mGlobalHelix.origin());
00076 }
00077
00078 double StChargedPionTrack::globalPhi(StThreeVectorF position) const {
00079 double pathLength = mGlobalHelix.pathLength(position,false);
00080 StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
00081 return gP.phi();
00082 }
00083
00084 double StChargedPionTrack::globalEta() const {
00085 return this->globalEta(mGlobalHelix.origin());
00086 }
00087
00088 double StChargedPionTrack::globalEta(StThreeVectorF position) const {
00089 double pathLength = mGlobalHelix.pathLength(position,false);
00090 StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
00091 return gP.pseudoRapidity();
00092 }
00093
00094 TLorentzVector StChargedPionTrack::globalP() const {
00095 return this->globalP(mGlobalHelix.origin());
00096 }
00097
00098 TLorentzVector StChargedPionTrack::globalP(StThreeVectorF position) const {
00099 double pathLength = mGlobalHelix.pathLength(position,false);
00100 StThreeVector<double> gP = mGlobalHelix.momentumAt(pathLength,mB);
00101 TLorentzVector vec;
00102 vec.SetPtEtaPhiM(gP.perp(),gP.pseudoRapidity(),gP.phi(),StPionPlus::instance()->mass());
00103 return vec;
00104 }
00105
00106 StThreeVectorF StChargedPionTrack::globalDca() const {
00107 return this->globalDca(mVertex);
00108 }
00109
00110 StThreeVectorF StChargedPionTrack::globalDca(StThreeVectorF position) const {
00111 double pathlength = mGlobalHelix.pathLength(position,false);
00112 return (mGlobalHelix.at(pathlength) - position);
00113 }
00114
00115 double StChargedPionTrack::length() const
00116 {
00117 double end = mGlobalHelix.pathLength(StThreeVectorD(mGlobalLastPoint));
00118 double begin = mGlobalHelix.pathLength(StThreeVectorD(mVertex));
00119 return fabs(end - begin);
00120 }
00121
00122 double StChargedPionTrack::lengthMeasured() const
00123 {
00124 double end = mGlobalHelix.pathLength(StThreeVectorD(mGlobalLastPoint));
00125 return fabs(end);
00126 }
00127
00128
00129
00130
00131
00132
00133
00134