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() :
53 //_____________________________________________________________________________
54 AliFemtoK0Particle::AliFemtoK0Particle(const AliFemtoK0Particle &obj) :
58 fDaughterID1(obj.fDaughterID1),
59 fDaughterID2(obj.fDaughterID2),
61 fSideLeft(obj.fSideLeft),
62 fSideRight(obj.fSideRight),
63 fSkipShared(obj.fSkipShared),
66 fDecayLength(obj.fDecayLength),
81 //_____________________________________________________________________________
82 AliFemtoK0Particle &AliFemtoK0Particle::operator=(const AliFemtoK0Particle &obj)
85 if(this == &obj) return *this;
87 fMomentum[0] = obj.fMomentum[0];
88 fMomentum[1] = obj.fMomentum[1];
89 fMomentum[2] = obj.fMomentum[2];
92 fDaughterID1 = obj.fDaughterID1;
93 fDaughterID2 = obj.fDaughterID2;
95 fSideLeft = obj.fSideLeft;
96 fSideRight = obj.fSideRight;
97 fSkipShared = obj.fSkipShared;
100 fDecayLength = obj.fDecayLength;
101 fPosDca = obj.fPosDca;
102 fNegDca = obj.fNegDca;
105 fPosPhi = obj.fPosPhi;
106 fNegPhi = obj.fNegPhi;
107 for(int i=0;i<3;i++){
108 fPPos[i] = obj.fPPos[i];
109 fPNeg[i] = obj.fPNeg[i];
110 for(int j=0;j<9;j++){
111 fPosXYZ[j][i] = obj.fPosXYZ[j][i];
112 fNegXYZ[j][i] = obj.fNegXYZ[j][i];
117 //_____________________________________________________________________________
118 AliFemtoK0Particle::~AliFemtoK0Particle()
122 //_____________________________________________________________________________
124 AliFemtoK0Event::AliFemtoK0Event():
129 //Default constructor
131 //_____________________________________________________________________________
132 AliFemtoK0Event::AliFemtoK0Event(const AliFemtoK0Event &obj) :
133 fFillStatus(obj.fFillStatus),
134 fNumV0s(obj.fNumV0s),
135 fK0Particle(obj.fK0Particle)
139 //_____________________________________________________________________________
140 AliFemtoK0Event &AliFemtoK0Event::operator=(const AliFemtoK0Event &obj)
142 //Assignment operator
143 if(this == &obj) return *this;
145 fFillStatus = obj.fFillStatus;
146 fNumV0s = obj.fNumV0s;
147 fK0Particle = obj.fK0Particle;
151 //_____________________________________________________________________________
152 AliFemtoK0Event::~AliFemtoK0Event()
160 //_____________________________________________________________________________
161 AliFemtoK0EventCollection::AliFemtoK0EventCollection() :
166 //Default constructor
168 //_____________________________________________________________________________
169 AliFemtoK0EventCollection::AliFemtoK0EventCollection(short a, int lim) :
178 fEvt = new AliFemtoK0Event[fBufferSize]; //allocate pointer array of type particle_event
181 for(int ii = 0; ii < fBufferSize; ii++){ //Initialize particle table pointers to NULL
182 (fEvt + ii)->fK0Particle = NULL;
183 (fEvt + ii)->fNumV0s = 0;
184 (fEvt + ii)->fFillStatus = 0;
186 (fEvt + ii)->fK0Particle = new AliFemtoK0Particle[fLimit];
189 //_____________________________________________________________________________
190 AliFemtoK0EventCollection::AliFemtoK0EventCollection(const AliFemtoK0EventCollection &obj)
191 : fBufferSize(obj.fBufferSize),
197 //_____________________________________________________________________________
198 AliFemtoK0EventCollection &AliFemtoK0EventCollection::operator=(const
199 AliFemtoK0EventCollection &obj)
201 //Assignment operator
202 if(this == &obj) return *this;
204 fBufferSize = obj.fBufferSize;
210 //_____________________________________________________________________________
211 AliFemtoK0EventCollection::~AliFemtoK0EventCollection()
213 for(int i =0; i < fBufferSize; i++){
214 if((fEvt + i)->fK0Particle != NULL){
215 delete [] (fEvt + i)->fK0Particle;
216 (fEvt + i)->fK0Particle = NULL;
220 delete [] fEvt; fEvt = NULL;
222 //_____________________________________________________________________________
223 void AliFemtoK0EventCollection::FIFOShift(){ //Shift elements in FIFO by one and clear last element in FIFO
225 for(unsigned short i=fBufferSize-1 ; i > 0; i--){
226 for(int j=0; j<(fEvt + i-1)->fNumV0s; j++) (fEvt + i)->fK0Particle[j] = (fEvt + i-1)->fK0Particle[j];
227 (fEvt + i)->fFillStatus = (fEvt + i-1)->fFillStatus;
228 (fEvt + i)->fNumV0s = (fEvt + i-1)->fNumV0s;
232 (fEvt)->fFillStatus=0;