68 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
70 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
71 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
73 #include "StHbtMaker/Infrastructure/StHbtAihongPid.h"
74 #include "StEventUtilities/StuProbabilityPidAlgorithm.h"
77 StHbtTrack::StHbtTrack()
84 mTrackType = t.mTrackType;
87 mNHitsPoss = t.mNHitsPoss;
88 mNHitsDedx = t.mNHitsDedx;
89 mNSigmaElectron = t.mNSigmaElectron;
90 mNSigmaPion = t.mNSigmaPion;
91 mNSigmaKaon = t.mNSigmaKaon;
92 mNSigmaProton = t.mNSigmaProton;
93 mPidProbElectron = t.mPidProbElectron;
94 mPidProbPion = t.mPidProbPion;
95 mPidProbKaon = t.mPidProbKaon;
96 mPidProbProton = t.mPidProbProton;
100 mDCAxyGlobal = t.mDCAxyGlobal;
101 mDCAzGlobal = t.mDCAzGlobal;
102 mChiSqXY = t.mChiSqXY;
106 mPGlobal = t.mPGlobal;
107 mPtGlobal = t.mPtGlobal;
109 mHelixGlobal = t.mHelixGlobal;
112 mTrackId = t.mTrackId;
113 if (t.ValidHiddenInfo())
114 mHiddenInfo = t.getHiddenInfo()->clone();
120 #include "StEventTypes.h"
121 #include "StEvent/StTpcDedxPidAlgorithm.h"
122 #include "StEventUtilities/StuRefMult.hh"
124 #include "StarClassLibrary/SystemOfUnits.h"
125 #include "StarClassLibrary/StParticleTypes.hh"
126 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
127 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
139 StElectron* Electron = StElectron::instance();
142 StProton* Proton = StProton::instance();
146 mTrackType = ST->type();
147 mCharge = ST->geometry()->charge();
148 mNHits = ST->detectorInfo()->numberOfPoints(kTpcId);
149 mNHitsPoss = ST->numberOfPossiblePoints(kTpcId);
150 mNHitsDedx = ST->fitTraits().numberOfFitPoints(kTpcId);
152 mNSigmaElectron = PidAlgorithm.numberOfSigma(Electron);
153 mNSigmaPion = PidAlgorithm.numberOfSigma(Pion);
154 mNSigmaKaon = PidAlgorithm.numberOfSigma(Kaon);
155 mNSigmaProton = PidAlgorithm.numberOfSigma(Proton);
156 if ( PidAlgorithm.traits() )
157 mdEdx = PidAlgorithm.traits()->mean();
159 cout <<
"StHbtTrack(const StTrack* ST, StHbtThreeVector PrimaryVertex) - no traits " << endl;
161 mChiSqXY = ST->fitTraits().chi2(0);
162 mChiSqZ = ST->fitTraits().chi2(1);
164 mP = ST->geometry()->momentum();
166 mHelix = ST->geometry()->helix();
167 double pathlength = ST->geometry()->helix().
pathLength(PrimaryVertex);
168 StHbtThreeVector DCAxyz = ST->geometry()->helix().at(pathlength)-PrimaryVertex;
169 mDCAxy = DCAxyz.perp();
172 mHelixGlobal = ST->node()->track(global)->geometry()->helix();
173 double pathlengthGlobal = mHelixGlobal.
pathLength(PrimaryVertex);
174 StHbtThreeVector DCAxyzGlobal = mHelixGlobal.at(pathlengthGlobal)-PrimaryVertex;
175 mDCAxyGlobal = DCAxyzGlobal.perp();
176 mDCAzGlobal = DCAxyzGlobal.z();
177 mPGlobal = ST->node()->track(global)->geometry()->momentum();
178 mPtGlobal = mPGlobal.perp();
180 mMap[0] = ST->topologyMap().data(0);
181 mMap[1] = ST->topologyMap().data(1);
182 mTrackId = ST->key();
190 ST->pidTraits(PidAlgorithm);
193 StElectron* Electron = StElectron::instance();
196 StProton* Proton = StProton::instance();
200 mTrackType = ST->type();
201 mCharge = ST->geometry()->charge();
202 mNHits = ST->detectorInfo()->numberOfPoints(kTpcId);
203 mNHitsPoss = ST->numberOfPossiblePoints(kTpcId);
204 mNHitsDedx = ST->fitTraits().numberOfFitPoints(kTpcId);
206 mNSigmaElectron = PidAlgorithm.numberOfSigma(Electron);
207 mNSigmaPion = PidAlgorithm.numberOfSigma(Pion);
208 mNSigmaKaon = PidAlgorithm.numberOfSigma(Kaon);
209 mNSigmaProton = PidAlgorithm.numberOfSigma(Proton);
210 mdEdx = PidAlgorithm.traits()->mean();
213 mChiSqXY = ST->fitTraits().chi2(0);
214 mChiSqZ = ST->fitTraits().chi2(1);
218 mHelix = ST->geometry()->helix();
219 double pathlength = mHelix.
pathLength(primaryVertex);
221 mDCAxy = DCAxyz.perp();
223 mP = mHelix.momentumAt(pathlength,EV->summary()->magneticField()*kilogauss);
226 if(dynamic_cast<const StPrimaryTrack*>(ST)){
227 mHelixGlobal = ST->node()->track(global)->geometry()->helix();
230 mHelixGlobal = mHelix;
232 double pathlengthGlobal = mHelixGlobal.
pathLength(primaryVertex);
233 StHbtThreeVector DCAxyzGlobal = mHelixGlobal.at(pathlengthGlobal)-primaryVertex;
234 mDCAxyGlobal = DCAxyzGlobal.perp();
235 mDCAzGlobal = DCAxyzGlobal.z();
236 mPGlobal = mHelixGlobal.momentumAt(pathlengthGlobal,EV->summary()->magneticField()*kilogauss);
237 mPtGlobal = mPGlobal.perp();
239 mMap[0] = ST->topologyMap().data(0);
240 mMap[1] = ST->topologyMap().data(1);
241 mTrackId = ST->key();
244 static int previousEventNumber = 0;
247 if( (mPidProbElectron+mPidProbPion+mPidProbKaon+mPidProbProton) <= 0.){
248 if (previousEventNumber != EV->info()->id()) {
251 hbtAihongPid->updateEvent(uncorrectedNumberOfPositivePrimaries(*TempEv));
253 previousEventNumber = EV->info()->id();
255 hbtAihongPid->updateTrack( (
int)mCharge, mP.mag(), mP.pseudoRapidity(), mNHitsDedx, mdEdx);
256 mPidProbElectron= (mCharge>0) ? aihongPid->beingPositronProb() : aihongPid->beingElectronProb() ;
257 mPidProbPion= (mCharge>0) ? aihongPid->beingPionPlusProb() : aihongPid->beingPionMinusProb();
258 mPidProbKaon= (mCharge>0) ? aihongPid->beingKaonPlusProb() : aihongPid->beingKaonMinusProb();
259 mPidProbProton= (mCharge>0) ? aihongPid->beingProtonProb() : aihongPid->beingAntiProtonProb();
316 mTrackType = t->mTrackType;
317 mTrackId = t->mTrackId;
319 mNHitsPoss = t->mNHitsPoss;
320 mNHitsDedx = t->mNHitsDedx;
321 mNSigmaElectron = t->mNSigmaElectron;
322 mNSigmaPion = t->mNSigmaPion;
323 mNSigmaKaon = t->mNSigmaKaon;
324 mNSigmaProton = t->mNSigmaProton;
325 mPidProbElectron = t->mPidProbElectron/1000.;
326 mPidProbPion = t->mPidProbPion/1000.;
327 mPidProbKaon = t->mPidProbKaon/1000.;
328 mPidProbProton = t->mPidProbProton/1000.;
331 mChiSqXY = t->mChiSqXY;
332 mChiSqZ = t->mChiSqZ;
333 mMap[0] = t->mMap[0];
334 mMap[1] = t->mMap[1];
339 mHelixGlobal =
StPhysicalHelixD(t->mHelixGlobalC,t->mHelixGlobalDip,t->mHelixGlobalPhase,
340 StThreeVectorD(t->mHelixGlobalX,t->mHelixGlobalY,t->mHelixGlobalZ),
344 mCharge =mHelix.charge(ev->mMagneticField*kilogauss);
348 mP = mHelix.momentumAt(pathlength,ev->mMagneticField*kilogauss);
351 mDCAxy = (mHelix.at(pathlength) -
vertex).perp();
352 mDCAz = (mHelix.at(pathlength) -
vertex).z();
355 mDCAxyGlobal = (mHelixGlobal.at(pathlengthGlobal) -
vertex).perp();
356 mDCAzGlobal = (mHelixGlobal.at(pathlengthGlobal) -
vertex).z();
357 mPGlobal = mHelixGlobal.momentumAt(pathlengthGlobal,ev->mMagneticField*kilogauss);
358 mPtGlobal = mPGlobal.perp();
361 static unsigned int previousEventNumber = 0;
364 if( (mPidProbElectron+mPidProbPion+mPidProbKaon+mPidProbProton) <= 0.){
365 if (previousEventNumber != ev->mEventNumber) {
366 hbtAihongPid->updateEvent((
int)ev->mUncorrectedNumberOfNegativePrimaries);
367 previousEventNumber = ev->mEventNumber;
369 hbtAihongPid->updateTrack( (
int)mCharge, mP.mag(), mP.pseudoRapidity(), mNHitsDedx, mdEdx);
370 mPidProbElectron= (mCharge>0) ? aihongPid->beingPositronProb() : aihongPid->beingElectronProb() ;
371 mPidProbPion= (mCharge>0) ? aihongPid->beingPionPlusProb() : aihongPid->beingPionMinusProb();
372 mPidProbKaon= (mCharge>0) ? aihongPid->beingKaonPlusProb() : aihongPid->beingKaonMinusProb();
373 mPidProbProton= (mCharge>0) ? aihongPid->beingProtonProb() : aihongPid->beingAntiProtonProb();
380 (mPidProbElectron+mPidProbPion+mPidProbKaon+mPidProbProton) <= 0.){
385 StuProbabilityPidAlgorithm::readParametersFromFile(
"PIDTable.root");
390 int tRefMult = ev->mUncorrectedNumberOfNegativePrimaries;
392 if (tRefMult > 225 ) tCent = 0.03;
393 else if (tRefMult > 215 ) tCent = 0.05;
394 else if (tRefMult > 200 ) tCent = 0.07;
395 else if (tRefMult > 180 ) tCent = 0.10;
396 else if (tRefMult > 140 ) tCent = 0.18;
397 else if (tRefMult > 130 ) tCent = 0.20;
398 else if (tRefMult > 120 ) tCent = 0.23;
399 else if (tRefMult > 115 ) tCent = 0.24;
400 else if (tRefMult > 100 ) tCent = 0.28;
406 mPidProbElectron= mCharge>0 ? AihongsPID.beingPositronProb() :
407 AihongsPID.beingElectronProb();
408 mPidProbPion= mCharge>0 ? AihongsPID.beingPionPlusProb():
409 AihongsPID.beingPionMinusProb();
410 mPidProbKaon= mCharge>0 ? AihongsPID.beingKaonPlusProb():
411 AihongsPID.beingKaonMinusProb();
412 mPidProbProton= mCharge>0 ? AihongsPID.beingProtonProb():
413 AihongsPID.beingAntiProtonProb();
418 #include "StMuDSTMaker/COMMON/StMuDst.h"
419 #include "StMuDSTMaker/COMMON/StMuEvent.h"
420 #include "StMuDSTMaker/COMMON/StMuTrack.h"
423 mTrackType = t->
type();
441 mChiSqZ = t->
chi2z();
450 mP = mHelix.momentumAt(pathlength,ev->magneticField()*kilogauss);
458 mPGlobal = mHelixGlobal.momentumAt(pathlengthGlobal,ev->magneticField()*kilogauss);
459 mPtGlobal = mPGlobal.perp();
461 mDCAxyGlobal = dcaGlobal.perp();
462 mDCAzGlobal = dcaGlobal.z();
480 void StHbtTrack::SetTrackType(
const short& t){mTrackType=t;}
481 void StHbtTrack::SetCharge(
const short& ch){mCharge=ch;}
482 void StHbtTrack::SetNHits(
const short& nh){mNHits=nh;}
483 void StHbtTrack::SetNHitsPossible(
const short& nh){mNHitsPoss=nh;}
484 void StHbtTrack::SetNHitsDedx(
const short& nh){mNHitsDedx=nh;}
485 void StHbtTrack::SetNSigmaElectron(
const float& x){mNSigmaElectron = x;}
486 void StHbtTrack::SetNSigmaPion(
const float& x){mNSigmaPion = x;}
487 void StHbtTrack::SetNSigmaKaon(
const float& x){mNSigmaKaon = x;}
488 void StHbtTrack::SetNSigmaProton(
const float& x){mNSigmaProton = x;}
489 void StHbtTrack::SetPidProbElectron(
const float& x){mPidProbElectron = x;}
490 void StHbtTrack::SetPidProbPion(
const float& x){mPidProbPion = x;}
491 void StHbtTrack::SetPidProbKaon(
const float& x){mPidProbKaon = x;}
492 void StHbtTrack::SetPidProbProton(
const float& x){mPidProbProton = x;}
494 void StHbtTrack::SetdEdx(
const float& x){mdEdx = x;}
496 void StHbtTrack::SetDCAxy(
const float& x){mDCAxy = x;}
497 void StHbtTrack::SetDCAz(
const float& x){mDCAz = x;}
498 void StHbtTrack::SetDCAxyGlobal(
const float& x){mDCAxyGlobal = x;}
499 void StHbtTrack::SetDCAzGlobal(
const float& x){mDCAzGlobal = x;}
500 void StHbtTrack::SetChiSquaredXY(
const float& x){mChiSqXY = x;}
501 void StHbtTrack::SetChiSquaredZ(
const float& x){mChiSqZ = x;}
503 void StHbtTrack::SetPt(
const float& pt){mPt = pt;}
505 void StHbtTrack::SetPtGlobal(
const float& pt){mPt = pt;}
507 void StHbtTrack::SetHelixGlobal(
const StPhysicalHelixD& h){mHelixGlobal = h;}
508 void StHbtTrack::SetTopologyMap(
const int word,
const unsigned int map) { mMap[word]=map;}
509 void StHbtTrack::SetTrackId(
const short &
id) { mTrackId=id;}
511 short StHbtTrack::TrackType()
const {
return mTrackType;}
512 short StHbtTrack::Charge()
const {
return mCharge;}
513 short StHbtTrack::NHits()
const {
return mNHits;}
514 short StHbtTrack::NHitsPossible()
const {
return mNHitsPoss;}
515 short StHbtTrack::NHitsDedx()
const {
return mNHitsDedx;}
516 float StHbtTrack::NSigmaElectron()
const {
return mNSigmaElectron;}
517 float StHbtTrack::NSigmaPion()
const {
return mNSigmaPion;}
518 float StHbtTrack::NSigmaKaon()
const {
return mNSigmaKaon;}
519 float StHbtTrack::NSigmaProton()
const {
return mNSigmaProton;}
520 float StHbtTrack::dEdx()
const {
return mdEdx;}
522 float StHbtTrack::DCAxy()
const {
return mDCAxy;}
523 float StHbtTrack::DCAz()
const {
return mDCAz;}
524 float StHbtTrack::DCAxyGlobal()
const {
return mDCAxyGlobal;}
525 float StHbtTrack::DCAzGlobal()
const {
return mDCAzGlobal;}
526 float StHbtTrack::ChiSquaredXY()
const {
return mChiSqXY;}
527 float StHbtTrack::ChiSquaredZ()
const {
return mChiSqZ;}
529 float StHbtTrack::Pt()
const {
return mPt;}
531 const StPhysicalHelixD& StHbtTrack::HelixGlobal()
const {
return mHelixGlobal;}
532 unsigned int StHbtTrack::TopologyMap(
const unsigned int word)
const {
return mMap[word];}
533 short StHbtTrack::TrackId()
const {
return mTrackId; }
535 void StHbtTrack::SetHiddenInfo(
StHbtHiddenInfo* aHiddenInfo) {mHiddenInfo=aHiddenInfo;}
536 bool StHbtTrack::ValidHiddenInfo()
const {
if (mHiddenInfo)
return true;
else return false; }
537 StHbtHiddenInfo* StHbtTrack::getHiddenInfo()
const {
return mHiddenInfo;}
539 StHbtTrack::~StHbtTrack()
Double_t pidProbKaon() const
Returns Aihong's probability of being a kaon.
short type() const
Returns the track type: 0=global, 1=primary, etc (see StEvent manual for type information) ...
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in 'physical events'. Therefore there is only 1 primary vert...
Double_t pidProbElectron() const
Returns Aihong's probability of being an electron.
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.
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
StPhysicalHelixD helix() const
Returns inner helix (first 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.
Double_t chi2z() const
Returns probability of fit. ATTENTIONS: does not return z chi2 (historic)
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)
Double_t chi2xy() const
Returns chi2 of fit. ATTENTIONS: does not return xy chi2 (historic)
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.
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.
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.
StTrackTopologyMap topologyMap() const
Returns topology map.