]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODv0.cxx
Keep products of decay(cascades) of primary particles on the stack.
[u/mrichter/AliRoot.git] / STEER / AliAODv0.cxx
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 //-------------------------------------------------------------------------
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 //-------------------------------------------------------------------------
21
22 #include "AliAODv0.h"
23 #include "AliAODTrack.h"
24
25 ClassImp(AliAODv0)
26
27   AliAODv0::AliAODv0() : 
28     AliAODRecoDecay(),
29     fDcaV0ToPrimVertex(999),
30     fOnFlyStatus(kFALSE)
31 {
32   //--------------------------------------------------------------------
33   // Default constructor
34   //--------------------------------------------------------------------
35   fCharge  = 0;
36   fNProngs = 2;
37   fNDCA    = 1;
38   fNPID    = 0; // used to be 2!
39
40   fDCA = new Double_t[fNDCA];
41   fDCA[0] = 999;
42
43   fPx = new Double_t[GetNProngs()];
44   fPy = new Double_t[GetNProngs()];
45   fPz = new Double_t[GetNProngs()];
46   fPx[0] = 999;
47   fPy[0] = 999;
48   fPz[0] = 999;
49
50   fPx[1] = 999;
51   fPy[1] = 999;
52   fPz[1] = 999;
53
54   fd0 = new Double_t[GetNProngs()];
55   fd0[0] = 999;
56   fd0[1] = 999;
57 }
58
59 AliAODv0::AliAODv0(AliAODVertex* rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
60            const Double_t *rMomPos, const Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex) :
61   AliAODRecoDecay(rAODVertex,2,0,rDcaDaughterToPrimVertex),
62   fDcaV0ToPrimVertex(rDcaV0ToPrimVertex),
63   fOnFlyStatus(kFALSE)
64 {
65   //--------------------------------------------------------------------
66   // Constructor via setting each data member
67   //--------------------------------------------------------------------
68   fCharge  = 0;
69   fNProngs = 2;
70   fNDCA    = 1;
71   fNPID    = 0; // used to be 2!
72
73   fDCA = new Double_t[fNDCA];
74
75   fDCA[0] = rDcaV0Daughters;
76   fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
77
78   fPx = new Double_t[GetNProngs()];
79   fPy = new Double_t[GetNProngs()];
80   fPz = new Double_t[GetNProngs()];
81
82   fPx[0] = rMomPos[0] ;
83   fPy[0] = rMomPos[1];
84   fPz[0] = rMomPos[2];
85
86   fPx[1] = rMomNeg[0];
87   fPy[1] = rMomNeg[1];
88   fPz[1] = rMomNeg[2];
89 }
90
91 AliAODv0::AliAODv0(const AliAODv0& rAliAODv0) :
92   AliAODRecoDecay(rAliAODv0),
93   fDcaV0ToPrimVertex(rAliAODv0.fDcaV0ToPrimVertex),
94   fOnFlyStatus(rAliAODv0.fOnFlyStatus)
95  {
96   //--------------------------------------------------------------------
97   // Copy constructor
98   //--------------------------------------------------------------------
99 }
100
101 AliAODv0& AliAODv0::operator=(const AliAODv0& rAliAODv0){
102   //--------------------------------------------------------------------
103   // Assignment overload
104   //--------------------------------------------------------------------
105   if(this!=&rAliAODv0) {
106     AliAODRecoDecay::operator=(rAliAODv0);
107     this->fDcaV0ToPrimVertex  = rAliAODv0.fDcaV0ToPrimVertex ;
108     this->fOnFlyStatus        = rAliAODv0.fOnFlyStatus;
109   }
110   return *this;
111 }
112
113 AliAODv0::~AliAODv0(){
114   //--------------------------------------------------------------------
115   // Empty destructor
116   //--------------------------------------------------------------------
117 }
118
119 void AliAODv0::Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
120                     const Double_t *rMomPos, const Double_t *rMomNeg, const Double_t *rDcaDaughterToPrimVertex){
121   //--------------------------------------------------------------------
122   // Filling with all needed info
123   //--------------------------------------------------------------------
124   this->SetSecondaryVtx(rAODVertex);
125
126   fDCA[0] = rDcaV0Daughters;
127   fDcaV0ToPrimVertex = rDcaV0ToPrimVertex;
128
129   fPx[0] = rMomPos[0] ;
130   fPy[0] = rMomPos[1];
131   fPz[0] = rMomPos[2];
132
133   fPx[1] = rMomNeg[0];
134   fPy[1] = rMomNeg[1];
135   fPz[1] = rMomNeg[2];
136
137   fd0[0] = rDcaDaughterToPrimVertex[0];
138   fd0[1] = rDcaDaughterToPrimVertex[1];
139 }
140
141 void AliAODv0::ResetV0(){
142   //--------------------------------------------------------------------
143   // Resetting all the info
144   //--------------------------------------------------------------------
145   GetSecondaryVtx()->SetChi2perNDF(999);
146   GetSecondaryVtx()->RemoveCovMatrix();
147   GetSecondaryVtx()->RemoveDaughters();
148   GetSecondaryVtx()->SetParent((TObject*) 0x0);
149   GetSecondaryVtx()->SetID(-1);
150   GetSecondaryVtx()->SetPosition(999,999,999);
151   GetSecondaryVtx()->SetType(AliAODVertex::kUndef);
152
153   fDCA[0] = 999;
154   fDcaV0ToPrimVertex  = 999;
155
156   fPx[0] = 999;
157   fPy[0] = 999;
158   fPz[0] = 999;
159
160   fPx[1] = 999;
161   fPy[1] = 999;
162   fPz[1] = 999;
163
164   fd0[0] = 999;
165   fd0[1] = 999;
166 }
167
168 Short_t AliAODv0::GetPosID() const {
169         AliAODTrack *posTrack = (AliAODTrack *) (this->GetSecondaryVtx()->GetDaughter(0));
170         Short_t posID = posTrack->GetID();
171         return posID;
172 }
173
174 Short_t AliAODv0::GetNegID() const {
175         AliAODTrack *negTrack = (AliAODTrack *) (this->GetSecondaryVtx()->GetDaughter(1));
176         Short_t negID = negTrack->GetID();
177         return negID;
178 }
179
180 void AliAODv0::Print(Option_t* /*option*/) const {
181   //
182   // Print some information
183   //
184   AliAODRecoDecay::Print();
185   printf("AliAODv0: invariant mass (k0s %.6f, lambda %.6f, anti-lambda %.6f) \n",MassK0Short(),MassLambda(),MassAntiLambda());
186   printf("AliAODv0: dca (v0d %.6f, v0tpv %.6f, postpv %.6f, negtpv %.6f ) \n",DcaV0Daughters(),DcaV0ToPrimVertex(),DcaPosToPrimVertex(),DcaNegToPrimVertex());
187   printf("AliAODv0: mom (ptot2 %.6f, pt2 %.6f, rapk0 %.6f, rapla %.6f ) \n",Ptot2V0(),Pt2V0(),RapK0Short(),RapLambda());
188   printf("AliAODv0: cin (mpav0 %.6f, mnav0 %.6f, alpha %.6f, ptarm %.6f ) \n",MomPosAlongV0(),MomNegAlongV0(),AlphaV0(),PtArmV0());
189   printf("AliAODv0: nrg (eppro %.6f, enpro %.6f, eppio %.6f, enpio %.6f ) \n",EPosProton(),ENegProton(),EPosPion(),ENegPion());
190
191   return;
192 }