12 #include "StPicoMessMgr.h"
13 #include "StPicoTrack.h"
15 #if defined (__TFG__VERSION__)
17 #include "St_base/StMessMgr.h"
18 #include "StMuDSTMaker/COMMON/StMuTrack.h"
19 #include "StBichsel/Bichsel.h"
20 #include "StBichsel/StdEdxModel.h"
21 #include "StBichsel/StdEdxPull.h"
29 mChi2(std::numeric_limits<
unsigned short>::max()),
30 mPMomentumX(0), mPMomentumY(0), mPMomentumZ(0),
31 mGMomentumX(0), mGMomentumY(0), mGMomentumZ(0),
32 mOriginX(0),mOriginY(0), mOriginZ(0),
33 mDedx(0), mDedxError(0),
34 mDnDx(0),mDnDxError(0),
35 mNHitsFit(0), mNHitsMax(0), mNHitsDedx(0),
36 mNSigmaPion( std::numeric_limits<
short>::min() ),
37 mNSigmaKaon( std::numeric_limits<
short>::min() ),
38 mNSigmaProton( std::numeric_limits<
short>::min() ),
39 mNSigmaElectron( std::numeric_limits<
short>::min() ),
40 mTopologyMap{}, mBEmcPidTraitsIndex(-1), mBTofPidTraitsIndex(-1),
41 mMtdPidTraitsIndex(-1), mETofPidTraitsIndex(-1),
42 mBEmcMatchedTowerIndex(-1)
43 #if !defined (__TFG__VERSION__)
47 mIdTruth(0), mQATruth(0), mVertexIndex(-1)
78 for(
int iIter=0; iIter<eTopologyMap; iIter++) {
85 #if !defined (__TFG__VERSION__)
101 LOG_INFO <<
"id: " <<
id() <<
" chi2: " <<
chi2() <<
"\n"
102 <<
"pMom: " <<
pMom().X() <<
" " <<
pMom().Y() <<
" " <<
pMom().Z() <<
"\n"
103 <<
"gMom: " <<
gMom().X() <<
" " <<
gMom().Y() <<
" " <<
gMom().Z() <<
"\n"
134 mChi2 = ( (chi2 * 1000.) > std::numeric_limits<unsigned short>::max() ?
135 std::numeric_limits<unsigned short>::max() :
136 (UShort_t)( TMath::Nint( chi2 * 1000. ) ) );
163 if(
id==0 ||
id==1 ||
id==2) {
173 mNSigmaPion = ( fabs(ns * 1000.) > std::numeric_limits<short>::max() ?
174 ( (ns > 0) ? std::numeric_limits<short>::max() :
175 std::numeric_limits<short>::min() ) :
176 (Short_t)( TMath::Nint( ns * 1000. ) ) );
181 mNSigmaKaon = ( fabs(ns * 1000.) > std::numeric_limits<short>::max() ?
182 ( (ns > 0) ? std::numeric_limits<short>::max() :
183 std::numeric_limits<short>::min() ) :
184 (Short_t)( TMath::Nint( ns * 1000. ) ) );
189 mNSigmaProton = ( fabs(ns * 1000.) > std::numeric_limits<short>::max() ?
190 ( (ns > 0) ? std::numeric_limits<short>::max() :
191 std::numeric_limits<short>::min() ) :
192 (Short_t)( TMath::Nint( ns * 1000. ) ) );
197 mNSigmaElectron = ( fabs(ns * 1000.) > std::numeric_limits<short>::max() ?
198 ( (ns > 0) ? std::numeric_limits<short>::max() :
199 std::numeric_limits<short>::min() ) :
200 (Short_t)( TMath::Nint( ns * 1000. ) ) );
212 static_cast<float>(
charge() ) );
215 #if defined (__TFG__VERSION__)
217 Float_t StPicoTrack::dEdxPull(Float_t mass, UChar_t fit, Int_t charge)
const {
219 Float_t momentum =
gMom().Mag();
220 Float_t betagamma = momentum * TMath::Abs(charge) / mass;
221 Float_t dedx_measured, dedx_resolution = -1;
223 dedx_measured = 1e-6*
dEdx();
226 else if ( fit == 1) {
227 dedx_measured = 1e-6*
dEdx();
231 dedx_measured =
dNdx();
234 if (dedx_resolution <= 0)
return z;
235 z = StdEdxPull::Eval(dedx_measured,dedx_resolution,betagamma,fit,charge);
240 Float_t StPicoTrack::dEdxPullToF(Float_t mass, UChar_t fit, Int_t charge)
const {
242 Float_t momentum =
gMom().Mag();
243 Float_t betagamma = momentum * TMath::Abs(charge) / mass;
244 Float_t dedx_measured, dedx_resolution = -1;
245 Float_t dedx_predicted = -1;
246 static TF1 *ToFCor[2][3] = {0};
249 if (! ToFCor[0][0]) {
267 ToFCor[0][0] =
new TF1(
"dEdxCorPion",
"pol8",0,1.4);
268 ToFCor[0][0]->SetParameters(-0.0686941, 1.00512, -7.01202, 26.5077, -55.6186,
269 67.2198, -46.5966, 17.194, -2.61537);
287 ToFCor[0][1] =
new TF1(
"dEdxCorKaon",
"pol8",-0.30,1);
288 ToFCor[0][1]->SetParameters(0.0103183, -0.113391, 0.347118, 0.939172, -2.85298,
289 -2.16397, 12.1903, -12.2671, 3.9317);
308 ToFCor[0][2] =
new TF1(
"dEdxCorProt",
"pol8",-0.5,0.75);
309 ToFCor[0][2]->SetParameters(0.0241608, -0.122085, 0.409931, 0.772181, -2.82003,
310 -1.15634, 5.60995, 0.425809, -3.1966);
329 ToFCor[1][0] =
new TF1(
"dNdxCorPion",
"pol8",0,1.4);
330 ToFCor[1][0]->SetParameters(-0.0790884, 0.960891, -7.18579, 29.6238, -65.671,
331 82.2409, -58.5028, 22.0458, -3.41535);
356 ToFCor[1][1] =
new TF1(
"dNdxCorKaon",
"pol8",-0.3,1);
357 ToFCor[1][1]->SetParameters(-0.0165074, 0.00880377, 0.181553, 0.723291, -1.69666,
358 -2.88222, 9.83642, -8.58367, 2.45608);
376 ToFCor[1][2] =
new TF1(
"dNdxCorProt",
"pol8",-0.5,0.75);
377 ToFCor[1][2]->SetParameters(-0.0254615, 0.0610245, 0.364898, 0.0783227, -2.27553,
378 0.317491, 4.55173, -1.44629, -1.70712);
383 if (mass < 1.0) hyp = 2;
384 if (mass < 0.5) hyp = 1;
385 if (mass < 0.2) hyp = 0;
386 if (mass < 0.1) hyp = -1;
387 Double_t bgL10 = TMath::Log10(betagamma);
389 dedx_measured = 1e-6*
dEdx();
391 dedx_predicted = 1.e-6 * charge * charge * TMath::Exp(Bichsel::Instance()->GetMostProbableZ(bgL10));
392 if (ToFCor[0][hyp] &&hyp >= 0 && bgL10 > ToFCor[0][hyp]->GetXmin() &&
393 bgL10 < ToFCor[0][hyp]->GetXmax()) {
394 dedx_predicted *= TMath::Exp(ToFCor[0][hyp]->Eval(bgL10));
398 dedx_measured =
dNdx();
400 dedx_predicted = StdEdxModel::instance()->dNdx(betagamma,charge);
401 if (ToFCor[0][hyp] && hyp >= 0 && bgL10 > ToFCor[0][hyp]->GetXmin() &&
402 bgL10 < ToFCor[0][hyp]->GetXmax()) {
403 dedx_predicted *= TMath::Exp(ToFCor[1][hyp]->Eval(bgL10));
406 if (dedx_resolution <= 0)
return z;
407 z = TMath::Log(dedx_measured/dedx_predicted) / dedx_resolution;
421 TVector3 dir =
gMom();
424 Float_t cosl = dir.Perp();
426 TVector3 dca =
gDCA( point );
427 return -dir.Y()/cosl * dca.X() + dir.X()/cosl * dca.Y();
432 if ( index<=-2 || index>std::numeric_limits<char>::max() ) {
TVector3 momentumAt(Double_t, Double_t) const
Return momemtum at S.
Bool_t isPrimary() const
Return if track is primary.
Float_t dEdxError() const
Return dE/dx error of the track (in GeV/cm)
UChar_t mNHitsMax
Possible number of hits (in TPC)
ULong64_t mTopoMap_iTpc
Topology map for the iTPC.
void setNSigmaKaon(Float_t ns)
Set nSigma(kaon)
Short_t mBEmcPidTraitsIndex
Index of the BEMC pidTratis in the event.
Float_t mOriginX
Track origin x (DCAx to the primary vertex) in cm.
StPicoTrack()
Default constructor.
Short_t mNSigmaPion
nSigma(pion) (encoding = nsigma * 1000)
Short_t mNSigmaElectron
nSigma(electron) (encoding = nsigma * 1000)
Float_t mDnDx
Fitted dN/dx.
Float_t mPMomentumY
Py momentum (GeV/c) of the primary track ( 0 if not primary )
Float_t nSigmaKaon() const
Return nSigma(kaon)
Short_t mNSigmaProton
nSigma(proton) (encoding = nsigma * 1000)
UShort_t mChi2
Chi2 of the track (encoding = chi2*1000)
Float_t nSigmaPion() const
Return nSigma(pion)
void setTopologyMap(Int_t id, UInt_t word)
Set topology map (2 words)
void setDedx(Float_t dEdx)
Set dE/dx of the track.
Float_t dNdxError() const
Return dN/dx error of the track.
void setNSigmaProton(Float_t ns)
Set nSigma(proton)
Short_t mMtdPidTraitsIndex
Index of the MTD pidTratis in the event.
UChar_t mNHitsDedx
Number of hits used for dE/dx estimation (in TPC)
Float_t mOriginY
Track origin y (DCAy to the primary vertex) in cm.
Float16_t mDedxError
dE/dx error (in GeV/cm)
Float_t mDnDxError
Fitted dN/dx error.
void setNSigmaPion(Float_t ns)
Set nSigma(pion)
TVector3 gMom() const
Return momentum (GeV/c) of the global tracks at the point of DCA to the primary vertex.
Float_t dNdx() const
Return dN/dx of the track.
Float_t gDCAs(TVector3 pVtx) const
void setChi2(Float_t chi2)
Set chi2 of the track.
Holds information about track parameters.
Short_t mNSigmaKaon
nSigma(kaon) (encoding = nsigma * 1000)
void setNHitsPossible(Int_t nhits)
Set nHitsPoss.
void setNSigmaElectron(Float_t ns)
Set nSigma(electron)
TVector3 origin() const
Return space coordinate (cm) of DCA to the primary vertex.
pair< Double_t, Double_t > pathLength(Double_t r) const
path length at given r (cylindrical r)
Float_t mGMomentumX
Px component of the momentum (GeV/c) of the global track at DCA to primary vertex.
UShort_t mIdTruth
MC track id.
Float_t chi2() const
Return chi2 of the track.
Short_t mBTofPidTraitsIndex
Index of the BTOF pidTratis in the event.
UShort_t mQATruth
MC track quality (percentage of hits coming from corresponding MC track)
Float_t gDCAxy(Float_t pVtxX, Float_t pVtxY) const
Return distance in xy direction (cm) between the (x,y) point and the DCA point to primary vertex...
Float_t nSigmaElectron() const
Return nSigma(electron)
void setNHitsMax(Int_t nhits)
Set nHitsPoss.
Int_t nHitsDedx() const
Return number of hits used for dE/dx measurement.
void setNHitsDedx(Int_t nhits)
Set nHitsDedx.
Float_t mPMomentumZ
Pz momentum (GeV/c) of the primary track ( 0 if not primary )
TVector3 pMom() const
Return momentum (GeV/c) of the primary track. Return (0,0,0) if not primary track.
Float_t dEdx() const
Return dE/dx (in keV/cm) of the track.
Helis parametrization for the particle.
void setVertexIndex(Int_t index)
Set vertex index to which the track was fitted.
Float_t mGMomentumZ
Pz component of the momentum (GeV/c) of the global track at DCA to primary vertex.
Float_t mGMomentumY
Py component of the momentum (GeV/c) of the global track at DCA to primary vertex.
Float_t nSigmaProton() const
Return nSigma(proton)
Float16_t mDedx
dE/dx in KeV/cm (dE/dx * 1e6)
Int_t nHitsFit() const
Return number of hits fit.
Float_t gDCA(Float_t pVtxX, Float_t pVtxY, Float_t pVtxZ) const
Return distance in xyz direction (cm) between the (x,y,z) point and the DCA point to primary vertex...
Int_t qaTruth() const
Qualtiy of the MC track.
Float_t mOriginZ
Track origin z (DCAy to the primary vertex) in cm.
virtual ~StPicoTrack()
Destructor.
Short_t mETofPidTraitsIndex
Index of the ETOF pidTratis in the event.
Int_t idTruth() const
Index of the corresponding MC track.
UInt_t mTopologyMap[eTopologyMap]
Toplogy Map data0 and data1. See StEvent/StTrackTopologyMap.cxx.
Int_t id() const
Return unique Id of the track.
Char_t mNHitsFit
Charge * nHitsFit.
virtual void Print(const Char_t *option="") const
Print track parameters.
UShort_t mId
Unique track ID.
Float_t mPMomentumX
Px momentum (GeV/c) of the primary track ( 0 if not primary )
Char_t mVertexIndex
Parent vertex index. -2 if no vertex.
StPicoPhysicalHelix helix(Float_t const B) const
Helix at point of DCA to StPicoEvent::mPrimaryVertex.
Short_t charge() const
Return charge of the track (encoded in nHitsFit as: nHitsFit * charge)