CbmRoot
CbmStsKFSecondaryVertexFinder.cxx
Go to the documentation of this file.
1 
9 
10 #include "CbmKFMath.h"
11 
12 #include <vector>
13 
14 using std::vector;
15 
17 
18  void CbmStsKFSecondaryVertexFinder::Clear(Option_t* /*opt*/) {
19  Finder.Clear();
20  vStsTracks.clear();
21  vKFTracks.clear();
22 }
23 
25  if (!Track) return;
26  vStsTracks.push_back(Track);
27  vKFTracks.push_back(CbmKFTrack(*Track));
28 }
29 
31  if (!Guess) {
33  } else {
34  VGuess.SetVertex(*Guess);
36  }
37 }
38 
40  Finder.SetMassConstraint(MotherMass);
41 }
42 
44  if (!Parent) {
46  } else {
47  VParent.SetVertex(*Parent);
49  }
50 }
51 
54  for (vector<CbmKFTrack>::iterator i = vKFTracks.begin(); i != vKFTracks.end();
55  ++i) {
56  Finder.AddTrack(&*i);
57  }
58  Finder.Fit();
59 }
60 
62  Finder.GetVertex(vtx);
63 }
64 /*
65 void CbmStsKFSecondaryVertexFinder::GetFittedTrack( Int_t itrack, CbmStsTrack *Track ){
66  if(!Track) return;
67  *Track = *vStsTracks[itrack];
68  double T[6], C[15];
69  Finder.GetTrack(itrack, T, C );
70  CbmKFMath::CopyTC2TrackParam( Track->GetParamFirst(), T, C );
71 }
72 
73 void CbmStsKFSecondaryVertexFinder::GetFittedTrack( Int_t itrack, FairTrackParam *Param ){
74  if(!Param) return;
75  double T[6], C[15];
76  Finder.GetTrack(itrack, T, C );
77  CbmKFMath::CopyTC2TrackParam( Param, T, C );
78 }
79 */
81  if (!MotherTrack) return;
82  double T[6], C[15];
83  Finder.GetMotherTrack(T, C);
84  FairTrackParam parFirst(*MotherTrack->GetParamFirst()),
85  parLast(*MotherTrack->GetParamLast());
87  &parFirst, T, C); // MotherTrack->GetParamFirst(), T, C );
89  &parLast, T, C); //MotherTrack->GetParamLast(), T, C );
90  MotherTrack->SetParamFirst(&parFirst);
91  MotherTrack->SetParamLast(&parLast);
92  MotherTrack->SetPidHypo(211);
93  MotherTrack->SetChiSq(0);
94  MotherTrack->SetNDF(1);
95 }
96 
97 void CbmStsKFSecondaryVertexFinder::GetMass(Double_t* M, Double_t* Error_) {
98  Finder.GetMass(M, Error_);
99 }
100 
102  return vStsTracks[itrack];
103 }
104 
CbmKFSecondaryVertexFinder::GetVertex
void GetVertex(CbmKFVertexInterface &vtx)
Definition: CbmKFSecondaryVertexFinder.cxx:288
CbmTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTrack.h:62
CbmStsKFSecondaryVertexFinder.h
CbmKFSecondaryVertexFinder::Clear
virtual void Clear(Option_t *opt="")
CbmKFSecondaryVertexFinder::GetMotherTrack
void GetMotherTrack(Double_t T[], Double_t C[])
Definition: CbmKFSecondaryVertexFinder.cxx:305
CbmKFSecondaryVertexFinder::SetTopoConstraint
void SetTopoConstraint(CbmKFVertexInterface *Parent=0)
Definition: CbmKFSecondaryVertexFinder.cxx:46
CbmKFSecondaryVertexFinder::GetMass
void GetMass(Double_t *M, Double_t *Error)
Definition: CbmKFSecondaryVertexFinder.cxx:363
CbmStsKFSecondaryVertexFinder::SetMassConstraint
void SetMassConstraint(Double_t MotherMass=-1)
Definition: CbmStsKFSecondaryVertexFinder.cxx:39
CbmStsKFSecondaryVertexFinder
Definition: CbmStsKFSecondaryVertexFinder.h:21
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmStsKFSecondaryVertexFinder::GetVertex
void GetVertex(CbmVertex &vtx)
Definition: CbmStsKFSecondaryVertexFinder.cxx:61
CbmKFSecondaryVertexFinder::Fit
void Fit()
Definition: CbmKFSecondaryVertexFinder.cxx:50
CbmStsKFSecondaryVertexFinder::VParent
CbmKFVertex VParent
Definition: CbmStsKFSecondaryVertexFinder.h:25
CbmKFSecondaryVertexFinder::AddTrack
void AddTrack(CbmKFTrackInterface *Track)
Definition: CbmKFSecondaryVertexFinder.cxx:30
CbmTrack::SetParamLast
void SetParamLast(const FairTrackParam *par)
Definition: CbmTrack.h:76
CbmTrack::SetNDF
void SetNDF(Int_t ndf)
Definition: CbmTrack.h:71
CbmKFMath.h
CbmStsKFSecondaryVertexFinder::SetApproximation
void SetApproximation(CbmVertex *Guess=0)
Definition: CbmStsKFSecondaryVertexFinder.cxx:30
CbmStsKFSecondaryVertexFinder::GetMotherTrack
void GetMotherTrack(CbmStsTrack *MotherTrack)
Definition: CbmStsKFSecondaryVertexFinder.cxx:80
CbmKFVertexInterface::SetVertex
void SetVertex(CbmVertex &v)
Number of tracks used during fit.
Definition: CbmKFVertexInterface.cxx:36
CbmStsKFSecondaryVertexFinder::AddTrack
void AddTrack(CbmStsTrack *Track)
Definition: CbmStsKFSecondaryVertexFinder.cxx:24
CbmVertex
Definition: CbmVertex.h:26
CbmTrack::SetPidHypo
void SetPidHypo(Int_t pid)
Definition: CbmTrack.h:68
CbmStsKFSecondaryVertexFinder::SetTopoConstraint
void SetTopoConstraint(CbmVertex *Parent=0)
Definition: CbmStsKFSecondaryVertexFinder.cxx:43
CbmTrack::SetChiSq
void SetChiSq(Double_t chiSq)
Definition: CbmTrack.h:70
CbmStsKFSecondaryVertexFinder::GetMass
void GetMass(Double_t *M, Double_t *Error)
Definition: CbmStsKFSecondaryVertexFinder.cxx:97
CbmStsKFSecondaryVertexFinder::GetTrack
CbmStsTrack * GetTrack(Int_t itrack)
Definition: CbmStsKFSecondaryVertexFinder.cxx:101
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
CbmKFSecondaryVertexFinder::SetMassConstraint
void SetMassConstraint(Double_t MotherMass=-1)
Definition: CbmKFSecondaryVertexFinder.cxx:42
CbmStsKFSecondaryVertexFinder::GetNTracks
Int_t GetNTracks()
Definition: CbmStsKFSecondaryVertexFinder.cxx:105
CbmStsKFSecondaryVertexFinder::VGuess
CbmKFVertex VGuess
Definition: CbmStsKFSecondaryVertexFinder.h:25
CbmKFSecondaryVertexFinder::ClearTracks
void ClearTracks()
Definition: CbmKFSecondaryVertexFinder.cxx:28
CbmKFMath::CopyTC2TrackParam
static void CopyTC2TrackParam(FairTrackParam *par, Double_t T[], Double_t C[])
Definition: CbmKFMath.cxx:809
CbmKFSecondaryVertexFinder::SetApproximation
void SetApproximation(CbmKFVertexInterface *Guess=0)
Definition: CbmKFSecondaryVertexFinder.cxx:38
CbmTrack::SetParamFirst
void SetParamFirst(const FairTrackParam *par)
Definition: CbmTrack.h:75
ClassImp
ClassImp(CbmStsKFSecondaryVertexFinder) void CbmStsKFSecondaryVertexFinder
Definition: CbmStsKFSecondaryVertexFinder.cxx:16
CbmStsKFSecondaryVertexFinder::Fit
void Fit()
Definition: CbmStsKFSecondaryVertexFinder.cxx:52
CbmStsKFSecondaryVertexFinder::vStsTracks
std::vector< CbmStsTrack * > vStsTracks
Definition: CbmStsKFSecondaryVertexFinder.h:23
CbmStsKFSecondaryVertexFinder::vKFTracks
std::vector< CbmKFTrack > vKFTracks
Definition: CbmStsKFSecondaryVertexFinder.h:24
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmKFTrack
Definition: CbmKFTrack.h:21
CbmStsKFSecondaryVertexFinder::Clear
virtual void Clear(Option_t *opt="")
CbmStsKFSecondaryVertexFinder::Finder
CbmKFSecondaryVertexFinder Finder
Definition: CbmStsKFSecondaryVertexFinder.h:26