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() :
56 //_____________________________________________________________________________
57 AliFemtoK0Particle::AliFemtoK0Particle(const AliFemtoK0Particle &obj) :
61 fDaughterID1(obj.fDaughterID1),
62 fDaughterID2(obj.fDaughterID2),
64 fSideLeft(obj.fSideLeft),
65 fSideRight(obj.fSideRight),
66 fSkipShared(obj.fSkipShared),
69 fDecayLength(obj.fDecayLength),
87 //_____________________________________________________________________________
88 AliFemtoK0Particle &AliFemtoK0Particle::operator=(const AliFemtoK0Particle &obj)
91 if(this == &obj) return *this;
93 fMomentum[0] = obj.fMomentum[0];
94 fMomentum[1] = obj.fMomentum[1];
95 fMomentum[2] = obj.fMomentum[2];
98 fDaughterID1 = obj.fDaughterID1;
99 fDaughterID2 = obj.fDaughterID2;
101 fSideLeft = obj.fSideLeft;
102 fSideRight = obj.fSideRight;
103 fSkipShared = obj.fSkipShared;
106 fDecayLength = obj.fDecayLength;
107 fPosDca = obj.fPosDca;
108 fNegDca = obj.fNegDca;
111 fPosPhi = obj.fPosPhi;
112 fNegPhi = obj.fNegPhi;
113 for(int i=0;i<3;i++){
114 fPPos[i] = obj.fPPos[i];
115 fPNeg[i] = obj.fPNeg[i];
116 for(int j=0;j<9;j++){
117 fPosXYZ[j][i] = obj.fPosXYZ[j][i];
118 fNegXYZ[j][i] = obj.fNegXYZ[j][i];
121 for(int i=0;i<4;i++){
122 for(int j=0;j<5;j++){
123 fCutPass[i][j] = obj.fCutPass[i][j];
126 fPhiPsi = obj.fPhiPsi;
129 //_____________________________________________________________________________
130 AliFemtoK0Particle::~AliFemtoK0Particle()
134 //_____________________________________________________________________________
136 AliFemtoK0Event::AliFemtoK0Event():
141 //Default constructor
143 //_____________________________________________________________________________
144 AliFemtoK0Event::AliFemtoK0Event(const AliFemtoK0Event &obj) :
145 fFillStatus(obj.fFillStatus),
146 fNumV0s(obj.fNumV0s),
147 fK0Particle(obj.fK0Particle)
151 //_____________________________________________________________________________
152 AliFemtoK0Event &AliFemtoK0Event::operator=(const AliFemtoK0Event &obj)
154 //Assignment operator
155 if(this == &obj) return *this;
157 fFillStatus = obj.fFillStatus;
158 fNumV0s = obj.fNumV0s;
159 fK0Particle = obj.fK0Particle;
163 //_____________________________________________________________________________
164 AliFemtoK0Event::~AliFemtoK0Event()
172 //_____________________________________________________________________________
173 AliFemtoK0EventCollection::AliFemtoK0EventCollection() :
178 //Default constructor
180 //_____________________________________________________________________________
181 AliFemtoK0EventCollection::AliFemtoK0EventCollection(short a, int lim) :
190 fEvt = new AliFemtoK0Event[fBufferSize]; //allocate pointer array of type particle_event
193 for(int ii = 0; ii < fBufferSize; ii++){ //Initialize particle table pointers to NULL
194 (fEvt + ii)->fK0Particle = NULL;
195 (fEvt + ii)->fNumV0s = 0;
196 (fEvt + ii)->fFillStatus = 0;
198 (fEvt + ii)->fK0Particle = new AliFemtoK0Particle[fLimit];
201 //_____________________________________________________________________________
202 AliFemtoK0EventCollection::AliFemtoK0EventCollection(const AliFemtoK0EventCollection &obj)
203 : fBufferSize(obj.fBufferSize),
209 //_____________________________________________________________________________
210 AliFemtoK0EventCollection &AliFemtoK0EventCollection::operator=(const
211 AliFemtoK0EventCollection &obj)
213 //Assignment operator
214 if(this == &obj) return *this;
216 fBufferSize = obj.fBufferSize;
222 //_____________________________________________________________________________
223 AliFemtoK0EventCollection::~AliFemtoK0EventCollection()
225 for(int i =0; i < fBufferSize; i++){
226 if((fEvt + i)->fK0Particle != NULL){
227 delete [] (fEvt + i)->fK0Particle;
228 (fEvt + i)->fK0Particle = NULL;
232 delete [] fEvt; fEvt = NULL;
234 //_____________________________________________________________________________
235 void AliFemtoK0EventCollection::FIFOShift(){ //Shift elements in FIFO by one and clear last element in FIFO
237 for(unsigned short i=fBufferSize-1 ; i > 0; i--){
238 for(int j=0; j<(fEvt + i-1)->fNumV0s; j++) (fEvt + i)->fK0Particle[j] = (fEvt + i-1)->fK0Particle[j];
239 (fEvt + i)->fFillStatus = (fEvt + i-1)->fFillStatus;
240 (fEvt + i)->fNumV0s = (fEvt + i-1)->fNumV0s;
244 (fEvt)->fFillStatus=0;