00001 00002 // 00003 // $Id: StFlowPicoEvent.cxx,v 1.15 2005/07/06 19:39:26 fisyak Exp $ 00004 // 00005 // Author: Sergei Voloshin and Raimond Snellings, March 2000 00006 // 00007 // Description: A persistent Flow Pico DST 00008 // 00009 // The StFlowPicoEvent class has a simple event structure: 00010 // TClonesArray *fTracks; 00011 // 00012 // The StFlowPicoEventHeader class: 00013 // Int_t mNtrack; // track number 00014 // Int_t mEventID; // event ID 00015 // UInt_t mOrigMult; // number of StEvent tracks 00016 // UInt_t mCentrality; // centrality bin 00017 // Float_t mVertexX, Y, Z; // primary vertex position 00018 // 00019 // The StFlowPicoEvent data member fTracks is a pointer to a TClonesArray. 00020 // It is an array of a variable number of tracks per Event. 00021 // Each element of the array is an object of class StFlowTrack 00022 // 00024 00025 #include <Stiostream.h> 00026 #include <math.h> 00027 #include "StFlowPicoEvent.h" 00028 #include "StFlowConstants.h" 00029 #include "TClonesArray.h" 00030 00031 ClassImp(StFlowPicoEvent) 00032 00033 TClonesArray *StFlowPicoEvent::fgTracks = 0; 00034 00035 //----------------------------------------------------------------------- 00036 00037 StFlowPicoEvent::StFlowPicoEvent() { 00038 // Create an StFlowPicoEvent object. 00039 // When the constructor is invoked for the first time, the class static 00040 // variable fgTracks is 0 and the TClonesArray fgTracks is created. 00041 00042 if (!fgTracks) fgTracks = new TClonesArray("StFlowPicoTrack", 4000); 00043 fTracks = fgTracks; 00044 mNtrack = 0; 00045 mVersion = 0; 00046 } 00047 00048 //----------------------------------------------------------------------- 00049 00050 void StFlowPicoEvent::Clear(Option_t *option) { 00051 fTracks->Clear(option); 00052 mNtrack=0; 00053 } 00054 00055 //--------------------------------------------------------------------- 00056 00057 void StFlowPicoEvent::AddTrack(StFlowPicoTrack* inputTrack) { 00058 00059 TClonesArray &tracks = *fTracks; 00060 new(tracks[mNtrack++]) StFlowPicoTrack(inputTrack); 00061 } 00062 00063 //----------------------------------------------------------------------- 00064 00065 UInt_t StFlowPicoEvent::CalcCentrality() { 00066 00067 Int_t* cent = 0; 00068 Int_t tracks = mMultEta; // converts UInt_t to Int_t 00069 00070 if (mCenterOfMassEnergy == 0.) { // year=1 00071 cent = Flow::cent130; 00072 } else if (mCenterOfMassEnergy >= 199.) { 00073 if (fabs(mMagneticField) >= 4.) { // year=2, Au+Au, Full Field 00074 cent = Flow::cent200Full; 00075 } else { // year=2, Au+Au, Half Field 00076 cent = Flow::cent200Half; 00077 } 00078 } else if (mCenterOfMassEnergy <= 25.) { // year=2, 22 GeV 00079 cent = Flow::cent22; 00080 } else if (mCenterOfMassEnergy > 60. && mCenterOfMassEnergy < 65.) { // 62 GeV 00081 cent = Flow::cent62; 00082 } 00083 00084 if (tracks < cent[0]) { mCentrality = 0; } 00085 else if (tracks < cent[1]) { mCentrality = 1; } 00086 else if (tracks < cent[2]) { mCentrality = 2; } 00087 else if (tracks < cent[3]) { mCentrality = 3; } 00088 else if (tracks < cent[4]) { mCentrality = 4; } 00089 else if (tracks < cent[5]) { mCentrality = 5; } 00090 else if (tracks < cent[6]) { mCentrality = 6; } 00091 else if (tracks < cent[7]) { mCentrality = 7; } 00092 else if (tracks < cent[8]) { mCentrality = 8; } 00093 else { mCentrality = 9; } 00094 00095 return mCentrality; 00096 } 00097 00099 // 00100 // $Log: StFlowPicoEvent.cxx,v $ 00101 // Revision 1.15 2005/07/06 19:39:26 fisyak 00102 // use templated version of StThreeVectorF and StPhysicalHelixD 00103 // 00104 // Revision 1.14 2004/08/24 20:24:36 oldi 00105 // Minor modifications to avoid compiler warnings. 00106 // Small bug fix (didn't affect anyone yet). 00107 // 00108 // Revision 1.13 2004/05/31 20:09:39 oldi 00109 // PicoDst format changed (Version 7) to hold ZDC SMD information. 00110 // Trigger cut modified to comply with TriggerCollections. 00111 // Centrality definition for 62 GeV data introduced. 00112 // Minor bug fixes. 00113 // 00114 // Revision 1.12 2003/09/02 17:58:12 perev 00115 // gcc 3.2 updates + WarnOff 00116 // 00117 // Revision 1.11 2002/05/23 18:54:13 posk 00118 // Moved centrality cuts into StFlowConstants 00119 // 00120 // Revision 1.10 2002/03/15 16:43:22 snelling 00121 // Added a method to recalculate the centrality in StFlowPicoEvent 00122 // 00123 // Revision 1.9 2001/07/24 22:29:31 snelling 00124 // First attempt to get a standard root pico file again, added variables 00125 // 00126 // Revision 1.8 2001/05/22 20:17:51 posk 00127 // Now can do pseudorapidity subevents. 00128 // 00129 // Revision 1.7 2000/12/12 20:22:06 posk 00130 // Put log comments at end of files. 00131 // Deleted persistent StFlowEvent (old micro DST). 00132 // 00133 // Revision 1.6 2000/09/15 22:51:31 posk 00134 // Added pt weighting for event plane calcualtion. 00135 // 00136 // Revision 1.5 2000/09/05 16:11:34 snelling 00137 // Added global DCA, electron and positron 00138 // 00139 // Revision 1.4 2000/08/09 21:38:23 snelling 00140 // PID added 00141 // 00142 // Revision 1.3 2000/06/01 18:26:39 posk 00143 // Increased precision of Track integer data members. 00144 // 00145 // Revision 1.2 2000/05/26 21:29:31 posk 00146 // Protected Track data members from overflow. 00147 // 00148 // Revision 1.1 2000/05/23 20:09:48 voloshin 00149 // added StFlowPicoEvent, persistent FlowEvent as plain root TTree 00150 // 00151 // Revision 1.4 2000/05/16 20:59:33 posk 00152 // Voloshin's flowPicoevent.root added. 00153 // 00155 00156 00157 00158
1.5.9