2 #include "StjTPCMuDst.h"
4 #include "StEventTypes.h"
5 #include "StMuDSTMaker/COMMON/StMuTypes.hh"
7 #include <mudst/StMuEmcPosition.h>
8 #include <StEmcUtil/geometry/StEmcGeom.h>
9 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
13 #include "StMuDSTMaker/COMMON/StMuBTofHit.h"
15 int StjTPCMuDst::currentVertexIndex()
const
20 void StjTPCMuDst::setVertexIndex(
int i)
25 int StjTPCMuDst::numberOfVertices()
const
27 return StMuDst::numberOfPrimaryVertices();
35 vertex.mPosition = muVertex->position().xyz();
36 vertex.mPosError = muVertex->posError().xyz();
37 vertex.mVertexFinderId = muVertex->vertexFinderId();
38 vertex.mRanking = muVertex->ranking();
39 vertex.mNTracksUsed = muVertex->nTracksUsed();
40 vertex.mNBTOFMatch = muVertex->nBTOFMatch();
41 vertex.mNCTBMatch = muVertex->nCTBMatch();
42 vertex.mNBEMCMatch = muVertex->nBEMCMatch();
43 vertex.mNEEMCMatch = muVertex->nEEMCMatch();
44 vertex.mNCrossCentralMembrane = muVertex->nCrossCentralMembrane();
45 vertex.mSumTrackPt = muVertex->sumTrackPt();
46 vertex.mMeanDip = muVertex->meanDip();
47 vertex.mChiSquared = muVertex->chiSquared();
48 vertex.mRefMultPos = muVertex->refMultPos();
49 vertex.mRefMultNeg = muVertex->refMultNeg();
50 vertex.mRefMultFtpcEast = muVertex->refMultFtpcEast();
51 vertex.mRefMultFtpcWest = muVertex->refMultFtpcWest();
57 StjTrackList StjTPCMuDst::getTrackList()
61 int nTracks = StMuDst::numberOfPrimaryTracks();
64 for(
int i = 0; i < nTracks; ++i) {
67 if(mutrack->
flag() < 0)
continue;
79 StjTrack StjTPCMuDst::createTrack(
const StMuTrack* mutrack,
int i,
double magneticField)
85 track.detectorId = kTpcId;
93 track.flag = mutrack->
flag();
94 track.nHits = mutrack->
nHits();
95 track.charge = mutrack->
charge();
98 track.nHitsFit = mutrack->
nHitsFit();
106 track.dcaZ = mutrack->
dcaZ();
107 track.dcaD = mutrack->
dcaD();
108 track.chi2 = mutrack->
chi2();
109 track.chi2prob = mutrack->
chi2prob();
110 track.BField = magneticField;
112 track.btofTrayId = -999;
114 if(mutrack->index2BTofHit()>=0) {
115 track.btofTrayId = mutrack->tofHit()->tray();
117 track.nSigmaTofPion = mutrack->btofPidTraits().sigmaPion();
118 track.nSigmaTofKaon = mutrack->btofPidTraits().sigmaKaon();
119 track.nSigmaTofProton = mutrack->btofPidTraits().sigmaProton();
120 track.nSigmaTofElectron = mutrack->btofPidTraits().
sigmaElectron();
126 track.bemcRadius = 238.6;
129 track.vertexZ = vertex.z();
134 if (EmcPosition.
trackOnEmc(&positionAt, &momentumAt, mutrack, magneticField, track.bemcRadius))
136 track.exitDetectorId = kBarrelEmcTowerId;
137 track.exitEta = positionAt.pseudoRapidity();
138 track.exitPhi = positionAt.phi();
139 StEmcGeom::instance(
"bemc")->getId(track.exitPhi, track.exitEta, track.exitTowerId);
141 else if (EmcPosition.
trackOnEEmc(&positionAt, &momentumAt, mutrack, magneticField, kEEmcZSMD))
143 track.exitDetectorId = kEndcapEmcTowerId;
144 track.exitEta = positionAt.pseudoRapidity();
145 track.exitPhi = positionAt.phi();
146 int sector, subsector, etabin;
148 track.exitTowerId = sector*60+subsector*12+etabin;
152 track.exitDetectorId = -999;
153 track.exitEta = -999;
154 track.exitPhi = -999;
155 track.exitTowerId = -999;
158 track.dEdx = mutrack->
dEdx();
160 track.trackIndex = i;
161 track.id = mutrack->
id();
162 track.idTruth = mutrack->idTruth();
163 track.qaTruth = mutrack->qaTruth();
164 track.firstPoint = mutrack->
firstPoint().xyz();
165 track.lastPoint = mutrack->
lastPoint().xyz();
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Double_t chi2prob() const
Returns probability of fit.
static EEmcGeomSimple & Instance()
returns a reference to a static instance of EEmcGeomSimple
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
UShort_t nHitsDedx() const
Return number of hits used for dEdx.
Float_t dcaZ(Int_t vtx_id=-1) const
Z component of global DCA.
Double_t chi2() const
Returns chi2 of fit.
UShort_t nHitsFit() const
Return total number of hits used in fit.
short flag() const
Returns flag, (see StEvent manual for type information)
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.
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Double_t nSigmaElectron() const
Returns Craig's distance to the calculated dE/dx band for electrons in units of sigma.
UShort_t nHitsPoss() const
Return number of possible hits on track.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
bool trackOnEEmc(StThreeVectorD *position, StThreeVectorD *momentum, const StMuTrack *track, double magField=0.5, double z=kEEmcZSMD) const
Project track into EEMC at SMD depth (magnetic field must be in Tesla)
UShort_t nHits() const
Bingchu.
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
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.
float sigmaElectron() const
PID functions.
bool getTower(const TVector3 &r, int &sec, int &sub, int &etabin, Float_t &dphi, Float_t &deta) const
Float_t dcaD(Int_t vtx_id=-1) const
Signed radial component of global DCA (projected)
static Int_t currentVertexIndex()
Get the index number of the current primary vertex.
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Double_t nSigmaKaon() const
Returns Craig's distance to the calculated dE/dx band for kaons in units of sigma.
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
StTrackTopologyMap topologyMap() const
Returns topology map.
bool trackOnEmc(StThreeVectorD *, StThreeVectorD *, const StMuTrack *, double, double=225.405)
StjTrack projection utility.