StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtEvent.cc
1 /***************************************************************************
2  *
3  * $Id: StHbtEvent.cc,v 1.23 2005/08/19 21:19:11 chajecki Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker 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.
12  *
13  ***************************************************************************
14  *
15  * $Log: StHbtEvent.cc,v $
16  * Revision 1.23 2005/08/19 21:19:11 chajecki
17  * line 326: the same change as in line 235
18  *
19  * Revision 1.22 2005/08/19 11:33:31 chajecki
20  * fix due to the last changes in MuDst
21  * line 235: TClonesArray* tracks=0; to TObjArray* tracks=0;
22  * see for more details:
23  * http://www.star.bnl.gov/HyperNews-star/protected/get/starsoft/5949.html
24  *
25  * Revision 1.21 2003/09/02 17:58:32 perev
26  * gcc 3.2 updates + WarnOff
27  *
28  * Revision 1.20 2003/01/31 19:43:20 magestro
29  * several casts added to remove compiler warnings
30  *
31  * Revision 1.19 2003/01/17 16:46:58 mercedes
32  * StMuEvent::refMult() added
33  *
34  * Revision 1.18 2002/11/19 23:27:37 renault
35  * New event constructor to find V0 daughters informations(helix for average
36  * separation calculation)
37  *
38  * Revision 1.17 2002/03/21 18:49:31 laue
39  * updated for new MuDst reader
40  *
41  * Revision 1.16 2001/12/06 16:47:13 laue
42  * l3 trigger algorithm added
43  *
44  * Revision 1.15 2001/11/14 21:07:21 lisa
45  * Fixed several small things (mostly discarded const) that caused fatal errors with gcc2.95.3
46  *
47  * Revision 1.14 2001/09/05 20:41:42 laue
48  * Updates of the hbtMuDstTree microDSTs
49  *
50  * Revision 1.13 2001/07/20 20:03:53 rcwells
51  * Added pT weighting and moved event angle cal. to event cut
52  *
53  * Revision 1.12 2001/06/23 21:55:17 laue
54  * StHbtCheckPdgIdList can take can not check for mother,particle,daughter
55  * Some output turned off
56  *
57  * Revision 1.11 2001/06/21 19:15:45 laue
58  * Modified fiels:
59  * CTH.hh : new constructor added
60  * StHbtEvent, StHbtKink, StHbtTrack : constructors from the persistent
61  * (TTree) classes added
62  * StHbtLikeSignAnalysis : minor changes, for debugging
63  * StHbtTypes: split into different files
64  * Added files: for the new TTree muDst's
65  * StExceptions.cxx StExceptions.hh StHbtEnumeration.hh
66  * StHbtHelix.hh StHbtHisto.hh StHbtString.hh StHbtTFile.hh
67  * StHbtTTreeEvent.cxx StHbtTTreeEvent.h StHbtTTreeKink.cxx
68  * StHbtTTreeKink.h StHbtTTreeTrack.cxx StHbtTTreeTrack.h
69  * StHbtTTreeV0.cxx StHbtTTreeV0.h StHbtVector.hh
70  *
71  * Revision 1.10 2001/05/15 15:30:16 rcwells
72  * Added magnetic field to StHbtEvent
73  *
74  * Revision 1.9 2000/08/31 22:31:31 laue
75  * StHbtAnalysis: output changed (a little bit less)
76  * StHbtEvent: new version, members for reference mult added
77  * StHbtIOBinary: new IO for new StHbtEvent version
78  * StHbtTypes: TTree typedef to StHbtTTree added
79  * StHbtVertexAnalysis: overflow and underflow added
80  *
81  * Revision 1.8 2000/07/16 21:38:22 laue
82  * StHbtCoulomb.cxx StHbtSectoredAnalysis.cxx : updated for standalone version
83  * StHbtV0.cc StHbtV0.hh : some cast to prevent compiling warnings
84  * StHbtParticle.cc StHbtParticle.hh : pointers mTrack,mV0 initialized to 0
85  * StHbtIOBinary.cc : some printouts in #ifdef STHBTDEBUG
86  * StHbtEvent.cc : B-Field set to 0.25Tesla, we have to think about a better
87  * solution
88  *
89  * Revision 1.7 2000/05/25 21:54:16 laue
90  * RotateZ implemented. Rotates momentum and helix around the z axis
91  *
92  * Revision 1.5 2000/02/18 21:32:23 laue
93  * franksTrackCut changed. If mCharge is set to '0' there will be no cut
94  * on charge. This is important for front-loaded cuts.
95  *
96  * copy constructor implemented for StHbtEvent, StHbtTrack and StHbtV0.
97  *
98  * franks1HistoD.cxx franks1HistoD.h franks2HistoD.cxx franks2HistoD.h
99  * removed. We can now (CC5 on Solaris) use the versions (no D)
100  *
101  * Revision 1.4 1999/09/16 18:47:59 lisa
102  * replace placeholder HbtV0Track stuff with Helens StHbtV0 classes
103  *
104  * Revision 1.3 1999/07/27 10:47:04 lisa
105  * now works in dev on linux and solaris - mistake in deleting picoEvents fixed
106  *
107  * Revision 1.2 1999/07/19 14:24:05 hardtke
108  * modifications to implement uDST
109  *
110  * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
111  * Installation of StHbtMaker
112  *
113  **************************************************************************/
114 
115 #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
116 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
117 #include "StHbtMaker/Infrastructure/StHbtV0.hh"
118 #include "StHbtMaker/Infrastructure/StHbtXi.hh"
119 #include "StHbtMaker/Infrastructure/StHbtKink.hh"
120 #include "StHbtMaker/Base/StHbtTrackCut.h"
121 #include "StHbtMaker/Base/StHbtV0Cut.h"
122 #include "StHbtMaker/Base/StHbtXiCut.h"
123 #include "StHbtMaker/Base/StHbtKinkCut.h"
124 #include "PhysicalConstants.h"
125 #include "SystemOfUnits.h"
126 
127 #ifdef __ROOT__
128 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
129 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
130 #include "StHbtMaker/Infrastructure/StHbtTTreeV0.h"
131 #include "StHbtMaker/Infrastructure/StHbtTTreeXi.h"
132 #include "StHbtMaker/Infrastructure/StHbtTTreeKink.h"
133 
134 StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev) {
135 #ifdef STHBTDEBUG
136  cout << "StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev)" << endl;
137 #endif
138  mEventNumber = ev->mEventNumber;
139  mRunNumber = ev->mRunNumber;
140  mTpcNhits = ev->mTpcNhits;
141  mNumberOfTracks = ev->mNumberOfTracks;
142  mNumberOfGoodTracks = ev->mNumberOfGoodTracks;
143  mCtbMultiplicity = (unsigned short) ev->mCtbMultiplicity;
144  mZdcAdc[0] = (unsigned short) ev->mZdcAdc[0];
145  mZdcAdc[1] = (unsigned short) ev->mZdcAdc[1];
146  mUncorrectedNumberOfPositivePrimaries = ev->mUncorrectedNumberOfPositivePrimaries;
147  mUncorrectedNumberOfNegativePrimaries = ev->mUncorrectedNumberOfNegativePrimaries;
148  mReactionPlane[0] = ev->mReactionPlane[0];
149  mReactionPlane[1] = ev->mReactionPlane[1];
150  mReactionPlanePtWgt[0] = ev->mReactionPlanePtWgt[0];
151  mReactionPlanePtWgt[1] = ev->mReactionPlanePtWgt[1];
152  mPrimVertPos = StHbtThreeVector(ev->mVertexX,ev->mVertexY,ev->mVertexZ);
153  mMagneticField = ev->mMagneticField;
154  if (mMagneticField==0) {
155 #if STHBTDEBUG
156  cout << "StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev) - mMagneticField=" << mMagneticField << endl;
157 #endif
158  mMagneticField = 2.5;
159  // ev->SetMagneticField(mMagneticField); commented-out by malisa 14nov01 - unneeded and caused compiler problems
160  cout << "StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev) - B=0 in TTree! WARNING!! PROBABLY SCREWED-UP!!" << endl;
161  }
162  mTriggerWord = ev->mTriggerWord;
163  mTriggerActionWord = ev->mTriggerActionWord;
164  // for (int i=0;i<4; i++) mL3TriggerAlgorithm[i] = ev->mL3TriggerAlgorithm[i];
165  mL3TriggerAlgorithm[0] = ev->mL3TriggerAlgorithm;
166 
167 
168  // create collections
169  mV0Collection = new StHbtV0Collection();
170  mXiCollection = new StHbtXiCollection();
171  mKinkCollection = new StHbtKinkCollection();
172  mTrackCollection = new StHbtTrackCollection();
173 
174  // copy track collection
175  for ( unsigned int i=0; i <ev->mNtracks; i++) {
176  StHbtTrack* trackCopy = new StHbtTrack(ev, (StHbtTTreeTrack*)ev->tracks()->UncheckedAt(i));
177  mTrackCollection->push_back(trackCopy);
178  }
179  // copy v0 collection
180  for ( unsigned int i=0; i<ev->mNv0s; i++) {
181  StHbtV0* v0Copy = new StHbtV0(ev, (StHbtTTreeV0*)ev->v0s()->UncheckedAt(i));
182  mV0Collection->push_back(v0Copy);
183  }
184  // copy xi collection
185  for ( unsigned int i=0; i<ev->mNxis; i++) {
186  StHbtXi* xiCopy = new StHbtXi(ev, (StHbtTTreeXi*)ev->xis()->UncheckedAt(i));
187  mXiCollection->push_back(xiCopy);
188  }
189  // copy kink collection
190  for ( unsigned int i=0; i <ev->mNkinks; i++) {
191  StHbtKink* kinkCopy = new StHbtKink(ev, (StHbtTTreeKink*)ev->kinks()->UncheckedAt(i));
192  mKinkCollection->push_back(kinkCopy);
193  }
194  cout << "StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev) - collections:";
195  cout << " " << mTrackCollection->size();
196  cout << "/" << mV0Collection->size();
197  cout << "/" << mXiCollection->size();
198  cout << "/" << mKinkCollection->size();
199  cout << endl;
200 }
201 #endif
202 
203 
204 #ifdef __ROOT__
205 #include "StMuDSTMaker/COMMON/StMuDst.h"
206 #include "StMuDSTMaker/COMMON/StMuEvent.h"
207 #include "StMuDSTMaker/COMMON/StMuTrack.h"
208 #include "StMuDSTMaker/COMMON/StMuDebug.h"
209 #endif
210 
211 StHbtEvent::StHbtEvent(const StMuDst* dst, int trackType) {
212  DEBUGMESSAGE1("");
213  StMuEvent* ev = dst->event();
214  mEventNumber = ev->eventNumber();
215  mRunNumber = ev->runNumber();
216  mTpcNhits = 0;
217  mNumberOfTracks = ev->eventSummary().numberOfTracks();
218  mNumberOfGoodTracks = ev->eventSummary().numberOfGoodTracks();
219  mCtbMultiplicity = (unsigned short) ev->ctbMultiplicity();
220  mZdcAdc[0] = (unsigned short) ev->zdcAdcAttentuatedSumWest();
221  mZdcAdc[1] = (unsigned short) ev->zdcAdcAttentuatedSumEast();
222  mUncorrectedNumberOfPositivePrimaries = ev->refMultPos();
223  mUncorrectedNumberOfNegativePrimaries = ev->refMultNeg();
224  mUncorrectedNumberOfPrimaries = ev->refMult();
225  mReactionPlane[0] = 0;
226  mReactionPlane[1] = 0;
227  mReactionPlanePtWgt[0] = 0;
228  mReactionPlanePtWgt[1] = 0;
229  mPrimVertPos = ev->eventSummary().primaryVertexPosition();
230  mMagneticField = ev->magneticField();
231 
232  mTriggerWord = ev->l0Trigger().triggerWord();
233  mTriggerActionWord = ev->l0Trigger().triggerActionWord();
234 
235 
236 
237  // create collections
238  mV0Collection = new StHbtV0Collection();
239  mXiCollection = new StHbtXiCollection();
240  mKinkCollection = new StHbtKinkCollection();
241  mTrackCollection = new StHbtTrackCollection();
242 
243  // copy track collection
244  TObjArray* tracks=0;
245  switch (trackType) {
246  case 0: tracks = dst->globalTracks(); break;
247  case 1: tracks = dst->primaryTracks(); break;
248  default: DEBUGMESSAGE("don't know how to handle this track type");
249  }
250  if (tracks) {
251  DEBUGVALUE2(trackType);
252  int nTracks = tracks->GetEntries();
253  DEBUGVALUE2(tracks->GetEntries());
254  for ( int i=0; i<nTracks; i++) {
255  StHbtTrack* trackCopy = new StHbtTrack(dst, (StMuTrack*) tracks->UncheckedAt(i));
256  mTrackCollection->push_back(trackCopy);
257  }
258  }
259 
260  StStrangeEvMuDst* strangeEvent = dst->strangeEvent();
261  // copy v0 collection
262  int nV0s = dst->v0s()->GetEntries();
263  for ( int i=0; i<nV0s; i++) {
264  dst->v0s(i)->SetEvent(strangeEvent);
265 
266  StHbtV0* v0Copy = new StHbtV0( *dst->v0s(i) );
267  mV0Collection->push_back(v0Copy);
268  }
269  // copy xi collection
270  int nXis = dst->xis()->GetEntries();
271  for ( int i=0; i<nXis; i++) {
272  dst->xis(i)->SetEvent(strangeEvent);
273  StHbtXi* xiCopy = new StHbtXi( *dst->xis(i) );
274  mXiCollection->push_back(xiCopy);
275  }
276 // // copy kink collection
277 // int nKinks = dst->kinks()->GetEntries();
278 // for ( unsigned int i=0; i <nKinks; i++) {
279 // StHbtKink* kinkCopy = new StHbtKink( *dst->kinks(i) );
280 // mKinkCollection->push_back(kinkCopy);
281 // }
282  cout << "StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev) - collections:";
283  cout << " " << mTrackCollection->size();
284  cout << "/" << mV0Collection->size();
285  cout << "/" << mXiCollection->size();
286  cout << "/" << mKinkCollection->size();
287  cout << endl;
288 }
289 
290 
291 
292 // Gael addition 24 Sept 02
293 StHbtEvent::StHbtEvent(const StMuDst* dst, int trackType, bool readV0Daughters) {
294  DEBUGMESSAGE1("");
295  StMuEvent* ev = dst->event();
296  mEventNumber = ev->eventNumber();
297  mRunNumber = ev->runNumber();
298  mTpcNhits = 0;
299  mNumberOfTracks = ev->eventSummary().numberOfTracks();
300  mNumberOfGoodTracks = ev->eventSummary().numberOfGoodTracks();
301  mCtbMultiplicity = (unsigned short) ev->ctbMultiplicity();
302  mZdcAdc[0] = (unsigned short) ev->zdcAdcAttentuatedSumWest();
303  mZdcAdc[1] = (unsigned short) ev->zdcAdcAttentuatedSumEast();
304  mUncorrectedNumberOfPositivePrimaries = ev->refMultPos();
305  mUncorrectedNumberOfNegativePrimaries = ev->refMultNeg();
306  mUncorrectedNumberOfPrimaries = ev->refMult();
307  mReactionPlane[0] = 0;
308  mReactionPlane[1] = 0;
309  mReactionPlanePtWgt[0] = 0;
310  mReactionPlanePtWgt[1] = 0;
311  mPrimVertPos = ev->eventSummary().primaryVertexPosition();
312  mMagneticField = ev->magneticField();
313 
314  mTriggerWord = ev->l0Trigger().triggerWord();
315  mTriggerActionWord = ev->l0Trigger().triggerActionWord();
316 
317 
318 
319  // create collections
320  mV0Collection = new StHbtV0Collection();
321  mXiCollection = new StHbtXiCollection();
322  mKinkCollection = new StHbtKinkCollection();
323  mTrackCollection = new StHbtTrackCollection();
324 
325  // copy track collection
326  TObjArray* tracks=0;
327  switch (trackType) {
328  case 0: tracks = dst->globalTracks(); break;
329  case 1: tracks = dst->primaryTracks(); break;
330  default: DEBUGMESSAGE("don't know how to handle this track type");
331  }
332 
333  if (tracks) {
334  DEBUGVALUE2(trackType);
335  int nTracks = tracks->GetEntries();
336  DEBUGVALUE2(tracks->GetEntries());
337  for ( int i=0; i<nTracks; i++) {
338  StHbtTrack* trackCopy = new StHbtTrack(dst, (StMuTrack*) tracks->UncheckedAt(i));
339 
340  mTrackCollection->push_back(trackCopy);
341  }
342  }
343 
344  StStrangeEvMuDst* strangeEvent = dst->strangeEvent();
345  // copy v0 collection
346  int nV0s = dst->v0s()->GetEntries();
347  // to read V0 daugthers
348  double *TrackToId;
349  tracks = dst->globalTracks();
350  int nTracks = tracks->GetEntries();
351  TrackToId = (double*)malloc(sizeof(double)*nTracks);
352  for ( int i=0; i<nTracks; i++) {
353  StHbtTrack* trackCopy = new StHbtTrack(dst, (StMuTrack*) tracks->UncheckedAt(i));
354  TrackToId[i] = trackCopy->TrackId();
355  delete trackCopy;
356  }
357  for ( int i=0; i<nV0s; i++) {
358  dst->v0s(i)->SetEvent(strangeEvent);
359  StHbtV0* v0Copy = new StHbtV0( *dst->v0s(i) );
360  // Gael 23 Sept 02 --beg
361  // search for daughters....
362  if (readV0Daughters){
363  tracks = dst->globalTracks();
364  int nTracks = tracks->GetEntries();
365  int V0NegOk = 1;
366  int V0PosOk = 1;
367 
368  for ( int j=0; j<nTracks; j++) {
369  if (TrackToId[j]==v0Copy->idNeg()) {
370  V0NegOk = -1;
371  StHbtTrack* trackCopy = new StHbtTrack(dst, (StMuTrack*) tracks->UncheckedAt(j));
372  v0Copy->SetHelixNeg(trackCopy->Helix());
373  delete trackCopy;
374  }
375  if (TrackToId[j]==v0Copy->idPos()) {
376  V0PosOk = -1;
377  StHbtTrack* trackCopy = new StHbtTrack(dst, (StMuTrack*) tracks->UncheckedAt(j));
378  v0Copy->SetHelixPos(trackCopy->Helix());
379  delete trackCopy;
380  }
381 
382  if ((V0PosOk < 0) && (V0NegOk < 0)) {
383  break;}
384  }
385 
386  if ((V0PosOk < 0) != (V0NegOk < 0)) {
387  cout <<"!!! StHbtEvent::At least One V0 daughter is not found !!!" << endl;
388  }
389  v0Copy->SetprimaryVertex(ev->eventSummary().primaryVertexPosition());
390  }
391  mV0Collection->push_back(v0Copy);
392  }
393  free(TrackToId); // Gael 23 Sept 02 --end
394 
395 
396  // copy xi collection
397  int nXis = dst->xis()->GetEntries();
398  for ( int i=0; i<nXis; i++) {
399  dst->xis(i)->SetEvent(strangeEvent);
400  StHbtXi* xiCopy = new StHbtXi( *dst->xis(i) );
401  mXiCollection->push_back(xiCopy);
402  }
403 // // copy kink collection
404 // int nKinks = dst->kinks()->GetEntries();
405 // for ( unsigned int i=0; i <nKinks; i++) {
406 // StHbtKink* kinkCopy = new StHbtKink( *dst->kinks(i) );
407 // mKinkCollection->push_back(kinkCopy);
408 // }
409  cout << "StHbtEvent::StHbtEvent(const StHbtTTreeEvent* ev) - collections:";
410  cout << " " << mTrackCollection->size();
411  cout << "/" << mV0Collection->size();
412  cout << "/" << mXiCollection->size();
413  cout << "/" << mKinkCollection->size();
414  cout << endl;
415 }
416 
417 
418 
419 
420 //___________________
421 // end Gael addition 24 Sept 02
422 //___________________
423 StHbtEvent::StHbtEvent(){
424  mPrimVertPos[0]=-999.0;
425  mPrimVertPos[1]=-999.0;
426  mPrimVertPos[2]=-999.0;
427  mTrackCollection = new StHbtTrackCollection;
428  mV0Collection = new StHbtV0Collection;
429  mXiCollection = new StHbtXiCollection;
430  mKinkCollection = new StHbtKinkCollection;
431  mMagneticField=0.0;
432 }
433 //___________________
434 StHbtEvent::StHbtEvent(const StHbtEvent& ev, StHbtTrackCut* tCut, StHbtV0Cut* vCut, StHbtXiCut* xCut, StHbtKinkCut* kCut){ // copy constructor with track and v0 cuts
435  //cout << "StHbtEvent::StHbtEvent(const StHbtEvent& ev, StHbtTrackCut* tCut, StHbtV0Cut* vCut, StHbtV0Cut* kCut)" << endl;
436  mEventNumber = ev.mEventNumber;
437  mRunNumber = ev.mRunNumber;
438  mCtbMultiplicity = ev.mCtbMultiplicity;
439  mZdcAdc[0] = ev.mZdcAdc[0];
440  mZdcAdc[1] = ev.mZdcAdc[1];
441  mTpcNhits = ev.mTpcNhits;
442  mNumberOfTracks = ev.mNumberOfTracks;
443  mNumberOfGoodTracks = ev.mNumberOfGoodTracks;
444  mUncorrectedNumberOfPositivePrimaries = ev.mUncorrectedNumberOfPositivePrimaries;
445  mUncorrectedNumberOfNegativePrimaries = ev.mUncorrectedNumberOfNegativePrimaries;
446  mUncorrectedNumberOfPrimaries = ev.mUncorrectedNumberOfPrimaries;
447  mReactionPlane[0] = ev.mReactionPlane[0];
448  mReactionPlane[1] = ev.mReactionPlane[1];
449  mReactionPlanePtWgt[0] = ev.mReactionPlanePtWgt[0];
450  mReactionPlanePtWgt[1] = ev.mReactionPlanePtWgt[1];
451  mPrimVertPos = ev.mPrimVertPos;
452  mMagneticField= ev.mMagneticField;
453  mTriggerWord = ev.mTriggerWord;
454  mTriggerActionWord = ev.mTriggerActionWord;
455  for ( int i=0; i<4; i++) mL3TriggerAlgorithm[i] = ev.mL3TriggerAlgorithm[i];
456 
457  // create collections
458  mTrackCollection = new StHbtTrackCollection;
459  mV0Collection = new StHbtV0Collection;
460  mXiCollection = new StHbtXiCollection;
461  mKinkCollection = new StHbtKinkCollection;
462  // copy track collection
463  for ( StHbtTrackIterator tIter=ev.mTrackCollection->begin(); tIter!=ev.mTrackCollection->end(); tIter++) {
464  if ( !tCut || tCut->Pass(*tIter) ) {
465  StHbtTrack* trackCopy = new StHbtTrack(**tIter);
466  mTrackCollection->push_back(trackCopy);
467  }
468  }
469  // copy v0 collection
470  for ( StHbtV0Iterator vIter=ev.mV0Collection->begin(); vIter!=ev.mV0Collection->end(); vIter++) {
471  if ( !vCut || vCut->Pass(*vIter) ) {
472  StHbtV0* v0Copy = new StHbtV0(**vIter);
473  mV0Collection->push_back(v0Copy);
474  }
475  }
476  // copy xi collection
477  for ( StHbtXiIterator xIter=ev.mXiCollection->begin(); xIter!=ev.mXiCollection->end(); xIter++) {
478  if ( !xCut || xCut->Pass(*xIter) ) {
479  StHbtXi* xiCopy = new StHbtXi(**xIter);
480  mXiCollection->push_back(xiCopy);
481  }
482  }
483  // copy kink collection
484  for ( StHbtKinkIterator kIter=ev.mKinkCollection->begin(); kIter!=ev.mKinkCollection->end(); kIter++) {
485  if ( !kCut || kCut->Pass(*kIter) ) {
486  //cout << " kinkCut passed " << endl;
487  StHbtKink* kinkCopy = new StHbtKink(**kIter);
488  mKinkCollection->push_back(kinkCopy);
489  }
490  }
491 }
492 //___________________
493 StHbtEvent::~StHbtEvent(){
494 #ifdef STHBTDEBUG
495  cout << " StHbtEvent::~StHbtEvent() " << endl;
496 #endif
497  for (StHbtTrackIterator iter=mTrackCollection->begin();iter!=mTrackCollection->end();iter++){
498  delete *iter;
499  }
500  mTrackCollection->clear();
501  delete mTrackCollection;
502  //must do the same for the V0 collection
503  for (StHbtV0Iterator V0iter=mV0Collection->begin();V0iter!=mV0Collection->end();V0iter++){
504  delete *V0iter;
505  }
506  //must do the same for the Xi collection
507  for (StHbtXiIterator XiIter=mXiCollection->begin();XiIter!=mXiCollection->end();XiIter++){
508  delete *XiIter;
509  }
510  mXiCollection->clear();
511  delete mXiCollection;
512  //must do the same for the Kink collection
513  for (StHbtKinkIterator kinkIter=mKinkCollection->begin();kinkIter!=mKinkCollection->end();kinkIter++){
514  delete *kinkIter;
515  }
516  mKinkCollection->clear();
517  delete mKinkCollection;
518 }
519 //___________________
520 void StHbtEvent::RotateZ(const double angle){
521 
522  StHbtTrackIterator iter;
523  StHbtV0Iterator V0iter;
524 
525  StPhysicalHelixD helix;
528  double c;
529 
530  mReactionPlane[0] += angle;
531  mReactionPlanePtWgt[0] += angle;
532  cout << " StHbtEvent::RotateZ(const double angle) - angle=" << angle << " rad ";
533  cout << angle / degree << " deg " << endl;
534  for (iter=mTrackCollection->begin();iter!=mTrackCollection->end();iter++){
535  p = (*iter)->P(); p.rotateZ(angle); (*iter)->SetP(p);
536  p= (*iter)->Helix().momentum(mMagneticField*kilogauss);
537  o= (*iter)->Helix().origin();
538  p.rotateZ(angle);
539  o.rotateZ(angle);
540  c= (*iter)->Helix().charge(mMagneticField*kilogauss);
541  helix = StPhysicalHelixD(p,o,mMagneticField*kilogauss,c);
542  (*iter)->SetHelix(helix);
543  }
544  for (V0iter=mV0Collection->begin();V0iter!=mV0Collection->end();V0iter++){
545  p=(*V0iter)->decayVertexV0(); p.rotateX(angle); (*V0iter)->SetdecayVertexV0(p);
546  p=(*V0iter)->momV0(); p.rotateX(angle); (*V0iter)->SetmomV0(p);
547  p=(*V0iter)->momPos(); p.rotateX(angle); (*V0iter)->SetmomPos(p);
548  p=(*V0iter)->momNeg(); p.rotateX(angle); (*V0iter)->SetmomNeg(p);
549  }
550 }
551 
552 
553 void StHbtEvent::SetEventNumber(const unsigned short& event){mEventNumber = event;}
554 void StHbtEvent::SetRunNumber(const int& runNum){mRunNumber = runNum;}
555 void StHbtEvent::SetCtbMult(const unsigned short& mult){mCtbMultiplicity = mult;}
556 void StHbtEvent::SetZdcAdcEast(const unsigned short& adc){mZdcAdc[0]= adc;}
557 void StHbtEvent::SetZdcAdcWest(const unsigned short& adc){mZdcAdc[1]=adc;}
558 void StHbtEvent::SetNumberOfTpcHits(const int& nhits){mTpcNhits = nhits;}
559 void StHbtEvent::SetNumberOfTracks(const unsigned short& tracks){mNumberOfTracks = tracks;}
560 void StHbtEvent::SetNumberOfGoodTracks(const unsigned short& tracks){mNumberOfGoodTracks = tracks;}
561 void StHbtEvent::SetUncorrectedNumberOfPositivePrimaries(const unsigned int& tracks){mUncorrectedNumberOfPositivePrimaries = tracks;}
562 void StHbtEvent::SetUncorrectedNumberOfNegativePrimaries(const unsigned int& tracks){mUncorrectedNumberOfNegativePrimaries = tracks;}
563 void StHbtEvent::SetUncorrectedNumberOfPrimaries(const unsigned int& tracks){mUncorrectedNumberOfPrimaries = tracks;}
564 void StHbtEvent::SetReactionPlane(const float& rp, const int& wgt){
565  (wgt) ? mReactionPlanePtWgt[0]=rp : mReactionPlane[0]=rp;
566 }
567 void StHbtEvent::SetReactionPlaneError(const float& rp, const int& wgt){ SetReactionPlaneSubEventDifference(rp,wgt); }
568 void StHbtEvent::SetReactionPlaneSubEventDifference(const float& rp, const int& wgt){
569  (wgt) ? mReactionPlanePtWgt[1]=rp : mReactionPlane[1]=rp;
570 }
571 void StHbtEvent::SetPrimVertPos(const StHbtThreeVector& vp){mPrimVertPos = vp;}
572 void StHbtEvent::SetMagneticField(const double& magF){mMagneticField = magF;}
573 void StHbtEvent::SetTriggerWord(const unsigned int& t){mTriggerWord = t;}
574 void StHbtEvent::SetTriggerActionWord(const unsigned int& t){mTriggerActionWord = t;}
575 void StHbtEvent::SetL3TriggerAlgorithm(const unsigned int& i, const unsigned int& t){mL3TriggerAlgorithm[i] = t;}
576 
577 unsigned short StHbtEvent::EventNumber() const {return mEventNumber;}
578 int StHbtEvent::RunNumber() const {return mRunNumber;}
579 unsigned short StHbtEvent::CtbMult() const {return mCtbMultiplicity;}
580 unsigned short StHbtEvent::ZdcAdcEast() const {return mZdcAdc[0];}
581 unsigned short StHbtEvent::ZdcAdcWest() const {return mZdcAdc[1];}
582 int StHbtEvent::NumberOfTpcHits() const {return mTpcNhits;}
583 unsigned short StHbtEvent::NumberOfTracks() const {return mNumberOfTracks;}
584 unsigned short StHbtEvent::NumberOfGoodTracks() const {return mNumberOfGoodTracks;}
585 unsigned int StHbtEvent::UncorrectedNumberOfPositivePrimaries() const {return mUncorrectedNumberOfPositivePrimaries;}
586 unsigned int StHbtEvent::UncorrectedNumberOfNegativePrimaries() const {return mUncorrectedNumberOfNegativePrimaries;}
587 unsigned int StHbtEvent::UncorrectedNumberOfPrimaries() const {return mUncorrectedNumberOfPrimaries;}
588 float StHbtEvent::ReactionPlane(const int& wgt) const {
589  return (wgt) ? mReactionPlanePtWgt[0] : mReactionPlane[0];
590 }
591 float StHbtEvent::ReactionPlaneError(const int& wgt) const {return ReactionPlaneSubEventDifference(wgt);}
592 float StHbtEvent::ReactionPlaneSubEventDifference(const int& wgt) const {
593  return (wgt) ? mReactionPlanePtWgt[0] : mReactionPlane[0];
594 }
595 StHbtV0Collection* StHbtEvent::V0Collection() const {return mV0Collection;}
596 StHbtXiCollection* StHbtEvent::XiCollection() const {return mXiCollection;}
597 StHbtKinkCollection* StHbtEvent::KinkCollection() const {return mKinkCollection;}
598 StHbtTrackCollection* StHbtEvent::TrackCollection() const {return mTrackCollection;}
599 StHbtThreeVector StHbtEvent::PrimVertPos() const {return mPrimVertPos;}
600 double StHbtEvent::MagneticField() const {return mMagneticField;}
601 unsigned int StHbtEvent::TriggerWord() const {return mTriggerWord;}
602 unsigned int StHbtEvent::TriggerActionWord() const {return mTriggerActionWord;}
603 unsigned int StHbtEvent::L3TriggerAlgorithm(const unsigned int& i) const {return mL3TriggerAlgorithm[i];}
static TObjArray * globalTracks()
returns pointer to the global tracks list
Definition: StMuDst.h:303
unsigned short refMultNeg(int vtx_id=-1)
Reference multiplicity of negative particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:184
static TClonesArray * v0s()
returns pointer to the v0 list
Definition: StMuDst.h:354
static StStrangeEvMuDst * strangeEvent()
returns pointer to current StStrangeEvMuDst (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:350
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
unsigned short refMult(int vtx_id=-1)
Reference multiplicity of charged particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:195
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
static TClonesArray * xis()
returns pointer to the xi list
Definition: StMuDst.h:360
unsigned short refMultPos(int vtx_id=-1)
Reference multiplicity of positive particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:173