StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowMaker.h
1 //
3 // $Id: StFlowMaker.h,v 1.56 2014/08/06 11:43:15 jeromel Exp $
4 //
5 // Author List:
6 // Raimond Snellings, Art Poskanzer, and Sergei Voloshin 6/99
7 // FTPC added by Markus Oldenburg, MPI, Dec 2000
8 // MuDst enabled by Kirill Filimonov, LBNL, Jun 2002
9 //
11 //
12 // Description:
13 // Maker to fill StFlowEvent from StEvent, picoevent, or muevent
14 //
16 
17 #ifndef StFlowMaker_H
18 #define StFlowMaker_H
19 #include <Stiostream.h>
20 #include <stdlib.h>
21 #include "StMaker.h"
22 #include "TString.h"
23 #include "TTree.h"
24 #include "StFlowConstants.h"
25 #include "StThreeVectorF.hh"
26 #include "StPhysicalHelixD.hh"
27 class StRunInfo;
28 class StEvent;
29 class StTrack;
31 class StFlowEvent;
32 class StFlowPicoTrack;
33 class StFlowPicoEvent;
34 class StMuDst;
35 class StMuEvent;
36 class StFlowSelection;
37 class StIOMaker;
38 class StFileI;
39 class TChain;
40 class TClonesArray;
41 class StHbtEvent; // Randy added these 2
42 class StHbtTrack;
43 
44 class StFlowMaker : public StMaker {
45 
46 public:
47 
48  StFlowMaker(const Char_t* name="Flow");
49  StFlowMaker(const Char_t* name,
50  const StFlowSelection& pFlowSelect);
51  virtual ~StFlowMaker();
52 
53  Int_t Init();
54  Int_t InitRun(int runumber);
55  Int_t Make();
56  Int_t Finish();
57  StFlowEvent* FlowEventPointer() const;
58  void PicoEventWrite(Bool_t flag=kFALSE);
59  void PicoEventRead(Bool_t flag=kFALSE);
60  void MuEventRead(Bool_t flag=kFALSE);
61  void SetPicoEventDir(const Char_t* name="./");
62  void SetPicoEventFileName(StFileI* fileList);
63  void SetMuEventDir(const Char_t* name="./");
64  void SetMuEventFileName(StFileI* fileList);
65  void SetReCentCalc(Bool_t flag=kTRUE);
66  void SetPhiWgtCalc(Bool_t flag=kTRUE);
67  Bool_t ReCentCalc();
68  Bool_t PhiWgtCalc();
69  void FillFlowEvent(StHbtEvent* hbtEvent); //rcwells added this
70 
71  StFlowSelection* FlowSelection();
72 
73  virtual const char *GetCVS() const { static const char cvs[]=
74  "Tag $Name: $ $Id: StFlowMaker.h,v 1.56 2014/08/06 11:43:15 jeromel Exp $ built " __DATE__ " " __TIME__ ;
75  return cvs; }
76 
77 protected:
78 
79  Flow::PhiWgt_t mPhiWgt;
80  Flow::PhiWgt_t mPhiWgtFarEast;
81  Flow::PhiWgt_t mPhiWgtEast;
82  Flow::PhiWgt_t mPhiWgtWest;
83  Flow::PhiWgt_t mPhiWgtFarWest;
84  Flow::PhiWgtFtpc_t mPhiWgtFtpcFarEast;
85  Flow::PhiWgtFtpc_t mPhiWgtFtpcEast;
86  Flow::PhiWgtFtpc_t mPhiWgtFtpcWest;
87  Flow::PhiWgtFtpc_t mPhiWgtFtpcFarWest;
88  Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtWest;
89  Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtEast;
90  Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtFull;
91  Double_t mZDCSMDCenterEx, mZDCSMDCenterEy;
92  Double_t mZDCSMDCenterWx, mZDCSMDCenterWy;
93  Double_t mZDCSMDPed[2][2][8];
94  Flow::ReCent_t mReCentX;
95  Flow::ReCent_t mReCentY;
96 
97 private:
98 
99  TString mEventFileName;
100  TString mEventFileNameOld;
101  Char_t mPicoEventDir[64]; // Pico-DST directory name
102  StFileI* pPicoFileList;
103  Char_t mMuEventDir[64]; // Mu-DST directory name
104  StFileI* pMuFileList;
105  Bool_t mPicoEventWrite; // switch for pico-DST
106  Bool_t mPicoEventRead; // switch for pico-DST
107  Bool_t mMuEventRead; // switch for Mu-DST
108  Bool_t mReCentCalc; // switch for recentering
109  Bool_t mPhiWgtCalc; // switch for phi weighting
110  UInt_t mEventCounter; // number of Bytes in pico event
111  Bool_t mFirstLastPhiWgt; // use z of first-last for phi weights
112  Int_t mRunID; // last run ID
113  Int_t ReadPhiWgtFile(); // get the weight file
114  Int_t ReadZDCSMDFile(); // get the ZDCSMD constants
115  Int_t ReadReCentFile(); // get the recenting parameter file
116  Int_t InitPicoEventWrite(); // open pico-DST
117  Int_t InitPicoEventRead(); // open pico-DST
118  Int_t InitMuEventRead(); // open Mu-DST
119  Int_t InitEventRead(); // open StEvent
120  void FillFlowEvent(); // fill the flow event
121  void FillPicoEvent(); // fill pico-DST
122  Bool_t FillFromPicoDST(StFlowPicoEvent* pPicoEvent);
123  Bool_t FillFromPicoVersion7DST(StFlowPicoEvent* pPicoEvent);
124  Bool_t FillFromMuDST();
125  void CloseEventRead(); // close StEvent
126  void PrintSubeventMults(); // for testing
127  StFlowSelection* pFlowSelect;
128  StEvent* pEvent;
129  StFlowEvent* pFlowEvent;
130  StFlowPicoEvent* pPicoEvent; // pointer to pico-DST Event
131  StIOMaker* pIOMaker;
132  TTree* pFlowTree; // pointer to pico-DST Tree
133  TFile* pPicoDST;
134  TChain* pPicoChain;
135  //TTree* pMuFlowTree; // pointer to mu-DST Tree
136  TFile* pMuDST;
137  TChain* pMuChain;
138  StMuDst* pMu;
139  StMuEvent* pMuEvent;
140  //TClonesArray* pMuEvents; //! pointer to Mu-DST Event array (not used)
141  TObjArray* pMuTracks;
142  TObjArray* pMuGlobalTracks;
143 
144  Float_t CalcDcaSigned(const StThreeVectorF pos,
145  const StTrack* track);
146  Float_t CalcDcaSigned(const StThreeVectorF vertex,
147  const StPhysicalHelixD helix);
148 
149  ClassDef(StFlowMaker,0) // macro for rootcint
150 };
151 
152 inline StFlowEvent* StFlowMaker::FlowEventPointer() const { return pFlowEvent; }
153 
154 inline void StFlowMaker::PicoEventWrite(Bool_t flag) {
155  mPicoEventWrite=flag;
156  if (flag) mPicoEventRead=kFALSE; }
157 
158 inline void StFlowMaker::PicoEventRead(Bool_t flag) {
159  mPicoEventRead=flag;
160  if (flag) mPicoEventWrite=kFALSE; }
161 
162 inline void StFlowMaker::MuEventRead(Bool_t flag) {
163  mMuEventRead=flag; }
164 
165 inline void StFlowMaker::SetPicoEventDir(const Char_t* name) {
166  strncpy(mPicoEventDir, name, 63); mPicoEventDir[63] = '\0'; }
167 
168 inline void StFlowMaker::SetPicoEventFileName(StFileI* fileList) {
169  pPicoFileList = fileList; }
170 
171 inline void StFlowMaker::SetMuEventDir(const Char_t* name) {
172  strncpy(mMuEventDir, name, 63); mMuEventDir[63] = '\0'; }
173 
174 inline void StFlowMaker::SetMuEventFileName(StFileI* fileList) {
175  pMuFileList = fileList; }
176 
177 inline StFlowSelection* StFlowMaker::FlowSelection() {
178  return pFlowSelect; }
179 
180 inline void StFlowMaker::SetReCentCalc(Bool_t flag) {
181  mReCentCalc=flag; }
182 
183 inline Bool_t StFlowMaker::ReCentCalc() {
184  return mReCentCalc; }
185 
186 inline void StFlowMaker::SetPhiWgtCalc(Bool_t flag) {
187  mPhiWgtCalc=flag; }
188 
189 inline Bool_t StFlowMaker::PhiWgtCalc() {
190  return mPhiWgtCalc; }
191 
192 
193 #endif
194 
196 //
197 // $Log: StFlowMaker.h,v $
198 // Revision 1.56 2014/08/06 11:43:15 jeromel
199 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
200 //
201 // Revision 1.55 2010/03/05 16:49:44 posk
202 // Compatable with ROOT 5.22
203 //
204 // Revision 1.54 2009/11/24 19:23:06 posk
205 // Added reCenter option to remove acceptance correlations instead of phiWgt.
206 //
207 // Revision 1.53 2009/08/04 23:00:31 posk
208 // Reads year 7 MuDsts.
209 //
210 // Revision 1.52 2009/07/28 16:11:55 posk
211 // Reinstalled hbt stuff.
212 //
213 // Revision 1.51 2009/07/24 20:23:35 posk
214 // 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.
215 //
216 // Revision 1.50 2007/02/06 18:58:00 posk
217 // In Lee Yang Zeros method, introduced recentering of Q vector.
218 // Reactivated eta symmetry cut.
219 //
220 // Revision 1.49 2006/02/22 19:25:39 posk
221 // Changes needed for the MuDst
222 // Stopped using eventSummary()
223 //
224 // Revision 1.48 2005/08/23 20:29:43 oldi
225 // Latest fix to comply with MuDst changes.
226 //
227 // Revision 1.47 2005/08/19 19:49:13 oldi
228 // Change to be in compliance with recent changes in the MuDsts.
229 //
230 // Revision 1.46 2005/07/06 19:39:26 fisyak
231 // use templated version of StThreeVectorF and StPhysicalHelixD
232 //
233 // Revision 1.45 2005/02/10 17:39:42 posk
234 // Now also works with the Grid Collector.
235 //
236 // Revision 1.44 2004/12/22 15:15:18 aihong
237 // Read run-by-run beam shifts and SMD pedestal. Done by Gang
238 //
239 // Revision 1.42 2004/12/09 23:43:37 posk
240 // Minor changes in code formatting.
241 //
242 // Revision 1.41 2004/12/07 17:04:48 posk
243 // Eliminated the very old mOnePhiWgt, which used one phiWgt histogram for flttening
244 // instead of four.
245 //
246 // Revision 1.40 2004/05/31 20:09:38 oldi
247 // PicoDst format changed (Version 7) to hold ZDC SMD information.
248 // Trigger cut modified to comply with TriggerCollections.
249 // Centrality definition for 62 GeV data introduced.
250 // Minor bug fixes.
251 //
252 // Revision 1.39 2004/05/05 21:13:44 aihong
253 // Gang's code for ZDC-SMD added
254 //
255 // Revision 1.38 2003/12/12 02:33:06 oldi
256 // Read from PicoDST version 4 enabled again (some simulations are in this format).
257 //
258 // Revision 1.37 2003/09/10 19:47:15 perev
259 // ansi corrs
260 //
261 // Revision 1.36 2003/09/02 17:58:12 perev
262 // gcc 3.2 updates + WarnOff
263 //
264 // Revision 1.35 2003/05/06 20:38:05 posk
265 // Removed all but last two versions of pico file read.
266 //
267 // Revision 1.34 2003/01/10 16:42:31 oldi
268 // Several changes to comply with FTPC tracks:
269 // - Switch to include/exclude FTPC tracks introduced.
270 // The same switch changes the range of the eta histograms.
271 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots.
272 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East,
273 // West, FarWest (depending on vertex.z()).
274 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added.
275 // - Cut to exclude mu-events with no primary vertex introduced.
276 // (This is possible for UPC events and FTPC tracks.)
277 // - Global DCA cut for FTPC tracks added.
278 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks.
279 // - Charge cut for FTPC tracks added.
280 //
281 // Revision 1.33 2003/01/08 19:26:50 posk
282 // PhiWgt hists sorted on sign of z of first and last points.
283 // Version 6 of pico file.
284 //
285 // Revision 1.32 2002/06/10 22:51:02 posk
286 // pt and eta weighting now default.
287 // DcaGlobalPart default now 0 to 1 cm.
288 // Event cut order changed.
289 //
290 // Revision 1.31 2002/06/07 22:18:42 kirill
291 // Introduced MuDst reader
292 //
293 // Revision 1.30 2002/03/12 02:33:34 posk
294 // Now makes pico files in SL02c.
295 //
296 // Revision 1.29 2002/02/01 23:06:53 snelling
297 // Added entries for header information in flowPico (not everthing is available yet)
298 //
299 // Revision 1.28 2001/12/18 19:22:29 posk
300 // "proton" and "antiproton" changed to "pr+" and "pr-".
301 // Compiles on Solaris.
302 //
303 // Revision 1.27 2001/12/11 21:34:06 posk
304 // Went from one to four sets of histograms for making the event plane isotropic.
305 // StFlowEvent::PhiWeight() has changed arguments and return value.
306 // The ptWgt saturates above 2 GeV/c.
307 //
308 // Revision 1.26 2001/07/27 20:33:45 snelling
309 // switched from StRun to StEvtHddr.
310 //
311 // Revision 1.25 2001/07/27 01:26:30 snelling
312 // Added and changed variables for picoEvent. Changed trackCut class to StTrack
313 //
314 // Revision 1.24 2001/07/24 22:29:26 snelling
315 // First attempt to get a standard root pico file again, added variables
316 //
317 // Revision 1.23 2001/06/04 18:57:06 rcwells
318 // Adding filling from HbtEvents
319 //
320 // Revision 1.22 2001/05/22 20:17:46 posk
321 // Now can do pseudorapidity subevents.
322 //
323 // Revision 1.21 2000/12/12 20:22:05 posk
324 // Put log comments at end of files.
325 // Deleted persistent StFlowEvent (old micro DST).
326 //
327 // Revision 1.20 2000/12/08 17:03:39 oldi
328 // Phi weights for both FTPCs included.
329 //
330 // Revision 1.19 2000/10/12 22:46:38 snelling
331 // Added support for the new pDST's and the probability pid method
332 //
333 // Revision 1.18 2000/09/11 17:24:09 snelling
334 // Put picoreader for different versions in seperate methods
335 //
336 // Revision 1.17 2000/08/31 18:58:24 posk
337 // For picoDST, added version number, runID, and multEta for centrality.
338 // Added centrality cut when reading picoDST.
339 // Added pt and eta selections for particles corr. wrt event plane.
340 //
341 // Revision 1.16 2000/08/26 21:37:02 snelling
342 // Removed flownanoevent, Added multiple input for pico, fixed IO bug
343 //
344 // Revision 1.15 2000/08/25 19:55:16 snelling
345 // Changed naming pico files (1 pico per dst)
346 //
347 // Revision 1.14 2000/07/12 17:54:38 posk
348 // Added chi2 and dca cuts. Multiplied EtaSym by ::sqrt(mult).
349 // Apply cuts when reading picoevent file.
350 //
351 // Revision 1.13 2000/06/30 14:48:34 posk
352 // Using MessageMgr, changed Eta Symmetry cut.
353 //
354 // Revision 1.12 2000/06/20 16:34:26 snelling
355 // fixed cout/streamer problem for mPhiWgt under Solaris
356 //
357 // Revision 1.11 2000/06/01 18:26:37 posk
358 // Increased precision of Track integer data members.
359 //
360 // Revision 1.10 2000/05/26 21:29:29 posk
361 // Protected Track data members from overflow.
362 //
363 // Revision 1.9 2000/05/23 20:09:46 voloshin
364 // added StFlowPicoEvent, persistent FlowEvent as plain root TTree
365 //
366 // Revision 1.7 2000/05/16 20:59:32 posk
367 // Voloshin's flownanoevent.root added.
368 //
369 // Revision 1.6 2000/05/12 22:42:04 snelling
370 // Additions for persistency and minor fix
371 //
372 // Revision 1.4 2000/03/28 23:21:03 posk
373 // Allow multiple instances of the AnalysisMaker.
374 //
375 // Revision 1.3 2000/03/21 00:22:02 posk
376 // Added GetCVS and some print commands.
377 //
378 // Revision 1.1 2000/03/02 23:02:54 posk
379 // Changed extensions from .hh and .cc to .h and .cxx .
380 //
381 // Revision 1.10 2000/02/29 22:00:55 posk
382 // Made SetPhiWeight inline, changed ImpactPar to Dca, etc.
383 //
384 // Revision 1.9 2000/02/18 22:49:57 posk
385 // Added PID and centrality.
386 //
387 // Revision 1.5 1999/12/15 22:01:28 posk
388 // Added StFlowConstants.hh
389 //
390 // Revision 1.4 1999/11/30 18:52:54 snelling
391 // First modification for the new StEvent
392 //
393 // Revision 1.3 1999/11/24 18:17:15 posk
394 // Put the methods which act on the data in with the data in StFlowEvent.
395 //
396 // Revision 1.1 1999/11/04 19:02:14 snelling
397 // First check in of StFlowMaker. It contains the common code from
398 // StFlowTagMaker and StFlowAnalysisMaker.
399 //
Flow::ReCent_t mReCentY
Recentering parameters.
Definition: StFlowMaker.h:95
Flow::PhiWgtFtpc_t mPhiWgtFtpcFarWest
To make event plane isotropic.
Definition: StFlowMaker.h:87
Flow::ReCent_t mReCentX
ZDCSMD pedestal.
Definition: StFlowMaker.h:94
Int_t Make()
Definition: StFlowMaker.cxx:96
Flow::PhiWgt_t mPhiWgtWest
To make event plane isotropic.
Definition: StFlowMaker.h:82
Flow::PhiWgt_t mPhiWgtEast
To make event plane isotropic.
Definition: StFlowMaker.h:81
Double_t mZDCSMDPed[2][2][8]
ZDCSMD Beam Center.
Definition: StFlowMaker.h:93
Flow::PhiWgtFtpc_t mPhiWgtFtpcFarEast
To make event plane isotropic.
Definition: StFlowMaker.h:84
Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtWest
To make event plane isotropic.
Definition: StFlowMaker.h:88
Double_t mZDCSMDCenterEx
ZDCSMD full Psi.
Definition: StFlowMaker.h:91
Flow::PhiWgtFtpc_t mPhiWgtFtpcEast
To make event plane isotropic.
Definition: StFlowMaker.h:85
Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtEast
ZDCSMD west Psi.
Definition: StFlowMaker.h:89
Double_t mZDCSMDCenterWx
ZDCSMD Beam Center.
Definition: StFlowMaker.h:92
Flow::PhiWgt_t mPhiWgtFarEast
To make event plane isotropic.
Definition: StFlowMaker.h:80
Flow::PhiWgt_t mPhiWgtFarWest
To make event plane isotropic.
Definition: StFlowMaker.h:83
Int_t Finish()
Flow::PhiWgtFtpc_t mPhiWgtFtpcWest
To make event plane isotropic.
Definition: StFlowMaker.h:86
Flow::ZDCSMD_PsiWgt_t mZDCSMD_PsiWgtFull
ZDCSMD east Psi.
Definition: StFlowMaker.h:90