1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //-------------------------------------------------------------------------
17 // Analysis Oriented Data (AOD) V0 vertex class
18 // Authors: B.Hippolyte, IReS, hippolyt@in2p3.fr
19 // G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts)
20 //-------------------------------------------------------------------------
22 //#include "AliESDEvent.h"
23 //#include "AliESDv0.h"
27 //#include "AliAODTrack.h"
31 AliAODv0::AliAODv0() :
33 fDcaV0ToPrimVertex(999)
35 //--------------------------------------------------------------------
36 // Default constructor
37 //--------------------------------------------------------------------
41 fNPID = 0; // used to be 2!
43 fDCA = new Double_t[fNDCA];
46 fPx = new Double_t[GetNProngs()];
47 fPy = new Double_t[GetNProngs()];
48 fPz = new Double_t[GetNProngs()];
57 fd0 = new Double_t[GetNProngs()];
62 //AliAODv0::AliAODv0(AliESDv0* rV0Vertex ,AliESDEvent* rEvent) :
64 // fDcaV0ToPrimVertex(999)
66 //--------------------------------------------------------------------
67 // Constructor via fill to be removed eventually
68 //--------------------------------------------------------------------
74 // fDCA = new Double_t[fNDCA];
76 // fPx = new Double_t[GetNProngs()];
77 // fPy = new Double_t[GetNProngs()];
78 // fPz = new Double_t[GetNProngs()];
80 // fd0 = new Double_t[GetNProngs()];
82 // this->Fill(rV0Vertex,rEvent);
85 AliAODv0::AliAODv0(AliAODVertex* rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
86 Double_t *rMomPos, Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex) :
87 AliAODRecoDecay(rAODVertex,2,0,rDcaDaughterToPrimVertex),
88 fDcaV0ToPrimVertex(rDcaV0ToPrimVertex)
90 //--------------------------------------------------------------------
91 // Constructor via setting each data member
92 //--------------------------------------------------------------------
96 fNPID = 0; // used to be 2!
98 fDCA = new Double_t[fNDCA];
100 fDCA[0] = rDcaV0Daughters;
101 fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
103 fPx = new Double_t[GetNProngs()];
104 fPy = new Double_t[GetNProngs()];
105 fPz = new Double_t[GetNProngs()];
107 fPx[0] = rMomPos[0] ;
116 AliAODv0::AliAODv0(const AliAODv0& rAliAODv0) :
117 AliAODRecoDecay(rAliAODv0),
118 fDcaV0ToPrimVertex(rAliAODv0.fDcaV0ToPrimVertex)
120 //--------------------------------------------------------------------
122 //--------------------------------------------------------------------
125 AliAODv0& AliAODv0::operator=(const AliAODv0& rAliAODv0){
126 //--------------------------------------------------------------------
127 // Assignment overload
128 //--------------------------------------------------------------------
129 this->fDcaV0ToPrimVertex = rAliAODv0.fDcaV0ToPrimVertex ;
133 AliAODv0::~AliAODv0(){
134 //--------------------------------------------------------------------
136 //--------------------------------------------------------------------
140 // void AliAODv0::Fill(AliESDv0* rV0Vertex ,AliESDEvent* rEvent){
142 // Double_t tDecayVertexV0[3]; rV0Vertex->GetXYZ(tDecayVertexV0[0],tDecayVertexV0[1],tDecayVertexV0[2]);
143 // GetSecondaryVtx()->SetX(tDecayVertexV0[0]);
144 // GetSecondaryVtx()->SetY(tDecayVertexV0[1]);
145 // GetSecondaryVtx()->SetZ(tDecayVertexV0[2]);
147 // Double_t lCovVtx[6];
148 // rV0Vertex->GetPosCov(lCovVtx);
149 // GetSecondaryVtx()->SetCovMatrix(lCovVtx);
151 // GetSecondaryVtx()->SetChi2perNDF(rV0Vertex->GetChi2V0());
152 // GetSecondaryVtx()->SetType(AliAODVertex::kV0);
154 // UInt_t lKeyPos = (UInt_t)TMath::Abs(rV0Vertex->GetPindex());// need to ask why Abs
155 // UInt_t lKeyNeg = (UInt_t)TMath::Abs(rV0Vertex->GetNindex());
156 // GetSecondaryVtx()->AddDaughter(rEvent->GetTrack(lKeyPos));
157 // GetSecondaryVtx()->AddDaughter(rEvent->GetTrack(lKeyNeg));
159 // fDCA[0] = rV0Vertex->GetDcaV0Daughters();
160 // fDcaV0ToPrimVertex = rV0Vertex->GetD();
162 // Double_t tMomPos[3]; rV0Vertex->GetPPxPyPz(tMomPos[0],tMomPos[1],tMomPos[2]);
163 // fPx[0] = tMomPos[0];
164 // fPy[0] = tMomPos[1];
165 // fPz[0] = tMomPos[2];
167 // Double_t tMomNeg[3]; rV0Vertex->GetNPxPyPz(tMomNeg[0],tMomNeg[1],tMomNeg[2]);
168 // fPx[1] = tMomNeg[0];
169 // fPy[1] = tMomNeg[1];
170 // fPz[1] = tMomNeg[2];
172 // AliESDtrack *pTrack=rEvent->GetTrack(lKeyPos);
173 // AliESDtrack *nTrack=rEvent->GetTrack(lKeyNeg);
175 // Float_t tDcaPosToPrimVertex[2];
176 // if(pTrack) pTrack->GetImpactParameters(tDcaPosToPrimVertex[0],tDcaPosToPrimVertex[1]);
177 // else { tDcaPosToPrimVertex[0]=999.; tDcaPosToPrimVertex[1]=999.;}
178 // fd0[0] = TMath::Sqrt(tDcaPosToPrimVertex[0]*tDcaPosToPrimVertex[0]+tDcaPosToPrimVertex[1]*tDcaPosToPrimVertex[1]);
180 // Float_t tDcaNegToPrimVertex[2];
181 // if(nTrack) nTrack->GetImpactParameters(tDcaNegToPrimVertex[0],tDcaNegToPrimVertex[1]);
182 // else { tDcaNegToPrimVertex[0]=999.; tDcaNegToPrimVertex[1]=999.;}
184 // fd0[1] = TMath::Sqrt(tDcaNegToPrimVertex[0]*tDcaNegToPrimVertex[0]+tDcaNegToPrimVertex[1]*tDcaNegToPrimVertex[1]);
187 void AliAODv0::Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
188 Double_t *rMomPos, Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex){
190 this->SetSecondaryVtx(rAODVertex);
192 fDCA[0] = rDcaV0Daughters;
193 fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
195 fPx[0] = rMomPos[0] ;
203 fd0[0] = rDcaDaughterToPrimVertex[0];
204 fd0[1] = rDcaDaughterToPrimVertex[1];
207 void AliAODv0::ResetV0(){
209 GetSecondaryVtx()->SetX(999);
210 GetSecondaryVtx()->SetY(999);
211 GetSecondaryVtx()->SetZ(999);
212 GetSecondaryVtx()->SetChi2perNDF(999);
213 GetSecondaryVtx()->SetType(AliAODVertex::kUndef);
215 Int_t lNumDaughters = GetSecondaryVtx()->GetNDaughters();
216 for(Int_t iDaughterIndex = 0; iDaughterIndex<lNumDaughters;iDaughterIndex++)
217 GetSecondaryVtx()->RemoveDaughter(GetSecondaryVtx()->GetDaughter(iDaughterIndex));
220 fDcaV0ToPrimVertex = 999;
234 void AliAODv0::Print(Option_t* /*option*/) const {
236 // Print some information
238 AliAODRecoDecay::Print();
239 printf("AliAODv0: invariant mass (k0s %.6f, lambda %.6f, anti-lambda %.6f) \n",MassK0Short(),MassLambda(),MassAntiLambda());
240 printf("AliAODv0: dca (v0d %.6f, v0tpv %.6f, postpv %.6f, negtpv %.6f ) \n",DcaV0Daughters(),DcaV0ToPrimVertex(),DcaPosToPrimVertex(),DcaNegToPrimVertex());
241 printf("AliAODv0: mom (ptot2 %.6f, pt2 %.6f, rapk0 %.6f, rapla %.6f ) \n",Ptot2V0(),Pt2V0(),RapK0Short(),RapLambda());
242 printf("AliAODv0: cin (mpav0 %.6f, mnav0 %.6f, alpha %.6f, ptarm %.6f ) \n",MomPosAlongV0(),MomNegAlongV0(),AlphaV0(),PtArmV0());
243 printf("AliAODv0: nrg (eppro %.6f, enpro %.6f, eppio %.6f, enpio %.6f ) \n",EPosProton(),ENegProton(),EPosPion(),ENegPion());