CbmRoot
CbmKFTrack.cxx
Go to the documentation of this file.
1 #include "CbmKFTrack.h"
2 
3 #include "CbmKFMath.h"
4 
5 #include "CbmStsTrack.h"
6 #include "FairTrackParam.h"
7 
8 #include "TDatabasePDG.h"
9 #include "TMath.h"
10 #include "TParticlePDG.h"
11 
13 
15  : fMass(0), fChi2(0), fIsElectron(kFALSE), fNDF(0), fHits() {
16  for (Int_t i = 0; i < 6; i++)
17  fT[i] = 0.;
18  for (Int_t i = 0; i < 15; i++)
19  fC[i] = 0.;
20 }
21 
22 
24  for (Int_t i = 0; i < 6; i++)
25  fT[i] = track.GetTrack()[i];
26  for (Int_t i = 0; i < 15; i++)
27  fC[i] = track.GetCovMatrix()[i];
28  fMass = track.GetMass();
29  fIsElectron = track.IsElectron();
30  fChi2 = track.GetRefChi2();
31  fNDF = track.GetRefNDF();
32 }
33 
34 void CbmKFTrack::SetTrackParam(const FairTrackParam& track) {
36 }
37 
39  SetPID(track.GetPidHypo());
40  SetTrackParam(first ? *track.GetParamFirst() : *track.GetParamLast());
41  GetRefChi2() = track.GetChiSq();
42  GetRefNDF() = track.GetNDF();
43 }
44 
45 void CbmKFTrack::GetTrackParam(FairTrackParam& track) {
47 }
48 
50  FairTrackParam par(first ? *track.GetParamFirst() : *track.GetParamLast());
52  par); //first? *track.GetParamFirst() : *track.GetParamLast() );
53  first ? track.SetParamFirst(&par) : track.SetParamLast(&par);
54  track.SetChiSq(GetRefChi2());
55  track.SetNDF(GetRefNDF());
56 }
57 
58 void CbmKFTrack::SetPID(Int_t pidHypo) {
59  TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(pidHypo);
60  fMass = (particlePDG) ? particlePDG->Mass() : 0.13957;
61  fIsElectron = (TMath::Abs(pidHypo) == 11);
62 }
CbmTrack::GetChiSq
Double_t GetChiSq() const
Definition: CbmTrack.h:58
CbmTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTrack.h:62
CbmKFTrack::fC
Double_t fC[15]
Definition: CbmKFTrack.h:24
CbmKFTrackInterface::IsElectron
virtual Bool_t IsElectron()
Mass hypothesis.
Definition: CbmKFTrackInterface.h:36
CbmKFTrackInterface::GetTrack
virtual Double_t * GetTrack()
Is it electron.
Definition: CbmKFTrackInterface.cxx:33
CbmKFTrack::fNDF
Int_t fNDF
Definition: CbmKFTrack.h:26
CbmKFTrack::SetPID
void SetPID(Int_t pidHypo)
Definition: CbmKFTrack.cxx:58
CbmKFTrack::GetTrackParam
void GetTrackParam(FairTrackParam &track)
Definition: CbmKFTrack.cxx:45
CbmKFMath::CopyTrackParam2TC
static void CopyTrackParam2TC(const FairTrackParam *par, Double_t T[], Double_t C[])
Definition: CbmKFMath.cxx:827
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmKFTrack::CbmKFTrack
CbmKFTrack()
CbmKFTrackInterface::GetMass
virtual Double_t GetMass()
Definition: CbmKFTrackInterface.h:35
CbmTrack::SetParamLast
void SetParamLast(const FairTrackParam *par)
Definition: CbmTrack.h:76
ClassImp
ClassImp(CbmKFTrack) CbmKFTrack
Definition: CbmKFTrack.cxx:12
CbmTrack::SetNDF
void SetNDF(Int_t ndf)
Definition: CbmTrack.h:71
CbmKFTrack::fIsElectron
Bool_t fIsElectron
Definition: CbmKFTrack.h:25
CbmKFTrack::SetTrack
void SetTrack(CbmKFTrackInterface &track)
Definition: CbmKFTrack.cxx:23
CbmKFMath.h
CbmKFTrack::GetRefChi2
Double_t & GetRefChi2()
array[15] of covariance matrix
Definition: CbmKFTrack.h:60
CbmKFTrack::SetStsTrack
void SetStsTrack(CbmStsTrack &track, bool first=1)
Definition: CbmKFTrack.cxx:38
CbmKFTrack::fMass
Double_t fMass
Definition: CbmKFTrack.h:24
CbmStsTrack.h
Data class for STS tracks.
CbmKFTrack::GetRefNDF
Int_t & GetRefNDF()
Chi^2 after fit.
Definition: CbmKFTrack.h:61
CbmKFTrack::fChi2
Double_t fChi2
Definition: CbmKFTrack.h:24
CbmTrack::SetChiSq
void SetChiSq(Double_t chiSq)
Definition: CbmTrack.h:70
CbmTrack::GetNDF
Int_t GetNDF() const
Definition: CbmTrack.h:59
CbmKFTrack.h
CbmKFTrackInterface::GetRefNDF
virtual Int_t & GetRefNDF()
Chi^2 after fit.
Definition: CbmKFTrackInterface.cxx:36
first
bool first
Definition: LKFMinuit.cxx:143
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
CbmKFTrackInterface
Definition: CbmKFTrackInterface.h:26
CbmKFTrackInterface::GetCovMatrix
virtual Double_t * GetCovMatrix()
array[6] of track parameters(x,y,tx,ty,qp,z)
Definition: CbmKFTrackInterface.cxx:34
CbmKFTrack::fT
Double_t fT[6]
Definition: CbmKFTrack.h:24
CbmKFTrack::GetStsTrack
void GetStsTrack(CbmStsTrack &track, bool first=1)
Definition: CbmKFTrack.cxx:49
CbmKFMath::CopyTC2TrackParam
static void CopyTC2TrackParam(FairTrackParam *par, Double_t T[], Double_t C[])
Definition: CbmKFMath.cxx:809
CbmTrack::SetParamFirst
void SetParamFirst(const FairTrackParam *par)
Definition: CbmTrack.h:75
CbmTrack::GetPidHypo
Int_t GetPidHypo() const
Definition: CbmTrack.h:56
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmKFTrack
Definition: CbmKFTrack.h:21
CbmKFTrack::SetTrackParam
void SetTrackParam(const FairTrackParam &track)
Definition: CbmKFTrack.cxx:34
CbmKFTrackInterface::GetRefChi2
virtual Double_t & GetRefChi2()
array[15] of covariance matrix
Definition: CbmKFTrackInterface.cxx:35