K0s code update (Matt Steinpreis)
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / K0Analysis / AliFemtoK0EventCollection.cxx
CommitLineData
0da241a9 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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//
18// These classes provide storage for event and track information which
19// are used for same-event and mixed-event analyses in AliFemtoK0Analysis.
20//
21// authors: Dhevan Gangadharan (dhevan.raja.gangadharan@cern.ch)
22// Matthew Steinpreis (matthew.steinpreis@cern.ch)
23////////////////////////////////////////////////////////////////////////////////
24
25#include "AliFemtoK0EventCollection.h"
26
27AliFemtoK0Particle::AliFemtoK0Particle() :
28 fMomentum(),
29 fPt(0),
30 fMass(0),
31 fDaughterID1(0),
32 fDaughterID2(0),
33 fK0(0),
cc64ee13 34 fSideLeft(0),
35 fSideRight(0),
36 fSkipShared(0),
37 fV0Dca(0),
38 fDDDca(0),
39 fDecayLength(0),
40 fPosDca(0),
41 fNegDca(0),
42 fPosPt(0),
43 fNegPt(0),
44 fPosPhi(0),
45 fNegPhi(0),
0da241a9 46 fPPos(),
47 fPNeg(),
fae797ad 48 fPosXYZ(),
41dfc4d3
DRG
49 fNegXYZ(),
50 fPhiPsi(0)
0da241a9 51{
52 //Default constructor
53}
54//_____________________________________________________________________________
55AliFemtoK0Particle::AliFemtoK0Particle(const AliFemtoK0Particle &obj) :
56 fMomentum(),
57 fPt(obj.fPt),
58 fMass(obj.fMass),
59 fDaughterID1(obj.fDaughterID1),
60 fDaughterID2(obj.fDaughterID2),
61 fK0(obj.fK0),
cc64ee13 62 fSideLeft(obj.fSideLeft),
63 fSideRight(obj.fSideRight),
64 fSkipShared(obj.fSkipShared),
65 fV0Dca(obj.fV0Dca),
66 fDDDca(obj.fDDDca),
67 fDecayLength(obj.fDecayLength),
68 fPosDca(obj.fPosDca),
69 fNegDca(obj.fNegDca),
70 fPosPt(obj.fPosPt),
71 fNegPt(obj.fNegPt),
72 fPosPhi(obj.fPosPhi),
73 fNegPhi(obj.fNegPhi),
0da241a9 74 fPPos(),
75 fPNeg(),
fae797ad 76 fPosXYZ(),
41dfc4d3
DRG
77 fNegXYZ(),
78 fPhiPsi()
fae797ad 79
0da241a9 80{
81 // copy constructor
82}
83//_____________________________________________________________________________
84AliFemtoK0Particle &AliFemtoK0Particle::operator=(const AliFemtoK0Particle &obj)
85{
86 //Assignment operator
87 if(this == &obj) return *this;
88
89 fMomentum[0] = obj.fMomentum[0];
90 fMomentum[1] = obj.fMomentum[1];
91 fMomentum[2] = obj.fMomentum[2];
92 fPt = obj.fPt;
93 fMass = obj.fMass;
94 fDaughterID1 = obj.fDaughterID1;
95 fDaughterID2 = obj.fDaughterID2;
96 fK0 = obj.fK0;
cc64ee13 97 fSideLeft = obj.fSideLeft;
98 fSideRight = obj.fSideRight;
99 fSkipShared = obj.fSkipShared;
100 fV0Dca = obj.fV0Dca;
101 fDDDca = obj.fDDDca;
102 fDecayLength = obj.fDecayLength;
103 fPosDca = obj.fPosDca;
104 fNegDca = obj.fNegDca;
105 fPosPt = obj.fPosPt;
106 fNegPt = obj.fNegPt;
107 fPosPhi = obj.fPosPhi;
108 fNegPhi = obj.fNegPhi;
fae797ad 109 for(int i=0;i<3;i++){
110 fPPos[i] = obj.fPPos[i];
111 fPNeg[i] = obj.fPNeg[i];
112 for(int j=0;j<9;j++){
113 fPosXYZ[j][i] = obj.fPosXYZ[j][i];
114 fNegXYZ[j][i] = obj.fNegXYZ[j][i];
115 }
116 }
41dfc4d3 117 fPhiPsi = obj.fPhiPsi;
0da241a9 118 return (*this);
119}
120//_____________________________________________________________________________
121AliFemtoK0Particle::~AliFemtoK0Particle()
122{
123 // Destructor
124}
125//_____________________________________________________________________________
126
127AliFemtoK0Event::AliFemtoK0Event():
128 fFillStatus(0),
129 fNumV0s(0),
130 fK0Particle(0x0)
131{
132 //Default constructor
133}
134//_____________________________________________________________________________
135AliFemtoK0Event::AliFemtoK0Event(const AliFemtoK0Event &obj) :
136 fFillStatus(obj.fFillStatus),
137 fNumV0s(obj.fNumV0s),
138 fK0Particle(obj.fK0Particle)
139{
140 //Copy constructor
141}
142//_____________________________________________________________________________
143AliFemtoK0Event &AliFemtoK0Event::operator=(const AliFemtoK0Event &obj)
144{
145 //Assignment operator
146 if(this == &obj) return *this;
147
148 fFillStatus = obj.fFillStatus;
149 fNumV0s = obj.fNumV0s;
150 fK0Particle = obj.fK0Particle;
151
152 return (*this);
153}
154//_____________________________________________________________________________
155AliFemtoK0Event::~AliFemtoK0Event()
156{
157 //Destructor
1779c440 158 if(fK0Particle){
159 delete fK0Particle;
160 fK0Particle = NULL;
161 }
0da241a9 162}
0da241a9 163//_____________________________________________________________________________
164AliFemtoK0EventCollection::AliFemtoK0EventCollection() :
165 fBufferSize(0),
166 fLimit(0),
167 fEvt(0x0)
168{
169 //Default constructor
170}
171//_____________________________________________________________________________
172AliFemtoK0EventCollection::AliFemtoK0EventCollection(short a, int lim) :
173 fBufferSize(0),
174 fLimit(0),
175 fEvt(0x0)
176{
177 //maint constructor
178
179 SetBufferSize(a);
180
181 fEvt = new AliFemtoK0Event[fBufferSize]; //allocate pointer array of type particle_event
182 fLimit = lim;
183
184 for(int ii = 0; ii < fBufferSize; ii++){ //Initialize particle table pointers to NULL
185 (fEvt + ii)->fK0Particle = NULL;
186 (fEvt + ii)->fNumV0s = 0;
187 (fEvt + ii)->fFillStatus = 0;
188
189 (fEvt + ii)->fK0Particle = new AliFemtoK0Particle[fLimit];
190 }
191}
192//_____________________________________________________________________________
193AliFemtoK0EventCollection::AliFemtoK0EventCollection(const AliFemtoK0EventCollection &obj)
194 : fBufferSize(obj.fBufferSize),
195 fLimit(obj.fLimit),
196 fEvt(obj.fEvt)
197{
198 //copy constructor
199}
200//_____________________________________________________________________________
201AliFemtoK0EventCollection &AliFemtoK0EventCollection::operator=(const
202AliFemtoK0EventCollection &obj)
203{
204 //Assignment operator
205 if(this == &obj) return *this;
206
207 fBufferSize = obj.fBufferSize;
208 fLimit = obj.fLimit;
209 fEvt = obj.fEvt;
210
211 return (*this);
212}
213//_____________________________________________________________________________
214AliFemtoK0EventCollection::~AliFemtoK0EventCollection()
215{
216 for(int i =0; i < fBufferSize; i++){
217 if((fEvt + i)->fK0Particle != NULL){
218 delete [] (fEvt + i)->fK0Particle;
1779c440 219 (fEvt + i)->fK0Particle = NULL;
0da241a9 220 }
221 }
222
1779c440 223 delete [] fEvt; fEvt = NULL;
0da241a9 224}
225//_____________________________________________________________________________
226void AliFemtoK0EventCollection::FIFOShift(){ //Shift elements in FIFO by one and clear last element in FIFO
227
228 for(unsigned short i=fBufferSize-1 ; i > 0; i--){
229 for(int j=0; j<(fEvt + i-1)->fNumV0s; j++) (fEvt + i)->fK0Particle[j] = (fEvt + i-1)->fK0Particle[j];
230 (fEvt + i)->fFillStatus = (fEvt + i-1)->fFillStatus;
231 (fEvt + i)->fNumV0s = (fEvt + i-1)->fNumV0s;
232 }
233
234 (fEvt)->fNumV0s=0;
235 (fEvt)->fFillStatus=0;
236
237}