Correct layer index for LayerSize() and LayerName() methods
[u/mrichter/AliRoot.git] / ITS / AliCascadeVertex.cxx
CommitLineData
a9a2d814 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
7d62fb64 16////////////////////////////////////////////////////////////////////////////
17// Implementation of the cascade vertex class //
18// //
19// Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr//
20////////////////////////////////////////////////////////////////////////////
a9a2d814 21#include <TMath.h>
22
23#include "AliCascadeVertex.h"
a9a2d814 24#include "AliITStrackV2.h"
116cbefd 25#include "AliV0vertex.h"
a9a2d814 26
27ClassImp(AliCascadeVertex)
28
a9a2d814 29
a9a2d814 30AliCascadeVertex::AliCascadeVertex(const AliV0vertex &v,const AliITStrackV2 &t) {
31 //--------------------------------------------------------------------
32 // Main constructor
33 //--------------------------------------------------------------------
34 fPdgCode=kXiMinus;
35
e23730c7 36 fV0idx[0]=v.GetNindex(); fV0idx[1]=v.GetPindex();
37 fBachIdx=t.GetLabel();
a9a2d814 38
39 //Trivial estimation of the vertex parameters
40 Double_t pt, phi, x, par[5];
41 Double_t alpha, cs, sn;
42
43 t.GetExternalParameters(x,par); alpha=t.GetAlpha();
44 pt=1./TMath::Abs(par[4]);
45 phi=TMath::ASin(par[2]) + alpha;
46
47 // momentum of the bachelor track
48
49 Double_t px1=pt*TMath::Cos(phi), py1=pt*TMath::Sin(phi), pz1=pt*par[3];
50
51 cs=TMath::Cos(alpha); sn=TMath::Sin(alpha);
52
53 Double_t x1=x*cs - par[0]*sn; // position of the bachelor at dca (bachelor,V0)
54 Double_t y1=x*sn + par[0]*cs;
55 Double_t z1=par[1];
56
57 Double_t x2,y2,z2; // position of the V0
58 v.GetXYZ(x2,y2,z2);
59
60 Double_t px2,py2,pz2; // momentum of V0
61 v.GetPxPyPz(px2,py2,pz2);
62
63 Double_t a2=((x1-x2)*px2+(y1-y2)*py2+(z1-z2)*pz2)/(px2*px2+py2*py2+pz2*pz2);
64
65 Double_t xm=x2+a2*px2;
66 Double_t ym=y2+a2*py2;
67 Double_t zm=z2+a2*pz2;
68
69 // position of the cascade decay
70
71 fPos[0]=0.5*(x1+xm); fPos[1]=0.5*(y1+ym); fPos[2]=0.5*(z1+zm);
04b2a5f1 72
73
a9a2d814 74 // invariant mass of the cascade (default is Ximinus)
75
76 Double_t e1=TMath::Sqrt(0.13957*0.13957 + px1*px1 + py1*py1 + pz1*pz1);
77 Double_t e2=TMath::Sqrt(1.11568*1.11568 + px2*px2 + py2*py2 + pz2*pz2);
78
79 fEffMass=TMath::Sqrt((e1+e2)*(e1+e2)-
80 (px1+px2)*(px1+px2)-(py1+py2)*(py1+py2)-(pz1+pz2)*(pz1+pz2));
81
04b2a5f1 82
83 // momenta of the bachelor and the V0
84
85 fBachMom[0]=px1; fBachMom[1]=py1; fBachMom[2]=pz1;
86 v.GetNPxPyPz(px2,py2,pz2);
87 fV0mom[0][0]=px2; fV0mom[0][1]=py2; fV0mom[0][2]=pz2;
88 v.GetPPxPyPz(px2,py2,pz2);
89 fV0mom[1][0]=px2; fV0mom[1][1]=py2; fV0mom[1][2]=pz2;
90
91
a9a2d814 92 fChi2=7.;
93
94}
95
04b2a5f1 96