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 ////////////////////////////////////////////////////////////////////////////////
18 // These classes provide storage for event and track information which
19 // are used for same-event and mixed-event analyses in AliFemtoK0Analysis.
21 // authors: Dhevan Gangadharan (dhevan.raja.gangadharan@cern.ch)
22 // Matthew Steinpreis (matthew.steinpreis@cern.ch)
23 ////////////////////////////////////////////////////////////////////////////////
25 #include "AliFemtoK0EventCollection.h"
27 AliFemtoK0Particle::AliFemtoK0Particle() :
54 //_____________________________________________________________________________
55 AliFemtoK0Particle::AliFemtoK0Particle(const AliFemtoK0Particle &obj) :
59 fDaughterID1(obj.fDaughterID1),
60 fDaughterID2(obj.fDaughterID2),
62 fSideLeft(obj.fSideLeft),
63 fSideRight(obj.fSideRight),
64 fSkipShared(obj.fSkipShared),
67 fDecayLength(obj.fDecayLength),
83 //_____________________________________________________________________________
84 AliFemtoK0Particle &AliFemtoK0Particle::operator=(const AliFemtoK0Particle &obj)
87 if(this == &obj) return *this;
89 fMomentum[0] = obj.fMomentum[0];
90 fMomentum[1] = obj.fMomentum[1];
91 fMomentum[2] = obj.fMomentum[2];
94 fDaughterID1 = obj.fDaughterID1;
95 fDaughterID2 = obj.fDaughterID2;
97 fSideLeft = obj.fSideLeft;
98 fSideRight = obj.fSideRight;
99 fSkipShared = obj.fSkipShared;
102 fDecayLength = obj.fDecayLength;
103 fPosDca = obj.fPosDca;
104 fNegDca = obj.fNegDca;
107 fPosPhi = obj.fPosPhi;
108 fNegPhi = obj.fNegPhi;
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];
117 fPhiPsi = obj.fPhiPsi;
120 //_____________________________________________________________________________
121 AliFemtoK0Particle::~AliFemtoK0Particle()
125 //_____________________________________________________________________________
127 AliFemtoK0Event::AliFemtoK0Event():
132 //Default constructor
134 //_____________________________________________________________________________
135 AliFemtoK0Event::AliFemtoK0Event(const AliFemtoK0Event &obj) :
136 fFillStatus(obj.fFillStatus),
137 fNumV0s(obj.fNumV0s),
138 fK0Particle(obj.fK0Particle)
142 //_____________________________________________________________________________
143 AliFemtoK0Event &AliFemtoK0Event::operator=(const AliFemtoK0Event &obj)
145 //Assignment operator
146 if(this == &obj) return *this;
148 fFillStatus = obj.fFillStatus;
149 fNumV0s = obj.fNumV0s;
150 fK0Particle = obj.fK0Particle;
154 //_____________________________________________________________________________
155 AliFemtoK0Event::~AliFemtoK0Event()
163 //_____________________________________________________________________________
164 AliFemtoK0EventCollection::AliFemtoK0EventCollection() :
169 //Default constructor
171 //_____________________________________________________________________________
172 AliFemtoK0EventCollection::AliFemtoK0EventCollection(short a, int lim) :
181 fEvt = new AliFemtoK0Event[fBufferSize]; //allocate pointer array of type particle_event
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;
189 (fEvt + ii)->fK0Particle = new AliFemtoK0Particle[fLimit];
192 //_____________________________________________________________________________
193 AliFemtoK0EventCollection::AliFemtoK0EventCollection(const AliFemtoK0EventCollection &obj)
194 : fBufferSize(obj.fBufferSize),
200 //_____________________________________________________________________________
201 AliFemtoK0EventCollection &AliFemtoK0EventCollection::operator=(const
202 AliFemtoK0EventCollection &obj)
204 //Assignment operator
205 if(this == &obj) return *this;
207 fBufferSize = obj.fBufferSize;
213 //_____________________________________________________________________________
214 AliFemtoK0EventCollection::~AliFemtoK0EventCollection()
216 for(int i =0; i < fBufferSize; i++){
217 if((fEvt + i)->fK0Particle != NULL){
218 delete [] (fEvt + i)->fK0Particle;
219 (fEvt + i)->fK0Particle = NULL;
223 delete [] fEvt; fEvt = NULL;
225 //_____________________________________________________________________________
226 void AliFemtoK0EventCollection::FIFOShift(){ //Shift elements in FIFO by one and clear last element in FIFO
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;
235 (fEvt)->fFillStatus=0;