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