Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoPicoEvent.cxx
CommitLineData
ea77036b 1////////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoPicoEvent - internal AliFemto representation of the event. //
4// Created for the sake of minimizing the used size. Multiple instances are //
5// stored in memory when several mixing bins are used. //
6// //
7////////////////////////////////////////////////////////////////////////////////
67427ff7 8/***************************************************************************
9 *
10 * $Id$
11 *
12 * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
13 ***************************************************************************
14 *
15 * Description: part of STAR HBT Framework: AliFemtoMaker package
16 * PicoEvents are last-step ultra-compressed "events" just containing
17 * bare information about the particles of interest. They have already
18 * gone through Event and Track cuts, so only Pair cuts are left.
19 * PicoEvents are *internal* to the code, and are stored in the
20 * Event-mixing buffers.
21 *
22 *
23 ***************************************************************************
24 *
25 * $Log$
ea77036b 26 * Revision 1.1.2.1 2007/10/12 14:28:37 akisiel
27 * New wave of cleanup and rule conformance
28 *
29 * Revision 1.1 2007/05/16 10:22:11 akisiel
30 * Making the directory structure of AliFemto flat. All files go into one common directory
31 *
d0e92d9a 32 * Revision 1.2 2007/05/03 09:42:29 akisiel
33 * Fixing Effective C++ warnings
34 *
0215f606 35 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
36 * Importing the HBT code dir
37 *
67427ff7 38 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
39 * First version on CVS
40 *
41 * Revision 1.4 2000/07/16 21:38:23 laue
42 * AliFemtoCoulomb.cxx AliFemtoSectoredAnalysis.cxx : updated for standalone version
43 * AliFemtoV0.cc AliFemtoV0.h : some cast to prevent compiling warnings
44 * AliFemtoParticle.cc AliFemtoParticle.h : pointers mTrack,mV0 initialized to 0
45 * AliFemtoIOBinary.cc : some printouts in #ifdef STHBTDEBUG
46 * AliFemtoEvent.cc : B-Field set to 0.25Tesla, we have to think about a better
47 * solution
48 *
49 * Revision 1.3 2000/06/01 20:40:13 laue
50 * AliFemtoIO.cc: updated for new V0s
51 * AliFemtoPicoEvent.cc: collections especially cleared
52 * franks1DHistoD.h, include changed from <stdio> to <cstdio>
53 * franks1DHistoD.cc, cout statement deleted
54 *
55 * Revision 1.2 2000/03/17 17:23:05 laue
56 * Roberts new three particle correlations implemented.
57 *
58 * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
59 * Installation of AliFemtoMaker
60 *
61 **************************************************************************/
62
d0e92d9a 63#include "AliFemtoPicoEvent.h"
ea77036b 64#include "AliFemtoParticleCollection.h"
67427ff7 65
66//________________
0215f606 67AliFemtoPicoEvent::AliFemtoPicoEvent() :
68 fFirstParticleCollection(0),
69 fSecondParticleCollection(0),
70 fThirdParticleCollection(0)
71{
ea77036b 72 // Default constructor
67427ff7 73 fFirstParticleCollection = new AliFemtoParticleCollection;
74 fSecondParticleCollection = new AliFemtoParticleCollection;
75 fThirdParticleCollection = new AliFemtoParticleCollection;
76}
77//_________________
0215f606 78AliFemtoPicoEvent::AliFemtoPicoEvent(const AliFemtoPicoEvent& aPicoEvent) :
79 fFirstParticleCollection(0),
80 fSecondParticleCollection(0),
81 fThirdParticleCollection(0)
82{
ea77036b 83 // Copy constructor
0215f606 84 AliFemtoParticleIterator iter;
85
86 fFirstParticleCollection = new AliFemtoParticleCollection;
87 if (aPicoEvent.fFirstParticleCollection) {
88 for (iter=aPicoEvent.fFirstParticleCollection->begin();iter!=aPicoEvent.fFirstParticleCollection->end();iter++){
89 fFirstParticleCollection->push_back(*iter);
90 }
91 }
92 fSecondParticleCollection = new AliFemtoParticleCollection;
93 if (aPicoEvent.fSecondParticleCollection) {
94 for (iter=aPicoEvent.fSecondParticleCollection->begin();iter!=aPicoEvent.fSecondParticleCollection->end();iter++){
95 fSecondParticleCollection->push_back(*iter);
96 }
97 }
98 fThirdParticleCollection = new AliFemtoParticleCollection;
99 if (aPicoEvent.fThirdParticleCollection) {
100 for (iter=aPicoEvent.fThirdParticleCollection->begin();iter!=aPicoEvent.fThirdParticleCollection->end();iter++){
101 fThirdParticleCollection->push_back(*iter);
102 }
103 }
104}
105//_________________
67427ff7 106AliFemtoPicoEvent::~AliFemtoPicoEvent(){
ea77036b 107 // Destructor
67427ff7 108 AliFemtoParticleIterator iter;
0215f606 109
110 if (fFirstParticleCollection){
111 for (iter=fFirstParticleCollection->begin();iter!=fFirstParticleCollection->end();iter++){
112 delete *iter;
113 }
114 fFirstParticleCollection->clear();
115 delete fFirstParticleCollection;
116 fFirstParticleCollection = 0;
117 }
118
119 if (fSecondParticleCollection){
120 for (iter=fSecondParticleCollection->begin();iter!=fSecondParticleCollection->end();iter++){
121 delete *iter;
122 }
123 fSecondParticleCollection->clear();
124 delete fSecondParticleCollection;
125 fSecondParticleCollection = 0;
126 }
67427ff7 127
0215f606 128 if (fThirdParticleCollection){
129 if (fThirdParticleCollection->size() != 0 ) {
130 for (iter=fThirdParticleCollection->begin();iter!=fThirdParticleCollection->end();iter++){
131 delete *iter;
132 }
133 }
134 fThirdParticleCollection->clear();
135 delete fThirdParticleCollection;
136 fThirdParticleCollection = 0;
137 }
138}
139//_________________
ea77036b 140AliFemtoPicoEvent& AliFemtoPicoEvent::operator=(const AliFemtoPicoEvent& aPicoEvent)
0215f606 141{
ea77036b 142 // Assignment operator
0215f606 143 if (this == &aPicoEvent)
144 return *this;
67427ff7 145
0215f606 146 AliFemtoParticleIterator iter;
147
67427ff7 148 if (fFirstParticleCollection){
149 for (iter=fFirstParticleCollection->begin();iter!=fFirstParticleCollection->end();iter++){
150 delete *iter;
151 }
152 fFirstParticleCollection->clear();
153 delete fFirstParticleCollection;
154 fFirstParticleCollection = 0;
155 }
156
157 if (fSecondParticleCollection){
158 for (iter=fSecondParticleCollection->begin();iter!=fSecondParticleCollection->end();iter++){
159 delete *iter;
160 }
161 fSecondParticleCollection->clear();
162 delete fSecondParticleCollection;
163 fSecondParticleCollection = 0;
164 }
165
166 if (fThirdParticleCollection){
167 if (fThirdParticleCollection->size() != 0 ) {
168 for (iter=fThirdParticleCollection->begin();iter!=fThirdParticleCollection->end();iter++){
169 delete *iter;
170 }
171 }
172 fThirdParticleCollection->clear();
173 delete fThirdParticleCollection;
174 fThirdParticleCollection = 0;
175 }
0215f606 176
177 fFirstParticleCollection = new AliFemtoParticleCollection;
178 if (aPicoEvent.fFirstParticleCollection) {
179 for (iter=aPicoEvent.fFirstParticleCollection->begin();iter!=aPicoEvent.fFirstParticleCollection->end();iter++){
180 fFirstParticleCollection->push_back(*iter);
181 }
182 }
183 fSecondParticleCollection = new AliFemtoParticleCollection;
184 if (aPicoEvent.fSecondParticleCollection) {
185 for (iter=aPicoEvent.fSecondParticleCollection->begin();iter!=aPicoEvent.fSecondParticleCollection->end();iter++){
186 fSecondParticleCollection->push_back(*iter);
187 }
188 }
189 fThirdParticleCollection = new AliFemtoParticleCollection;
190 if (aPicoEvent.fThirdParticleCollection) {
191 for (iter=aPicoEvent.fThirdParticleCollection->begin();iter!=aPicoEvent.fThirdParticleCollection->end();iter++){
192 fThirdParticleCollection->push_back(*iter);
193 }
194 }
195
196 return *this;
67427ff7 197}
0215f606 198