7 #include "StPeCTrack.h"
8 #include "StEventTypes.h"
9 #include "BetheBloch.h"
19 StPeCTrack::~StPeCTrack() {
23 StPeCTrack::StPeCTrack ( Int_t _primary,
StTrack* trk) {
24 set ( _primary, trk ) ;
29 set (_primary, trk, event);
32 void StPeCTrack::set ( Int_t _primary,
StTrack* trk) {
35 charge = trk->geometry()->charge();
36 pt = trk->geometry()->momentum().perp();
37 p = trk->geometry()->momentum().mag();
38 psi = trk->geometry()->momentum().phi();
39 eta = -::log(tan(trk->geometry()->momentum().theta()/2.));
40 phi0 = trk->geometry()->origin().phi();
41 z0 = trk->geometry()->origin().z();
42 r0 = trk->geometry()->origin().perp();
53 StSPtrVecTrackPidTraits& traits = trk->pidTraits();
56 Int_t NTraits = traits.size();
57 for( Int_t i=0; i<NTraits; i++) {
58 if ( traits[i]->detector() == kTpcId ){
60 if ( dedxPid && dedxPid->method() == kTruncatedMeanIdentifier )
break;
64 length= dedxPid->length();
65 dedx = dedxPid->mean();
66 dedxZel = getZdEdx(mMassElectron);
67 dedxZmu = getZdEdx(mMassMuon);
68 dedxZpi = getZdEdx(mMassPion);
69 dedxZk = getZdEdx(mMassKaon);
70 dedxZp = getZdEdx(mMassProton);
93 eta = -::log(tan(trk->
momentum().theta()/2.));
99 vtxX =
event->primaryVertexPosition(vertexIndex).x();
100 vtxY =
event->primaryVertexPosition(vertexIndex).y();
101 vtxZ =
event->primaryVertexPosition(vertexIndex).z();
123 nHits = trk->
nHits();
137 Float_t StPeCTrack::getZdEdx(Float_t mass) {
141 if ( ! mass || length<=0. ) {
return -9999; }
142 Double_t betaGamma = p / mass ;
145 Double_t dedxBB= BetheBloch::Sirrf(betaGamma, length);
147 if (p && dedx && dedxBB ) {
148 return log ( dedx/dedxBB);
Double_t pidProbKaon() const
Returns Aihong's probability of being a kaon.
Double_t pidProbElectron() const
Returns Aihong's probability of being an electron.
Int_t vertexIndex() const
Returns index of associated primary vertex.
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
Double_t length() const
Returns length of track (cm) from primary vertex to last measured point.
Short_t charge() const
Returns charge.
Double_t nSigmaPion() const
Returns Craig's distance to the calculated dE/dx band for pions in units of sigma.
Double_t pidProbProton() const
Returns Aihong's probability of being a proton.
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
Double_t nSigmaElectron() const
Returns Craig's distance to the calculated dE/dx band for electrons in units of sigma.
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
UShort_t nHits() const
Bingchu.
Double_t dEdx() const
Returns measured dE/dx value.
Double_t nSigmaProton() const
Returns Craig's distance to the calculated dE/dx band for protons in units of sigma.
Double_t nSigmaKaon() const
Returns Craig's distance to the calculated dE/dx band for kaons in units of sigma.
Double_t pidProbPion() const
Returns Aihong's probability of being a pion.