]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDv0.cxx
Test case for B0 -> mu
[u/mrichter/AliRoot.git] / STEER / AliESDv0.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
4f679a16 16/* $Id$ */
17
e23730c7 18//-------------------------------------------------------------------------
19// Implementation of the ESD V0 vertex class
4f679a16 20// This class is part of the Event Data Summary
21// set of classes and contains information about
22// V0 kind vertexes generated by a neutral particle
e23730c7 23// Origin: Iouri Belikov, IReS, Strasbourg, Jouri.Belikov@cern.ch
24//-------------------------------------------------------------------------
4f679a16 25
e23730c7 26#include <Riostream.h>
27#include <TMath.h>
90e48c0c 28#include <TDatabasePDG.h>
e23730c7 29#include <TPDGCode.h>
90e48c0c 30#include <TParticlePDG.h>
e23730c7 31
5f7789fc 32#include "AliLog.h"
e23730c7 33#include "AliESDv0.h"
34
35ClassImp(AliESDv0)
36
90e48c0c 37AliESDv0::AliESDv0() :
38 TObject(),
39 fPdgCode(kK0Short),
40 fEffMass(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass()),
17f7744d 41 fDcaDaughters(0),
90e48c0c 42 fChi2(1.e+33),
43 fNidx(0),
44 fPidx(0)
45{
e23730c7 46 //--------------------------------------------------------------------
47 // Default constructor (K0s)
48 //--------------------------------------------------------------------
6605de26 49
50 for (Int_t i=0; i<3; i++) {
51 fPos[i] = 0.;
52 fNmom[i] = 0.;
53 fPmom[i] = 0.;
54 }
55
56 for (Int_t i=0; i<6; i++) {
57 fPosCov[i]= 0.;
58 fNmomCov[i] = 0.;
59 fPmomCov[i] = 0.;
60 }
e23730c7 61}
62
63Double_t AliESDv0::ChangeMassHypothesis(Int_t code) {
64 //--------------------------------------------------------------------
65 // This function changes the mass hypothesis for this V0
66 // and returns the "kinematical quality" of this hypothesis
67 //--------------------------------------------------------------------
68 Double_t nmass=0.13957, pmass=0.13957, mass=0.49767, ps=0.206;
69
70 fPdgCode=code;
71
72 switch (code) {
73 case kLambda0:
74 nmass=0.13957; pmass=0.93827; mass=1.1157; ps=0.101; break;
75 case kLambda0Bar:
76 pmass=0.13957; nmass=0.93827; mass=1.1157; ps=0.101; break;
77 case kK0Short:
78 break;
79 default:
5f7789fc 80 AliError("invalide PDG code ! Assuming K0s...");
e23730c7 81 fPdgCode=kK0Short;
82 break;
83 }
84
85 Double_t pxn=fNmom[0], pyn=fNmom[1], pzn=fNmom[2];
86 Double_t pxp=fPmom[0], pyp=fPmom[1], pzp=fPmom[2];
87
88 Double_t en=TMath::Sqrt(nmass*nmass + pxn*pxn + pyn*pyn + pzn*pzn);
89 Double_t ep=TMath::Sqrt(pmass*pmass + pxp*pxp + pyp*pyp + pzp*pzp);
90 Double_t pxl=pxn+pxp, pyl=pyn+pyp, pzl=pzn+pzp;
91 Double_t pl=TMath::Sqrt(pxl*pxl + pyl*pyl + pzl*pzl);
92
93 fEffMass=TMath::Sqrt((en+ep)*(en+ep)-pl*pl);
94
95 Double_t beta=pl/(en+ep);
96 Double_t pln=(pxn*pxl + pyn*pyl + pzn*pzl)/pl;
97 Double_t plp=(pxp*pxl + pyp*pyl + pzp*pzl)/pl;
98
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)/(mass*mass);
103 a = 0.25*beta*beta*mass*mass*a*a + pt2;
104
105 return (a - ps*ps);
106
107}
108
109void AliESDv0::GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const {
110 //--------------------------------------------------------------------
111 // This function returns V0's momentum (global)
112 //--------------------------------------------------------------------
113 px=fNmom[0]+fPmom[0];
114 py=fNmom[1]+fPmom[1];
115 pz=fNmom[2]+fPmom[2];
116}
117
118void AliESDv0::GetXYZ(Double_t &x, Double_t &y, Double_t &z) const {
119 //--------------------------------------------------------------------
120 // This function returns V0's position (global)
121 //--------------------------------------------------------------------
122 x=fPos[0];
123 y=fPos[1];
124 z=fPos[2];
125}
126
127Double_t AliESDv0::GetD(Double_t x0, Double_t y0, Double_t z0) const {
128 //--------------------------------------------------------------------
129 // This function returns V0's impact parameter
130 //--------------------------------------------------------------------
131 Double_t x=fPos[0],y=fPos[1],z=fPos[2];
132 Double_t px=fNmom[0]+fPmom[0];
133 Double_t py=fNmom[1]+fPmom[1];
134 Double_t pz=fNmom[2]+fPmom[2];
135
136 Double_t dx=(y0-y)*pz - (z0-z)*py;
137 Double_t dy=(x0-x)*pz - (z0-z)*px;
138 Double_t dz=(x0-x)*py - (y0-y)*px;
139 Double_t d=TMath::Sqrt((dx*dx+dy*dy+dz*dz)/(px*px+py*py+pz*pz));
140 return d;
141}