]>
Commit | Line | Data |
---|---|---|
d0e92d9a | 1 | /////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoEvent: hold the information specific to the event and a // | |
4 | // track list // | |
5 | // AliFemtoEvent is the "transient microDST" Objects of this class are // | |
6 | // generated from the input data by a Reader, and then presented to // | |
7 | // the Cuts of the various active Analyses. // | |
8 | // // | |
9 | /////////////////////////////////////////////////////////////////////////// | |
10 | #include "AliFemtoEvent.h" | |
11 | #include "AliFemtoTrack.h" | |
12 | #include "AliFemtoV0.h" | |
13 | #include "AliFemtoXi.h" | |
14 | #include "AliFemtoKink.h" | |
15 | #include "AliFemtoTrackCut.h" | |
16 | #include "AliFemtoV0Cut.h" | |
17 | #include "AliFemtoXiCut.h" | |
18 | #include "AliFemtoKinkCut.h" | |
19 | #include "PhysicalConstants.h" | |
20 | #include "SystemOfUnits.h" | |
67427ff7 | 21 | |
22 | // Mike removed all of the AliFemtoTTree stuff here 21apr2006 - it was not used for a long time. | |
23 | ||
24 | ||
25 | ||
26 | //___________________ | |
0215f606 | 27 | AliFemtoEvent::AliFemtoEvent(): |
28 | fEventNumber(0), | |
29 | fRunNumber(0), | |
30 | fNumberOfTracks(0), | |
31 | fMagneticField(0), | |
32 | fPrimVertPos(0,0,0), | |
33 | fTrackCollection(0), | |
34 | fV0Collection(0), | |
35 | fXiCollection(0), | |
36 | fKinkCollection(0), | |
37 | fZDCN1Energy(0), | |
38 | fZDCP1Energy(0), | |
39 | fZDCN2Energy(0), | |
40 | fZDCP2Energy(0), | |
41 | fZDCEMEnergy(0), | |
42 | fZDCParticipants(0), | |
43 | fTriggerMask(0), | |
44 | fTriggerCluster(0) | |
45 | { | |
d0e92d9a | 46 | // Default constructor |
67427ff7 | 47 | fPrimVertPos[0]=-999.0; |
48 | fPrimVertPos[1]=-999.0; | |
49 | fPrimVertPos[2]=-999.0; | |
50 | fTrackCollection = new AliFemtoTrackCollection; | |
51 | fV0Collection = new AliFemtoV0Collection; | |
52 | fXiCollection = new AliFemtoXiCollection; | |
53 | fKinkCollection = new AliFemtoKinkCollection; | |
54 | fMagneticField=0.0; | |
55 | } | |
56 | //___________________ | |
0215f606 | 57 | AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoXiCut* xCut, AliFemtoKinkCut* kCut): |
58 | fEventNumber(0), | |
59 | fRunNumber(0), | |
60 | fNumberOfTracks(0), | |
61 | fMagneticField(0), | |
62 | fPrimVertPos(0,0,0), | |
63 | fTrackCollection(0), | |
64 | fV0Collection(0), | |
65 | fXiCollection(0), | |
66 | fKinkCollection(0), | |
67 | fZDCN1Energy(0), | |
68 | fZDCP1Energy(0), | |
69 | fZDCN2Energy(0), | |
70 | fZDCP2Energy(0), | |
71 | fZDCEMEnergy(0), | |
72 | fZDCParticipants(0), | |
73 | fTriggerMask(0), | |
74 | fTriggerCluster(0) | |
75 | { // copy constructor with track and v0 cuts | |
67427ff7 | 76 | //cout << "AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoV0Cut* kCut)" << endl; |
77 | fEventNumber = ev.fEventNumber; | |
78 | fRunNumber = ev.fRunNumber; | |
79 | ||
80 | fZDCN1Energy=ev.fZDCN1Energy; | |
81 | fZDCP1Energy=ev.fZDCP1Energy; | |
82 | fZDCN2Energy=ev.fZDCN2Energy; | |
83 | fZDCP2Energy=ev.fZDCP2Energy; | |
84 | fZDCEMEnergy=ev.fZDCEMEnergy; | |
85 | fZDCParticipants=ev.fZDCParticipants; | |
86 | fNumberOfTracks = ev.fNumberOfTracks; | |
87 | fMagneticField= ev.fMagneticField; | |
88 | ||
89 | fTriggerMask=ev.fTriggerMask; // Trigger Type (mask) | |
90 | fTriggerCluster=ev.fTriggerCluster; | |
91 | // create collections | |
92 | fTrackCollection = new AliFemtoTrackCollection; | |
93 | fV0Collection = new AliFemtoV0Collection; | |
94 | fXiCollection = new AliFemtoXiCollection; | |
95 | fKinkCollection = new AliFemtoKinkCollection; | |
96 | // copy track collection | |
97 | for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) { | |
98 | if ( !tCut || tCut->Pass(*tIter) ) { | |
99 | AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter); | |
100 | fTrackCollection->push_back(trackCopy); | |
101 | } | |
102 | } | |
103 | // copy v0 collection | |
104 | for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) { | |
105 | if ( !vCut || vCut->Pass(*vIter) ) { | |
106 | AliFemtoV0* v0Copy = new AliFemtoV0(**vIter); | |
107 | fV0Collection->push_back(v0Copy); | |
108 | } | |
109 | } | |
110 | // copy xi collection | |
111 | for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) { | |
112 | if ( !xCut || xCut->Pass(*xIter) ) { | |
113 | AliFemtoXi* xiCopy = new AliFemtoXi(**xIter); | |
114 | fXiCollection->push_back(xiCopy); | |
115 | } | |
116 | } | |
117 | // copy kink collection | |
118 | for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) { | |
119 | if ( !kCut || kCut->Pass(*kIter) ) { | |
120 | //cout << " kinkCut passed " << endl; | |
121 | AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter); | |
122 | fKinkCollection->push_back(kinkCopy); | |
123 | } | |
124 | } | |
125 | } | |
0215f606 | 126 | //______________________________ |
127 | AliFemtoEvent& AliFemtoEvent::operator=(const AliFemtoEvent& aEvent) | |
128 | { | |
d0e92d9a | 129 | // assignment operator |
0215f606 | 130 | if (this == &aEvent) |
131 | return *this; | |
132 | ||
133 | fEventNumber = aEvent.fEventNumber; | |
134 | fRunNumber = aEvent.fRunNumber; | |
135 | ||
136 | fZDCN1Energy=aEvent.fZDCN1Energy; | |
137 | fZDCP1Energy=aEvent.fZDCP1Energy; | |
138 | fZDCN2Energy=aEvent.fZDCN2Energy; | |
139 | fZDCP2Energy=aEvent.fZDCP2Energy; | |
140 | fZDCEMEnergy=aEvent.fZDCEMEnergy; | |
141 | fZDCParticipants=aEvent.fZDCParticipants; | |
142 | fNumberOfTracks = aEvent.fNumberOfTracks; | |
143 | fMagneticField= aEvent.fMagneticField; | |
144 | ||
145 | fTriggerMask=aEvent.fTriggerMask; // Trigger Type (mask) | |
146 | fTriggerCluster=aEvent.fTriggerCluster; | |
147 | // create collections | |
148 | fTrackCollection = new AliFemtoTrackCollection; | |
149 | fV0Collection = new AliFemtoV0Collection; | |
150 | fXiCollection = new AliFemtoXiCollection; | |
151 | fKinkCollection = new AliFemtoKinkCollection; | |
152 | // copy track collection | |
153 | for ( AliFemtoTrackIterator tIter=aEvent.fTrackCollection->begin(); tIter!=aEvent.fTrackCollection->end(); tIter++) { | |
154 | AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter); | |
155 | fTrackCollection->push_back(trackCopy); | |
156 | } | |
157 | // copy v0 collection | |
158 | for ( AliFemtoV0Iterator vIter=aEvent.fV0Collection->begin(); vIter!=aEvent.fV0Collection->end(); vIter++) { | |
159 | AliFemtoV0* v0Copy = new AliFemtoV0(**vIter); | |
160 | fV0Collection->push_back(v0Copy); | |
161 | } | |
162 | // copy xi collection | |
163 | for ( AliFemtoXiIterator xIter=aEvent.fXiCollection->begin(); xIter!=aEvent.fXiCollection->end(); xIter++) { | |
164 | AliFemtoXi* xiCopy = new AliFemtoXi(**xIter); | |
165 | fXiCollection->push_back(xiCopy); | |
166 | } | |
167 | // copy kink collection | |
168 | for ( AliFemtoKinkIterator kIter=aEvent.fKinkCollection->begin(); kIter!=aEvent.fKinkCollection->end(); kIter++) { | |
169 | AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter); | |
170 | fKinkCollection->push_back(kinkCopy); | |
171 | } | |
172 | ||
173 | return *this; | |
174 | } | |
175 | ||
67427ff7 | 176 | //___________________ |
177 | AliFemtoEvent::~AliFemtoEvent(){ | |
d0e92d9a | 178 | // destructor |
67427ff7 | 179 | #ifdef STHBTDEBUG |
180 | cout << " AliFemtoEvent::~AliFemtoEvent() " << endl; | |
181 | #endif | |
182 | for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){ | |
183 | delete *iter; | |
184 | } | |
185 | fTrackCollection->clear(); | |
186 | delete fTrackCollection; | |
187 | //must do the same for the V0 collection | |
d0e92d9a | 188 | for (AliFemtoV0Iterator tV0iter=fV0Collection->begin();tV0iter!=fV0Collection->end();tV0iter++){ |
189 | delete *tV0iter; | |
67427ff7 | 190 | }//added by M Chojnacki To avodid memory leak |
191 | fV0Collection->clear(); | |
192 | delete fV0Collection; | |
193 | //must do the same for the Xi collection | |
d0e92d9a | 194 | for (AliFemtoXiIterator tXiIter=fXiCollection->begin();tXiIter!=fXiCollection->end();tXiIter++){ |
195 | delete *tXiIter; | |
67427ff7 | 196 | } |
197 | fXiCollection->clear(); | |
198 | delete fXiCollection; | |
199 | //must do the same for the Kink collection | |
200 | for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){ | |
201 | delete *kinkIter; | |
202 | } | |
203 | fKinkCollection->clear(); | |
204 | delete fKinkCollection; | |
205 | } | |
206 | //___________________ | |
207 | ||
208 | ||
209 | ||
210 | void AliFemtoEvent::SetEventNumber(const unsigned short& event){fEventNumber = event;} | |
211 | void AliFemtoEvent::SetRunNumber(const int& runNum){fRunNumber = runNum;} | |
212 | ||
213 | ||
214 | void AliFemtoEvent::SetZDCN1Energy(const float& ZDCN1Energy){fZDCN1Energy=ZDCN1Energy;} | |
215 | void AliFemtoEvent::SetZDCP1Energy(const float& ZDCP1Energy){fZDCP1Energy=ZDCP1Energy;} | |
216 | void AliFemtoEvent::SetZDCN2Energy(const float& ZDCN2Energy){fZDCN2Energy=ZDCN2Energy;} | |
217 | void AliFemtoEvent::SetZDCP2Energy(const float& ZDCP2Energy){fZDCP2Energy=ZDCP2Energy;} | |
218 | void AliFemtoEvent::SetZDCEMEnergy(const float& ZDCEMEnergy){fZDCEMEnergy=ZDCEMEnergy;} | |
219 | void AliFemtoEvent::SetZDCParticipants(const unsigned int& ZDCParticipants){fZDCParticipants=ZDCParticipants;} | |
220 | ||
221 | ||
222 | void AliFemtoEvent::SetNumberOfTracks(const unsigned short& tracks){fNumberOfTracks = tracks;} | |
223 | ||
224 | ||
225 | ||
226 | void AliFemtoEvent::SetPrimVertPos(const AliFemtoThreeVector& vp){fPrimVertPos = vp;} | |
227 | void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;} | |
228 | ||
229 | void AliFemtoEvent::SetTriggerMask(const unsigned long int& TriggerMask) {fTriggerMask=TriggerMask;} | |
230 | void AliFemtoEvent::SetTriggerCluster(const unsigned char& TriggerCluster) {fTriggerCluster=TriggerCluster;} | |
231 | ||
232 | ||
233 | unsigned short AliFemtoEvent::EventNumber() const {return fEventNumber;} | |
234 | int AliFemtoEvent::RunNumber() const {return fRunNumber;} | |
235 | ||
236 | ||
237 | ||
238 | unsigned short AliFemtoEvent::NumberOfTracks() const {return fNumberOfTracks;} | |
239 | ||
240 | AliFemtoV0Collection* AliFemtoEvent::V0Collection() const {return fV0Collection;} | |
241 | AliFemtoXiCollection* AliFemtoEvent::XiCollection() const {return fXiCollection;} | |
242 | AliFemtoKinkCollection* AliFemtoEvent::KinkCollection() const {return fKinkCollection;} | |
243 | AliFemtoTrackCollection* AliFemtoEvent::TrackCollection() const {return fTrackCollection;} | |
244 | AliFemtoThreeVector AliFemtoEvent::PrimVertPos() const {return fPrimVertPos;} | |
245 | double AliFemtoEvent::MagneticField() const {return fMagneticField;} | |
246 | unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;} | |
247 | unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;} | |
248 | ||
249 | ||
250 | float AliFemtoEvent::ZDCN1Energy() const {return fZDCN1Energy;} | |
251 | float AliFemtoEvent::ZDCP1Energy() const {return fZDCP1Energy;} | |
252 | float AliFemtoEvent::ZDCN2Energy() const {return fZDCN2Energy;} | |
253 | float AliFemtoEvent::ZDCP2Energy() const {return fZDCP2Energy;} | |
254 | float AliFemtoEvent::ZDCEMEnergy() const {return fZDCEMEnergy;} | |
255 | unsigned int AliFemtoEvent::ZDCParticipants() const {return fZDCParticipants;} | |
256 | ||
257 | //----------------------------- below here is only for star | |
258 | ||
259 | double AliFemtoEvent::UncorrectedNumberOfNegativePrimaries() const | |
260 | { | |
261 | return NumberOfTracks()/2; | |
262 | } | |
263 | ||
264 | double AliFemtoEvent::UncorrectedNumberOfPrimaries() const | |
265 | { | |
266 | return NumberOfTracks(); | |
267 | } | |
268 | ||
269 |