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 // This class provides storage for event and track information which
19 // are used for same-event as well as mixed-event analyses in AliXiStar
21 // authors: Dhevan Gangadharan (dhevan.raja.gangadharan@cern.ch)
23 ////////////////////////////////////////////////////////////////////////////////
26 #include "AliXiStarEventCollection.h"
28 AliXiStarTrackStruct::AliXiStarTrackStruct():
52 //_____________________________________________________________________________
53 AliXiStarTrackStruct::AliXiStarTrackStruct(const AliXiStarTrackStruct &obj)
54 : fStatus(obj.fStatus),
55 fFilterMap(obj.fFilterMap),
69 fNSigmaPi(obj.fNSigmaPi),
70 fNSigmaK(obj.fNSigmaK),
71 fNSigmaPr(obj.fNSigmaPr),
73 fNclusTPC(obj.fNclusTPC)
78 //_____________________________________________________________________________
79 AliXiStarTrackStruct &AliXiStarTrackStruct::operator=(const AliXiStarTrackStruct &obj)
81 // Assignment operator
85 fStatus = obj.fStatus;
86 fFilterMap = obj.fFilterMap;
94 fCharge = obj.fCharge;
103 fCov[0] = obj.fCov[0]; fCov[1] = obj.fCov[1]; fCov[2] = obj.fCov[2];
104 fCov[3] = obj.fCov[3]; fCov[4] = obj.fCov[4]; fCov[5] = obj.fCov[5];
105 fCov[6] = obj.fCov[6]; fCov[7] = obj.fCov[7]; fCov[8] = obj.fCov[8];
106 fCov[9] = obj.fCov[9]; fCov[10] = obj.fCov[10]; fCov[11] = obj.fCov[11];
107 fCov[12] = obj.fCov[12]; fCov[13] = obj.fCov[13]; fCov[14] = obj.fCov[14];
108 fCov[15] = obj.fCov[15]; fCov[16] = obj.fCov[16]; fCov[17] = obj.fCov[17];
109 fCov[18] = obj.fCov[18]; fCov[19] = obj.fCov[19]; fCov[20] = obj.fCov[20];
110 fNSigmaPi = obj.fNSigmaPi;
111 fNSigmaK = obj.fNSigmaK;
112 fNSigmaPr = obj.fNSigmaPr;
114 fNclusTPC = obj.fNclusTPC;
119 //_____________________________________________________________________________
120 AliXiStarTrackStruct::~AliXiStarTrackStruct()
124 //_____________________________________________________________________________
125 AliXiStarEventStruct::AliXiStarEventStruct():
129 //Default constructor
131 //_____________________________________________________________________________
132 AliXiStarEventStruct::AliXiStarEventStruct(const AliXiStarEventStruct &obj)
133 : fNTracks(obj.fNTracks),
138 //_____________________________________________________________________________
139 AliXiStarEventStruct &AliXiStarEventStruct::operator=(const AliXiStarEventStruct &obj)
141 // Assignment operator
145 fNTracks = obj.fNTracks;
146 fTracks = obj.fTracks;
150 //_____________________________________________________________________________
151 AliXiStarEventStruct::~AliXiStarEventStruct()
154 if(fTracks) delete fTracks;
156 //_____________________________________________________________________________
157 AliXiStarEventCollection::AliXiStarEventCollection():
161 //Default constructor
163 //_____________________________________________________________________________
164 AliXiStarEventCollection::AliXiStarEventCollection(short a):
171 fEvtStr = new AliXiStarEventStruct[fFIFO]; //allocate pointer array
172 for(Int_t ii = 0; ii < fFIFO; ii++){ //Initialize to NULL
173 (fEvtStr + ii)->fTracks = NULL;
174 (fEvtStr + ii)->fNTracks = 0;
176 (fEvtStr + ii)->fTracks = new AliXiStarTrackStruct[300];
180 //_____________________________________________________________________________
181 AliXiStarEventCollection::AliXiStarEventCollection(const AliXiStarEventCollection &obj)
187 //_____________________________________________________________________________
188 AliXiStarEventCollection &AliXiStarEventCollection::operator=(const AliXiStarEventCollection &obj)
190 // Assignment operator
195 fEvtStr = obj.fEvtStr;
200 //_____________________________________________________________________________
201 AliXiStarEventCollection::~AliXiStarEventCollection(){
203 for(Int_t i = 0; i < fFIFO; i++){
205 if((fEvtStr + i)->fTracks != NULL){
206 delete [] (fEvtStr + i)->fTracks;
212 //remove histos from heap
215 //_____________________________________________________________________________
216 void AliXiStarEventCollection::FIFOShift(){ //Shift elements in FIFO by one and clear last element in FIFO
218 for(UShort_t i=fFIFO-1 ; i > 0; i--){
219 for(Int_t j=0; j<(fEvtStr + i-1)->fNTracks; j++) (fEvtStr + i)->fTracks[j] = (fEvtStr + i-1)->fTracks[j];
220 (fEvtStr + i)->fNTracks = (fEvtStr + i-1)->fNTracks;
223 (fEvtStr)->fNTracks=0;