]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliAODv0.cxx
Coding conventions
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODv0.cxx
CommitLineData
d77fd7b3 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 Analysis Oriented Data (AOD) V0 vertex class
18//
19// Origin: B.Hippolyte, IReS, hippolyt@in2p3.fr
20// G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts)
2d8e3807 21//
22// Purpose: Having observables for physics available for V0s
d77fd7b3 23//-------------------------------------------------------------------------
24#include <Riostream.h>
25#include <TMath.h>
d77fd7b3 26
27#include "AliESD.h"
d77fd7b3 28#include "AliAODv0.h"
29
30ClassImp(AliAODv0)
31
32AliAODv0::AliAODv0() : TObject() {
33 //--------------------------------------------------------------------
34 // Default constructor
35 //--------------------------------------------------------------------
36 fDecayVertexV0X = 999;
37 fDecayVertexV0Y = 999;
38 fDecayVertexV0Z = 999;
39 fDcaV0Daughters = 999;
40 fDcaV0ToPrimVertex = 999;
41 fDcaPosToPrimVertex = 999;
42 fDcaNegToPrimVertex = 999;
43 fMomPosX = 999;
44 fMomPosY = 999;
45 fMomPosZ = 999;
46 fMomNegX = 999;
47 fMomNegY = 999;
48 fMomNegZ = 999;
49
50 fKeyPos = 999;
51 fKeyNeg = 999;
52
53 fChi2 = 999;
54 fEvent = 0;
55}
56
57AliAODv0::AliAODv0(AliESDv0* rV0Vertex ,AliESD* rEvent){
58 this->Fill(rV0Vertex,rEvent);
59}
60
61// AliAODv0::~AliAODv0(){
62// }
63
2d8e3807 64void AliAODv0::Fill(AliESDv0* rV0Vertex ,AliESD* rEvent){// Filling method
d77fd7b3 65 fEvent=rEvent;
66 Double_t tDecayVertexV0[3]; rV0Vertex->GetXYZ(tDecayVertexV0[0],tDecayVertexV0[1],tDecayVertexV0[2]);
67 fDecayVertexV0X = tDecayVertexV0[0];
68 fDecayVertexV0Y = tDecayVertexV0[1];
69 fDecayVertexV0Z = tDecayVertexV0[2];
70
71 fDcaV0Daughters = rV0Vertex->GetDcaDaughters();
72
73 fDcaV0ToPrimVertex = rV0Vertex->GetD();
74
75
76 Double_t tMomPos[3]; rV0Vertex->GetPPxPyPz(tMomPos[0],tMomPos[1],tMomPos[2]);
77 fMomPosX = tMomPos[0];
78 fMomPosY = tMomPos[1];
79 fMomPosZ = tMomPos[2];
80
81 Double_t tMomNeg[3]; rV0Vertex->GetNPxPyPz(tMomNeg[0],tMomNeg[1],tMomNeg[2]);
82 fMomNegX = tMomNeg[0];
83 fMomNegY = tMomNeg[1];
84 fMomNegZ = tMomNeg[2];
85
86 fKeyPos = TMath::Abs(rV0Vertex->GetPindex());// need to ask why Abs
87 fKeyNeg = TMath::Abs(rV0Vertex->GetNindex());
88
89 AliESDtrack *pTrack=fEvent->GetTrack(fKeyPos);
90 AliESDtrack *nTrack=fEvent->GetTrack(fKeyNeg);
91
92 Float_t tDcaPosToPrimVertex[2];
93 if(pTrack) pTrack->GetImpactParameters(tDcaPosToPrimVertex[0],tDcaPosToPrimVertex[1]);
94 else { tDcaPosToPrimVertex[0]=999.; tDcaPosToPrimVertex[1]=999.;}
95
96 fDcaPosToPrimVertex = TMath::Sqrt(tDcaPosToPrimVertex[0]*tDcaPosToPrimVertex[0]+tDcaPosToPrimVertex[1]*tDcaPosToPrimVertex[1]);
97
98 Float_t tDcaNegToPrimVertex[2];
99 if(nTrack) nTrack->GetImpactParameters(tDcaNegToPrimVertex[0],tDcaNegToPrimVertex[1]);
100 else { tDcaNegToPrimVertex[0]=999.; tDcaNegToPrimVertex[1]=999.;}
101
102 fDcaNegToPrimVertex = TMath::Sqrt(tDcaNegToPrimVertex[0]*tDcaNegToPrimVertex[0]+tDcaNegToPrimVertex[1]*tDcaPosToPrimVertex[1]);
103}
104
2d8e3807 105void AliAODv0::ResetV0(){// Reset method
d77fd7b3 106 fDecayVertexV0X = 999;
107 fDecayVertexV0Y = 999;
108 fDecayVertexV0Z = 999;
109 fDcaV0Daughters = 999;
110 fDcaV0ToPrimVertex = 999;
111 fDcaPosToPrimVertex = 999;
112 fDcaNegToPrimVertex = 999;
113 fMomPosX = 999;
114 fMomPosY = 999;
115 fMomPosZ = 999;
116 fMomNegX = 999;
117 fMomNegY = 999;
118 fMomNegZ = 999;
119
120 fKeyPos = 999;
121 fKeyNeg = 999;
122
123 fChi2 = 999;
124}