StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowPicoEvent.cxx
1 //
3 // $Id: StFlowPicoEvent.cxx,v 1.15 2005/07/06 19:39:26 fisyak Exp $
4 //
5 // Author: Sergei Voloshin and Raimond Snellings, March 2000
6 //
7 // Description: A persistent Flow Pico DST
8 //
9 // The StFlowPicoEvent class has a simple event structure:
10 // TClonesArray *fTracks;
11 //
12 // The StFlowPicoEventHeader class:
13 // Int_t mNtrack; // track number
14 // Int_t mEventID; // event ID
15 // UInt_t mOrigMult; // number of StEvent tracks
16 // UInt_t mCentrality; // centrality bin
17 // Float_t mVertexX, Y, Z; // primary vertex position
18 //
19 // The StFlowPicoEvent data member fTracks is a pointer to a TClonesArray.
20 // It is an array of a variable number of tracks per Event.
21 // Each element of the array is an object of class StFlowTrack
22 //
24 
25 #include <Stiostream.h>
26 #include <math.h>
27 #include "StFlowPicoEvent.h"
28 #include "StFlowConstants.h"
29 #include "TClonesArray.h"
30 
31 ClassImp(StFlowPicoEvent)
32 
33 TClonesArray *StFlowPicoEvent::fgTracks = 0;
34 
35 //-----------------------------------------------------------------------
36 
38  // Create an StFlowPicoEvent object.
39  // When the constructor is invoked for the first time, the class static
40  // variable fgTracks is 0 and the TClonesArray fgTracks is created.
41 
42  if (!fgTracks) fgTracks = new TClonesArray("StFlowPicoTrack", 4000);
43  fTracks = fgTracks;
44  mNtrack = 0;
45  mVersion = 0;
46 }
47 
48 //-----------------------------------------------------------------------
49 
50 void StFlowPicoEvent::Clear(Option_t *option) {
51  fTracks->Clear(option);
52  mNtrack=0;
53 }
54 
55 //---------------------------------------------------------------------
56 
57 void StFlowPicoEvent::AddTrack(StFlowPicoTrack* inputTrack) {
58 
59  TClonesArray &tracks = *fTracks;
60  new(tracks[mNtrack++]) StFlowPicoTrack(inputTrack);
61 }
62 
63 //-----------------------------------------------------------------------
64 
65 UInt_t StFlowPicoEvent::CalcCentrality() {
66 
67  Int_t* cent = 0;
68  Int_t tracks = mMultEta; // converts UInt_t to Int_t
69 
70  if (mCenterOfMassEnergy == 0.) { // year=1
71  cent = Flow::cent130;
72  } else if (mCenterOfMassEnergy >= 199.) {
73  if (fabs(mMagneticField) >= 4.) { // year=2, Au+Au, Full Field
74  cent = Flow::cent200Full;
75  } else { // year=2, Au+Au, Half Field
76  cent = Flow::cent200Half;
77  }
78  } else if (mCenterOfMassEnergy <= 25.) { // year=2, 22 GeV
79  cent = Flow::cent22;
80  } else if (mCenterOfMassEnergy > 60. && mCenterOfMassEnergy < 65.) { // 62 GeV
81  cent = Flow::cent62;
82  }
83 
84  if (tracks < cent[0]) { mCentrality = 0; }
85  else if (tracks < cent[1]) { mCentrality = 1; }
86  else if (tracks < cent[2]) { mCentrality = 2; }
87  else if (tracks < cent[3]) { mCentrality = 3; }
88  else if (tracks < cent[4]) { mCentrality = 4; }
89  else if (tracks < cent[5]) { mCentrality = 5; }
90  else if (tracks < cent[6]) { mCentrality = 6; }
91  else if (tracks < cent[7]) { mCentrality = 7; }
92  else if (tracks < cent[8]) { mCentrality = 8; }
93  else { mCentrality = 9; }
94 
95  return mCentrality;
96 }
97 
99 //
100 // $Log: StFlowPicoEvent.cxx,v $
101 // Revision 1.15 2005/07/06 19:39:26 fisyak
102 // use templated version of StThreeVectorF and StPhysicalHelixD
103 //
104 // Revision 1.14 2004/08/24 20:24:36 oldi
105 // Minor modifications to avoid compiler warnings.
106 // Small bug fix (didn't affect anyone yet).
107 //
108 // Revision 1.13 2004/05/31 20:09:39 oldi
109 // PicoDst format changed (Version 7) to hold ZDC SMD information.
110 // Trigger cut modified to comply with TriggerCollections.
111 // Centrality definition for 62 GeV data introduced.
112 // Minor bug fixes.
113 //
114 // Revision 1.12 2003/09/02 17:58:12 perev
115 // gcc 3.2 updates + WarnOff
116 //
117 // Revision 1.11 2002/05/23 18:54:13 posk
118 // Moved centrality cuts into StFlowConstants
119 //
120 // Revision 1.10 2002/03/15 16:43:22 snelling
121 // Added a method to recalculate the centrality in StFlowPicoEvent
122 //
123 // Revision 1.9 2001/07/24 22:29:31 snelling
124 // First attempt to get a standard root pico file again, added variables
125 //
126 // Revision 1.8 2001/05/22 20:17:51 posk
127 // Now can do pseudorapidity subevents.
128 //
129 // Revision 1.7 2000/12/12 20:22:06 posk
130 // Put log comments at end of files.
131 // Deleted persistent StFlowEvent (old micro DST).
132 //
133 // Revision 1.6 2000/09/15 22:51:31 posk
134 // Added pt weighting for event plane calcualtion.
135 //
136 // Revision 1.5 2000/09/05 16:11:34 snelling
137 // Added global DCA, electron and positron
138 //
139 // Revision 1.4 2000/08/09 21:38:23 snelling
140 // PID added
141 //
142 // Revision 1.3 2000/06/01 18:26:39 posk
143 // Increased precision of Track integer data members.
144 //
145 // Revision 1.2 2000/05/26 21:29:31 posk
146 // Protected Track data members from overflow.
147 //
148 // Revision 1.1 2000/05/23 20:09:48 voloshin
149 // added StFlowPicoEvent, persistent FlowEvent as plain root TTree
150 //
151 // Revision 1.4 2000/05/16 20:59:33 posk
152 // Voloshin's flowPicoevent.root added.
153 //
155 
156 
157 
158