1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.2 1999/09/29 09:24:28 fca
19 Introduction of the Copyright and cvs Log
23 ///////////////////////////////////////////////////////////////////////////
25 // Perform various Lorentz transformations.
30 // Float_t a[3]={0.1,0.2,0.3};
31 // Float_t ea[3]={0.01,0.02,0.03};
33 // beta.SetVector(a,"car");
34 // beta.SetErrors(ea,"car");
40 // Float_t b[4]={14,1,2,3};
41 // Float_t eb[4]={1.4,0.1,0.2,0.3};
43 // p.SetVector(b,"car");
44 // p.SetErrors(eb,"car");
45 // Ali4Vector pprim=b1.Boost(p);
49 // p=b1.Inverse(pprim);
53 // Float_t c[4]={5,0,0,4};
54 // Float_t ec[4]={0.5,0,0,0.4};
56 // q.SetVector(c,"car");
57 // q.SetErrors(ec,"car");
60 // b2.Set4Momentum(q);
63 //--- Author: Nick van Eijndhoven 14-may-1996 UU-SAP Utrecht
64 //- Modified: NvE 24-oct-1999 UU-SAP Utrecht
65 ///////////////////////////////////////////////////////////////////////////
69 ClassImp(AliBoost) // Class implementation to enable ROOT I/O
73 // Creation of a Lorentz boost object and initialisation of parameters.
74 // Beta is set to (0,0,0) and consequently Gamma=1.
75 // All errors are initialised to 0.
76 Double_t a[3]={0,0,0};
77 fBeta.SetVector(a,"sph");
82 ///////////////////////////////////////////////////////////////////////////
85 // Default destructor.
87 ///////////////////////////////////////////////////////////////////////////
88 void AliBoost::SetBeta(Ali3Vector b)
90 // Setting of boost parameters on basis of beta 3-vector.
91 // The errors on the beta 3-vector are taken from the input 3-vector.
92 // The gamma value and its error are calculated accordingly.
94 Double_t beta2=fBeta.Dot(fBeta);
95 Double_t dbeta2=fBeta.GetResultError();
99 cout << " *AliBoost::SetBeta* beta > 1." << endl;
103 Double_t temp=1.-beta2;
106 fGamma=sqrt(1./temp);
107 fDgamma=fabs(dbeta2/(2.*pow(temp,1.5)));
110 ///////////////////////////////////////////////////////////////////////////
111 void AliBoost::Set4Momentum(Ali4Vector& p)
113 // Setting of boost parameters on basis of momentum 4-vector data.
114 // The errors of the input 4-vector are used to calculate the
115 // errors on the beta 3-vector and the gamma factor.
116 Double_t E=p.GetScalar();
117 Double_t dE=p.GetResultError();
120 cout << " *AliBoost::Set4Momentum* Unphysical situation." << endl;
125 Ali3Vector b=p.Get3Vector();
126 Double_t vb[3],eb[3];
127 b.GetVector(vb,"car");
128 b.GetErrors(eb,"car");
130 for (Int_t i=0; i<3; i++)
132 eb[i]=sqrt(pow(eb[i]/E,2)+pow(vb[i]*dE/(E*E),2));
134 b.SetErrors(eb,"car");
138 ///////////////////////////////////////////////////////////////////////////
139 Ali3Vector AliBoost::GetBetaVector()
141 // Provide the beta 3-vector.
144 ///////////////////////////////////////////////////////////////////////////
145 Double_t AliBoost::GetBeta()
147 // Provide the norm of the beta 3-vector.
148 // The error on the value can be obtained via GetResultError().
149 Double_t norm=fBeta.GetNorm();
150 fDresult=fBeta.GetResultError();
153 ///////////////////////////////////////////////////////////////////////////
154 Double_t AliBoost::GetGamma()
156 // Provide the gamma factor.
157 // The error on the value can be obtained via GetResultError().
161 ///////////////////////////////////////////////////////////////////////////
162 Double_t AliBoost::GetResultError()
164 // Provide the error on the result of an operation yielding a scalar.
165 // E.g. GetBeta() or GetGamma()
168 ///////////////////////////////////////////////////////////////////////////
169 void AliBoost::Info(TString f)
171 // Printing of the boost parameter info in coordinate frame f.
172 Double_t beta=fBeta.GetNorm();
173 Double_t dbeta=fBeta.GetResultError();
174 cout << " *AliBoost::Info* beta : " << beta << " error : " << dbeta
175 << " gamma : " << fGamma << " error : " << fDgamma << endl;
179 ///////////////////////////////////////////////////////////////////////////
180 Ali4Vector AliBoost::Boost(Ali4Vector& v)
182 // Perform the Lorentz boost on the 4-vector v.
183 // Error propagation is performed automatically.
184 // Note : As an approximation Beta and p.Dot(Beta) are considered as
185 // independent quantities.
187 Double_t beta=fBeta.GetNorm();
188 Double_t dbeta=fBeta.GetResultError();
190 Double_t beta2=pow(beta,2);
194 Double_t E=v.GetScalar();
195 Double_t dE=v.GetResultError();
197 Ali3Vector p=v.Get3Vector();
199 Double_t pdotbeta=p.Dot(fBeta);
200 Double_t dpdotbeta=p.GetResultError();
202 // Determine the new vector components
203 Double_t Eprim=fGamma*(E-pdotbeta);
205 Double_t z=((fGamma-1.)*pdotbeta/beta2)-fGamma*E;
206 Ali3Vector add=fBeta*z;
208 // Determine errors on the new vector components
209 Double_t dEprim=sqrt(pow((E-pdotbeta)*fDgamma,2)+pow(fGamma*dE,2)
210 +pow(fGamma*dpdotbeta,2));
211 Double_t dz=sqrt( pow(((fGamma-1.)/beta2)*dpdotbeta,2) + pow(fGamma*dE,2)
213 ((2./beta)-(4.*pow(beta,3)-6.*pow(beta,5))/(2.*pow((pow(beta,4)-pow(beta,6)),1.5)))*pdotbeta
214 +beta*E/pow(fGamma,3))*dbeta,2) );
216 Double_t vb[3],eb[3];
217 fBeta.GetVector(vb,"car");
218 fBeta.GetErrors(eb,"car");
219 for (Int_t i=0; i<3; i++)
221 eb[i]=sqrt(pow(z*eb[i],2)+pow(vb[i]*dz,2));
223 add.SetErrors(eb,"car");
225 // Calculate the new 3-vector
226 Ali3Vector pprim=p+add;
228 // Set the components and errors of the new 4-vector
230 w.SetVector(Eprim,pprim);
231 w.SetScalarError(dEprim);
240 ///////////////////////////////////////////////////////////////////////////
241 Ali4Vector AliBoost::Inverse(Ali4Vector& vprim)
243 // Perform the inverse Lorentz boost on the 4-vector vprim.
244 // Error propagation is performed automatically.
245 // Note : As an approximation Beta and pprim.Dot(Beta) are considered as
246 // independent quantities.
248 Double_t beta=fBeta.GetNorm();
249 Double_t dbeta=fBeta.GetResultError();
251 Double_t beta2=pow(beta,2);
255 Double_t Eprim=vprim.GetScalar();
256 Double_t dEprim=vprim.GetResultError();
258 Ali3Vector pprim=vprim.Get3Vector();
260 Double_t pprimdotbeta=pprim.Dot(fBeta);
261 Double_t dpprimdotbeta=pprim.GetResultError();
263 // Determine the new vector components
264 Double_t E=fGamma*(Eprim+pprimdotbeta);
266 Double_t z=((fGamma-1.)*pprimdotbeta/beta2)+fGamma*Eprim;
267 Ali3Vector add=fBeta*z;
269 // Determine errors on the prime-vector components
270 Double_t dE=sqrt(pow((Eprim+pprimdotbeta)*fDgamma,2)+pow(fGamma*dEprim,2)
271 +pow(fGamma*dpprimdotbeta,2));
272 Double_t dz=sqrt( pow(((fGamma-1.)/beta2)*dpprimdotbeta,2) + pow(fGamma*dEprim,2)
274 ((2./beta)-(4.*pow(beta,3)-6.*pow(beta,5))/(2.*pow((pow(beta,4)-pow(beta,6)),1.5)))*pprimdotbeta
275 -beta*Eprim/pow(fGamma,3))*dbeta,2) );
277 Double_t vb[3],eb[3];
278 fBeta.GetVector(vb,"car");
279 fBeta.GetErrors(eb,"car");
280 for (Int_t i=0; i<3; i++)
282 eb[i]=sqrt(pow(z*eb[i],2)+pow(vb[i]*dz,2));
284 add.SetErrors(eb,"car");
286 // Calculate the new 3-vector
287 Ali3Vector p=pprim+add;
289 // Set the components and errors of the new 4-vector
292 w.SetScalarError(dE);
301 ///////////////////////////////////////////////////////////////////////////