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