00001 00002 // 00003 // $Id: StFlowMaker.h,v 1.55 2010/03/05 16:49:44 posk Exp $ 00004 // 00005 // Author List: 00006 // Raimond Snellings, Art Poskanzer, and Sergei Voloshin 6/99 00007 // FTPC added by Markus Oldenburg, MPI, Dec 2000 00008 // MuDst enabled by Kirill Filimonov, LBNL, Jun 2002 00009 // 00011 // 00012 // Description: 00013 // Maker to fill StFlowEvent from StEvent, picoevent, or muevent 00014 // 00016 00017 #ifndef StFlowMaker_H 00018 #define StFlowMaker_H 00019 #include <Stiostream.h> 00020 #include <stdlib.h> 00021 #include "StMaker.h" 00022 #include "TString.h" 00023 #include "TTree.h" 00024 #include "StFlowConstants.h" 00025 #include "StThreeVectorF.hh" 00026 #include "StPhysicalHelixD.hh" 00027 class StRunInfo; 00028 class StEvent; 00029 class StTrack; 00030 class StParticleDefinition; 00031 class StFlowEvent; 00032 class StFlowPicoTrack; 00033 class StFlowPicoEvent; 00034 class StMuDst; 00035 class StMuEvent; 00036 class StFlowSelection; 00037 class StIOMaker; 00038 class StFileI; 00039 class TChain; 00040 class TClonesArray; 00041 class StHbtEvent; // Randy added these 2 00042 class StHbtTrack; 00043 00044 class StFlowMaker : public StMaker { 00045 00046 public: 00047 00048 StFlowMaker(const Char_t* name="Flow"); 00049 StFlowMaker(const Char_t* name, 00050 const StFlowSelection& pFlowSelect); 00051 virtual ~StFlowMaker(); 00052 00053 Int_t Init(); 00054 Int_t InitRun(int runumber); 00055 Int_t Make(); 00056 Int_t Finish(); 00057 StFlowEvent* FlowEventPointer() const; 00058 void PicoEventWrite(Bool_t flag=kFALSE); 00059 void PicoEventRead(Bool_t flag=kFALSE); 00060 void MuEventRead(Bool_t flag=kFALSE); 00061 void SetPicoEventDir(const Char_t* name="./"); 00062 void SetPicoEventFileName(StFileI* fileList); 00063 void SetMuEventDir(const Char_t* name="./"); 00064 void SetMuEventFileName(StFileI* fileList); 00065 void SetReCentCalc(Bool_t flag=kTRUE); 00066 void SetPhiWgtCalc(Bool_t flag=kTRUE); 00067 Bool_t ReCentCalc(); 00068 Bool_t PhiWgtCalc(); 00069 void FillFlowEvent(StHbtEvent* hbtEvent); //rcwells added this 00070 00071 StFlowSelection* FlowSelection(); 00072 00073 virtual const char *GetCVS() const { static const char cvs[]= 00074 "Tag $Name: $ $Id: StFlowMaker.h,v 1.55 2010/03/05 16:49:44 posk Exp $ built "__DATE__" "__TIME__ ; 00075 return cvs; } 00076 00077 protected: 00078 00079 Flow::PhiWgt_t mPhiWgt; 00080 Flow::PhiWgt_t mPhiWgtFarEast; 00081 Flow::PhiWgt_t mPhiWgtEast; 00082 Flow::PhiWgt_t mPhiWgtWest; 00083 Flow::PhiWgt_t mPhiWgtFarWest; 00084 Flow::PhiWgtFtpc_t mPhiWgtFtpcFarEast; 00085 Flow::PhiWgtFtpc_t mPhiWgtFtpcEast; 00086 Flow::PhiWgtFtpc_t mPhiWgtFtpcWest; 00087 Flow::PhiWgtFtpc_t mPhiWgtFtpcFarWest; 00088 Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtWest; 00089 Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtEast; 00090 Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtFull; 00091 Double_t mZDCSMDCenterEx, mZDCSMDCenterEy; 00092 Double_t mZDCSMDCenterWx, mZDCSMDCenterWy; 00093 Double_t mZDCSMDPed[2][2][8]; 00094 Flow::ReCent_t mReCentX; 00095 Flow::ReCent_t mReCentY; 00096 00097 private: 00098 00099 TString mEventFileName; 00100 TString mEventFileNameOld; 00101 Char_t mPicoEventDir[64]; // Pico-DST directory name 00102 StFileI* pPicoFileList; 00103 Char_t mMuEventDir[64]; // Mu-DST directory name 00104 StFileI* pMuFileList; 00105 Bool_t mPicoEventWrite; // switch for pico-DST 00106 Bool_t mPicoEventRead; // switch for pico-DST 00107 Bool_t mMuEventRead; // switch for Mu-DST 00108 Bool_t mReCentCalc; // switch for recentering 00109 Bool_t mPhiWgtCalc; // switch for phi weighting 00110 UInt_t mEventCounter; // number of Bytes in pico event 00111 Bool_t mFirstLastPhiWgt; // use z of first-last for phi weights 00112 Int_t mRunID; // last run ID 00113 Int_t ReadPhiWgtFile(); // get the weight file 00114 Int_t ReadZDCSMDFile(); // get the ZDCSMD constants 00115 Int_t ReadReCentFile(); // get the recenting parameter file 00116 Int_t InitPicoEventWrite(); // open pico-DST 00117 Int_t InitPicoEventRead(); // open pico-DST 00118 Int_t InitMuEventRead(); // open Mu-DST 00119 Int_t InitEventRead(); // open StEvent 00120 void FillFlowEvent(); // fill the flow event 00121 void FillPicoEvent(); // fill pico-DST 00122 Bool_t FillFromPicoDST(StFlowPicoEvent* pPicoEvent); 00123 Bool_t FillFromPicoVersion7DST(StFlowPicoEvent* pPicoEvent); 00124 Bool_t FillFromMuDST(); 00125 void CloseEventRead(); // close StEvent 00126 void PrintSubeventMults(); // for testing 00127 StFlowSelection* pFlowSelect; 00128 StEvent* pEvent; 00129 StFlowEvent* pFlowEvent; 00130 StFlowPicoEvent* pPicoEvent; // pointer to pico-DST Event 00131 StIOMaker* pIOMaker; 00132 TTree* pFlowTree; // pointer to pico-DST Tree 00133 TFile* pPicoDST; 00134 TChain* pPicoChain; 00135 //TTree* pMuFlowTree; // pointer to mu-DST Tree 00136 TFile* pMuDST; 00137 TChain* pMuChain; 00138 StMuDst* pMu; 00139 StMuEvent* pMuEvent; 00140 //TClonesArray* pMuEvents; //! pointer to Mu-DST Event array (not used) 00141 TObjArray* pMuTracks; 00142 TObjArray* pMuGlobalTracks; 00143 00144 Float_t CalcDcaSigned(const StThreeVectorF pos, 00145 const StTrack* track); 00146 Float_t CalcDcaSigned(const StThreeVectorF vertex, 00147 const StPhysicalHelixD helix); 00148 00149 ClassDef(StFlowMaker,0) // macro for rootcint 00150 }; 00151 00152 inline StFlowEvent* StFlowMaker::FlowEventPointer() const { return pFlowEvent; } 00153 00154 inline void StFlowMaker::PicoEventWrite(Bool_t flag) { 00155 mPicoEventWrite=flag; 00156 if (flag) mPicoEventRead=kFALSE; } 00157 00158 inline void StFlowMaker::PicoEventRead(Bool_t flag) { 00159 mPicoEventRead=flag; 00160 if (flag) mPicoEventWrite=kFALSE; } 00161 00162 inline void StFlowMaker::MuEventRead(Bool_t flag) { 00163 mMuEventRead=flag; } 00164 00165 inline void StFlowMaker::SetPicoEventDir(const Char_t* name) { 00166 strncpy(mPicoEventDir, name, 63); mPicoEventDir[63] = '\0'; } 00167 00168 inline void StFlowMaker::SetPicoEventFileName(StFileI* fileList) { 00169 pPicoFileList = fileList; } 00170 00171 inline void StFlowMaker::SetMuEventDir(const Char_t* name) { 00172 strncpy(mMuEventDir, name, 63); mMuEventDir[63] = '\0'; } 00173 00174 inline void StFlowMaker::SetMuEventFileName(StFileI* fileList) { 00175 pMuFileList = fileList; } 00176 00177 inline StFlowSelection* StFlowMaker::FlowSelection() { 00178 return pFlowSelect; } 00179 00180 inline void StFlowMaker::SetReCentCalc(Bool_t flag) { 00181 mReCentCalc=flag; } 00182 00183 inline Bool_t StFlowMaker::ReCentCalc() { 00184 return mReCentCalc; } 00185 00186 inline void StFlowMaker::SetPhiWgtCalc(Bool_t flag) { 00187 mPhiWgtCalc=flag; } 00188 00189 inline Bool_t StFlowMaker::PhiWgtCalc() { 00190 return mPhiWgtCalc; } 00191 00192 00193 #endif 00194 00196 // 00197 // $Log: StFlowMaker.h,v $ 00198 // Revision 1.55 2010/03/05 16:49:44 posk 00199 // Compatable with ROOT 5.22 00200 // 00201 // Revision 1.54 2009/11/24 19:23:06 posk 00202 // Added reCenter option to remove acceptance correlations instead of phiWgt. 00203 // 00204 // Revision 1.53 2009/08/04 23:00:31 posk 00205 // Reads year 7 MuDsts. 00206 // 00207 // Revision 1.52 2009/07/28 16:11:55 posk 00208 // Reinstalled hbt stuff. 00209 // 00210 // Revision 1.51 2009/07/24 20:23:35 posk 00211 // Clean up: Removed John Wu's Grid Collector, reading any data before year4, and calculating event plane for hbt Maker. Kept only the most recent pico DST read. 00212 // 00213 // Revision 1.50 2007/02/06 18:58:00 posk 00214 // In Lee Yang Zeros method, introduced recentering of Q vector. 00215 // Reactivated eta symmetry cut. 00216 // 00217 // Revision 1.49 2006/02/22 19:25:39 posk 00218 // Changes needed for the MuDst 00219 // Stopped using eventSummary() 00220 // 00221 // Revision 1.48 2005/08/23 20:29:43 oldi 00222 // Latest fix to comply with MuDst changes. 00223 // 00224 // Revision 1.47 2005/08/19 19:49:13 oldi 00225 // Change to be in compliance with recent changes in the MuDsts. 00226 // 00227 // Revision 1.46 2005/07/06 19:39:26 fisyak 00228 // use templated version of StThreeVectorF and StPhysicalHelixD 00229 // 00230 // Revision 1.45 2005/02/10 17:39:42 posk 00231 // Now also works with the Grid Collector. 00232 // 00233 // Revision 1.44 2004/12/22 15:15:18 aihong 00234 // Read run-by-run beam shifts and SMD pedestal. Done by Gang 00235 // 00236 // Revision 1.42 2004/12/09 23:43:37 posk 00237 // Minor changes in code formatting. 00238 // 00239 // Revision 1.41 2004/12/07 17:04:48 posk 00240 // Eliminated the very old mOnePhiWgt, which used one phiWgt histogram for flttening 00241 // instead of four. 00242 // 00243 // Revision 1.40 2004/05/31 20:09:38 oldi 00244 // PicoDst format changed (Version 7) to hold ZDC SMD information. 00245 // Trigger cut modified to comply with TriggerCollections. 00246 // Centrality definition for 62 GeV data introduced. 00247 // Minor bug fixes. 00248 // 00249 // Revision 1.39 2004/05/05 21:13:44 aihong 00250 // Gang's code for ZDC-SMD added 00251 // 00252 // Revision 1.38 2003/12/12 02:33:06 oldi 00253 // Read from PicoDST version 4 enabled again (some simulations are in this format). 00254 // 00255 // Revision 1.37 2003/09/10 19:47:15 perev 00256 // ansi corrs 00257 // 00258 // Revision 1.36 2003/09/02 17:58:12 perev 00259 // gcc 3.2 updates + WarnOff 00260 // 00261 // Revision 1.35 2003/05/06 20:38:05 posk 00262 // Removed all but last two versions of pico file read. 00263 // 00264 // Revision 1.34 2003/01/10 16:42:31 oldi 00265 // Several changes to comply with FTPC tracks: 00266 // - Switch to include/exclude FTPC tracks introduced. 00267 // The same switch changes the range of the eta histograms. 00268 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots. 00269 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East, 00270 // West, FarWest (depending on vertex.z()). 00271 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added. 00272 // - Cut to exclude mu-events with no primary vertex introduced. 00273 // (This is possible for UPC events and FTPC tracks.) 00274 // - Global DCA cut for FTPC tracks added. 00275 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks. 00276 // - Charge cut for FTPC tracks added. 00277 // 00278 // Revision 1.33 2003/01/08 19:26:50 posk 00279 // PhiWgt hists sorted on sign of z of first and last points. 00280 // Version 6 of pico file. 00281 // 00282 // Revision 1.32 2002/06/10 22:51:02 posk 00283 // pt and eta weighting now default. 00284 // DcaGlobalPart default now 0 to 1 cm. 00285 // Event cut order changed. 00286 // 00287 // Revision 1.31 2002/06/07 22:18:42 kirill 00288 // Introduced MuDst reader 00289 // 00290 // Revision 1.30 2002/03/12 02:33:34 posk 00291 // Now makes pico files in SL02c. 00292 // 00293 // Revision 1.29 2002/02/01 23:06:53 snelling 00294 // Added entries for header information in flowPico (not everthing is available yet) 00295 // 00296 // Revision 1.28 2001/12/18 19:22:29 posk 00297 // "proton" and "antiproton" changed to "pr+" and "pr-". 00298 // Compiles on Solaris. 00299 // 00300 // Revision 1.27 2001/12/11 21:34:06 posk 00301 // Went from one to four sets of histograms for making the event plane isotropic. 00302 // StFlowEvent::PhiWeight() has changed arguments and return value. 00303 // The ptWgt saturates above 2 GeV/c. 00304 // 00305 // Revision 1.26 2001/07/27 20:33:45 snelling 00306 // switched from StRun to StEvtHddr. 00307 // 00308 // Revision 1.25 2001/07/27 01:26:30 snelling 00309 // Added and changed variables for picoEvent. Changed trackCut class to StTrack 00310 // 00311 // Revision 1.24 2001/07/24 22:29:26 snelling 00312 // First attempt to get a standard root pico file again, added variables 00313 // 00314 // Revision 1.23 2001/06/04 18:57:06 rcwells 00315 // Adding filling from HbtEvents 00316 // 00317 // Revision 1.22 2001/05/22 20:17:46 posk 00318 // Now can do pseudorapidity subevents. 00319 // 00320 // Revision 1.21 2000/12/12 20:22:05 posk 00321 // Put log comments at end of files. 00322 // Deleted persistent StFlowEvent (old micro DST). 00323 // 00324 // Revision 1.20 2000/12/08 17:03:39 oldi 00325 // Phi weights for both FTPCs included. 00326 // 00327 // Revision 1.19 2000/10/12 22:46:38 snelling 00328 // Added support for the new pDST's and the probability pid method 00329 // 00330 // Revision 1.18 2000/09/11 17:24:09 snelling 00331 // Put picoreader for different versions in seperate methods 00332 // 00333 // Revision 1.17 2000/08/31 18:58:24 posk 00334 // For picoDST, added version number, runID, and multEta for centrality. 00335 // Added centrality cut when reading picoDST. 00336 // Added pt and eta selections for particles corr. wrt event plane. 00337 // 00338 // Revision 1.16 2000/08/26 21:37:02 snelling 00339 // Removed flownanoevent, Added multiple input for pico, fixed IO bug 00340 // 00341 // Revision 1.15 2000/08/25 19:55:16 snelling 00342 // Changed naming pico files (1 pico per dst) 00343 // 00344 // Revision 1.14 2000/07/12 17:54:38 posk 00345 // Added chi2 and dca cuts. Multiplied EtaSym by ::sqrt(mult). 00346 // Apply cuts when reading picoevent file. 00347 // 00348 // Revision 1.13 2000/06/30 14:48:34 posk 00349 // Using MessageMgr, changed Eta Symmetry cut. 00350 // 00351 // Revision 1.12 2000/06/20 16:34:26 snelling 00352 // fixed cout/streamer problem for mPhiWgt under Solaris 00353 // 00354 // Revision 1.11 2000/06/01 18:26:37 posk 00355 // Increased precision of Track integer data members. 00356 // 00357 // Revision 1.10 2000/05/26 21:29:29 posk 00358 // Protected Track data members from overflow. 00359 // 00360 // Revision 1.9 2000/05/23 20:09:46 voloshin 00361 // added StFlowPicoEvent, persistent FlowEvent as plain root TTree 00362 // 00363 // Revision 1.7 2000/05/16 20:59:32 posk 00364 // Voloshin's flownanoevent.root added. 00365 // 00366 // Revision 1.6 2000/05/12 22:42:04 snelling 00367 // Additions for persistency and minor fix 00368 // 00369 // Revision 1.4 2000/03/28 23:21:03 posk 00370 // Allow multiple instances of the AnalysisMaker. 00371 // 00372 // Revision 1.3 2000/03/21 00:22:02 posk 00373 // Added GetCVS and some print commands. 00374 // 00375 // Revision 1.1 2000/03/02 23:02:54 posk 00376 // Changed extensions from .hh and .cc to .h and .cxx . 00377 // 00378 // Revision 1.10 2000/02/29 22:00:55 posk 00379 // Made SetPhiWeight inline, changed ImpactPar to Dca, etc. 00380 // 00381 // Revision 1.9 2000/02/18 22:49:57 posk 00382 // Added PID and centrality. 00383 // 00384 // Revision 1.5 1999/12/15 22:01:28 posk 00385 // Added StFlowConstants.hh 00386 // 00387 // Revision 1.4 1999/11/30 18:52:54 snelling 00388 // First modification for the new StEvent 00389 // 00390 // Revision 1.3 1999/11/24 18:17:15 posk 00391 // Put the methods which act on the data in with the data in StFlowEvent. 00392 // 00393 // Revision 1.1 1999/11/04 19:02:14 snelling 00394 // First check in of StFlowMaker. It contains the common code from 00395 // StFlowTagMaker and StFlowAnalysisMaker. 00396 //
1.5.9