]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliKFParticleBase.h
Introducing a new set of classes for secondary vertex fitting based on Kalman filter...
[u/mrichter/AliRoot.git] / STEER / AliKFParticleBase.h
CommitLineData
f826d409 1//---------------------------------------------------------------------------------
2// The AliKFParticleBase class
3// .
4// @author S.Gorbunov, I.Kisel
5// @version 1.0
6// @since 13.05.07
7//
8// Class to reconstruct and store the decayed particle parameters.
9// The method is described in CBM-SOFT note 2007-003,
10// ``Reconstruction of decayed particles based on the Kalman filter'',
11// http://www.gsi.de/documents/DOC-2007-May-14-1.pdf
12//
13// This class describes general mathematics which is used by AliKFParticle class
14//
15// -= Copyright &copy ALICE HLT Group =-
16//_________________________________________________________________________________
17
18
19
20#ifndef ALIKFPARTICLEBASE_H
21#define ALIKFPARTICLEBASE_H
22
23#include "TObject.h"
24
25class AliKFParticleBase :public TObject {
26
27 public:
28
29 //*
30 //* ABSTRACT METHODS HAVE TO BE DEFINED IN USER CLASS
31 //*
32
33 //* Virtual method to access the magnetic field
34
35 virtual void GetFieldValue(const Double_t xyz[], Double_t B[]) const = 0;
36
37 //* Virtual methods needed for particle transportation
38 //* One can use particular implementations for collider (only Bz component)
39 //* geometry and for fixed-target (CBM-like) geometry which are provided below
40 //* in TRANSPORT section
41
42 //* Get dS to xyz[] space point
43
44 virtual Double_t GetDStoPoint( const Double_t xyz[] ) const = 0;
45
46 //* Get dS to other particle p (dSp for particle p also returned)
47
48 virtual void GetDStoParticle( const AliKFParticleBase &p,
49 Double_t &DS, Double_t &DSp ) const = 0;
50
51 //* Transport on dS value along trajectory, output to P,C
52
53 virtual void Transport( Double_t dS, Double_t P[], Double_t C[] ) const = 0;
54
55
56
57 //*
58 //* INITIALIZATION
59 //*
60
61 //* Constructor
62
63 AliKFParticleBase();
64
65 //* Destructor
66
67 virtual ~AliKFParticleBase(){};
68
69 //* Initialise covariance matrix and set current parameters to 0.0
70
71 void Initialize();
72
73 //* Set decay vertex parameters for linearisation
74
75 void SetVtxGuess( Double_t x, Double_t y, Double_t z );
76
77 //*
78 //* ACCESSORS
79 //*
80
81 //* Simple accessors
82
83 Double_t GetX () const { return fP[0]; }
84 Double_t GetY () const { return fP[1]; }
85 Double_t GetZ () const { return fP[2]; }
86 Double_t GetPx () const { return fP[3]; }
87 Double_t GetPy () const { return fP[4]; }
88 Double_t GetPz () const { return fP[5]; }
89 Double_t GetE () const { return fP[6]; }
90 Double_t GetS () const { return fP[7]; }
91 Int_t GetQ () const { return fQ; }
92 Double_t GetChi2 () const { return fChi2; }
93 Int_t GetNDF () const { return fNDF; }
94
95 Double_t GetParameter ( Int_t i ) const { return fP[i]; }
96 Double_t GetCovariance( Int_t i ) const { return fC[i]; }
97 Double_t GetCovariance( Int_t i, Int_t j ) const { return fC[IJ(i,j)]; }
98
99 //* Accessors with calculations( &value, &estimated sigma )
100 //* error flag returned (0 means no error during calculations)
101
102 Int_t GetMomentum ( Double_t &P, Double_t &SigmaP ) const ;
103 Int_t GetMass ( Double_t &M, Double_t &SigmaM ) const ;
104 Int_t GetDecayLength ( Double_t &L, Double_t &SigmaL ) const ;
105 Int_t GetLifeTime ( Double_t &T, Double_t &SigmaT ) const ;
106
107 //*
108 //* MODIFIERS
109 //*
110
111 Double_t & X () { return fP[0]; }
112 Double_t & Y () { return fP[1]; }
113 Double_t & Z () { return fP[2]; }
114 Double_t & Px () { return fP[3]; }
115 Double_t & Py () { return fP[4]; }
116 Double_t & Pz () { return fP[5]; }
117 Double_t & E () { return fP[6]; }
118 Double_t & S () { return fP[7]; }
119 Int_t & Q () { return fQ; }
120 Double_t & Chi2 () { return fChi2; }
121 Int_t & NDF () { return fNDF; }
122
123 Double_t & Parameter ( Int_t i ) { return fP[i]; }
124 Double_t & Covariance( Int_t i ) { return fC[i]; }
125 Double_t & Covariance( Int_t i, Int_t j ) { return fC[IJ(i,j)]; }
126
127
128 //*
129 //* CONSTRUCTION OF THE PARTICLE BY ITS DAUGHTERS AND MOTHER
130 //* USING THE KALMAN FILTER METHOD
131 //*
132
133
134 //* Simple way to add daughter ex. D0+= Pion;
135
136 void operator +=( const AliKFParticleBase &Daughter );
137
138 //* Add daughter track to the particle
139
140 void AddDaughter( const AliKFParticleBase &Daughter );
141
142 //* Set production vertex
143
144 void SetProductionVertex( const AliKFParticleBase &Vtx );
145
146 //* Set hard mass constraint
147
148 void SetMassConstraint( Double_t Mass );
149
150 //* Everything in one go
151
152 void Construct( const AliKFParticleBase *vDaughters[], Int_t NDaughters,
153 const AliKFParticleBase *ProdVtx=0, Double_t Mass=-1 );
154
155
156 //*
157 //* TRANSPORT
158 //*
159 //* ( main transportation parameter is S = SignedPath/Momentum )
160 //* ( parameters of decay & production vertices are stored locally )
161 //*
162
163
164 //* Transport the particle to its decay vertex
165
166 void TransportToDecayVertex();
167
168 //* Transport the particle to its production vertex
169
170 void TransportToProductionVertex();
171
172 //* Transport the particle on dS parameter (SignedPath/Momentum)
173
174 void TransportToDS( Double_t dS );
175
176 //* Particular extrapolators one can use
177
178 Double_t GetDStoPointBz( Double_t Bz, const Double_t xyz[] ) const;
179
180 void GetDStoParticleBz( Double_t Bz, const AliKFParticleBase &p,
181 Double_t &dS, Double_t &dS1 ) const ;
182
183 // Double_t GetDStoPointCBM( const Double_t xyz[] ) const;
184
185 void TransportBz( Double_t Bz, Double_t dS, Double_t P[], Double_t C[] ) const;
186 void TransportCBM( Double_t dS, Double_t P[], Double_t C[] ) const;
187
188
189 //*
190 //* OTHER UTILITIES
191 //*
192
193 //* Calculate distance from another object [cm]
194
195 Double_t GetDistanceFromVertex( const Double_t vtx[] ) const;
196 Double_t GetDistanceFromVertex( const AliKFParticleBase &Vtx ) const;
197 Double_t GetDistanceFromParticleBz( Double_t Bz,
198 const AliKFParticleBase &p ) const;
199
200 //* Calculate sqrt(Chi2/ndf) deviation from vertex
201 //* v = [xyz], Cv=[Cxx,Cxy,Cyy,Cxz,Cyz,Czz]-covariance matrix
202
203 Double_t GetDeviationFromVertex( const Double_t v[],
204 const Double_t Cv[]=0 ) const;
205 Double_t GetDeviationFromVertex( const AliKFParticleBase &Vtx ) const;
206 Double_t GetDeviationFromParticleBz( Double_t Bz,
207 const AliKFParticleBase &p ) const;
208
209 //* Subtract the particle from the vertex
210
211 void SubtractFromVertex( Double_t v[], Double_t Cv[],
212 Double_t &vChi2, Int_t vNDF ) const ;
213
214 protected:
215
216 static Int_t IJ( Int_t i, Int_t j ){
217 return ( j<=i ) ? i*(i+1)/2+j :j*(j+1)/2+i;
218 }
219
220 Double_t & Cij( Int_t i, Int_t j ){ return fC[IJ(i,j)]; }
221
222 void Convert( bool ToProduction );
223 void TransportLine( Double_t S, Double_t P[], Double_t C[] ) const ;
224 Double_t GetDStoPointLine( const Double_t xyz[] ) const;
225
226 static void MultQSQt( const Double_t Q[], const Double_t S[],
227 Double_t SOut[] );
228
229
230 Double_t fP[8]; //* Main particle parameters {X,Y,Z,Px,Py,Pz,E,S[=DecayLength/P]}
231 Double_t fC[36]; //* Low-triangle covariance matrix of fP
232 Int_t fQ; //* Particle charge
233 Int_t fNDF; //* Number of degrees of freedom
234 Double_t fChi2; //* Chi^2
235
236 Double_t fSFromDecay; //* Distance from decay vertex to current position
237
238 Bool_t fAtProductionVertex; //* Flag shows that the particle error along
239 //* its trajectory is taken from production vertex
240
241 Double_t fVtxGuess[3]; //* Guess for the position of the decay vertex
242 //* ( used for linearisation of equations )
243
244 Bool_t fIsLinearized; //* Flag shows that the guess is present
245
246 ClassDef( AliKFParticleBase, 1 );
247};
248
249#endif