]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDcascade.cxx
Removing AliESDCaloTrack now obsolete
[u/mrichter/AliRoot.git] / STEER / AliESDcascade.cxx
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
16 /* $Id$ */
17
18 //-------------------------------------------------------------------------
19 //               Implementation of the cascade vertex class
20 //              This is part of the Event Summary Data 
21 //              which contains the result of the reconstruction
22 //              and is the main set of classes for analaysis
23 //    Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr
24 //-------------------------------------------------------------------------
25
26 #include <TMath.h>
27
28 #include "AliESDcascade.h"
29
30 ClassImp(AliESDcascade)
31
32 AliESDcascade::AliESDcascade() : TObject() {
33   //--------------------------------------------------------------------
34   // Default constructor  (Xi-)
35   //--------------------------------------------------------------------
36   fPdgCode=kXiMinus;
37   fEffMass=1.32131;
38   fChi2=1.e+33;
39   fPos[0]=fPos[1]=fPos[2]=0.;
40   fPosCov[0]=fPosCov[1]=fPosCov[2]=fPosCov[3]=fPosCov[4]=fPosCov[5]=0.;
41 }
42
43 inline Double_t det(Double_t a00, Double_t a01, Double_t a10, Double_t a11){
44   // determinant 2x2
45   return a00*a11 - a01*a10;
46 }
47
48 inline Double_t det (Double_t a00,Double_t a01,Double_t a02,
49                      Double_t a10,Double_t a11,Double_t a12,
50                      Double_t a20,Double_t a21,Double_t a22) {
51   // determinant 3x3
52   return 
53   a00*det(a11,a12,a21,a22)-a01*det(a10,a12,a20,a22)+a02*det(a10,a11,a20,a21);
54 }
55
56 Double_t AliESDcascade::ChangeMassHypothesis(Double_t &v0q, Int_t code) {
57   //--------------------------------------------------------------------
58   // This function changes the mass hypothesis for this cascade
59   // and returns the "kinematical quality" of this hypothesis
60   // together with the "quality" of associated V0 (argument v0q) 
61   //--------------------------------------------------------------------
62   Double_t nmass=0.13957, pmass=0.93827, ps0=0.101; 
63   Double_t bmass=0.13957, mass =1.3213,  ps =0.139;
64
65   fPdgCode=code;
66
67   switch (code) {
68   case 213: 
69        bmass=0.93827; 
70        break;
71   case kXiMinus:
72        break;
73   case kXiPlusBar:
74        nmass=0.93827; pmass=0.13957; 
75        break;
76   case kOmegaMinus: 
77        bmass=0.49368; mass=1.67245; ps=0.211;
78        break;
79   case kOmegaPlusBar: 
80        nmass=0.93827; pmass=0.13957; 
81        bmass=0.49368; mass=1.67245; ps=0.211;
82        break;
83   default:
84        Info("AliCascadeVertex::ChangeMassHypothesis",
85             "Invalide PDG code !  Assuming XiMinus's...");
86        fPdgCode=kXiMinus;
87     break;
88   }
89
90   Double_t pxn=fV0mom[0][0], pyn=fV0mom[0][1], pzn=fV0mom[0][2];
91   Double_t pxp=fV0mom[1][0], pyp=fV0mom[1][1], pzp=fV0mom[1][2];
92   Double_t px0=pxn+pxp, py0=pyn+pyp, pz0=pzn+pzp;
93   Double_t p0=TMath::Sqrt(px0*px0 + py0*py0 + pz0*pz0);
94
95   Double_t e0=TMath::Sqrt(1.11568*1.11568 + p0*p0);
96   Double_t beta0=p0/e0;
97   Double_t pln=(pxn*px0 + pyn*py0 + pzn*pz0)/p0;
98   Double_t plp=(pxp*px0 + pyp*py0 + pzp*pz0)/p0;
99   Double_t pt2=pxp*pxp + pyp*pyp + pzp*pzp - plp*plp;
100
101   Double_t a=(plp-pln)/(plp+pln);
102   a -= (pmass*pmass-nmass*nmass)/(1.11568*1.11568);
103   a = 0.25*beta0*beta0*1.11568*1.11568*a*a + pt2;
104
105
106   v0q=a - ps0*ps0;
107
108
109   Double_t pxb=fBachMom[0], pyb=fBachMom[1], pzb=fBachMom[2]; 
110
111   Double_t eb=TMath::Sqrt(bmass*bmass + pxb*pxb + pyb*pyb + pzb*pzb);
112   Double_t pxl=px0+pxb, pyl=py0+pyb, pzl=pz0+pzb;
113   Double_t pl=TMath::Sqrt(pxl*pxl + pyl*pyl + pzl*pzl);
114   
115   fEffMass=TMath::Sqrt((e0+eb)*(e0+eb) - pl*pl);
116
117   Double_t beta=pl/(e0+eb);
118   Double_t pl0=(px0*pxl + py0*pyl + pz0*pzl)/pl;
119   Double_t plb=(pxb*pxl + pyb*pyl + pzb*pzl)/pl;
120   pt2=p0*p0 - pl0*pl0;
121
122   a=(pl0-plb)/(pl0+plb);
123   a -= (1.11568*1.11568-bmass*bmass)/(mass*mass);
124   a = 0.25*beta*beta*mass*mass*a*a + pt2;
125
126   return (a - ps*ps);
127 }
128
129 void 
130 AliESDcascade::GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const {
131   //--------------------------------------------------------------------
132   // This function returns the cascade momentum (global)
133   //--------------------------------------------------------------------
134   px=fV0mom[0][0]+fV0mom[1][0]+fBachMom[0]; 
135   py=fV0mom[0][1]+fV0mom[1][1]+fBachMom[1]; 
136   pz=fV0mom[0][2]+fV0mom[1][2]+fBachMom[2]; 
137 }
138
139 void AliESDcascade::GetXYZ(Double_t &x, Double_t &y, Double_t &z) const {
140   //--------------------------------------------------------------------
141   // This function returns cascade position (global)
142   //--------------------------------------------------------------------
143   x=fPos[0]; 
144   y=fPos[1]; 
145   z=fPos[2]; 
146 }
147
148 Double_t AliESDcascade::GetD(Double_t x0, Double_t y0, Double_t z0) const {
149   //--------------------------------------------------------------------
150   // This function returns the cascade impact parameter
151   //--------------------------------------------------------------------
152
153   Double_t x=fPos[0],y=fPos[1],z=fPos[2];
154   Double_t px=fV0mom[0][0]+fV0mom[1][0]+fBachMom[0];
155   Double_t py=fV0mom[0][1]+fV0mom[1][1]+fBachMom[1];
156   Double_t pz=fV0mom[0][2]+fV0mom[1][2]+fBachMom[2];
157
158   Double_t dx=(y0-y)*pz - (z0-z)*py; 
159   Double_t dy=(x0-x)*pz - (z0-z)*px;
160   Double_t dz=(x0-x)*py - (y0-y)*px;
161   Double_t d=TMath::Sqrt((dx*dx+dy*dy+dz*dz)/(px*px+py*py+pz*pz));
162
163   return d;
164 }
165