AliRoot Core  3dc7879 (3dc7879)
AliAODv0.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2007, 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 #include "AliAODv0.h"
17 #include "AliAODTrack.h"
18 
19 ClassImp(AliAODv0)
20 
23  fDcaV0ToPrimVertex(999),
24  fOnFlyStatus(kFALSE)
25 {
26 }
27 
28 AliAODv0::AliAODv0(AliAODVertex* rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
29  const Double_t *rMomPos, const Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex) :
30  AliAODRecoDecay(rAODVertex,2,0,rDcaDaughterToPrimVertex),
31  fDcaV0ToPrimVertex(rDcaV0ToPrimVertex),
32  fOnFlyStatus(kFALSE)
33 {
35 
36  fCharge = 0;
37  fNProngs = 2;
38  fNDCA = 1;
39  fNPID = 0; // used to be 2!
40 
41  fDCA = new Double_t[fNDCA];
42 
43  fDCA[0] = rDcaV0Daughters;
44  fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
45 
46  fPx = new Double_t[GetNProngs()];
47  fPy = new Double_t[GetNProngs()];
48  fPz = new Double_t[GetNProngs()];
49 
50  fPx[0] = rMomPos[0] ;
51  fPy[0] = rMomPos[1];
52  fPz[0] = rMomPos[2];
53 
54  fPx[1] = rMomNeg[0];
55  fPy[1] = rMomNeg[1];
56  fPz[1] = rMomNeg[2];
57 }
58 
59 AliAODv0::AliAODv0(const AliAODv0& rAliAODv0) :
60  AliAODRecoDecay(rAliAODv0),
62  fOnFlyStatus(rAliAODv0.fOnFlyStatus)
63  {
65 
66 }
67 
70 
71  if(this!=&rAliAODv0) {
72  AliAODRecoDecay::operator=(rAliAODv0);
74  fOnFlyStatus = rAliAODv0.fOnFlyStatus;
75  }
76  return *this;
77 }
78 
81 
82 }
83 
84 void AliAODv0::Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
85  const Double_t *rMomPos, const Double_t *rMomNeg, const Double_t *rDcaDaughterToPrimVertex){
87 
88  this->SetSecondaryVtx(rAODVertex);
89 
90  fDCA[0] = rDcaV0Daughters;
91  fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
92 
93  fPx[0] = rMomPos[0] ;
94  fPy[0] = rMomPos[1];
95  fPz[0] = rMomPos[2];
96 
97  fPx[1] = rMomNeg[0];
98  fPy[1] = rMomNeg[1];
99  fPz[1] = rMomNeg[2];
100 
101  fd0[0] = rDcaDaughterToPrimVertex[0];
102  fd0[1] = rDcaDaughterToPrimVertex[1];
103 }
104 
107 
111  GetSecondaryVtx()->SetParent((TObject*) 0x0);
112  GetSecondaryVtx()->SetID(-1);
113  GetSecondaryVtx()->SetPosition(999,999,999);
115 
116  fDCA[0] = 999;
117  fDcaV0ToPrimVertex = 999;
118 
119  fPx[0] = 999;
120  fPy[0] = 999;
121  fPz[0] = 999;
122 
123  fPx[1] = 999;
124  fPy[1] = 999;
125  fPz[1] = 999;
126 
127  fd0[0] = 999;
128  fd0[1] = 999;
129 }
130 
131 Short_t AliAODv0::GetPosID() const {
132  AliAODTrack *posTrack = (AliAODTrack *) (this->GetSecondaryVtx()->GetDaughter(0));
133  Short_t posID = posTrack->GetID();
134  return posID;
135 }
136 
137 Short_t AliAODv0::GetNegID() const {
138  AliAODTrack *negTrack = (AliAODTrack *) (this->GetSecondaryVtx()->GetDaughter(1));
139  Short_t negID = negTrack->GetID();
140  return negID;
141 }
142 
143 void AliAODv0::Print(Option_t* /*option*/) const {
145 
147  printf("AliAODv0: invariant mass (k0s %.6f, lambda %.6f, anti-lambda %.6f) \n",MassK0Short(),MassLambda(),MassAntiLambda());
148  printf("AliAODv0: dca (v0d %.6f, v0tpv %.6f, postpv %.6f, negtpv %.6f ) \n",DcaV0Daughters(),DcaV0ToPrimVertex(),DcaPosToPrimVertex(),DcaNegToPrimVertex());
149  printf("AliAODv0: mom (ptot2 %.6f, pt2 %.6f, rapk0 %.6f, rapla %.6f ) \n",Ptot2V0(),Pt2V0(),RapK0Short(),RapLambda());
150  printf("AliAODv0: cin (mpav0 %.6f, mnav0 %.6f, alpha %.6f, ptarm %.6f ) \n",MomPosAlongV0(),MomNegAlongV0(),AlphaV0(),PtArmV0());
151  printf("AliAODv0: nrg (eppro %.6f, enpro %.6f, eppio %.6f, enpio %.6f ) \n",EPosProton(),ENegProton(),EPosPion(),ENegPion());
152 
153  return;
154 }
Int_t fNProngs
number of prongs
Short_t fCharge
charge, use this convention for prongs charges:
Double_t MomPosAlongV0() const
Definition: AliAODv0.h:150
Double_t MassLambda() const
Definition: AliAODv0.h:199
void RemoveDaughters()
Definition: AliAODVertex.h:107
void RemoveCovMatrix()
Definition: AliAODVertex.h:88
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Double32_t fDcaV0ToPrimVertex
dca of V0 to primary vertex
Definition: AliAODv0.h:94
void ResetV0()
Definition: AliAODv0.cxx:105
Double_t RapLambda() const
Definition: AliAODv0.h:215
Double_t MassAntiLambda() const
Definition: AliAODv0.h:203
virtual ~AliAODv0()
Definition: AliAODv0.cxx:79
Double_t DcaNegToPrimVertex() const
Definition: AliAODv0.h:113
Double_t MassK0Short() const
Definition: AliAODv0.h:207
Short_t GetPosID() const
Definition: AliAODv0.cxx:131
Double_t DcaV0ToPrimVertex() const
Definition: AliAODv0.h:111
Double_t EPosProton() const
Definition: AliAODv0.h:175
Short_t GetNegID() const
Definition: AliAODv0.cxx:137
Double_t MomNegAlongV0() const
Definition: AliAODv0.h:159
Double_t Ptot2V0() const
Definition: AliAODv0.h:145
void SetPosition(Double_t x, Double_t y, Double_t z)
Definition: AliAODVertex.h:62
Double_t ENegPion() const
Definition: AliAODv0.h:187
Int_t GetNProngs() const
void Print(Option_t *option="") const
Double_t EPosPion() const
Definition: AliAODv0.h:183
void Print(Option_t *option="") const
Definition: AliAODv0.cxx:143
AliAODv0()
Definition: AliAODv0.cxx:21
Double_t PtArmV0() const
Definition: AliAODv0.h:171
void SetType(AODVtx_t vtype)
Definition: AliAODVertex.h:100
TObject * GetDaughter(Int_t i)
Definition: AliAODVertex.h:183
void SetID(Short_t id)
Definition: AliAODVertex.h:97
void SetSecondaryVtx(AliAODVertex *vtx2)
Double_t ENegProton() const
Definition: AliAODv0.h:179
AliAODVertex * GetSecondaryVtx() const
Double_t DcaPosToPrimVertex() const
Definition: AliAODv0.h:112
void Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex, const Double_t *rMomPos, const Double_t *rMomNeg, const Double_t *rDcaDaughterToPrimVertex)
Definition: AliAODv0.cxx:84
Double_t Pt2V0() const
Definition: AliAODv0.h:146
void SetParent(TObject *parent)
Definition: AliAODVertex.h:68
Double_t AlphaV0() const
Definition: AliAODv0.h:168
AliAODv0 & operator=(const AliAODv0 &rAliAODv0)
Definition: AliAODv0.cxx:68
Int_t GetID() const
Definition: AliAODTrack.h:196
Int_t fNDCA
number of dca's
Double32_t * fDCA
prong-to-prong DCA [cm]
Analysis Oriented Data (AOD) V0 vertex class.
Definition: AliAODv0.h:15
void SetChi2perNDF(Double_t chi2perNDF)
Definition: AliAODVertex.h:66
Double32_t * fPz
pz of tracks at the vertex [GeV/c]
Bool_t fOnFlyStatus
if kTRUE, then this V0 is recontructed
Definition: AliAODv0.h:95
Class AliAODRecoDecay.
Double32_t * fPx
px of tracks at the vertex [GeV/c]
AliAODRecoDecay & operator=(const AliAODRecoDecay &source)
Double32_t * fd0
rphi impact params w.r.t. Primary Vtx [cm]
Double32_t * fPy
py of tracks at the vertex [GeV/c]
AOD vertex base class.
Definition: AliAODVertex.h:23
AOD track implementation of AliVTrack.
Definition: AliAODTrack.h:29
Double_t DcaV0Daughters() const
Definition: AliAODv0.h:110
Double_t RapK0Short() const
Definition: AliAODv0.h:211