1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 // Implementation of the Analysis Oriented Data (AOD) Xi vertex class
18 // Origin: A.Maire, IReS, antonin.maire@ires.in2p3.fr
19 // G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts)
21 // Purpose: Having physics observables available for Xis
22 //-------------------------------------------------------------------------
28 #include "AliAODcascade.h"
29 #include "AliAODTrack.h"
30 #include <AliAODVertex.h>
33 ClassImp(AliAODcascade)
38 AliAODcascade::AliAODcascade() :
45 fDcaXiToPrimVertex(999),
46 fDcaBachToPrimVertex(999),
53 //--------------------------------------------------------------------
54 // Default constructor
55 //--------------------------------------------------------------------
61 AliAODcascade::AliAODcascade(const AliAODcascade& rSource) :
64 fDecayVertexXi( rSource.fDecayVertexXi ),
65 fChargeXi( rSource.fChargeXi ),
67 fDcaXiDaughters( rSource.fDcaXiDaughters ),
68 fDcaXiToPrimVertex( rSource.fDcaXiToPrimVertex ),
69 fDcaBachToPrimVertex( rSource.fDcaBachToPrimVertex ),
71 fMomBachX( rSource.fMomBachX ),
72 fMomBachY( rSource.fMomBachY ),
73 fMomBachZ( rSource.fMomBachZ )
76 //--------------------------------------------------------------------
78 //--------------------------------------------------------------------
84 AliAODcascade::AliAODcascade( AliAODVertex* rAODVertexXi,
86 Double_t rDcaXiDaughters,
87 Double_t rDcaXiToPrimVertex,
88 Double_t rDcaBachToPrimVertex,
89 const Double_t* rMomBach,
91 AliAODVertex* rAODVertexV0,
92 Double_t rDcaV0Daughters,
93 Double_t rDcaV0ToPrimVertex,
94 const Double_t *rMomPos,
95 const Double_t *rMomNeg,
96 Double_t *rDcaDaughterToPrimVertex
98 AliAODv0(rAODVertexV0, rDcaV0Daughters, rDcaV0ToPrimVertex, rMomPos, rMomNeg, rDcaDaughterToPrimVertex),
99 fDecayVertexXi( rAODVertexXi ),
100 fChargeXi( rChargeXi ),
101 fDcaXiDaughters( rDcaXiDaughters ),
102 fDcaXiToPrimVertex( rDcaXiToPrimVertex ),
103 fDcaBachToPrimVertex( rDcaBachToPrimVertex ),
104 fMomBachX( rMomBach[0] ),
105 fMomBachY( rMomBach[1] ),
106 fMomBachZ( rMomBach[2] )
108 //--------------------------------------------------------------------
109 // Constructor via setting each data member
110 //--------------------------------------------------------------------
117 AliAODcascade::AliAODcascade( AliAODVertex* rAODVertexXi,
119 Double_t rDcaXiDaughters,
120 Double_t rDcaXiToPrimVertex,
121 Double_t rDcaBachToPrimVertex,
122 const Double_t* rMomBach,
123 const AliAODv0& rAODv0 ) :
125 fDecayVertexXi(rAODVertexXi),
126 fChargeXi( rChargeXi ),
127 fDcaXiDaughters( rDcaXiDaughters ),
128 fDcaXiToPrimVertex( rDcaXiToPrimVertex ),
129 fDcaBachToPrimVertex( rDcaBachToPrimVertex ),
130 fMomBachX( rMomBach[0] ),
131 fMomBachY( rMomBach[1] ),
132 fMomBachZ( rMomBach[2] )
134 //--------------------------------------------------------------------
135 // Constructor via setting each Xi data member + setting AODv0
136 //--------------------------------------------------------------------
144 AliAODcascade& AliAODcascade::operator=(const AliAODcascade& rSource){
145 //--------------------------------------------------------------------
146 // Assignment overload
147 //--------------------------------------------------------------------
149 if (this == &rSource) return *this;
151 AliAODv0::operator=(rSource);
153 this->fDecayVertexXi = rSource.fDecayVertexXi;
154 this->fChargeXi = rSource.fChargeXi;
156 this->fDcaXiDaughters = rSource.fDcaXiDaughters;
157 this->fDcaXiToPrimVertex = rSource.fDcaXiToPrimVertex;
158 this->fDcaBachToPrimVertex = rSource.fDcaBachToPrimVertex;
160 this->fMomBachX = rSource.fMomBachX;
161 this->fMomBachY = rSource.fMomBachY;
162 this->fMomBachZ = rSource.fMomBachZ;
169 AliAODcascade::~AliAODcascade(){
170 //--------------------------------------------------------------------
172 //--------------------------------------------------------------------
177 void AliAODcascade::Fill( AliAODVertex* rAODVertexXi,
179 Double_t rDcaXiDaughters,
180 Double_t rDcaXiToPrimVertex,
181 Double_t rDcaBachToPrimVertex,
182 const Double_t* rMomBach,
184 AliAODVertex* rAODVertexV0,
185 Double_t rDcaV0Daughters,
186 Double_t rDcaV0ToPrimVertex,
187 const Double_t* rMomPos,
188 const Double_t* rMomNeg,
189 Double_t* rDcaDaughterToPrimVertex )
191 //--------------------------------------------------------------------
192 // Fill the AODcascade
193 //--------------------------------------------------------------------
195 AliAODv0::Fill(rAODVertexV0,rDcaV0Daughters,rDcaV0ToPrimVertex,rMomPos,rMomNeg,rDcaDaughterToPrimVertex);
196 fDecayVertexXi = rAODVertexXi;
197 fChargeXi = rChargeXi;
199 fDcaXiDaughters = rDcaXiDaughters;
200 fDcaXiToPrimVertex = rDcaXiToPrimVertex;
201 fDcaBachToPrimVertex = rDcaBachToPrimVertex;
203 fMomBachX = rMomBach[0];
204 fMomBachY = rMomBach[1];
205 fMomBachZ = rMomBach[2];
210 void AliAODcascade::ResetXi(){
211 //--------------------------------------------------------------------
212 // Reset the values of the AOD data members to the default ones
213 //--------------------------------------------------------------------
217 GetDecayVertexXi()->SetChi2perNDF(-999);
218 GetDecayVertexXi()->RemoveCovMatrix();
219 GetDecayVertexXi()->RemoveDaughters();
220 GetDecayVertexXi()->SetID(-1);
221 GetDecayVertexXi()->SetParent((TObject*) 0x0);
222 GetDecayVertexXi()->SetPosition(-999, -999, -999);
223 GetDecayVertexXi()->SetType( AliAODVertex::kUndef );
227 fDcaXiDaughters = 999;
228 fDcaXiToPrimVertex = 999;
229 fDcaBachToPrimVertex = 999;
238 void AliAODcascade::PrintXi(const Double_t& rPrimVtxX,
239 const Double_t& rPrimVtxY,
240 const Double_t& rPrimVtxZ) const
244 printf("AliAODcascade : posXiVtx (%.6f, %.6f, %.6f) \n", DecayVertexXiX(), DecayVertexXiY(), DecayVertexXiZ() );
245 printf("AliAODcascade : chargeXi = %d \n", ChargeXi() );
246 printf("AliAODcascade : dca (bachtpv %.6f, xid %.6f, xitpv-calc %.6f, xitpv-mb %.6f) \n",
247 DcaBachToPrimVertex(),
249 DcaXiToPrimVertex( rPrimVtxX, rPrimVtxY, rPrimVtxZ),
250 DcaXiToPrimVertex() );
251 printf("AliAODcascade : cos(PtgAngle Xi) = %.6f \n", CosPointingAngleXi(rPrimVtxX, rPrimVtxY, rPrimVtxZ) );
254 printf("AliAODcascade : posVtxXI (x %.6f, y %.6f, z %.6f) \n", DecayVertexXiX(),DecayVertexXiY(),DecayVertexXiZ() );
255 printf("AliAODcascade : decaylgth (V0 %.6f, Xi %.6f) \n", DecayLengthV0(),DecayLengthXi(rPrimVtxX, rPrimVtxY, rPrimVtxZ) );
256 printf("AliAODcascade : momBach (px %.6f, py %.6f, pz %.6f, ptot2 %.6f) \n",
261 printf("AliAODcascade : momXi (px %.6f, py %.6f, pz %.6f, ptot2 %.6f, pt2 %.6f) \n",
267 printf("AliAODcascade : momAlongXi (Bach %.6f, V0 %.6f) \n", MomBachAlongXi(), MomV0AlongXi() );
268 printf("AliAODcascade : cin (alphaXi %.6f, PtArmXi %.6f) \n", AlphaXi(), PtArmXi() );
269 printf("AliAODcascade : rap (Xi %.6f, Omega %.6f) \n", RapXi(),RapOmega() );
270 printf("AliAODcascade : nrg (BachPi %.6f, BachK- %.6f, Omega %.6f, Xi %.6f ) \n",
275 printf("AliAODcascade : inv mass (Xi %.6f, Omega %.6f) \n", MassXi(), MassOmega() );
277 // Methods Not printed = GetBachID(), Chi2Xi()
282 Double_t AliAODcascade::CosPointingAngleXi(const Double_t& rPrimVtxX,
283 const Double_t& rPrimVtxY,
284 const Double_t& rPrimVtxZ) const {
286 // Cosine of Xi pointing angle in 3D space, with respect to a point
289 TVector3 rMomXi( MomXiX(),MomXiY(),MomXiZ() );
290 TVector3 rVect_1rVtxToXi(DecayVertexXiX() - rPrimVtxX,
291 DecayVertexXiY() - rPrimVtxY,
292 DecayVertexXiZ() - rPrimVtxZ);
294 Double_t PtgAngle = rMomXi.Angle(rVect_1rVtxToXi);
296 return TMath::Cos(PtgAngle);
300 Double_t AliAODcascade::DcaXiToPrimVertex(const Double_t& rPrimVtxX,
301 const Double_t& rPrimVtxY,
302 const Double_t& rPrimVtxZ) const {
304 // Compute the DCA between this Xi and the primary vertex
306 Double_t rMomXiX = MomXiX();
307 Double_t rMomXiY = MomXiY();
308 Double_t rMomXiZ = MomXiZ();
309 Double_t dx = (rPrimVtxY- DecayVertexXiY() )*rMomXiZ - (rPrimVtxZ- DecayVertexXiZ() )*rMomXiY;
310 Double_t dy = (rPrimVtxZ- DecayVertexXiZ() )*rMomXiX - (rPrimVtxX- DecayVertexXiX() )*rMomXiZ;
311 Double_t dz = (rPrimVtxX- DecayVertexXiX() )*rMomXiY - (rPrimVtxY- DecayVertexXiY() )*rMomXiX;
312 return TMath::Sqrt((dx*dx+dy*dy+dz*dz)/ Ptot2Xi() );
315 Int_t AliAODcascade::GetBachID() const {
317 // Return the ID of the bachelor
320 if( GetDecayVertexXi() == 0) return -1;
322 AliAODTrack *rBachTrack = (AliAODTrack *) ( GetDecayVertexXi()->GetDaughter(0) );
323 // The fDecayVertexXi should just have one stored daughter. To be managed within the AliAnalysisTaskESDFilter
324 Short_t rBachId = rBachTrack->GetID();