1 /***************************************************************************
5 * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6 ***************************************************************************
8 * Description: part of STAR HBT Framework: AliFemtoMaker package
9 * HbtEvent is the "transient microDST" Objects of this class are
10 * generated from the input data by a Reader, and then presented to
11 * the Cuts of the various active Analyses.
13 ***************************************************************************
16 * Revision 1.2 2007-04-03 16:00:08 mchojnacki
17 * Changes to iprove memory managing
19 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
20 * First version on CVS
22 * Revision 1.23 2005/08/19 21:19:11 chajecki
23 * line 326: the same change as in line 235
25 * Revision 1.22 2005/08/19 11:33:31 chajecki
26 * fix due to the last changes in MuDst
27 * line 235: TClonesArray* tracks=0; to TObjArray* tracks=0;
28 * see for more details:
29 * http://www.star.bnl.gov/HyperNews-star/protected/get/starsoft/5949.html
31 * Revision 1.21 2003/09/02 17:58:32 perev
32 * gcc 3.2 updates + WarnOff
34 * Revision 1.20 2003/01/31 19:43:20 magestro
35 * several casts added to remove compiler warnings
37 * Revision 1.19 2003/01/17 16:46:58 mercedes
38 * StMuEvent::refMult() added
40 * Revision 1.18 2002/11/19 23:27:37 renault
41 * New event constructor to find V0 daughters informations(helix for average
42 * separation calculation)
44 * Revision 1.17 2002/03/21 18:49:31 laue
45 * updated for new MuDst reader
47 * Revision 1.16 2001/12/06 16:47:13 laue
48 * l3 trigger algorithm added
50 * Revision 1.15 2001/11/14 21:07:21 lisa
51 * Fixed several small things (mostly discarded const) that caused fatal errors with gcc2.95.3
53 * Revision 1.14 2001/09/05 20:41:42 laue
54 * Updates of the hbtMuDstTree microDSTs
56 * Revision 1.13 2001/07/20 20:03:53 rcwells
57 * Added pT weighting and moved event angle cal. to event cut
59 * Revision 1.12 2001/06/23 21:55:17 laue
60 * AliFemtoCheckPdgIdList can take can not check for mother,particle,daughter
61 * Some output turned off
63 * Revision 1.11 2001/06/21 19:15:45 laue
65 * CTH.h : new constructor added
66 * AliFemtoEvent, AliFemtoKink, AliFemtoTrack : constructors from the persistent
67 * (TTree) classes added
68 * AliFemtoLikeSignAnalysis : minor changes, for debugging
69 * AliFemtoTypes: split into different files
70 * Added files: for the new TTree muDst's
71 * StExceptions.cxx StExceptions.h AliFemtoEnumeration.h
72 * AliFemtoHelix.h AliFemtoHisto.h AliFemtoString.h AliFemtoTFile.h
73 * AliFemtoTTreeEvent.cxx AliFemtoTTreeEvent.h AliFemtoTTreeKink.cxx
74 * AliFemtoTTreeKink.h AliFemtoTTreeTrack.cxx AliFemtoTTreeTrack.h
75 * AliFemtoTTreeV0.cxx AliFemtoTTreeV0.h AliFemtoVector.h
77 * Revision 1.10 2001/05/15 15:30:16 rcwells
78 * Added magnetic field to AliFemtoEvent
80 * Revision 1.9 2000/08/31 22:31:31 laue
81 * AliFemtoAnalysis: output changed (a little bit less)
82 * AliFemtoEvent: new version, members for reference mult added
83 * AliFemtoIOBinary: new IO for new AliFemtoEvent version
84 * AliFemtoTypes: TTree typedef to AliFemtoTTree added
85 * AliFemtoVertexAnalysis: overflow and underflow added
87 * Revision 1.8 2000/07/16 21:38:22 laue
88 * AliFemtoCoulomb.cxx AliFemtoSectoredAnalysis.cxx : updated for standalone version
89 * AliFemtoV0.cc AliFemtoV0.h : some cast to prevent compiling warnings
90 * AliFemtoParticle.cc AliFemtoParticle.h : pointers mTrack,mV0 initialized to 0
91 * AliFemtoIOBinary.cc : some printouts in #ifdef STHBTDEBUG
92 * AliFemtoEvent.cc : B-Field set to 0.25Tesla, we have to think about a better
95 * Revision 1.7 2000/05/25 21:54:16 laue
96 * RotateZ implemented. Rotates momentum and helix around the z axis
98 * Revision 1.5 2000/02/18 21:32:23 laue
99 * franksTrackCut changed. If mCharge is set to '0' there will be no cut
100 * on charge. This is important for front-loaded cuts.
102 * copy constructor implemented for AliFemtoEvent, AliFemtoTrack and AliFemtoV0.
104 * franks1HistoD.cxx franks1HistoD.h franks2HistoD.cxx franks2HistoD.h
105 * removed. We can now (CC5 on Solaris) use the versions (no D)
107 * Revision 1.4 1999/09/16 18:47:59 lisa
108 * replace placeholder HbtV0Track stuff with Helens AliFemtoV0 classes
110 * Revision 1.3 1999/07/27 10:47:04 lisa
111 * now works in dev on linux and solaris - mistake in deleting picoEvents fixed
113 * Revision 1.2 1999/07/19 14:24:05 hardtke
114 * modifications to implement uDST
116 * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
117 * Installation of AliFemtoMaker
119 **************************************************************************/
121 #include "Infrastructure/AliFemtoEvent.h"
122 #include "Infrastructure/AliFemtoTrack.h"
123 #include "Infrastructure/AliFemtoV0.h"
124 #include "Infrastructure/AliFemtoXi.h"
125 #include "Infrastructure/AliFemtoKink.h"
126 #include "Base/AliFemtoTrackCut.h"
127 #include "Base/AliFemtoV0Cut.h"
128 #include "Base/AliFemtoXiCut.h"
129 #include "Base/AliFemtoKinkCut.h"
130 #include "PhysicalConstants.h"
131 #include "SystemOfUnits.h"
133 // Mike removed all of the AliFemtoTTree stuff here 21apr2006 - it was not used for a long time.
137 //___________________
138 AliFemtoEvent::AliFemtoEvent(){
139 fPrimVertPos[0]=-999.0;
140 fPrimVertPos[1]=-999.0;
141 fPrimVertPos[2]=-999.0;
142 fTrackCollection = new AliFemtoTrackCollection;
143 fV0Collection = new AliFemtoV0Collection;
144 fXiCollection = new AliFemtoXiCollection;
145 fKinkCollection = new AliFemtoKinkCollection;
148 //___________________
149 AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoXiCut* xCut, AliFemtoKinkCut* kCut){ // copy constructor with track and v0 cuts
150 //cout << "AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoV0Cut* kCut)" << endl;
151 fEventNumber = ev.fEventNumber;
152 fRunNumber = ev.fRunNumber;
154 fZDCN1Energy=ev.fZDCN1Energy;
155 fZDCP1Energy=ev.fZDCP1Energy;
156 fZDCN2Energy=ev.fZDCN2Energy;
157 fZDCP2Energy=ev.fZDCP2Energy;
158 fZDCEMEnergy=ev.fZDCEMEnergy;
159 fZDCParticipants=ev.fZDCParticipants;
160 fNumberOfTracks = ev.fNumberOfTracks;
161 fMagneticField= ev.fMagneticField;
163 fTriggerMask=ev.fTriggerMask; // Trigger Type (mask)
164 fTriggerCluster=ev.fTriggerCluster;
165 // create collections
166 fTrackCollection = new AliFemtoTrackCollection;
167 fV0Collection = new AliFemtoV0Collection;
168 fXiCollection = new AliFemtoXiCollection;
169 fKinkCollection = new AliFemtoKinkCollection;
170 // copy track collection
171 for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) {
172 if ( !tCut || tCut->Pass(*tIter) ) {
173 AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
174 fTrackCollection->push_back(trackCopy);
177 // copy v0 collection
178 for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) {
179 if ( !vCut || vCut->Pass(*vIter) ) {
180 AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
181 fV0Collection->push_back(v0Copy);
184 // copy xi collection
185 for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) {
186 if ( !xCut || xCut->Pass(*xIter) ) {
187 AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
188 fXiCollection->push_back(xiCopy);
191 // copy kink collection
192 for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) {
193 if ( !kCut || kCut->Pass(*kIter) ) {
194 //cout << " kinkCut passed " << endl;
195 AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
196 fKinkCollection->push_back(kinkCopy);
200 //___________________
201 AliFemtoEvent::~AliFemtoEvent(){
203 cout << " AliFemtoEvent::~AliFemtoEvent() " << endl;
205 for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
208 fTrackCollection->clear();
209 delete fTrackCollection;
210 //must do the same for the V0 collection
211 for (AliFemtoV0Iterator V0iter=fV0Collection->begin();V0iter!=fV0Collection->end();V0iter++){
213 }//added by M Chojnacki To avodid memory leak
214 fV0Collection->clear();
215 delete fV0Collection;
216 //must do the same for the Xi collection
217 for (AliFemtoXiIterator XiIter=fXiCollection->begin();XiIter!=fXiCollection->end();XiIter++){
220 fXiCollection->clear();
221 delete fXiCollection;
222 //must do the same for the Kink collection
223 for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){
226 fKinkCollection->clear();
227 delete fKinkCollection;
229 //___________________
233 void AliFemtoEvent::SetEventNumber(const unsigned short& event){fEventNumber = event;}
234 void AliFemtoEvent::SetRunNumber(const int& runNum){fRunNumber = runNum;}
237 void AliFemtoEvent::SetZDCN1Energy(const float& ZDCN1Energy){fZDCN1Energy=ZDCN1Energy;}
238 void AliFemtoEvent::SetZDCP1Energy(const float& ZDCP1Energy){fZDCP1Energy=ZDCP1Energy;}
239 void AliFemtoEvent::SetZDCN2Energy(const float& ZDCN2Energy){fZDCN2Energy=ZDCN2Energy;}
240 void AliFemtoEvent::SetZDCP2Energy(const float& ZDCP2Energy){fZDCP2Energy=ZDCP2Energy;}
241 void AliFemtoEvent::SetZDCEMEnergy(const float& ZDCEMEnergy){fZDCEMEnergy=ZDCEMEnergy;}
242 void AliFemtoEvent::SetZDCParticipants(const unsigned int& ZDCParticipants){fZDCParticipants=ZDCParticipants;}
245 void AliFemtoEvent::SetNumberOfTracks(const unsigned short& tracks){fNumberOfTracks = tracks;}
249 void AliFemtoEvent::SetPrimVertPos(const AliFemtoThreeVector& vp){fPrimVertPos = vp;}
250 void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;}
252 void AliFemtoEvent::SetTriggerMask(const unsigned long int& TriggerMask) {fTriggerMask=TriggerMask;}
253 void AliFemtoEvent::SetTriggerCluster(const unsigned char& TriggerCluster) {fTriggerCluster=TriggerCluster;}
256 unsigned short AliFemtoEvent::EventNumber() const {return fEventNumber;}
257 int AliFemtoEvent::RunNumber() const {return fRunNumber;}
261 unsigned short AliFemtoEvent::NumberOfTracks() const {return fNumberOfTracks;}
263 AliFemtoV0Collection* AliFemtoEvent::V0Collection() const {return fV0Collection;}
264 AliFemtoXiCollection* AliFemtoEvent::XiCollection() const {return fXiCollection;}
265 AliFemtoKinkCollection* AliFemtoEvent::KinkCollection() const {return fKinkCollection;}
266 AliFemtoTrackCollection* AliFemtoEvent::TrackCollection() const {return fTrackCollection;}
267 AliFemtoThreeVector AliFemtoEvent::PrimVertPos() const {return fPrimVertPos;}
268 double AliFemtoEvent::MagneticField() const {return fMagneticField;}
269 unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;}
270 unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;}
273 float AliFemtoEvent::ZDCN1Energy() const {return fZDCN1Energy;}
274 float AliFemtoEvent::ZDCP1Energy() const {return fZDCP1Energy;}
275 float AliFemtoEvent::ZDCN2Energy() const {return fZDCN2Energy;}
276 float AliFemtoEvent::ZDCP2Energy() const {return fZDCP2Energy;}
277 float AliFemtoEvent::ZDCEMEnergy() const {return fZDCEMEnergy;}
278 unsigned int AliFemtoEvent::ZDCParticipants() const {return fZDCParticipants;}
280 //----------------------------- below here is only for star
282 double AliFemtoEvent::UncorrectedNumberOfNegativePrimaries() const
284 return NumberOfTracks()/2;
287 double AliFemtoEvent::UncorrectedNumberOfPrimaries() const
289 return NumberOfTracks();