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() :
55 //_____________________________________________________________________________
56 AliFemtoK0Particle::AliFemtoK0Particle(const AliFemtoK0Particle &obj) :
60 fDaughterID1(obj.fDaughterID1),
61 fDaughterID2(obj.fDaughterID2),
63 fSideLeft(obj.fSideLeft),
64 fSideRight(obj.fSideRight),
65 fSkipShared(obj.fSkipShared),
68 fDecayLength(obj.fDecayLength),
85 //_____________________________________________________________________________
86 AliFemtoK0Particle &AliFemtoK0Particle::operator=(const AliFemtoK0Particle &obj)
89 if(this == &obj) return *this;
91 fMomentum[0] = obj.fMomentum[0];
92 fMomentum[1] = obj.fMomentum[1];
93 fMomentum[2] = obj.fMomentum[2];
96 fDaughterID1 = obj.fDaughterID1;
97 fDaughterID2 = obj.fDaughterID2;
99 fSideLeft = obj.fSideLeft;
100 fSideRight = obj.fSideRight;
101 fSkipShared = obj.fSkipShared;
104 fDecayLength = obj.fDecayLength;
105 fPosDca = obj.fPosDca;
106 fNegDca = obj.fNegDca;
109 fPosPhi = obj.fPosPhi;
110 fNegPhi = obj.fNegPhi;
111 for(int i=0;i<3;i++){
112 fPPos[i] = obj.fPPos[i];
113 fPNeg[i] = obj.fPNeg[i];
114 for(int j=0;j<9;j++){
115 fPosXYZ[j][i] = obj.fPosXYZ[j][i];
116 fNegXYZ[j][i] = obj.fNegXYZ[j][i];
120 fPhiPsi = obj.fPhiPsi;
123 //_____________________________________________________________________________
124 AliFemtoK0Particle::~AliFemtoK0Particle()
128 //_____________________________________________________________________________
130 AliFemtoK0Event::AliFemtoK0Event():
135 //Default constructor
137 //_____________________________________________________________________________
138 AliFemtoK0Event::AliFemtoK0Event(const AliFemtoK0Event &obj) :
139 fFillStatus(obj.fFillStatus),
140 fNumV0s(obj.fNumV0s),
141 fK0Particle(obj.fK0Particle)
145 //_____________________________________________________________________________
146 AliFemtoK0Event &AliFemtoK0Event::operator=(const AliFemtoK0Event &obj)
148 //Assignment operator
149 if(this == &obj) return *this;
151 fFillStatus = obj.fFillStatus;
152 fNumV0s = obj.fNumV0s;
153 fK0Particle = obj.fK0Particle;
157 //_____________________________________________________________________________
158 AliFemtoK0Event::~AliFemtoK0Event()
166 //_____________________________________________________________________________
167 AliFemtoK0EventCollection::AliFemtoK0EventCollection() :
172 //Default constructor
174 //_____________________________________________________________________________
175 AliFemtoK0EventCollection::AliFemtoK0EventCollection(short a, int lim) :
184 fEvt = new AliFemtoK0Event[fBufferSize]; //allocate pointer array of type particle_event
187 for(int ii = 0; ii < fBufferSize; ii++){ //Initialize particle table pointers to NULL
188 (fEvt + ii)->fK0Particle = NULL;
189 (fEvt + ii)->fNumV0s = 0;
190 (fEvt + ii)->fFillStatus = 0;
192 (fEvt + ii)->fK0Particle = new AliFemtoK0Particle[fLimit];
195 //_____________________________________________________________________________
196 AliFemtoK0EventCollection::AliFemtoK0EventCollection(const AliFemtoK0EventCollection &obj)
197 : fBufferSize(obj.fBufferSize),
203 //_____________________________________________________________________________
204 AliFemtoK0EventCollection &AliFemtoK0EventCollection::operator=(const
205 AliFemtoK0EventCollection &obj)
207 //Assignment operator
208 if(this == &obj) return *this;
210 fBufferSize = obj.fBufferSize;
216 //_____________________________________________________________________________
217 AliFemtoK0EventCollection::~AliFemtoK0EventCollection()
219 for(int i =0; i < fBufferSize; i++){
220 if((fEvt + i)->fK0Particle != NULL){
221 delete [] (fEvt + i)->fK0Particle;
222 (fEvt + i)->fK0Particle = NULL;
226 delete [] fEvt; fEvt = NULL;
228 //_____________________________________________________________________________
229 void AliFemtoK0EventCollection::FIFOShift(){ //Shift elements in FIFO by one and clear last element in FIFO
231 for(unsigned short i=fBufferSize-1 ; i > 0; i--){
232 for(int j=0; j<(fEvt + i-1)->fNumV0s; j++) (fEvt + i)->fK0Particle[j] = (fEvt + i-1)->fK0Particle[j];
233 (fEvt + i)->fFillStatus = (fEvt + i-1)->fFillStatus;
234 (fEvt + i)->fNumV0s = (fEvt + i-1)->fNumV0s;
238 (fEvt)->fFillStatus=0;