StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowMaker.cxx
1 //
3 // $Id: StFlowMaker.cxx,v 1.119 2010/09/30 19:30:28 posk Exp $
4 //
5 // Authors: Raimond Snellings and Art Poskanzer, LBNL, Jun 1999
6 // FTPC added by Markus Oldenburg, MPI, Dec 2000
7 // MuDst enabled by Kirill Filimonov, LBNL, Jun 2002
8 // ZDCSMD added by Aihong Tang, Dec 2004
10 //
11 // Description:
12 // Maker to fill StFlowEvent from StEvent, picoevent, or muevent
13 //
15 
16 #include <Stiostream.h>
17 #include <stdlib.h>
18 #include <math.h>
19 #include "StFlowMaker.h"
20 #include "StFlowEvent.h"
21 #include "StFlowPicoEvent.h"
22 #include "StFlowCutEvent.h"
23 #include "StFlowCutTrack.h"
24 #include "StFlowSelection.h"
25 #include "StFlowConstants.h"
26 #include "PhysicalConstants.h"
27 #include "SystemOfUnits.h"
28 #include "StEvent.h"
29 #include "StEventTypes.h"
30 #include "StThreeVector.hh"
31 #include "StIOMaker/StIOMaker.h"
32 #include "TFile.h"
33 #include "TTree.h"
34 #include "TBranch.h"
35 #include "TChain.h"
36 #include "TText.h"
37 #include "TH1.h"
38 #include "TH2.h"
39 #include "TProfile.h"
40 #include "TProfile2D.h"
41 #include "StuRefMult.hh"
42 #include "StPionPlus.hh"
43 #include "StPionMinus.hh"
44 #include "StProton.hh"
45 #include "StKaonMinus.hh"
46 #include "StKaonPlus.hh"
47 #include "StAntiProton.hh"
48 #include "StDeuteron.hh"
49 #include "StElectron.hh"
50 #include "StPositron.hh"
51 #include "StTpcDedxPidAlgorithm.h"
52 #include "StuProbabilityPidAlgorithm.h"
53 #include "StMessMgr.h"
54 #include "StMuDSTMaker/COMMON/StMuEvent.h"
55 #include "StMuDSTMaker/COMMON/StMuTrack.h"
56 #include "TClass.h"
57 #include "TDatime.h"
58 #include "StHbtMaker/StHbtMaker.h"
59 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
60 #define PR(x) cout << "##### FlowMaker: " << (#x) << " = " << (x) << endl;
61 
62 ClassImp(StFlowMaker)
63 
64 //-----------------------------------------------------------------------
65 
66 StFlowMaker::StFlowMaker(const Char_t* name):
67  StMaker(name),
68  mPicoEventWrite(kFALSE), mPicoEventRead(kFALSE), mMuEventRead(kFALSE),
69  pEvent(NULL) {
70  pFlowSelect = new StFlowSelection();
71  SetPicoEventDir("./");
72  StMuTrack::Class()->IgnoreTObjectStreamer();
73  StMuHelix::Class()->IgnoreTObjectStreamer();
74  pFlowEvent = NULL;
75 }
76 
77 StFlowMaker::StFlowMaker(const Char_t* name,
78  const StFlowSelection& flowSelect) :
79  StMaker(name),
80  mPicoEventWrite(kFALSE), mPicoEventRead(kFALSE), mMuEventRead(kFALSE),
81  pEvent(NULL) {
82  pFlowSelect = new StFlowSelection(flowSelect);
83  SetPicoEventDir("./");
84  StMuTrack::Class()->IgnoreTObjectStreamer();
85  StMuHelix::Class()->IgnoreTObjectStreamer();
86  pFlowEvent = NULL;
87 }
88 
89 //-----------------------------------------------------------------------
90 
91 StFlowMaker::~StFlowMaker() {
92 }
93 
94 //-----------------------------------------------------------------------
95 
97  if (Debug()) gMessMgr->Info() << "FlowMaker: Make() " << endm;
98 
99  // Delete previous StFlowEvent
100  if (pFlowEvent) delete pFlowEvent;
101  pFlowEvent = NULL;
102 
103  // Get the input file name from the IOMaker
104  if (!mPicoEventRead && pIOMaker) {
105  mEventFileName = strrchr(pIOMaker->GetFile(),'/')+1;
106  if (Debug()) {
107  gMessMgr->Info() << "FlowMaker: filename: " << mEventFileName << endm;
108  gMessMgr->Info() << "FlowMaker: Old filename: " << mEventFileNameOld << endm;
109  }
110 
111  // new file?
112  if (mEventFileName != mEventFileNameOld) {
113  //gMessMgr->Info() << "##### FlowMaker: " << mEventFileName << endm;
114  if (Debug()) gMessMgr->Info() << "##### FlowMaker: " << mEventFileName << endm;
115  if (mPicoEventWrite) {
116  if (pPicoDST->IsOpen()) {
117  pPicoDST->Write(0, TObject::kOverwrite);
118  pPicoDST->Close();
119  }
120  if (pPicoEvent) delete pPicoEvent;
121  if (pPicoDST) delete pPicoDST;
122  pPicoEvent = NULL;
123  pPicoDST = NULL;
124  InitPicoEventWrite();
125  }
126  mEventFileNameOld = mEventFileName;
127  }
128  }
129 
130  // Instantiate a new StFlowEvent
131  pFlowEvent = new StFlowEvent;
132  if (!pFlowEvent) return kStOK;
133 
134  // Get a pointer to the event read
135  if (mPicoEventRead) {
136  if (!FillFromPicoDST(pPicoEvent)) return kStEOF; // false if EOF
137  if (!pFlowEvent) return kStOK; // could have been deleted
138 
139  } else if (mMuEventRead) {
140  pMu = (StMuDst*)GetInputDS("MuDst");
141  if (pMu) {
142  pMuEvent = pMu->event();
143  pMuTracks = pMu->primaryTracks();
144  pMuGlobalTracks = pMu->globalTracks();
145  if (!FillFromMuDST()) return kStEOF; // false if EOF
146  if (!pFlowEvent) return kStOK; // could have been deleted
147  if (mPicoEventWrite) FillPicoEvent();
148  }
149  } else {
150  // StEvent
151  pEvent = dynamic_cast<StEvent*>(GetInputDS("StEvent"));
152  if (!pEvent) {
153  if (Debug()) { gMessMgr->Info() << "FlowMaker: no StEvent " << endm; }
154  return kStOK; // If no event, we're done
155  }
156  // Check the event cuts and fill StFlowEvent
157  if (StFlowCutEvent::CheckEvent(pEvent)) {
158  FillFlowEvent();
159  if (!pFlowEvent) return kStOK; // could have been deleted
160  if (mPicoEventWrite) FillPicoEvent();
161  } else {
162  Long_t eventID = pEvent->id();
163  gMessMgr->Info() << "##### FlowMaker: event " << eventID
164  << " cut" << endm;
165  return kStOK; // to prevent seg. fault when event does not survive
166  }
167  }
168  // if (Debug()) PrintSubeventMults();
169 
170  UInt_t flowEventMult;
171  if (!pFlowEvent) { flowEventMult = 0; }
172  else { flowEventMult = pFlowEvent->FlowEventMult(); }
173 
174  if (flowEventMult) { // to prevent seg. fault when no particles
175  // new run?
176  int runID = pFlowEvent->RunID();
177  if (runID != mRunID) {
178  double beamEnergy = pFlowEvent->CenterOfMassEnergy();
179  double magneticField = pFlowEvent->MagneticField();
180  short beamMassE = pFlowEvent->BeamMassNumberEast();
181  short beamMassW = pFlowEvent->BeamMassNumberWest();
182  if (Debug()) gMessMgr->Info() << "##### FlowMaker: " << runID << ", " <<
183  beamEnergy << " GeV/A " << beamMassE << "+" << beamMassW <<
184  ", B= " << magneticField << endm;
185  mRunID = runID;
186  if (pFlowEvent->UseZDCSMD()) {
187  Float_t RawZDCSMD[2][2][8];
188  Float_t ex,ey,wx,wy;
189  for (int strip=1; strip<9; strip++) {
190  RawZDCSMD[0][1][strip-1] = (pFlowEvent->ZDCSMD(0,1,strip))*
191  Flow::zdcsmdGainFac[0][1][strip-1] + mZDCSMDPed[0][1][strip-1];
192  RawZDCSMD[0][0][strip-1] = (pFlowEvent->ZDCSMD(0,0,strip))*
193  Flow::zdcsmdGainFac[0][0][strip-1] + mZDCSMDPed[0][0][strip-1];
194  RawZDCSMD[1][1][strip-1] = (pFlowEvent->ZDCSMD(1,1,strip))*
195  Flow::zdcsmdGainFac[1][1][strip-1] + mZDCSMDPed[1][1][strip-1];
196  RawZDCSMD[1][0][strip-1] = (pFlowEvent->ZDCSMD(1,0,strip))*
197  Flow::zdcsmdGainFac[1][0][strip-1] + mZDCSMDPed[1][0][strip-1];
198  }
199  ReadZDCSMDFile();
200  for (int strip=1; strip<9; strip++) {
201  ey = (RawZDCSMD[0][1][strip-1] - mZDCSMDPed[0][1][strip-1])/
202  Flow::zdcsmdGainFac[0][1][strip-1];
203  ex = (RawZDCSMD[0][0][strip-1] - mZDCSMDPed[0][0][strip-1])/
204  Flow::zdcsmdGainFac[0][0][strip-1];
205  wy = (RawZDCSMD[1][1][strip-1] - mZDCSMDPed[1][1][strip-1])/
206  Flow::zdcsmdGainFac[1][1][strip-1];
207  wx = (RawZDCSMD[1][0][strip-1] - mZDCSMDPed[1][0][strip-1])/
208  Flow::zdcsmdGainFac[1][0][strip-1];
209  if (!mPicoEventRead) {
210  pFlowEvent->SetZDCSMD(0,1,strip,ey);
211  pFlowEvent->SetZDCSMD(0,0,strip,ex);
212  pFlowEvent->SetZDCSMD(1,0,strip,wx);
213  pFlowEvent->SetZDCSMD(1,1,strip,wy);
214  }
215  }
216  pFlowEvent->SetZDCSMD_BeamCenter(mZDCSMDCenterEx, mZDCSMDCenterEy,
217  mZDCSMDCenterWx, mZDCSMDCenterWy);
218  if (mPicoEventWrite)
219  for (int i=0; i<2; i++) for (int j=0; j<2; j++) for (int k=1; k<9; k++)
220  pPicoEvent->SetZDCSMD(i,j,k,pFlowEvent->ZDCSMD(i,j,k));
221  }//UseZDCSMD
222  }
223  }
224 
225  if (Debug()) StMaker::PrintInfo();
226 
227  return kStOK;
228 }
229 
230 //-----------------------------------------------------------------------
231 
232 Int_t StFlowMaker::Init() {
233 
234  // init message manager
235  gMessMgr->MemoryOn();
236  gMessMgr->SetLimit("##### FlowMaker", 5);
237  gMessMgr->Info("##### FlowMaker: $Id: StFlowMaker.cxx,v 1.119 2010/09/30 19:30:28 posk Exp $");
238 
239  if (Debug()) gMessMgr->Info() << "FlowMaker: Init()" << endm;
240 
241  // Open PhiWgt or ReCent file
242  ReadPhiWgtFile();
243  ReadReCentFile();
244 
245  if (!mPicoEventRead || !mMuEventRead) { // StEvent
246  pIOMaker = (StIOMaker*)GetMaker("IO");
247  if (pIOMaker) {
248  mEventFileName = "";
249  mEventFileNameOld = mEventFileName;
250  }
251  }
252  StuProbabilityPidAlgorithm::readParametersFromFile("PIDTable.root");
253 
254  Int_t kRETURN = kStOK;
255  if (mPicoEventWrite) kRETURN += InitPicoEventWrite();
256  if (mPicoEventRead) kRETURN += InitPicoEventRead();
257  if (mMuEventRead) kRETURN += InitMuEventRead();;
258 
259  if (kRETURN) gMessMgr->Info() << "##### FlowMaker: Init return = " << kRETURN << endm;
260  return kRETURN;
261 }
262 
263 //-----------------------------------------------------------------------
264 
265 Int_t StFlowMaker::InitRun(int runID) {
266  if (Debug()) gMessMgr->Info() << "FlowMaker: InitRun()" << endm;
267  PR(runID);
268 
269  return kStOK;
270 }
271 
272 //-----------------------------------------------------------------------
273 
275  if (Debug()) gMessMgr->Info() << "FlowMaker: Finish()" << endm;
276 
277  // Print message summary
278  cout << endl;
279  gMessMgr->Summary(3);
280  cout << endl;
281 
282  // Print the date of completion
283  TDatime now;
284  cout << "#######################################################" << endl;
285  cout << "##### Finish time: " << now.AsString() << endl;
286 
287  // Print the selection object details
288  pFlowSelect->PrintList();
289 
290  // Print the cut lists
291  cout << "#######################################################" << endl;
292  cout << "##### FlowMaker: Cut Lists" << endl;
293  StFlowCutEvent::PrintCutList();
294  StFlowCutTrack::PrintCutList();
295  pFlowEvent->PrintSelectionList();
296 
297  if (mPicoEventWrite && pPicoDST->IsOpen()) {
298  pPicoDST->Write(0, TObject::kOverwrite);
299  pPicoDST->Close();
300  }
301 
302  return StMaker::Finish();
303 }
304 
305 //-----------------------------------------------------------------------
306 
307 Int_t StFlowMaker::ReadPhiWgtFile() {
308  // Read the PhiWgt root file
309 
310  if (Debug()) gMessMgr->Info() << "FlowMaker: ReadPhiWgtFile()" << endm;
311 
312  TDirectory* dirSave = gDirectory;
313  TFile* pPhiWgtFile = new TFile("flowPhiWgt.hist.root", "READ");
314  if (!pPhiWgtFile->IsOpen() || !mPhiWgtCalc) {
315  gMessMgr->Info("##### FlowMaker: No PhiWgt, will set weights = 1.");
316  }
317  if (!pPhiWgtFile->IsOpen() && mPhiWgtCalc) {
318  gMessMgr->Info("##### FlowMaker: Calculating PhiWgts");
319  }
320  gDirectory = dirSave;
321 
322  // Read text object
323  if (pPhiWgtFile->IsOpen() && mPhiWgtCalc) {
324  gMessMgr->Info("##### FlowMaker: PhiWgt flattening being done");
325  TText* textInfo = dynamic_cast<TText*>(pPhiWgtFile->Get("info"));
326  if (textInfo) {
327  mFirstLastPhiWgt = kTRUE;
328  gMessMgr->Info("##### FlowMaker: File uses z of first-last points");
329  cout << "##### FlowMaker: PhiWgt file written with " ;
330  textInfo->ls();
331  } else {
332  gMessMgr->Info("##### FlowMaker: File uses vertex z and eta");
333  }
334  }
335 
336  // Fill mPhiWgt for each selection, and odd and even harmonics
337  for (int k = 0; k < Flow::nSels; k++) {
338  for (int j = 0; j < 2; j++) {
339  // Tpc (FarEast)
340  TString* histTitleFarEast = new TString("Flow_Phi_Weight_FarEast_Sel");
341  *histTitleFarEast += k+1;
342  histTitleFarEast->Append("_Har");
343  *histTitleFarEast += j+1;
344  // Tpc (East)
345  TString* histTitleEast = new TString("Flow_Phi_Weight_East_Sel");
346  *histTitleEast += k+1;
347  histTitleEast->Append("_Har");
348  *histTitleEast += j+1;
349  // Tpc (West)
350  TString* histTitleWest = new TString("Flow_Phi_Weight_West_Sel");
351  *histTitleWest += k+1;
352  histTitleWest->Append("_Har");
353  *histTitleWest += j+1;
354  // Tpc (FarWest)
355  TString* histTitleFarWest = new TString("Flow_Phi_Weight_FarWest_Sel");
356  *histTitleFarWest += k+1;
357  histTitleFarWest->Append("_Har");
358  *histTitleFarWest += j+1;
359  // Ftpc (FarEast)
360  TString* histTitleFtpcFarEast = new TString("Flow_Phi_Weight_FtpcFarEast_Sel");
361  *histTitleFtpcFarEast += k+1;
362  histTitleFtpcFarEast->Append("_Har");
363  *histTitleFtpcFarEast += j+1;
364  // Ftpc (East)
365  TString* histTitleFtpcEast = new TString("Flow_Phi_Weight_FtpcEast_Sel");
366  *histTitleFtpcEast += k+1;
367  histTitleFtpcEast->Append("_Har");
368  *histTitleFtpcEast += j+1;
369  // Ftpc (West)
370  TString* histTitleFtpcWest = new TString("Flow_Phi_Weight_FtpcWest_Sel");
371  *histTitleFtpcWest += k+1;
372  histTitleFtpcWest->Append("_Har");
373  *histTitleFtpcWest += j+1;
374  // Ftpc (FarWest)
375  TString* histTitleFtpcFarWest = new TString("Flow_Phi_Weight_FtpcFarWest_Sel");
376  *histTitleFtpcFarWest += k+1;
377  histTitleFtpcFarWest->Append("_Har");
378  *histTitleFtpcFarWest += j+1;
379  if (pPhiWgtFile->IsOpen() && mPhiWgtCalc) { //use phiWgt
380  TH1* phiWgtHistFarEast = dynamic_cast<TH1*>(pPhiWgtFile->
381  Get(histTitleFarEast->Data()));
382  TH1* phiWgtHistEast = dynamic_cast<TH1*>(pPhiWgtFile->
383  Get(histTitleEast->Data()));
384  TH1* phiWgtHistWest = dynamic_cast<TH1*>(pPhiWgtFile->
385  Get(histTitleWest->Data()));
386  TH1* phiWgtHistFarWest = dynamic_cast<TH1*>(pPhiWgtFile->
387  Get(histTitleFarWest->Data()));
388  for (int n = 0; n < Flow::nPhiBins; n++) {
389  mPhiWgtFarEast[k][j][n] = (phiWgtHistFarEast) ?
390  phiWgtHistFarEast->GetBinContent(n+1) : 1.;
391  mPhiWgtEast[k][j][n] = (phiWgtHistEast) ?
392  phiWgtHistEast->GetBinContent(n+1) : 1.;
393  mPhiWgtWest[k][j][n] = (phiWgtHistWest) ?
394  phiWgtHistWest->GetBinContent(n+1) : 1.;
395  mPhiWgtFarWest[k][j][n] = (phiWgtHistFarWest) ?
396  phiWgtHistFarWest->GetBinContent(n+1) : 1.;
397  }
398  TH1* phiWgtHistFtpcFarEast = dynamic_cast<TH1*>(pPhiWgtFile->
399  Get(histTitleFtpcFarEast->Data()));
400  TH1* phiWgtHistFtpcEast = dynamic_cast<TH1*>(pPhiWgtFile->
401  Get(histTitleFtpcEast->Data()));
402  TH1* phiWgtHistFtpcWest = dynamic_cast<TH1*>(pPhiWgtFile->
403  Get(histTitleFtpcWest->Data()));
404  TH1* phiWgtHistFtpcFarWest = dynamic_cast<TH1*>(pPhiWgtFile->
405  Get(histTitleFtpcFarWest->Data()));
406  for (int n = 0; n < Flow::nPhiBinsFtpc; n++) {
407  mPhiWgtFtpcFarEast[k][j][n] = (phiWgtHistFtpcFarEast) ?
408  phiWgtHistFtpcFarEast->GetBinContent(n+1) : 1.;
409  mPhiWgtFtpcEast[k][j][n] = (phiWgtHistFtpcEast) ?
410  phiWgtHistFtpcEast->GetBinContent(n+1) : 1.;
411  mPhiWgtFtpcWest[k][j][n] = (phiWgtHistFtpcWest) ?
412  phiWgtHistFtpcWest->GetBinContent(n+1) : 1.;
413  mPhiWgtFtpcFarWest[k][j][n] = (phiWgtHistFtpcFarWest) ?
414  phiWgtHistFtpcFarWest->GetBinContent(n+1) : 1.;
415  }
416 
417  } else { //phiWgts = 1
418  for (int n = 0; n < Flow::nPhiBins; n++) {
419  mPhiWgt[k][j][n] = 1.;
420  mPhiWgtFarEast[k][j][n] = 1.;
421  mPhiWgtEast[k][j][n] = 1.;
422  mPhiWgtWest[k][j][n] = 1.;
423  mPhiWgtFarWest[k][j][n] = 1.;
424  }
425 
426  for (int n = 0; n < Flow::nPhiBinsFtpc; n++) {
427  mPhiWgtFtpcFarEast[k][j][n] = 1.;
428  mPhiWgtFtpcWest[k][j][n] = 1.;
429  mPhiWgtFtpcEast[k][j][n] = 1.;
430  mPhiWgtFtpcFarWest[k][j][n] = 1.;
431  }
432 
433  }
434 
435  delete histTitleFarEast;
436  delete histTitleEast;
437  delete histTitleWest;
438  delete histTitleFarWest;
439  delete histTitleFtpcFarEast;
440  delete histTitleFtpcEast;
441  delete histTitleFtpcWest;
442  delete histTitleFtpcFarWest;
443  }
444  }//phiWgt
445 
446  // ZDCSMD psi Wgt
447  if (pPhiWgtFile->IsOpen()) {
448  TH1* mZDCSMDPsiWest = (TH1*)pPhiWgtFile->Get("Flow_ZDCSMDPsiWgtWest");
449  TH1* mZDCSMDPsiEast = (TH1*)pPhiWgtFile->Get("Flow_ZDCSMDPsiWgtEast");
450  TH1* mZDCSMDPsiFull = (TH1*)pPhiWgtFile->Get("Flow_ZDCSMDPsiWgtFull");
451  if (mZDCSMDPsiWest && mZDCSMDPsiEast) { //Weight histograms exist
452  Float_t mZDCSMDPsiWest_mean = (mZDCSMDPsiWest->Integral())/(mZDCSMDPsiWest->GetNbinsX());
453  Float_t mZDCSMDPsiEast_mean = (mZDCSMDPsiEast->Integral())/(mZDCSMDPsiEast->GetNbinsX());
454  for (int n = 0; n < Flow::zdcsmd_nPsiBins; n++) {
455  mZDCSMD_PsiWgtWest[n] = ((mZDCSMDPsiWest->GetBinContent(n+1))>0.) ?
456  mZDCSMDPsiWest_mean/(mZDCSMDPsiWest->GetBinContent(n+1)):1.;
457  mZDCSMD_PsiWgtEast[n] = ((mZDCSMDPsiEast->GetBinContent(n+1))>0.) ?
458  mZDCSMDPsiEast_mean/(mZDCSMDPsiEast->GetBinContent(n+1)):1.;
459  } // zdcsmd_nPsiBins
460  if (mZDCSMDPsiFull) {
461  Float_t mZDCSMDPsiFull_mean = (mZDCSMDPsiFull->Integral())/(mZDCSMDPsiFull->GetNbinsX());
462  for (int n = 0; n < Flow::zdcsmd_nPsiBins; n++) {
463  mZDCSMD_PsiWgtFull[n] = ((mZDCSMDPsiFull->GetBinContent(n+1))>0.) ?
464  mZDCSMDPsiFull_mean/(mZDCSMDPsiFull->GetBinContent(n+1)):1.;
465  }
466  } else{ // mZDCSMDPsiFull doesn't exist
467  for (int n=0;n < Flow::zdcsmd_nPsiBins;n++) {
468  mZDCSMD_PsiWgtFull[n] = 1.;
469  }
470  }
471  } else { // Weight histograms don't exist
472  for (int n=0;n < Flow::zdcsmd_nPsiBins;n++) {
473  mZDCSMD_PsiWgtWest[n] = 1.;
474  mZDCSMD_PsiWgtEast[n] = 1.;
475  mZDCSMD_PsiWgtFull[n] = 1.;
476  } // zdcsmd_nPsiBins
477  }
478  } else { // no pPhiWgtFile
479  for (int n=0;n < Flow::zdcsmd_nPsiBins;n++) {
480  mZDCSMD_PsiWgtWest[n] = 1.;
481  mZDCSMD_PsiWgtEast[n] = 1.;
482  mZDCSMD_PsiWgtFull[n] = 1.;
483  }
484  }//ZDCSMD
485 
486  // Close PhiWgt file
487  if (pPhiWgtFile->IsOpen()) pPhiWgtFile->Close();
488 
489  return kStOK;
490 }
491 
492 //-----------------------------------------------------------------------
493 
494 Int_t StFlowMaker::ReadReCentFile() {
495  // Read the recentering flow.reCentAna.root file
496 
497  if (Debug()) gMessMgr->Info() << "FlowMaker: ReadReCentFile()" << endm;
498 
499  TDirectory* dirSave = gDirectory;
500  TFile* pReCentFile = new TFile("flow.reCentAna.root", "READ");
501  if (pReCentFile->IsOpen() && mReCentCalc) {
502  gMessMgr->Info("##### FlowMaker: ReCentering being done.");
503  }
504  if (mReCentCalc) {
505  gMessMgr->Info("##### FlowMaker: Calculating ReCentering parameters.");
506  } else {
507  gMessMgr->Info("##### FlowMaker: Will set ReCentering parameters = 0.");
508  }
509  gDirectory = dirSave;
510 
511  // Fill mReCentX,Y for each selection and harmonic
512  if (pReCentFile->IsOpen() && mReCentCalc) {
513  for (int k = 0; k < Flow::nSels; k++) {
514  for (int j = 0; j < Flow::nHars; j++) {
515  TString* histTitleTPC_x = new TString("FlowReCentX_Sel");
516  *histTitleTPC_x += k+1;
517  *histTitleTPC_x += "_Har";
518  *histTitleTPC_x += j+1;
519  TString* histTitleTPC_y = new TString("FlowReCentY_Sel");
520  *histTitleTPC_y += k+1;
521  *histTitleTPC_y += "_Har";
522  *histTitleTPC_y += j+1;
523  TProfile* histCentX = dynamic_cast<TProfile*>(pReCentFile->Get(histTitleTPC_x->Data()));
524  TProfile* histCentY = dynamic_cast<TProfile*>(pReCentFile->Get(histTitleTPC_y->Data()));
525  if (!histCentX || !histCentY) {
526  gMessMgr->Info("##### FlowMaker: No ReCent hists.");
527  }
528  for (int n = 0; n < 4; n++) {
529  mReCentX[k][j][n] = (histCentX) ? histCentX->GetBinContent(n+1) : 0.;
530  mReCentY[k][j][n] = (histCentY) ? histCentY->GetBinContent(n+1) : 0.;
531  //PR(mReCentX[k][j][n]);
532  }
533  delete histTitleTPC_x;
534  delete histTitleTPC_y;
535  }
536  }
537  } else {
538  for (int k = 0; k < Flow::nSels; k++) {
539  for (int j = 0; j < Flow::nHars; j++) {
540  for (int n = 0; n < 4; n++) {
541  mReCentX[k][j][n] = 0.;
542  mReCentY[k][j][n] = 0.;
543  }
544  }
545  }
546  }
547 
548  // Close ReCent file
549  if (pReCentFile->IsOpen()) pReCentFile->Close();
550 
551  return kStOK;
552 }
553 
554 //-----------------------------------------------------------------------
555 
556 Int_t StFlowMaker::ReadZDCSMDFile() {
557  // Read the ZDCSMD constants root file
558 
559  if (Debug()) gMessMgr->Info() << "FlowMaker: ReadZDCSMDFile()" << endm;
560 
561  TDirectory* dirSave = gDirectory;
562  TFile* pZDCSMDConstFile = new TFile("zdcsmdConstants.root", "READ");
563  if (!pZDCSMDConstFile->IsOpen()) {
564  gMessMgr->Info("##### FlowMaker: No ZDCSMD constant file. Will use default.");
565  } else { gMessMgr->Info("##### FlowMaker: ZDCSMD constant file read."); }
566  gDirectory = dirSave;
567  int mRealRunID = mRunID;
568  Double_t HistTest = 0.;
569  if (pZDCSMDConstFile->IsOpen()) {
570  TH2* mZDCSMDBeamCenter2D = (TH2D *)pZDCSMDConstFile->Get("ZDCSMDBeamCenter");
571  while (HistTest < 1.) {
572  HistTest = mZDCSMDBeamCenter2D->GetBinContent(1,mRealRunID-5050000);
573  if (HistTest > 1.) break;
574  mRealRunID -= 1;
575  if (mRealRunID < 5050000) break;
576  }
577  if (mRealRunID < 5050000) {
578  mZDCSMDCenterEx = Flow::zdcsmd_ex0;
579  mZDCSMDCenterEy = Flow::zdcsmd_ey0;
580  mZDCSMDCenterWx = Flow::zdcsmd_wx0;
581  mZDCSMDCenterWy = Flow::zdcsmd_wy0;
582  } else {
583  mZDCSMDCenterEx = HistTest;
584  mZDCSMDCenterEy = mZDCSMDBeamCenter2D->GetBinContent(2,mRealRunID-5050000);
585  mZDCSMDCenterWx = mZDCSMDBeamCenter2D->GetBinContent(3,mRealRunID-5050000);
586  mZDCSMDCenterWy = mZDCSMDBeamCenter2D->GetBinContent(4,mRealRunID-5050000);
587  }
588  } else {
589  mZDCSMDCenterEx = Flow::zdcsmd_ex0;
590  mZDCSMDCenterEy = Flow::zdcsmd_ey0;
591  mZDCSMDCenterWx = Flow::zdcsmd_wx0;
592  mZDCSMDCenterWy = Flow::zdcsmd_wy0;
593  }
594  if (pZDCSMDConstFile->IsOpen()) {
595  mRealRunID = mRunID;
596  HistTest = 0.;
597  TH2* mZDCSMDPed2D = (TH2D*)pZDCSMDConstFile->Get("ZDCSMDPedestal");
598  while(HistTest < .1) {
599  HistTest = mZDCSMDPed2D->GetBinContent(1,mRealRunID-5050000);
600  if (HistTest > .1) break;
601  mRealRunID -= 1;
602  if (mRealRunID < 5050000) break;
603  }
604  if (mRealRunID < 5050000) {
605  for (int i=0;i<2;i++) {for (int j=0;j<2;j++){for (int k=0;k<8;k++) {
606  mZDCSMDPed[i][j][k] = Flow::zdcsmdPedstal[i][j][k];
607  }}} // for
608  } else {
609  int zdcsmd_map[2][2][8] = {
610  { { 7, 6, 5, 4, 3, 2, 1, 11} ,
611  { 0,15,14,13,12,8,10, 9} } ,
612  { {23,22,21,20,19,18,17,(mRealRunID < 8083000)?24:26} ,
613  {16,31,30,29,28,27,(mRealRunID < 8083000)?26:24,25} }
614  };
615  for (int i=0;i<2;i++) {for (int j=0;j<2;j++){for (int k=0;k<8;k++) {
616  mZDCSMDPed[i][j][k] = mZDCSMDPed2D->GetBinContent(zdcsmd_map[i][j][k]+1,
617  mRealRunID-5050000);
618  }}} // for
619  }
620  } else {
621  for (int i=0;i<2;i++) {for (int j=0;j<2;j++){for (int k=0;k<8;k++) {
622  mZDCSMDPed[i][j][k] = Flow::zdcsmdPedstal[i][j][k];
623  }}} // for
624  }
625 
626  // Close ZDCSMD constants file
627  if (pZDCSMDConstFile->IsOpen()) pZDCSMDConstFile->Close();
628 
629  return kStOK;
630 }
631 
632 //-----------------------------------------------------------------------
633 
634 void StFlowMaker::FillFlowEvent() {
635  // Make StFlowEvent from StEvent
636 
637  if (Debug()) gMessMgr->Info() << "FlowMaker: FillFlowEvent()" << endm;
638 
639  // Fill PhiWgt array
640  if (mFirstLastPhiWgt) pFlowEvent->SetFirstLastPhiWgt();
641  pFlowEvent->SetPhiWeightFarEast(mPhiWgtFarEast);
642  pFlowEvent->SetPhiWeightEast(mPhiWgtEast);
643  pFlowEvent->SetPhiWeightWest(mPhiWgtWest);
644  pFlowEvent->SetPhiWeightFarWest(mPhiWgtFarWest);
645  pFlowEvent->SetPhiWeightFtpcFarEast(mPhiWgtFtpcFarEast);
646  pFlowEvent->SetPhiWeightFtpcEast(mPhiWgtFtpcEast);
647  pFlowEvent->SetPhiWeightFtpcWest(mPhiWgtFtpcWest);
648  pFlowEvent->SetPhiWeightFtpcFarWest(mPhiWgtFtpcFarWest);
649  pFlowEvent->SetFirstLastPoints();
650  pFlowEvent->SetZDCSMD_PsiWeightWest(mZDCSMD_PsiWgtWest);
651  pFlowEvent->SetZDCSMD_PsiWeightEast(mZDCSMD_PsiWgtEast);
652  pFlowEvent->SetZDCSMD_PsiWeightFull(mZDCSMD_PsiWgtFull);
653  pFlowEvent->SetZDCSMD_BeamCenter(mZDCSMDCenterEx,mZDCSMDCenterEy,mZDCSMDCenterWx,
654  mZDCSMDCenterWy);
655 
656  // fill ReCent array
657  pFlowEvent->SetReCentX(mReCentX);
658  pFlowEvent->SetReCentY(mReCentY);
659 
660  // Get event id
661  pFlowEvent->SetEventID((Int_t)(pEvent->id()));
662  pFlowEvent->SetRunID((Int_t)(pEvent->runId()));
663 
664  if (pEvent->runInfo()) {
665  pFlowEvent->SetCenterOfMassEnergy(pEvent->runInfo()->centerOfMassEnergy());
666  pFlowEvent->SetMagneticField(pEvent->runInfo()->magneticField());
667  pFlowEvent->SetBeamMassNumberEast(pEvent->runInfo()->beamMassNumber(east));
668  pFlowEvent->SetBeamMassNumberWest(pEvent->runInfo()->beamMassNumber(west));
669  } else {
670  gMessMgr->Info() << "FlowMaker: no Run Info, reverting to year 1 settings "
671  << endm;
672  pFlowEvent->SetCenterOfMassEnergy(130);
673  pFlowEvent->SetMagneticField(4.98);
674  pFlowEvent->SetBeamMassNumberEast(197);
675  pFlowEvent->SetBeamMassNumberWest(197);
676  }
677 
678  // Get Trigger information
679  if (pEvent->runId() > 4000000) { // trigger collections
680  pFlowEvent->SetL0TriggerWord(StFlowCutEvent::TriggersFound()); // triggerWord is obsolete
681  } else {
682  StL0Trigger* pTrigger = pEvent->l0Trigger();
683  if (pTrigger) { pFlowEvent->SetL0TriggerWord(pTrigger->triggerWord()); }
684  }
685 
686  // Get primary vertex position
687  const StThreeVectorF& vertex = pEvent->primaryVertex(0)->position();
688  pFlowEvent->SetVertexPos(vertex);
689 
690  // include trigger (ZDC and CTB)
691  Float_t ctb = -1.;
692  Float_t zdce = -1.;
693  Float_t zdcw = -1.;
694  Float_t zdcsmdEastHorizontal = -1.;
695  Float_t zdcsmdEastVertical = -1.;
696  Float_t zdcsmdWestHorizontal = -1.;
697  Float_t zdcsmdWestVertical = -1.;
698  StTriggerDetectorCollection *triggers = pEvent->triggerDetectorCollection();
699  if (triggers) {
700  StCtbTriggerDetector &CTB = triggers->ctb();
701  StZdcTriggerDetector &ZDC = triggers->zdc();
702  // Get CTB
703  for (UInt_t slat = 0; slat < CTB.numberOfSlats(); slat++) {
704  for (UInt_t tray = 0; tray < CTB.numberOfTrays(); tray++) {
705  ctb += CTB.mips(tray,slat,0);
706  }
707  }
708  // Get ZDCe and ZDCw
709  zdce = ZDC.adcSum(east);
710  zdcw = ZDC.adcSum(west);
711  // Get ZDCSMD pedstal-subtracted and gain-corrected
712  for (int strip=1;strip<9;strip++) {
713  if (ZDC.zdcSmd(east,1,strip)) {
714  zdcsmdEastHorizontal = (ZDC.zdcSmd(east,1,strip)
715  -mZDCSMDPed[0][1][strip-1])/Flow::zdcsmdGainFac[0][1][strip-1];
716  pFlowEvent->SetZDCSMD(0,1,strip,zdcsmdEastHorizontal);
717  }
718  if (ZDC.zdcSmd(east,0,strip)) {
719  zdcsmdEastVertical = (ZDC.zdcSmd(east,0,strip)
720  -mZDCSMDPed[0][0][strip-1])/Flow::zdcsmdGainFac[0][0][strip-1];
721  pFlowEvent->SetZDCSMD(0,0,strip,zdcsmdEastVertical);
722  }
723  if (ZDC.zdcSmd(west,1,strip)) {
724  zdcsmdWestHorizontal = (ZDC.zdcSmd(west,1,strip)
725  -mZDCSMDPed[1][1][strip-1])/Flow::zdcsmdGainFac[1][1][strip-1];
726  pFlowEvent->SetZDCSMD(1,1,strip,zdcsmdWestHorizontal);
727  }
728  if (ZDC.zdcSmd(west,0,strip)) {
729  zdcsmdWestVertical = (ZDC.zdcSmd(west,0,strip)
730  -mZDCSMDPed[1][0][strip-1])/Flow::zdcsmdGainFac[1][0][strip-1];
731  pFlowEvent->SetZDCSMD(1,0,strip,zdcsmdWestVertical);
732  }
733  }
734  }
735  pFlowEvent->SetCTB(ctb);
736  pFlowEvent->SetZDCe(zdce);
737  pFlowEvent->SetZDCw(zdcw);
738 
739  // Get initial multiplicity before TrackCuts
740  UInt_t origMult = pEvent->primaryVertex(0)->numberOfDaughters();
741  pFlowEvent->SetOrigMult(origMult);
742  //PR(origMult);
743  pFlowEvent->SetUncorrNegMult(uncorrectedNumberOfNegativePrimaries(*pEvent));
744  pFlowEvent->SetUncorrPosMult(uncorrectedNumberOfPositivePrimaries(*pEvent));
745 
746  // define functor for pid probability algorithm
747  StuProbabilityPidAlgorithm uPid(*pEvent);
748 
749  // loop over tracks in StEvent
750  int goodTracks = 0;
751  int goodTracksEta = 0;
752  StTpcDedxPidAlgorithm tpcDedxAlgo;
753  Float_t nSigma;
754  Float_t dcaSigned;
755 
756  StSPtrVecTrackNode& trackNode = pEvent->trackNodes();
757 
758  for (unsigned int j=0; j < trackNode.size(); j++) {
759  StGlobalTrack* gTrack =
760  static_cast<StGlobalTrack*>(trackNode[j]->track(global));
761  StPrimaryTrack* pTrack =
762  static_cast<StPrimaryTrack*>(trackNode[j]->track(primary));
763 
764  // Tricking flowMaker to use global tracks
765  // StPrimaryTrack* pTrack = (StPrimaryTrack*)(trackNode[j]->track(global));
766 
767  if (pTrack && pTrack->flag() > 0) {
768  StThreeVectorD p = pTrack->geometry()->momentum();
769  StThreeVectorD g = gTrack->geometry()->momentum(); // p of global track
770  // calculate the number of tracks with positive flag & |eta| < 0.75
771  if (fabs(p.pseudoRapidity()) < 0.75) goodTracksEta++;
772  if (StFlowCutTrack::CheckTrack(pTrack)) {
773  // Instantiate new StFlowTrack
774  StFlowTrack* pFlowTrack = new StFlowTrack;
775  if (!pFlowTrack) return;
776  pFlowTrack->SetPhi(p.phi());
777  pFlowTrack->SetPhiGlobal(g.phi());
778  pFlowTrack->SetEta(p.pseudoRapidity());
779  pFlowTrack->SetEtaGlobal(g.pseudoRapidity());
780  pFlowTrack->SetPt(p.perp());
781  pFlowTrack->SetPtGlobal(g.perp());
782  pFlowTrack->SetCharge(pTrack->geometry()->charge());
783 
784  dcaSigned = CalcDcaSigned(vertex,gTrack);
785  pFlowTrack->SetDcaSigned(dcaSigned);
786  pFlowTrack->SetDca(pTrack->impactParameter());
787  pFlowTrack->SetDcaGlobal(gTrack->impactParameter());
788  pFlowTrack->SetChi2((Float_t)(pTrack->fitTraits().chi2()));
789  pFlowTrack->SetTopologyMap(pTrack->topologyMap());
790 
791  pFlowTrack->SetNhits(pTrack->detectorInfo()->numberOfPoints());
792  pFlowTrack->SetFitPts(pTrack->fitTraits().numberOfFitPoints() -
793  pTrack->fitTraits().numberOfFitPoints(kSvtId) -
794  pTrack->fitTraits().numberOfFitPoints(kSsdId) - 1); // remove additional vertex point
795  pFlowTrack->SetMaxPts(pTrack->numberOfPossiblePoints() -
796  pTrack->numberOfPossiblePoints(kSvtId) -
797  pTrack->numberOfPossiblePoints(kSsdId) - 1); // remove additional vertex point
798 
799  Double_t pathLength = gTrack->geometry()->helix().pathLength(vertex);
800  StThreeVectorD distance = gTrack->geometry()->helix().at(pathLength);
801  pFlowTrack->SetDcaGlobal3(distance - vertex);
802 
803  pFlowTrack->SetTrackLength(pTrack->length());
804 
805  if (pTrack->topologyMap().hasHitInDetector(kFtpcEastId) ||
806  pTrack->topologyMap().hasHitInDetector(kFtpcWestId)) { // FTPC track: first and last point are within these detectors
807  pFlowTrack->SetZFirstPoint(pTrack->detectorInfo()->firstPoint().z());
808  pFlowTrack->SetZLastPoint(pTrack->detectorInfo()->lastPoint().z());
809  }
810 
811  else if (pTrack->topologyMap().hasHitInDetector(kTpcId)) { // TPC track
812  Double_t innerFieldCageRadius = 46.107;
813  Double_t innerPadrowRadius = 60.0;
814  Double_t x, y;
815 
816  pFlowTrack->SetZLastPoint(pTrack->detectorInfo()->lastPoint().z());
817 
818  x = pTrack->detectorInfo()->firstPoint().x();
819  y = pTrack->detectorInfo()->firstPoint().y();
820  if (TMath::Sqrt(x*x+y*y) >= innerFieldCageRadius) { // track starts in TPC
821  pFlowTrack->SetZFirstPoint(pTrack->detectorInfo()->firstPoint().z());
822  } else { // track starts before TPC: calculate first TPC point
823  pairD pathL = pTrack->geometry()->helix().pathLength(innerPadrowRadius);
824 
825  Double_t s = 0.;
826  Double_t s1 = pathL.first;
827  Double_t s2 = pathL.second;
828 
829  // Selects positive path length to project track forward along its helix relative to
830  // first point of track. The smaller solution is taken when both are positive.
831 
832  if (finite(s1) != 0 || finite(s2) != 0) { // track could be projected
833  if (s1 >= 0 && s2 >= 0) s = s1;
834  else if (s1 >= 0 && s2 < 0) s = s1;
835  else if (s1 < 0 && s2 >= 0) s = s2;
836  pFlowTrack->SetZFirstPoint(pTrack->geometry()->helix().z(s));
837  } else { // no projection possible
838  pFlowTrack->SetZFirstPoint(0.);
839  }
840  }
841  }
842 
843  pTrack->pidTraits(tpcDedxAlgo); // initialize
844  nSigma = (float)tpcDedxAlgo.numberOfSigma(StPionPlus::instance());
845  pFlowTrack->SetPidPiPlus(nSigma);
846  nSigma = (float)tpcDedxAlgo.numberOfSigma(StPionMinus::instance());
847  pFlowTrack->SetPidPiMinus(nSigma);
848  nSigma = (float)tpcDedxAlgo.numberOfSigma(StProton::instance());
849  pFlowTrack->SetPidProton(nSigma);
850  nSigma = (float)tpcDedxAlgo.numberOfSigma(StAntiProton::instance());
851  pFlowTrack->SetPidAntiProton(nSigma);
852  nSigma = (float)tpcDedxAlgo.numberOfSigma(StKaonMinus::instance());
853  pFlowTrack->SetPidKaonMinus(nSigma);
854  nSigma = (float)tpcDedxAlgo.numberOfSigma(StKaonPlus::instance());
855  pFlowTrack->SetPidKaonPlus(nSigma);
856  nSigma = (float)tpcDedxAlgo.numberOfSigma(StDeuteron::instance());
857  pFlowTrack->SetPidDeuteron(nSigma);
858  if (pTrack->geometry()->charge() < 0) {
859  pFlowTrack->SetPidAntiDeuteron(nSigma);
860  }
861  nSigma = (float)tpcDedxAlgo.numberOfSigma(StElectron::instance());
862  pFlowTrack->SetPidElectron(nSigma);
863  nSigma = (float)tpcDedxAlgo.numberOfSigma(StPositron::instance());
864  pFlowTrack->SetPidPositron(nSigma);
865 
866  // dE/dx
867  StPtrVecTrackPidTraits traits = pTrack->pidTraits(kTpcId);
868  unsigned int size = traits.size();
869  if (size) {
870  StDedxPidTraits* pid = 0;
871  for (unsigned int i = 0; i < traits.size(); i++) {
872  pid = dynamic_cast<StDedxPidTraits*>(traits[i]);
873  if (pid && pid->method() == kTruncatedMeanId) break;
874  }
875  assert(pid);
876  pFlowTrack->SetDedx(pid->mean());
877  pFlowTrack->SetNdedxPts(pid->numberOfPoints());
878  }
879 
880  // Probability pid
881  //const StParticleDefinition* def = pTrack->pidTraits(uPid);
882  (void*)pTrack->pidTraits(uPid);
883  pFlowTrack->SetMostLikelihoodPID(uPid.mostLikelihoodParticleGeantID());
884  pFlowTrack->SetMostLikelihoodProb(uPid.mostLikelihoodProbability());
885  if (uPid.isExtrap()) pFlowTrack->SetExtrapTag(1); //merging area.
886  else pFlowTrack->SetExtrapTag(0);
887  if (pTrack->geometry()->charge() < 0) {
888  pFlowTrack->SetElectronPositronProb(uPid.beingElectronProb());
889  pFlowTrack->SetPionPlusMinusProb(uPid.beingPionMinusProb());
890  pFlowTrack->SetKaonPlusMinusProb(uPid.beingKaonMinusProb());
891  pFlowTrack->SetProtonPbarProb(uPid.beingAntiProtonProb());
892  } else if (pTrack->geometry()->charge() > 0) {
893  pFlowTrack->SetElectronPositronProb(uPid.beingPositronProb());
894  pFlowTrack->SetPionPlusMinusProb(uPid.beingPionPlusProb());
895  pFlowTrack->SetKaonPlusMinusProb(uPid.beingKaonPlusProb());
896  pFlowTrack->SetProtonPbarProb(uPid.beingProtonProb());
897  }
898 
899  pFlowEvent->TrackCollection()->push_back(pFlowTrack);
900  goodTracks++;
901  }
902  }
903  }
904 
905  // Check Eta Symmetry
906  if (!StFlowCutEvent::CheckEtaSymmetry(pEvent)) {
907  delete pFlowEvent; // delete this event
908  pFlowEvent = NULL;
909  return;
910  }
911 
912  // Get mult for centrality
913  UInt_t rawMult = pFlowEvent->UncorrNegMult() + pFlowEvent->UncorrPosMult();
914  pFlowEvent->SetMultEta(rawMult);
915 
916  // Set centrality
917  pFlowEvent->SetCentrality();
918 
919  // Set PID method
920  (pFlowEvent->ProbPid()) ? pFlowEvent->SetPidsProb() :
921  pFlowEvent->SetPidsDeviant();
922 
923  // Randomize tracks
924  pFlowEvent->TrackCollection()->random_shuffle();
925 
926  // Set selections
927  pFlowEvent->SetSelections();
928 
929  // Set subevent method
930  (pFlowEvent->EtaSubs()) ? pFlowEvent->MakeEtaSubEvents() :
931  pFlowEvent->MakeSubEvents();
932 
933 }
934 
935 //----------------------------------------------------------------------
936 
937 void StFlowMaker::FillPicoEvent() {
938  // Make StFlowPicoEvent from StFlowEvent
939 
940  if (Debug()) gMessMgr->Info() << "FlowMaker: FillPicoEvent()" << endm;
941 
942  if (!pPicoEvent) {
943  gMessMgr->Warning("##### FlowMaker: No FlowPicoEvent");
944  return;
945  }
946  StFlowPicoTrack* pFlowPicoTrack = new StFlowPicoTrack();
947 
948  pPicoEvent->SetVersion(7); // version 7
949  pPicoEvent->SetEventID(pFlowEvent->EventID());
950  pPicoEvent->SetRunID(pFlowEvent->RunID());
951  pPicoEvent->SetL0TriggerWord(pFlowEvent->L0TriggerWord());
952 
953  pPicoEvent->SetCenterOfMassEnergy(pFlowEvent->CenterOfMassEnergy());
954  pPicoEvent->SetMagneticField(pFlowEvent->MagneticField());
955  pPicoEvent->SetBeamMassNumberEast(pFlowEvent->BeamMassNumberEast());
956  pPicoEvent->SetBeamMassNumberWest(pFlowEvent->BeamMassNumberWest());
957 
958  pPicoEvent->SetOrigMult(pFlowEvent->OrigMult());
959  pPicoEvent->SetUncorrNegMult(pFlowEvent->UncorrNegMult());
960  pPicoEvent->SetUncorrPosMult(pFlowEvent->UncorrPosMult());
961  pPicoEvent->SetMultEta(pFlowEvent->MultEta());
962  pPicoEvent->SetCentrality(pFlowEvent->Centrality());
963  pPicoEvent->SetVertexPos(pFlowEvent->VertexPos().x(),
964  pFlowEvent->VertexPos().y(),
965  pFlowEvent->VertexPos().z());
966  pPicoEvent->SetCTB(pFlowEvent->CTB());
967  pPicoEvent->SetZDCe(pFlowEvent->ZDCe());
968  pPicoEvent->SetZDCw(pFlowEvent->ZDCw());
969 
970  for (int i=0; i<2; i++)
971  for (int j=0; j<2; j++)
972  for (int k=1; k<9; k++)
973  pPicoEvent->SetZDCSMD(i,j,k,pFlowEvent->ZDCSMD(i,j,k));
974 
975  StFlowTrackIterator itr;
976  StFlowTrackCollection* pFlowTracks = pFlowEvent->TrackCollection();
977 
978  for (itr = pFlowTracks->begin(); itr != pFlowTracks->end(); itr++) {
979  StFlowTrack* pFlowTrack = *itr;
980  pFlowPicoTrack->SetPt(pFlowTrack->Pt());
981  pFlowPicoTrack->SetPtGlobal(pFlowTrack->PtGlobal());
982  pFlowPicoTrack->SetEta(pFlowTrack->Eta());
983  pFlowPicoTrack->SetEtaGlobal(pFlowTrack->EtaGlobal());
984  pFlowPicoTrack->SetDedx(pFlowTrack->Dedx());
985  pFlowPicoTrack->SetPhi(pFlowTrack->Phi());
986  pFlowPicoTrack->SetPhiGlobal(pFlowTrack->PhiGlobal());
987  pFlowPicoTrack->SetCharge(pFlowTrack->Charge());
988  pFlowPicoTrack->SetDcaSigned(pFlowTrack->DcaSigned());
989  pFlowPicoTrack->SetDca(pFlowTrack->Dca());
990  pFlowPicoTrack->SetDcaGlobal(pFlowTrack->DcaGlobal());
991  pFlowPicoTrack->SetZFirstPoint(pFlowTrack->ZFirstPoint());
992  pFlowPicoTrack->SetZLastPoint(pFlowTrack->ZLastPoint());
993  pFlowPicoTrack->SetChi2(pFlowTrack->Chi2());
994  pFlowPicoTrack->SetFitPts(pFlowTrack->FitPts() + 1); // add additional vertex point
995  pFlowPicoTrack->SetMaxPts(pFlowTrack->MaxPts());
996  pFlowPicoTrack->SetNhits(pFlowTrack->Nhits());
997  pFlowPicoTrack->SetNdedxPts(pFlowTrack->NdedxPts());
998  pFlowPicoTrack->SetDcaGlobal3(pFlowTrack->DcaGlobal3().x(),
999  pFlowTrack->DcaGlobal3().y(),
1000  pFlowTrack->DcaGlobal3().z());
1001  pFlowPicoTrack->SetTrackLength(pFlowTrack->TrackLength());
1002  pFlowPicoTrack->SetMostLikelihoodPID(pFlowTrack->MostLikelihoodPID());
1003  pFlowPicoTrack->SetMostLikelihoodProb(pFlowTrack->MostLikelihoodProb());
1004  pFlowPicoTrack->SetExtrapTag(pFlowTrack->ExtrapTag());
1005  pFlowPicoTrack->SetElectronPositronProb(pFlowTrack->ElectronPositronProb());
1006  pFlowPicoTrack->SetPionPlusMinusProb(pFlowTrack->PionPlusMinusProb());
1007  pFlowPicoTrack->SetKaonPlusMinusProb(pFlowTrack->KaonPlusMinusProb());
1008  pFlowPicoTrack->SetProtonPbarProb(pFlowTrack->ProtonPbarProb());
1009  if (pFlowPicoTrack->Charge() > 0) {
1010  pFlowPicoTrack->SetPidPion(pFlowTrack->PidPiPlus());
1011  pFlowPicoTrack->SetPidProton(pFlowTrack->PidProton());
1012  pFlowPicoTrack->SetPidKaon(pFlowTrack->PidKaonPlus());
1013  pFlowPicoTrack->SetPidDeuteron(pFlowTrack->PidDeuteron());
1014  pFlowPicoTrack->SetPidElectron(pFlowTrack->PidPositron());
1015  } else {
1016  pFlowPicoTrack->SetPidPion(pFlowTrack->PidPiMinus());
1017  pFlowPicoTrack->SetPidProton(pFlowTrack->PidAntiProton());
1018  pFlowPicoTrack->SetPidKaon(pFlowTrack->PidKaonMinus());
1019  pFlowPicoTrack->SetPidDeuteron(pFlowTrack->PidAntiDeuteron());
1020  pFlowPicoTrack->SetPidElectron(pFlowTrack->PidElectron());
1021  }
1022  pFlowPicoTrack->SetTopologyMap(pFlowTrack->TopologyMap().data(0),
1023  pFlowTrack->TopologyMap().data(1));
1024  pPicoEvent->AddTrack(pFlowPicoTrack);
1025  }
1026 
1027  pFlowTree->Fill(); //fill the tree
1028  pPicoEvent->Clear();
1029 
1030  delete pFlowPicoTrack;
1031 }
1032 
1033 //-----------------------------------------------------------------------
1034 
1035 Bool_t StFlowMaker::FillFromPicoDST(StFlowPicoEvent* pPicoEvent) {
1036  // Make StFlowEvent from StFlowPicoEvent
1037 
1038  if (Debug()) gMessMgr->Info() << "FlowMaker: FillFromPicoDST()" << endm;
1039  if (Debug()) gMessMgr->Info() << "FlowMaker: Pico Version: " <<
1040  pPicoEvent->Version() << endm;
1041 
1042  if (!pPicoEvent || !pPicoChain->GetEntry(mEventCounter++)) {
1043  cout << "##### FlowMaker: no more events" << endl;
1044  return kFALSE;
1045  }
1046 
1047  // Set phi weights
1048  if (mFirstLastPhiWgt) pFlowEvent->SetFirstLastPhiWgt();
1049  pFlowEvent->SetPhiWeightFarEast(mPhiWgtFarEast);
1050  pFlowEvent->SetPhiWeightEast(mPhiWgtEast);
1051  pFlowEvent->SetPhiWeightWest(mPhiWgtWest);
1052  pFlowEvent->SetPhiWeightFarWest(mPhiWgtFarWest);
1053  pFlowEvent->SetPhiWeightFtpcFarEast(mPhiWgtFtpcFarEast);
1054  pFlowEvent->SetPhiWeightFtpcEast(mPhiWgtFtpcEast);
1055  pFlowEvent->SetPhiWeightFtpcWest(mPhiWgtFtpcWest);
1056  pFlowEvent->SetPhiWeightFtpcFarWest(mPhiWgtFtpcFarWest);
1057 
1058  // fill ReCent array
1059  pFlowEvent->SetReCentX(mReCentX);
1060  pFlowEvent->SetReCentY(mReCentY);
1061 
1062  // Check event cuts including centrality
1063  if (!StFlowCutEvent::CheckEvent(pPicoEvent)) {
1064  Int_t eventID = pPicoEvent->EventID();
1065  gMessMgr->Info() << "##### FlowMaker: picoevent " << eventID
1066  << " cut" << endm;
1067  delete pFlowEvent; // delete this event
1068  pFlowEvent = NULL;
1069  return kTRUE;
1070  }
1071 
1072 // PR(pPicoEvent->Version());
1073  switch (pPicoEvent->Version()) {
1074  case 7: FillFromPicoVersion7DST(pPicoEvent); break;
1075  default:
1076  cout << "##### FlowMaker: Illegal pico file version" << endl;
1077  return kStFatal;
1078  }
1079 
1080  // Check Eta Symmetry
1081  if (!StFlowCutEvent::CheckEtaSymmetry(pPicoEvent)) {
1082  Int_t eventID = pPicoEvent->EventID();
1083  gMessMgr->Info() << "##### FlowMaker: picoevent " << eventID
1084  << " cut" << endm;
1085  delete pFlowEvent; // delete this event
1086  pFlowEvent = NULL;
1087  return kTRUE;
1088  }
1089 
1090  (pFlowEvent->ProbPid()) ? pFlowEvent->SetPidsProb() :
1091  pFlowEvent->SetPidsDeviant();
1092 
1093  pFlowEvent->TrackCollection()->random_shuffle();
1094 
1095  pFlowEvent->SetSelections();
1096  (pFlowEvent->EtaSubs()) ? pFlowEvent->MakeEtaSubEvents() :
1097  pFlowEvent->MakeSubEvents();
1098 
1099  return kTRUE;
1100 }
1101 
1102 //-----------------------------------------------------------------------
1103 
1104 Bool_t StFlowMaker::FillFromPicoVersion7DST(StFlowPicoEvent* pPicoEvent) {
1105  // Finish making StFlowEvent from StFlowPicoEvent
1106 
1107  if (Debug()) gMessMgr->Info() << "FlowMaker: FillFromPicoVersion7DST()" << endm;
1108 
1110 
1111  pFlowEvent->SetFirstLastPoints();
1112  pFlowEvent->SetEventID(pPicoEvent->EventID());
1113  UInt_t origMult = pPicoEvent->OrigMult();
1114  pFlowEvent->SetOrigMult(origMult);
1115  //PR(origMult);
1116  pFlowEvent->SetUncorrNegMult(pPicoEvent->UncorrNegMult());
1117  pFlowEvent->SetUncorrPosMult(pPicoEvent->UncorrPosMult());
1118  pFlowEvent->SetVertexPos(StThreeVectorF(pPicoEvent->VertexX(),
1119  pPicoEvent->VertexY(),
1120  pPicoEvent->VertexZ()) );
1121 
1122  pFlowEvent->SetRunID(pPicoEvent->RunID());
1123  pFlowEvent->SetL0TriggerWord(pPicoEvent->L0TriggerWord());
1124 
1125  pFlowEvent->SetCenterOfMassEnergy(pPicoEvent->CenterOfMassEnergy());
1126  pFlowEvent->SetMagneticField(pPicoEvent->MagneticField());
1127  pFlowEvent->SetBeamMassNumberEast(pPicoEvent->BeamMassNumberEast());
1128  pFlowEvent->SetBeamMassNumberWest(pPicoEvent->BeamMassNumberWest());
1129  pFlowEvent->SetMultEta(pPicoEvent->MultEta());
1130  pFlowEvent->SetCentrality();
1131 
1132  pFlowEvent->SetCTB(pPicoEvent->CTB());
1133  pFlowEvent->SetZDCe(pPicoEvent->ZDCe());
1134  pFlowEvent->SetZDCw(pPicoEvent->ZDCw());
1135 
1136  for (int i=0; i<2; i++)
1137  for (int j=0; j<2; j++)
1138  for (int k=1; k<9; k++)
1139  pFlowEvent->SetZDCSMD(i,j,k,pPicoEvent->ZDCSMD(i,j,k));
1140 
1141  pFlowEvent->SetZDCSMD_PsiWeightWest(mZDCSMD_PsiWgtWest);
1142  pFlowEvent->SetZDCSMD_PsiWeightEast(mZDCSMD_PsiWgtEast);
1143  pFlowEvent->SetZDCSMD_PsiWeightFull(mZDCSMD_PsiWgtFull);
1144  pFlowEvent->SetZDCSMD_BeamCenter(mZDCSMDCenterEx,mZDCSMDCenterEy,mZDCSMDCenterWx,
1145  mZDCSMDCenterWy);
1146  int goodTracks = 0;
1147  // Fill FlowTracks
1148  for (Int_t nt=0; nt < pPicoEvent->GetNtrack(); nt++) {
1149  StFlowPicoTrack* pPicoTrack = (StFlowPicoTrack*)pPicoEvent->Tracks()
1150  ->UncheckedAt(nt);
1151  if (pPicoTrack && (pPicoTrack->Dca())!=(pPicoTrack->DcaGlobal())
1152  && StFlowCutTrack::CheckTrack(pPicoTrack)) {
1153  // Instantiate new StFlowTrack
1154  StFlowTrack* pFlowTrack = new StFlowTrack;
1155  if (!pFlowTrack) return kFALSE;
1156  pFlowTrack->SetPt(pPicoTrack->Pt());
1157  pFlowTrack->SetPtGlobal(pPicoTrack->PtGlobal());
1158  pFlowTrack->SetPhi(pPicoTrack->Phi());
1159  pFlowTrack->SetPhiGlobal(pPicoTrack->PhiGlobal());
1160  pFlowTrack->SetEta(pPicoTrack->Eta());
1161  pFlowTrack->SetEtaGlobal(pPicoTrack->EtaGlobal());
1162  pFlowTrack->SetZFirstPoint(pPicoTrack->ZFirstPoint());
1163  pFlowTrack->SetZLastPoint(pPicoTrack->ZLastPoint());
1164  pFlowTrack->SetDedx(pPicoTrack->Dedx());
1165  pFlowTrack->SetCharge(pPicoTrack->Charge());
1166  pFlowTrack->SetDcaSigned(pPicoTrack->DcaSigned());
1167  pFlowTrack->SetDca(pPicoTrack->Dca());
1168  pFlowTrack->SetDcaGlobal(pPicoTrack->DcaGlobal());
1169  pFlowTrack->SetChi2(pPicoTrack->Chi2());
1170  pFlowTrack->SetFitPts(pPicoTrack->FitPts() - 1); // remove additional vertex point
1171  pFlowTrack->SetMaxPts(pPicoTrack->MaxPts());
1172  pFlowTrack->SetNhits(pPicoTrack->Nhits());
1173  pFlowTrack->SetNdedxPts(pPicoTrack->NdedxPts());
1174  pFlowTrack->SetDcaGlobal3(StThreeVectorD(pPicoTrack->DcaGlobalX(),
1175  pPicoTrack->DcaGlobalY(),
1176  pPicoTrack->DcaGlobalZ()) );
1177  pFlowTrack->SetTrackLength(pPicoTrack->TrackLength());
1178 
1179  if (StFlowEvent::ProbPid() && StuProbabilityPidAlgorithm::isPIDTableRead()) {
1180  uPid.processPIDAsFunction(uPid.getCentrality(pPicoEvent->UncorrNegMult()),
1181  pPicoTrack->DcaGlobal(),
1182  pPicoTrack->Charge(),
1183  fabs((pPicoTrack->Pt()/sqrt(1-(tanh(pPicoTrack->Eta())
1184  *tanh(pPicoTrack->Eta()))))/float(pPicoTrack->Charge())),
1185  pPicoTrack->Eta(),
1186  pPicoTrack->NdedxPts(),
1187  pPicoTrack->Dedx() );
1188 
1189  pFlowTrack->SetMostLikelihoodPID(uPid.mostLikelihoodParticleGeantID());
1190  pFlowTrack->SetMostLikelihoodProb(uPid.mostLikelihoodProbability());
1191  pFlowTrack->SetExtrapTag(int(uPid.isExtrap()));
1192 
1193  pFlowTrack->SetElectronPositronProb( (pPicoTrack->Charge()>0) ?
1194  float(uPid.beingPositronProb()) :
1195  float(uPid.beingElectronProb()) );
1196 
1197  pFlowTrack->SetPionPlusMinusProb( (pPicoTrack->Charge()>0) ?
1198  float(uPid.beingPionPlusProb()) :
1199  float(uPid.beingPionMinusProb()) );
1200 
1201  pFlowTrack->SetKaonPlusMinusProb( (pPicoTrack->Charge()>0) ?
1202  float(uPid.beingKaonPlusProb()) :
1203  float(uPid.beingKaonMinusProb()) );
1204 
1205  pFlowTrack->SetProtonPbarProb( (pPicoTrack->Charge()>0) ?
1206  float(uPid.beingProtonProb()) :
1207  float(uPid.beingAntiProtonProb()) );
1208 
1209  } else {
1210  pFlowTrack->SetMostLikelihoodPID(pPicoTrack->MostLikelihoodPID());
1211  pFlowTrack->SetMostLikelihoodProb(pPicoTrack->MostLikelihoodProb());
1212  pFlowTrack->SetExtrapTag(pPicoTrack->ExtrapTag());
1213  pFlowTrack->SetElectronPositronProb(pPicoTrack->ElectronPositronProb());
1214  pFlowTrack->SetPionPlusMinusProb(pPicoTrack->PionPlusMinusProb());
1215  pFlowTrack->SetKaonPlusMinusProb(pPicoTrack->KaonPlusMinusProb());
1216  pFlowTrack->SetProtonPbarProb(pPicoTrack->ProtonPbarProb());
1217  }
1218 
1219  if (pPicoTrack->Charge() < 0) {
1220  pFlowTrack->SetPidPiMinus(pPicoTrack->PidPion());
1221  pFlowTrack->SetPidAntiProton(pPicoTrack->PidProton());
1222  pFlowTrack->SetPidKaonMinus(pPicoTrack->PidKaon());
1223  pFlowTrack->SetPidAntiDeuteron(pPicoTrack->PidDeuteron());
1224  pFlowTrack->SetPidElectron(pPicoTrack->PidElectron());
1225  } else {
1226  pFlowTrack->SetPidPiPlus(pPicoTrack->PidPion());
1227  pFlowTrack->SetPidProton(pPicoTrack->PidProton());
1228  pFlowTrack->SetPidKaonPlus(pPicoTrack->PidKaon());
1229  pFlowTrack->SetPidDeuteron(pPicoTrack->PidDeuteron());
1230  pFlowTrack->SetPidPositron(pPicoTrack->PidElectron());
1231  }
1232 
1233  if (pPicoTrack->TopologyMap0() || pPicoTrack->TopologyMap1()) {
1234  // topology map found
1235  pFlowTrack->SetTopologyMap(StTrackTopologyMap(pPicoTrack->TopologyMap0(),
1236  pPicoTrack->TopologyMap1()) );
1237  }
1238 
1239  pFlowEvent->TrackCollection()->push_back(pFlowTrack);
1240  goodTracks++;
1241  }
1242  }
1243 
1244  return kTRUE;
1245 }
1246 
1247 //-----------------------------------------------------------------------
1248 
1249 Bool_t StFlowMaker::FillFromMuDST() {
1250  // Make StFlowEvent from StMuDST
1251 
1252  if (Debug()) gMessMgr->Info() << "FlowMaker: FillFromMuDST()" << endm;
1253 
1254  // Check event cuts
1255  if (!StFlowCutEvent::CheckEvent(pMu)) {
1256  Int_t eventID = pMuEvent->eventId();
1257  gMessMgr->Info() << "##### FlowMaker: MuEvent " << eventID
1258  << " cut" << endm;
1259  delete pFlowEvent; // delete this event
1260  pFlowEvent = NULL;
1261  return kTRUE;
1262  }
1263 
1264  // Set phi weights
1265  if (mFirstLastPhiWgt) pFlowEvent->SetFirstLastPhiWgt();
1266  pFlowEvent->SetPhiWeightFarEast(mPhiWgtFarEast);
1267  pFlowEvent->SetPhiWeightEast(mPhiWgtEast);
1268  pFlowEvent->SetPhiWeightWest(mPhiWgtWest);
1269  pFlowEvent->SetPhiWeightFarWest(mPhiWgtFarWest);
1270  pFlowEvent->SetPhiWeightFtpcFarEast(mPhiWgtFtpcFarEast);
1271  pFlowEvent->SetPhiWeightFtpcEast(mPhiWgtFtpcEast);
1272  pFlowEvent->SetPhiWeightFtpcWest(mPhiWgtFtpcWest);
1273  pFlowEvent->SetPhiWeightFtpcFarWest(mPhiWgtFtpcFarWest);
1274  pFlowEvent->SetFirstLastPoints();
1275  pFlowEvent->SetZDCSMD_PsiWeightWest(mZDCSMD_PsiWgtWest);
1276  pFlowEvent->SetZDCSMD_PsiWeightEast(mZDCSMD_PsiWgtEast);
1277  pFlowEvent->SetZDCSMD_PsiWeightFull(mZDCSMD_PsiWgtFull);
1278  pFlowEvent->SetZDCSMD_BeamCenter(mZDCSMDCenterEx, mZDCSMDCenterEy,
1279  mZDCSMDCenterWx, mZDCSMDCenterWy);
1280 
1281  // Fill ReCent array
1282  pFlowEvent->SetReCentX(mReCentX);
1283  pFlowEvent->SetReCentY(mReCentY);
1284 
1285  // Set centrality, etc.
1286  pFlowEvent->SetRunID(pMuEvent->runId());
1287  //cout << "######### FillFromMuEvent runID = " << pFlowEvent->RunID() << endl;
1288  pFlowEvent->SetCenterOfMassEnergy(pMuEvent->runInfo().centerOfMassEnergy());
1289  pFlowEvent->SetMagneticField(pMuEvent->runInfo().magneticField());
1290  pFlowEvent->SetUncorrNegMult(pMuEvent->refMultNeg());
1291  pFlowEvent->SetUncorrPosMult(pMuEvent->refMultPos());
1292  if (pMuEvent->runId() > 8000000) { // year 7
1293  pFlowEvent->SetMultEta(pMuEvent->grefmult());
1294  } else {
1295  pFlowEvent->SetMultEta(pMuEvent->refMult());
1296  }
1297  pFlowEvent->SetCentrality();
1298  pFlowEvent->SetEventID(pMuEvent->eventId());
1299  pFlowEvent->SetVertexPos(pMuEvent->primaryVertexPosition());
1300  pFlowEvent->SetL0TriggerWord(StFlowCutEvent::TriggersFound());
1301  pFlowEvent->SetBeamMassNumberEast(pMuEvent->runInfo().beamMassNumber(east));
1302  pFlowEvent->SetBeamMassNumberWest(pMuEvent->runInfo().beamMassNumber(west));
1303 
1305 
1306  pFlowEvent->SetCTB(pMuEvent->ctbMultiplicity());
1307  pFlowEvent->SetZDCe(pMuEvent->zdcAdcAttentuatedSumEast());
1308  pFlowEvent->SetZDCw(pMuEvent->zdcAdcAttentuatedSumWest());
1309 
1310  // Get ZDCSMD pedstal-subtracted and gain-corrected
1311  Float_t zdcsmdEastHorizontal = -1.;
1312  Float_t zdcsmdEastVertical = -1.;
1313  Float_t zdcsmdWestHorizontal = -1.;
1314  Float_t zdcsmdWestVertical = -1.;
1315  StZdcTriggerDetector &ZDC = pMuEvent->zdcTriggerDetector();
1316  for (int strip=1; strip<9; strip++) {
1317  if (ZDC.zdcSmd(east,1,strip)) {
1318  zdcsmdEastHorizontal = (ZDC.zdcSmd(east,1,strip)
1319  -mZDCSMDPed[0][1][strip-1])/Flow::zdcsmdGainFac[0][1][strip-1];
1320  pFlowEvent->SetZDCSMD(0,1,strip,zdcsmdEastHorizontal);
1321  }
1322  if (ZDC.zdcSmd(east,0,strip)) {
1323  zdcsmdEastVertical = (ZDC.zdcSmd(east,0,strip)
1324  -mZDCSMDPed[0][0][strip-1])/Flow::zdcsmdGainFac[0][0][strip-1];
1325  pFlowEvent->SetZDCSMD(0,0,strip,zdcsmdEastVertical);
1326  }
1327  if (ZDC.zdcSmd(west,1,strip)) {
1328  zdcsmdWestHorizontal = (ZDC.zdcSmd(west,1,strip)
1329  -mZDCSMDPed[1][1][strip-1])/Flow::zdcsmdGainFac[1][1][strip-1];
1330  pFlowEvent->SetZDCSMD(1,1,strip,zdcsmdWestHorizontal);
1331  }
1332  if (ZDC.zdcSmd(west,0,strip)) {
1333  zdcsmdWestVertical = (ZDC.zdcSmd(west,0,strip)
1334  -mZDCSMDPed[1][0][strip-1])/Flow::zdcsmdGainFac[1][0][strip-1];
1335  pFlowEvent->SetZDCSMD(1,0,strip,zdcsmdWestVertical);
1336  }
1337  }
1338 
1339  // Tracks
1340  UInt_t origMult = pMuTracks->GetEntries();
1341  pFlowEvent->SetOrigMult(origMult);
1342  //PR(origMult);
1343  int goodTracks = 0;
1344  // Fill FlowTracks
1345  for (Int_t nt=0; nt < (Int_t)origMult; nt++) {
1346  StMuTrack* pMuTrack = (StMuTrack*)pMuTracks->UncheckedAt(nt);
1347  if (pMuTrack && pMuTrack->flag()>0 && StFlowCutTrack::CheckTrack(pMuTrack)) {
1348  // Instantiate new StFlowTrack
1349  StFlowTrack* pFlowTrack = new StFlowTrack;
1350  if (!pFlowTrack) return kFALSE;
1351  pFlowTrack->SetPt(pMuTrack->pt());
1352  if (pMuTrack->index2Global()<0) {
1353  gMessMgr->Info() << "FlowMaker: FillFromMuVersion0DST(): WARNING! primary track has no reference to global track (index2Global < 0)" << endl;
1354  continue;
1355  }
1356  StMuTrack* pMuGlobalTrack = (StMuTrack*)pMuGlobalTracks->
1357  At(pMuTrack->index2Global());
1358  if (!pMuGlobalTrack) {
1359  gMessMgr->Info() << "FlowMaker: FillFromMuVersion0DST(): WARNING! primary track has no reference to global track (pMuGlobalTrack = 0)" << endl;
1360  continue;
1361  }
1362  pFlowTrack->Setid(pMuTrack->id()); // added 2/17/10
1363  pFlowTrack->SetPtGlobal(pMuGlobalTrack->pt());
1364  pFlowTrack->SetPhi(pMuTrack->phi());
1365  pFlowTrack->SetPhiGlobal(pMuGlobalTrack->phi());
1366  pFlowTrack->SetEta(pMuTrack->eta());
1367  pFlowTrack->SetEtaGlobal(pMuGlobalTrack->eta());
1368  pFlowTrack->SetDedx(pMuTrack->dEdx());
1369  pFlowTrack->SetCharge(pMuTrack->charge());
1370  pFlowTrack->SetDcaSigned(CalcDcaSigned(pMuEvent->primaryVertexPosition(),
1371  pMuTrack->helix()));
1372  pFlowTrack->SetDca(pMuTrack->dca().mag());
1373  pFlowTrack->SetDcaGlobal(pMuTrack->dcaGlobal().mag());
1374  pFlowTrack->SetChi2(pMuTrack->chi2xy());
1375  pFlowTrack->SetTopologyMap(pMuTrack->topologyMap());
1376 
1377  pFlowTrack->SetNhits(pMuTrack->nHits());
1378  pFlowTrack->SetFitPts(pMuTrack->nHitsFit() -
1379  pMuTrack->nHitsFit(kSvtId) -
1380  pMuTrack->nHitsFit(kSsdId) - 1); // remove additional vertex point
1381  pFlowTrack->SetMaxPts(pMuTrack->nHitsPoss() -
1382  pMuTrack->nHitsPoss(kSvtId) -
1383  pMuTrack->nHitsPoss(kSsdId) - 1); // remove additional vertex point
1384 
1385  pFlowTrack->SetNdedxPts(pMuTrack->nHitsDedx());
1386  pFlowTrack->SetDcaGlobal3(pMuTrack->dcaGlobal());
1387  pFlowTrack->SetTrackLength(pMuTrack->helix().pathLength(pMuEvent->
1388  primaryVertexPosition()));
1389 
1390  if (pFlowTrack->TopologyMap().hasHitInDetector(kFtpcEastId)
1391  || pFlowTrack->TopologyMap().hasHitInDetector(kFtpcWestId)) { // FTPC track: first and last point are within these detectors
1392  pFlowTrack->SetZFirstPoint(pMuTrack->firstPoint().z());
1393  pFlowTrack->SetZLastPoint(pMuTrack->lastPoint().z());
1394  }
1395  else if (pFlowTrack->TopologyMap().hasHitInDetector(kTpcId)) { // TPC track
1396  Double_t innerFieldCageRadius = 46.107;
1397  Double_t innerPadrowRadius = 60.0;
1398  Double_t x, y;
1399  pFlowTrack->SetZLastPoint(pMuTrack->lastPoint().z());
1400 
1401  x = pMuTrack->firstPoint().x();
1402  y = pMuTrack->firstPoint().y();
1403  if (TMath::Sqrt(x*x+y*y) >= innerFieldCageRadius) { // track starts in TPC
1404  pFlowTrack->SetZFirstPoint(pMuTrack->firstPoint().z());
1405  } else { // track starts before TPC: calculate first TPC point
1406  pairD pathL = pMuTrack->helix().pathLength(innerPadrowRadius);
1407 
1408  Double_t s = 0.;
1409  Double_t s1 = pathL.first;
1410  Double_t s2 = pathL.second;
1411 
1412  // Selects positive path length to project track forward along its helix relative to
1413  // first point of track. The smaller solution is taken when both are positive.
1414  if (finite(s1) != 0 || finite(s2) != 0) { // track could be projected
1415  if (s1 >= 0 && s2 >= 0) s = s1;
1416  else if (s1 >= 0 && s2 < 0) s = s1;
1417  else if (s1 < 0 && s2 >= 0) s = s2;
1418  pFlowTrack->SetZFirstPoint(pMuTrack->helix().z(s));
1419  } else { // no projection possible
1420  pFlowTrack->SetZFirstPoint(0.);
1421  }
1422  }
1423  }
1424 
1425  if (StFlowEvent::ProbPid() && StuProbabilityPidAlgorithm::isPIDTableRead()) {
1426  PR(StuProbabilityPidAlgorithm::isPIDTableRead());
1427  uPid.processPIDAsFunction(uPid.getCentrality(pMuEvent->refMultNeg()),
1428  pMuTrack->dcaGlobal().mag(),
1429  pMuTrack->charge(),
1430  fabs((pMuTrack->p().mag())/float(pMuTrack->charge())),
1431  pMuTrack->eta(),
1432  pMuTrack->nHitsDedx(),
1433  pMuTrack->dEdx() );
1434 
1435  pFlowTrack->SetMostLikelihoodPID(uPid.mostLikelihoodParticleGeantID());
1436  pFlowTrack->SetMostLikelihoodProb(uPid.mostLikelihoodProbability());
1437  pFlowTrack->SetExtrapTag(int(uPid.isExtrap()));
1438 
1439  pFlowTrack->SetElectronPositronProb( (pMuTrack->charge()>0) ?
1440  float(uPid.beingPositronProb()) :
1441  float(uPid.beingElectronProb()) );
1442 
1443  pFlowTrack->SetPionPlusMinusProb( (pMuTrack->charge()>0) ?
1444  float(uPid.beingPionPlusProb()) :
1445  float(uPid.beingPionMinusProb()) );
1446 
1447  pFlowTrack->SetKaonPlusMinusProb( (pMuTrack->charge()>0) ?
1448  float(uPid.beingKaonPlusProb()) :
1449  float(uPid.beingKaonMinusProb()) );
1450 
1451  pFlowTrack->SetProtonPbarProb( (pMuTrack->charge()>0) ?
1452  float(uPid.beingProtonProb()) :
1453  float(uPid.beingAntiProtonProb()) );
1454  } else {
1455  pFlowTrack->SetElectronPositronProb(pMuTrack->pidProbElectron());
1456  pFlowTrack->SetPionPlusMinusProb(pMuTrack->pidProbPion());
1457  pFlowTrack->SetKaonPlusMinusProb(pMuTrack->pidProbKaon());
1458  pFlowTrack->SetProtonPbarProb(pMuTrack->pidProbProton());
1459  pFlowTrack->SetProtonPbarProb(pMuTrack->pidProbProton());
1460  int mostLikelihoodPid=0;
1461  double mostLikelihoodPidProbability=0;
1462  if (pFlowTrack->ElectronPositronProb()>mostLikelihoodPidProbability) {
1463  mostLikelihoodPidProbability=pFlowTrack->ElectronPositronProb();
1464  if (pMuTrack->charge() < 0)
1465  mostLikelihoodPid=3;
1466  else
1467  mostLikelihoodPid=2;
1468  }
1469  if (pFlowTrack->PionPlusMinusProb()>mostLikelihoodPidProbability) {
1470  mostLikelihoodPidProbability=pFlowTrack->PionPlusMinusProb();
1471  if (pMuTrack->charge() < 0)
1472  mostLikelihoodPid=9;
1473  else
1474  mostLikelihoodPid=8;
1475  }
1476  if (pFlowTrack->KaonPlusMinusProb()>mostLikelihoodPidProbability) {
1477  mostLikelihoodPidProbability=pFlowTrack->KaonPlusMinusProb();
1478  if (pMuTrack->charge() < 0)
1479  mostLikelihoodPid=12;
1480  else
1481  mostLikelihoodPid=11;
1482  }
1483  if (pFlowTrack->ProtonPbarProb()>mostLikelihoodPidProbability) {
1484  mostLikelihoodPidProbability=pFlowTrack->ProtonPbarProb();
1485  if (pMuTrack->charge() < 0)
1486  mostLikelihoodPid=15;
1487  else
1488  mostLikelihoodPid=14;
1489  }
1490 
1491  pFlowTrack->SetMostLikelihoodPID(mostLikelihoodPid);
1492  pFlowTrack->SetMostLikelihoodProb(mostLikelihoodPidProbability);
1493 
1494  }//PID
1495 
1496  if (pMuTrack->charge() < 0) {
1497  pFlowTrack->SetPidPiMinus(pMuTrack->nSigmaPion());
1498  pFlowTrack->SetPidAntiProton(pMuTrack->nSigmaProton());
1499  pFlowTrack->SetPidKaonMinus(pMuTrack->nSigmaKaon());
1500  pFlowTrack->SetPidAntiDeuteron( 999.0 );
1501  pFlowTrack->SetPidElectron(pMuTrack->nSigmaElectron());
1502  } else {
1503  pFlowTrack->SetPidPiPlus(pMuTrack->nSigmaPion());
1504  pFlowTrack->SetPidProton(pMuTrack->nSigmaProton());
1505  pFlowTrack->SetPidKaonPlus(pMuTrack->nSigmaKaon());
1506  pFlowTrack->SetPidDeuteron( 999.0 );
1507  pFlowTrack->SetPidPositron(pMuTrack->nSigmaElectron());
1508  }
1509 
1510  pFlowEvent->TrackCollection()->push_back(pFlowTrack);
1511  goodTracks++;
1512 
1513  }
1514  }//tracks
1515 
1516  // Check Eta Symmetry
1517  if (!StFlowCutEvent::CheckEtaSymmetry(pMuEvent)) {
1518  Int_t eventID = pMuEvent->eventId();
1519  gMessMgr->Info() << "##### FlowMaker: MuEvent " << eventID
1520  << " cut" << endm;
1521  delete pFlowEvent; // delete this event
1522  pFlowEvent = NULL;
1523  return kTRUE;
1524  }
1525 
1526  // Set PID method
1527  (pFlowEvent->ProbPid()) ? pFlowEvent->SetPidsProb() :
1528  pFlowEvent->SetPidsDeviant();
1529 
1530  // Randomize tracks
1531  pFlowEvent->TrackCollection()->random_shuffle();
1532 
1533  // Set selections
1534  pFlowEvent->SetSelections();
1535 
1536  // Set subevent method
1537  (pFlowEvent->RanSubs()) ? pFlowEvent->MakeSubEvents() :
1538  pFlowEvent->MakeEtaSubEvents();
1539 
1540  return kTRUE;
1541 }
1542 
1543 //-----------------------------------------------------------------------
1544 
1545 void StFlowMaker::PrintSubeventMults() {
1546  // Used for testing
1547 
1548  if (Debug()) gMessMgr->Info() << "FlowMaker: PrintSubeventMults()" << endm;
1549 
1550  int j, k, n;
1551 
1552  pFlowSelect->SetSubevent(-1);
1553  for (j = 0; j < Flow::nHars; j++) {
1554  pFlowSelect->SetHarmonic(j);
1555  for (k = 0; k < Flow::nSels; k++) {
1556  pFlowSelect->SetSelection(k);
1557  cout << "j,k= " << j << k << " : " << pFlowEvent->Mult(pFlowSelect) << endl;
1558  }
1559  }
1560 
1561  for (j = 0; j < Flow::nHars; j++) {
1562  pFlowSelect->SetHarmonic(j);
1563  for (k = 0; k <Flow:: nSels; k++) {
1564  pFlowSelect->SetSelection(k);
1565  for (n = 0; n < Flow::nSubs+1; n++) {
1566  pFlowSelect->SetSubevent(n);
1567  cout << "j,k,n= " << j << k << n << " : " <<
1568  pFlowEvent->Mult(pFlowSelect) << endl;
1569  }
1570  }
1571  }
1572 
1573 }
1574 
1575 //-----------------------------------------------------------------------
1576 
1577 Int_t StFlowMaker::InitPicoEventWrite() {
1578  if (Debug()) gMessMgr->Info() << "FlowMaker: InitPicoEventWrite()" << endm;
1579 
1580  Int_t split = 99; // by default split Event into sub branches
1581  Int_t comp = 1; // by default file is compressed
1582  Int_t bufsize = 256000;
1583  if (split) bufsize /= 16;
1584 
1585  // creat a Picoevent and an output file
1586  pPicoEvent = new StFlowPicoEvent();
1587 
1588  TString* filestring = new TString(mPicoEventDir);
1589  filestring->Append(mEventFileName);
1590  if (filestring->EndsWith(".event.root")) {
1591  int nameLength = filestring->Length();
1592  filestring->Remove(nameLength - 11);
1593  }
1594  if (filestring->EndsWith(".MuDst.root")) {
1595  int nameLength = filestring->Length();
1596  filestring->Remove(nameLength - 11);
1597  }
1598  //cout << filestring->Data() << endl;
1599  filestring->Append(".flowpicoevent.root");
1600  pPicoDST = new TFile(filestring->Data(),"RECREATE","Flow Pico DST file");
1601  if (!pPicoDST) {
1602  cout << "##### FlowMaker: Warning: no PicoEvents file = "
1603  << filestring->Data() << endl;
1604  return kStFatal;
1605  }
1606  pPicoDST->SetCompressionLevel(comp);
1607  if (Debug()) gMessMgr->Info() << "##### FlowMaker: PicoEvents file = "
1608  << filestring->Data() << endm;
1609 
1610  // Create a ROOT Tree and one superbranch
1611  pFlowTree = new TTree("FlowTree", "Flow Pico Tree");
1612  if (!pFlowTree) {
1613  cout << "##### FlowMaker: Warning: No FlowPicoTree" << endl;
1614  return kStFatal;
1615  }
1616 
1617  pFlowTree->SetAutoSave(1000000); // autosave when 1 Mbyte written
1618  pFlowTree->Branch("pPicoEvent", "StFlowPicoEvent", &pPicoEvent,
1619  bufsize, split);
1620 
1621  delete filestring;
1622 
1623  return kStOK;
1624 }
1625 
1626 //-----------------------------------------------------------------------
1627 
1628 Int_t StFlowMaker::InitPicoEventRead() {
1629  if (Debug()) gMessMgr->Info() << "FlowMaker: InitPicoEventRead()" << endm;
1630 
1631  pPicoEvent = new StFlowPicoEvent();
1632  pPicoChain = new TChain("FlowTree");
1633 
1634  for (Int_t ilist = 0; ilist < pPicoFileList->GetNBundles(); ilist++) {
1635  pPicoFileList->GetNextBundle();
1636 
1637  TFile dummyFile(pPicoFileList->GetFileName(0),"READ");
1638 
1639  if (!(dummyFile.IsOpen())) {
1640  gMessMgr->Info() <<pPicoFileList->GetFileName(0)<<" open failed ! not chained"<<endm;
1641  continue;
1642  }
1643 
1644  if (dummyFile.IsZombie()) {
1645  gMessMgr->Info() <<" sth. very wrong (overwritten, invalid) with "<<pPicoFileList->GetFileName(0)<<", not chained "<<endm;
1646  continue;
1647  }
1648 
1649  if (dummyFile.TestBit(1024)) {
1650  gMessMgr->Info() <<" revocer procedure applied to "<<pPicoFileList->GetFileName(0)<<", maybe useful but still not chained for flow analyses"<<endm;
1651  continue;
1652  }
1653 
1654  if (Debug()) gMessMgr->Info() << " doFlowEvents - input fileList = "
1655  << pPicoFileList->GetFileName(0) << endm;
1656  pPicoChain->Add(pPicoFileList->GetFileName(0));
1657  }
1658 
1659  pPicoChain->SetBranchAddress("pPicoEvent", &pPicoEvent);
1660 
1661  Int_t nEntries = (Int_t)pPicoChain->GetEntries();
1662  if (Debug()) gMessMgr->Info() << "##### FlowMaker: events in Pico-DST file = "
1663  << nEntries << endm;
1664 
1665  mEventCounter = 0;
1666 
1667  return kStOK;
1668 }
1669 
1670 //-----------------------------------------------------------------------
1671 
1672 // Int_t StFlowMaker::InitMuEventRead() {
1673 // // NOT USED
1674 
1675 // if (Debug()) gMessMgr->Info() << "FlowMaker: InitMuEventRead()" << endm;
1676 
1677 // pMuEvents = new TClonesArray("StMuEvent", 1);
1678 // pMuTracks = new TClonesArray("StMuTrack", 10000);
1679 // pMuGlobalTracks = new TClonesArray("StMuTrack", 10000);
1680 
1681 // pMuChain = new TChain("MuDst");
1682 
1683 // for (Int_t ilist = 0; ilist < pMuFileList->GetNBundles(); ilist++) {
1684 // pMuFileList->GetNextBundle();
1685 
1686 // #if 0
1687 // TFile* dummyFile = TFile::Open(pMuFileList->GetFileName(0),"READ");
1688 
1689 // if (!dummyFile ||!(dummyFile->IsOpen())) {
1690 // gMessMgr->Info() <<pMuFileList->GetFileName(0)<<" open failed ! not chained"<<endm;
1691 // continue;
1692 // }
1693 
1694 // if (dummyFile->IsZombie()) {
1695 // gMessMgr->Info() <<" sth. very wrong (overwritten, invalid) with "<<pMuFileList->GetFileName(0)<<", not chained "<<endm;
1696 // continue;
1697 // }
1698 // // this shoudl fix the memory leak and the code crash
1699 // delete dummyFile;
1700 
1701 // // this produced the misleading statement, because the file was open to READ and it can not be recovered.
1702 // if (dummyFile->TestBit(1024)) {
1703 // gMessMgr->Info() <<" revocer procedure applied to "<<pMuFileList->GetFileName(0)<<", maybe useful but still not chained for flow analyses"<<endm;
1704 // continue;
1705 // }
1706 // #endif
1707 
1708 
1709 // //************** this block is to remove files with # evts < 5
1710 // // if there is only one event in a file, the job will crash
1711 // TChain* pTempChain = new TChain("MuDst");
1712 // pTempChain->Add(pMuFileList->GetFileName(0));
1713 // if (((Int_t)pTempChain->GetEntries()) > 5 )
1714 // pMuChain->Add(pMuFileList->GetFileName(0));
1715 // if (pTempChain) { delete pTempChain; pTempChain=0; }
1716 // //************** end of the block
1717 
1718 // // if (Debug()) gMessMgr->Info() << " doFlowEvents - input fileList = "
1719 // // << pMuFileList->GetFileName(0) << endm;
1720 
1721 
1722 // pMuChain->SetBranchAddress("MuEvent", &pMuEvents);
1723 // pMuChain->SetBranchAddress("PrimaryTracks", &pMuTracks);
1724 // pMuChain->SetBranchAddress("GlobalTracks", &pMuGlobalTracks);
1725 
1726 // pMuChain->SetBranchStatus("*",0);
1727 // pMuChain->SetBranchStatus("MuEvent*",1);
1728 // pMuChain->SetBranchStatus("PrimaryTracks*",1);
1729 // pMuChain->SetBranchStatus("GlobalTracks.mPt",1);
1730 // pMuChain->SetBranchStatus("GlobalTracks.mPhi",1);
1731 // pMuChain->SetBranchStatus("GlobalTracks.mEta",1);
1732 
1733 // Int_t nEntries = (Int_t)pMuChain->GetEntries();
1734 // // if (Debug()) gMessMgr->Info() << "##### FlowMaker: events in Mu-DST chain = "
1735 // // << nEntries << endm;
1736 // gMessMgr->Info() << "### ## FlowMaker: " << pMuFileList->GetFileName(0)
1737 // << " " << nEntries << " events" << endm;
1738 
1739 // }
1740 
1741 // mEventCounter = 0;
1742 
1743 // return kStOK;
1744 // }
1745 
1746 //-----------------------------------------------------------------------
1747 
1748 Int_t StFlowMaker::InitMuEventRead() {
1749 
1750  if (Debug()) gMessMgr->Info() << "FlowMaker: InitMuEventRead()" << endm;
1751 
1752  mEventCounter = 0;
1753 
1754  return kStOK;
1755 }
1756 
1757 //-----------------------------------------------------------------------
1758 
1759 Float_t StFlowMaker::CalcDcaSigned(const StThreeVectorF vertex,
1760  const StTrack* gTrack) {
1761  // find the distance between the center of the circle and vertex.
1762  // if the radius of curvature > distance, then call it positive
1763  // Bum Choi
1764 
1765  double xCenter = gTrack->geometry()->helix().xcenter();
1766  double yCenter = gTrack->geometry()->helix().ycenter();
1767  double radius = 1.0/gTrack->geometry()->helix().curvature();
1768 
1769  double dPosCenter = ::sqrt( (vertex.x() - xCenter) * (vertex.x() - xCenter) +
1770  (vertex.y() - yCenter) * (vertex.y() - yCenter));
1771 
1772  return (Float_t)(radius - dPosCenter);
1773 }
1774 
1775 //-----------------------------------------------------------------------
1776 
1777 Float_t StFlowMaker::CalcDcaSigned(const StThreeVectorF vertex,
1778  const StPhysicalHelixD helix) {
1779  // find the distance between the center of the circle and vertex.
1780  // if the radius of curvature > distance, then call it positive
1781  // Bum Choi
1782 
1783  double xCenter = helix.xcenter();
1784  double yCenter = helix.ycenter();
1785  double radius = 1.0/helix.curvature();
1786 
1787  double dPosCenter = ::sqrt( (vertex.x() - xCenter) * (vertex.x() - xCenter) +
1788  (vertex.y() - yCenter) * (vertex.y() - yCenter));
1789 
1790  return (Float_t)(radius - dPosCenter);
1791 }
1792 
1793 //----------------------------------------------------------------------
1794 
1795 void StFlowMaker::FillFlowEvent(StHbtEvent* hbtEvent) {
1796  // For use with HBT Maker. By Randy Wells.
1797 
1798  if (Debug()) gMessMgr->Info() << "FlowMaker: FillFlowEvent(HbtEvent)" << endm;
1799 
1800  // Delete previous StFlowEvent
1801  if (pFlowEvent) delete pFlowEvent;
1802  pFlowEvent = NULL;
1803  // Instantiate a new StFlowEvent
1804  pFlowEvent = new StFlowEvent;
1805 
1806  cout << "Inside FlowMaker::FillFlowEvent(HbtEvent)..." << endl;
1807 
1808  // set phiweights
1809  if (mFirstLastPhiWgt) pFlowEvent->SetFirstLastPhiWgt();
1810  pFlowEvent->SetPhiWeightFarEast(mPhiWgtFarEast);
1811  pFlowEvent->SetPhiWeightEast(mPhiWgtEast);
1812  pFlowEvent->SetPhiWeightWest(mPhiWgtWest);
1813  pFlowEvent->SetPhiWeightFarWest(mPhiWgtFarWest);
1814  pFlowEvent->SetPhiWeightFtpcFarEast(mPhiWgtFtpcFarEast);
1815  pFlowEvent->SetPhiWeightFtpcEast(mPhiWgtFtpcEast);
1816  pFlowEvent->SetPhiWeightFtpcWest(mPhiWgtFtpcWest);
1817  pFlowEvent->SetPhiWeightFtpcFarWest(mPhiWgtFtpcFarWest);
1818 
1819  // Event ID and Run ID
1820  // ????????
1821  // Primary Vertex
1822  pFlowEvent->SetVertexPos( hbtEvent->PrimVertPos() );
1823  // Triggers
1824  pFlowEvent->SetCTB( hbtEvent->CtbMult() );
1825  pFlowEvent->SetZDCe( hbtEvent->ZdcAdcEast() );
1826  pFlowEvent->SetZDCw( hbtEvent->ZdcAdcWest() );
1827  // Get initial multiplicity before TrackCuts
1828  UInt_t origMult = hbtEvent->NumberOfTracks();
1829  pFlowEvent->SetOrigMult(origMult);
1830  //PR(origMult);
1831  // Fill track info
1832  int goodTracks = 0;
1833  int goodTracksEta = 0;
1834  StHbtTrack* pParticle;
1835  StHbtTrackIterator pIter;
1836  StHbtTrackIterator startLoop = hbtEvent->TrackCollection()->begin();
1837  StHbtTrackIterator endLoop = hbtEvent->TrackCollection()->end();
1838  for (pIter=startLoop; pIter!=endLoop; pIter++){
1839  pParticle = *pIter;
1840  // Instantiate new StFlowTrack
1841  StFlowTrack* pFlowTrack = new StFlowTrack;
1842  if (!pFlowTrack) return;
1843  double px = pParticle->P().x();
1844  double py = pParticle->P().y();
1845  double phi = atan2(py,px);
1846  if (phi<0.0) phi+=twopi;
1847  pFlowTrack->SetPhi( phi );
1848  pFlowTrack->SetPhiGlobal( phi );
1849  double pz = pParticle->P().z();
1850  double pTotal = pParticle->P().mag();
1851  double eta = 0.5*::log( (1.0+pz/pTotal)/(1.0-pz/pTotal) );
1852  pFlowTrack->SetEta( eta );
1853  pFlowTrack->SetEtaGlobal( eta );
1854  pFlowTrack->SetPt( pParticle->Pt() );
1855  pFlowTrack->SetPtGlobal( pParticle->Pt() );
1856  pFlowTrack->SetCharge( int(pParticle->Charge()) );
1857  double dcaXY = pParticle->DCAxy();
1858  double dcaZ = pParticle->DCAz();
1859  double dca = ::sqrt( dcaXY*dcaXY + dcaZ*dcaZ );
1860  //pFlowTrack->SetDca( dca );
1861  pFlowTrack->SetDcaGlobal( dca );
1862  pFlowTrack->SetChi2( pParticle->ChiSquaredXY() );
1863  pFlowTrack->SetFitPts( pParticle->NHits() );
1864  pFlowTrack->SetMaxPts( pParticle->NHitsPossible() );
1865  cout << "pParticle->NHits(), pParticle->NHitsPossible() in StFlowMaker::FillFlowEvent(StHbtEvent* hbtEvent) might be wrong!" << endl;
1866  cout << "(MuDst, StEvent were changed and nFitPts might be different from nHits.)" << endl;
1867  cout << "Whoever uses them, check it, please!" << endl;
1868  // PID
1869  pFlowTrack->SetPidPiPlus( pParticle->NSigmaPion() );
1870  pFlowTrack->SetPidPiMinus( pParticle->NSigmaPion() );
1871  pFlowTrack->SetPidProton( pParticle->NSigmaProton() );
1872  pFlowTrack->SetPidAntiProton( pParticle->NSigmaProton() );
1873  pFlowTrack->SetPidKaonMinus( pParticle->NSigmaKaon() );
1874  pFlowTrack->SetPidKaonPlus( pParticle->NSigmaKaon() );
1875  pFlowTrack->SetPidDeuteron( 0.0 );
1876  pFlowTrack->SetPidAntiDeuteron( 0.0 );
1877  pFlowTrack->SetPidElectron( pParticle->NSigmaElectron() );
1878  pFlowTrack->SetPidPositron( pParticle->NSigmaElectron() );
1879  // dEdx
1880  if ( pParticle->NSigmaKaon() > 2.0 ) {
1881  if (pParticle->Charge() > 0 ) {
1882  pFlowTrack->SetMostLikelihoodPID(14); // proton
1883  pFlowTrack->SetMostLikelihoodProb( 0.99 ); // guaranteed
1884  }
1885  else {
1886  pFlowTrack->SetMostLikelihoodPID(15); // anti-proton
1887  pFlowTrack->SetMostLikelihoodProb( 0.99 ); // guaranteed
1888  }
1889  }
1890  if ( pParticle->NSigmaPion() > 2.0 ) {
1891  if (pParticle->Charge() > 0 ) {
1892  pFlowTrack->SetMostLikelihoodPID(11); // kaon
1893  pFlowTrack->SetMostLikelihoodProb( 0.99 ); // guaranteed
1894  }
1895  else {
1896  pFlowTrack->SetMostLikelihoodPID(12); // anti-kaon
1897  pFlowTrack->SetMostLikelihoodProb( 0.99 ); // guaranteed
1898  }
1899  }
1900  if ( pParticle->NSigmaPion() < -2.0 ) {
1901  if (pParticle->Charge() < 0 ) {
1902  pFlowTrack->SetMostLikelihoodPID(3); // electron
1903  pFlowTrack->SetMostLikelihoodProb( 0.99 ); // guaranteed
1904  }
1905  else {
1906  pFlowTrack->SetMostLikelihoodPID(2); // positron
1907  pFlowTrack->SetMostLikelihoodProb( 0.99 ); // guaranteed
1908  }
1909  }
1910  pFlowTrack->SetExtrapTag(0); // none are in the PID merging area
1911  pFlowEvent->TrackCollection()->push_back(pFlowTrack);
1912  goodTracks++;
1913  }
1914 
1915  pFlowEvent->SetMultEta(goodTracksEta);
1916  pFlowEvent->SetCentrality();
1917  pFlowEvent->TrackCollection()->random_shuffle();
1918  pFlowEvent->SetSelections();
1919  pFlowEvent->MakeSubEvents();
1920 }
1921 
1922 //----------------------------------------------------------------------
1923 
1925 //
1926 // $Log: StFlowMaker.cxx,v $
1927 // Revision 1.119 2010/09/30 19:30:28 posk
1928 // Instead of reversing the weight for negative pseudrapidity for odd harmonics,
1929 // it is now done only for the first harmonic.
1930 // Recentering is now done for all harmonics.
1931 //
1932 // Revision 1.118 2010/03/08 16:52:51 posk
1933 // Added StFlowDirectCumulantMaker written by Dhevan Gangadharan.
1934 //
1935 // Revision 1.117 2009/11/24 19:23:04 posk
1936 // Added reCenter option to remove acceptance correlations instead of phiWgt.
1937 //
1938 // Revision 1.116 2009/08/04 23:00:29 posk
1939 // Reads year 7 MuDsts.
1940 //
1941 // Revision 1.115 2009/07/28 16:11:52 posk
1942 // Reinstalled hbt stuff.
1943 //
1944 // Revision 1.114 2009/07/24 20:23:32 posk
1945 // 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.
1946 //
1947 // Revision 1.113 2007/07/12 19:35:49 fisyak
1948 // Add includes for ROOT 5.16
1949 //
1950 // Revision 1.112 2007/03/26 20:36:04 aihong
1951 // west ZDCSMD H7 (readout as 26 in the trigger array) was swapped with LED (readout as 24 in trigger array), to avoid abnormal pedestal in the electronic channel associated with 26 in the trigger array. The swap happened on 03/25/07
1952 //
1953 // Revision 1.111 2007/02/06 18:57:55 posk
1954 // In Lee Yang Zeros method, introduced recentering of Q vector.
1955 // Reactivated eta symmetry cut.
1956 //
1957 // Revision 1.110 2006/07/06 20:29:48 posk
1958 // Changed the dynamic_cast of GetInputDS("MuDst") to a const cast.
1959 //
1960 // Revision 1.109 2006/07/06 16:56:02 posk
1961 // Calculation of v1 for selection=2 is done with mixed harmonics.
1962 //
1963 // Revision 1.108 2006/05/11 20:14:36 fine
1964 // Eliminate the memeory leak and code crash
1965 //
1966 // Revision 1.107 2006/02/22 19:25:35 posk
1967 // Changes needed for the MuDst
1968 // Stopped using eventSummary()
1969 //
1970 // Revision 1.106 2005/12/07 19:41:29 perev
1971 // new TFile ==> TFile::Open
1972 //
1973 // Revision 1.105 2005/03/03 17:22:02 posk
1974 // Initialized pFlowEvent in the constructors.
1975 //
1976 // Revision 1.104 2005/02/11 23:24:31 posk
1977 // SetCentrality works for year4.
1978 //
1979 // Revision 1.103 2005/02/10 21:04:57 aihong
1980 // test mProbPid of StFlowEvent before launch calculation pid on fly
1981 //
1982 // Revision 1.102 2005/02/10 17:39:40 posk
1983 // Now also works with the Grid Collector.
1984 //
1985 // Revision 1.101 2005/02/08 20:57:36 psoren
1986 // trigger and centrality selections were updated for all runs after run 4 to be compatible with trigger collections. Added TriggersFound() and GetFlowTriggerBitMap() functions.
1987 //
1988 // Revision 1.100 2004/12/22 15:15:16 aihong
1989 // Read run-by-run beam shifts and SMD pedestal. Done by Gang
1990 //
1991 // Revision 1.99 2004/12/21 17:06:12 aihong
1992 // check corrupted files for MuDst and picoDst
1993 //
1994 // Revision 1.98 2004/12/17 22:33:16 aihong
1995 // add in full Psi weight for ZDC SMD and fix a few bugs, done by Gang
1996 //
1997 // Revision 1.97 2004/12/09 23:43:36 posk
1998 // Minor changes in code formatting.
1999 //
2000 // Revision 1.96 2004/12/09 00:45:17 oldi
2001 // Little fix to get rid if problems when primaries don't have globals assigned to them.
2002 //
2003 // Revision 1.95 2004/12/07 23:08:12 posk
2004 // Only odd and even phiWgt hists. If the old phiWgt file contains more than
2005 // two harmonics, only the first two are read. Now writes only the first two.
2006 //
2007 // Revision 1.94 2004/12/07 17:04:46 posk
2008 // Eliminated the very old mOnePhiWgt, which used one phiWgt histogram for flttening
2009 // instead of four.
2010 //
2011 // Revision 1.93 2004/11/11 18:14:56 posk
2012 // Added a debug print statement.
2013 //
2014 // Revision 1.92 2004/08/24 20:24:34 oldi
2015 // Minor modifications to avoid compiler warnings.
2016 // Small bug fix (didn't affect anyone yet).
2017 //
2018 // Revision 1.91 2004/08/18 00:19:19 oldi
2019 // Several changes were necessary to comply with latest changes of MuDsts and StEvent:
2020 //
2021 // nHits, nFitPoints, nMaxPoints
2022 // -----------------------------
2023 // From now on
2024 // - the fit points used in StFlowMaker are the fit points within the TPC xor FTPC (vertex excluded).
2025 // - the max. possible points used in StFlowMAker are the max. possible points within the TPC xor FTPC (vertex excluded).
2026 // - the number of points (nHits; not used for analyses so far) are the total number of points on a track, i. e.
2027 // TPC + SVT + SSD + FTPCeast + FTPCwest [reading from HBT event gives a warning, but it seems like nobody uses it anyhow].
2028 // - The fit/max plot (used to be (fit-1)/max) was updated accordingly.
2029 // - The default cuts for fit points were changed (only for the FTPC, since TPC doesn't set default cuts).
2030 // - All these changes are backward compatible, as long as you change your cuts for the fit points by 1 (the vertex used to
2031 // be included and is not included anymore). In other words, your results won't depend on old or new MuDst, StEvent,
2032 // PicoDsts as long as you use the new flow software (together with the latest MuDst and StEvent software version).
2033 // - For backward compatibility reasons the number of fit points which is written out to the flowpicoevent.root file
2034 // includes the vertex. It is subtracted internally while reading back the pico files. This is completely hidden from the
2035 // user.
2036 //
2037 // zFirstPoint
2038 // -----------
2039 // The positions of the first point of tracks which have points in the TPC can lie outside of the TPC (the tracks can start in
2040 // the SVT or SSD now). In this case, the first point of the track is obtained by extrapolating the track helix to the inner
2041 // radius of the TPC.
2042 //
2043 // Revision 1.90 2004/05/31 20:09:37 oldi
2044 // PicoDst format changed (Version 7) to hold ZDC SMD information.
2045 // Trigger cut modified to comply with TriggerCollections.
2046 // Centrality definition for 62 GeV data introduced.
2047 // Minor bug fixes.
2048 //
2049 // Revision 1.89 2004/05/05 21:13:44 aihong
2050 // Gang's code for ZDC-SMD added
2051 //
2052 // Revision 1.88 2004/04/09 15:49:01 aihong
2053 // make changes to support getting PID on fly for picodst and MuDst.
2054 //
2055 // Revision 1.87 2003/12/12 02:33:04 oldi
2056 // Read from PicoDST version 4 enabled again (some simulations are in this format).
2057 //
2058 // Revision 1.86 2003/09/02 17:58:12 perev
2059 // gcc 3.2 updates + WarnOff
2060 //
2061 // Revision 1.85 2003/08/26 21:08:28 posk
2062 // Removed commented lines.
2063 //
2064 // Revision 1.84 2003/07/08 18:27:09 posk
2065 // Skips pico tracks with dca = dcaGlobal.
2066 //
2067 // Revision 1.83 2003/05/06 20:38:03 posk
2068 // Removed all but last two versions of pico file read.
2069 //
2070 // Revision 1.82 2003/04/01 00:27:08 posk
2071 // Little q is now unweighted by pt or eta. Big Q is unaffected.
2072 //
2073 // Revision 1.81 2003/01/14 14:19:07 oldi
2074 // Log of last commit changed to indicate the important introduction of the
2075 // pMuTrack->flag() cut.
2076 //
2077 // Revision 1.80 2003/01/14 14:12:17 oldi
2078 // Cut on pMuTrack->flag() introduced. No the results agree,
2079 // independently of the input format (*.event.root <-> *.MuDst.root).
2080 // Possibility to exclude TPC tracks completely (= FTPC only).
2081 //
2082 // Revision 1.79 2003/01/13 20:03:16 aihong
2083 // let it exclude MuDst files with events less than 5
2084 //
2085 // Revision 1.78 2003/01/10 16:42:17 oldi
2086 // Several changes to comply with FTPC tracks:
2087 // - Switch to include/exclude FTPC tracks introduced.
2088 // The same switch changes the range of the eta histograms.
2089 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots.
2090 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East,
2091 // West, FarWest (depending on vertex.z()).
2092 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added.
2093 // - Cut to exclude mu-events with no primary vertex introduced.
2094 // (This is possible for UPC events and FTPC tracks.)
2095 // - Global DCA cut for FTPC tracks added.
2096 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks.
2097 // - Charge cut for FTPC tracks added.
2098 //
2099 // Revision 1.77 2003/01/08 19:26:49 posk
2100 // PhiWgt hists sorted on sign of z of first and last points.
2101 // Version 6 of pico file.
2102 //
2103 // Revision 1.76 2002/06/10 22:51:00 posk
2104 // pt and eta weighting now default.
2105 // DcaGlobalPart default now 0 to 1 cm.
2106 // Event cut order changed.
2107 //
2108 // Revision 1.75 2002/06/07 22:18:40 kirill
2109 // Introduced MuDst reader
2110 //
2111 // Revision 1.74 2002/05/23 18:54:12 posk
2112 // Moved centrality cuts into StFlowConstants
2113 //
2114 // Revision 1.73 2002/03/15 16:43:22 snelling
2115 // Added a method to recalculate the centrality in StFlowPicoEvent
2116 //
2117 // Revision 1.72 2002/03/14 18:51:50 snelling
2118 // Added new centralities
2119 //
2120 // Revision 1.71 2002/03/12 02:33:22 posk
2121 // Now makes pico files in SL02c.
2122 //
2123 // Revision 1.70 2002/02/05 07:19:26 snelling
2124 // Quick fix for problems with backward compatibility (changed ClassDef back)
2125 //
2126 // Revision 1.69 2002/02/01 23:06:34 snelling
2127 // Added entries for header information in flowPico (not everthing is available yet)
2128 //
2129 // Revision 1.68 2002/01/14 23:39:34 posk
2130 // Moved print commands to Finish().
2131 //
2132 // Revision 1.67 2002/01/11 19:08:43 posk
2133 // Restored SetDca for backwards compatability.
2134 //
2135 // Revision 1.66 2002/01/07 23:32:01 posk
2136 // Added return to prevent seg. fault when event skipped.
2137 //
2138 // Revision 1.65 2002/01/07 21:42:49 posk
2139 // Protection for seg. fault when no particles.
2140 //
2141 // Revision 1.64 2001/12/18 19:22:15 posk
2142 // "proton" and "antiproton" changed to "pr+" and "pr-".
2143 // Compiles on Solaris.
2144 //
2145 // Revision 1.63 2001/12/11 21:33:55 posk
2146 // Went from one to four sets of histograms for making the event plane isotropic.
2147 // StFlowEvent::PhiWeight() has changed arguments and return value.
2148 // The ptWgt saturates above 2 GeV/c.
2149 //
2150 // Revision 1.62 2001/11/09 21:10:45 posk
2151 // Switched from CERNLIB to TMath. Little q is now normalized.
2152 //
2153 // Revision 1.61 2001/08/01 19:39:40 snelling
2154 // Added the trigger word
2155 //
2156 // Revision 1.60 2001/07/27 20:33:40 snelling
2157 // switched from StRun to StEvtHddr.
2158 //
2159 // Revision 1.59 2001/07/27 01:26:19 snelling
2160 // Added and changed variables for picoEvent. Changed trackCut class to StTrack
2161 //
2162 // Revision 1.58 2001/07/24 22:29:17 snelling
2163 // First attempt to get a standard root pico file again, added variables
2164 //
2165 // Revision 1.57 2001/07/02 20:19:12 posk
2166 // Moved call to SetPids() above call to SetSelections().
2167 //
2168 // Revision 1.56 2001/06/06 13:02:58 rcwells
2169 // Added SetPtWgt(Bool_t) function to StFlowEvent
2170 //
2171 // Revision 1.55 2001/06/04 18:57:05 rcwells
2172 // Adding filling from HbtEvents
2173 //
2174 // Revision 1.54 2001/05/23 18:11:14 posk
2175 // Removed SetPids().
2176 //
2177 // Revision 1.53 2001/05/22 20:17:34 posk
2178 // Now can do pseudorapidity subevents.
2179 //
2180 // Revision 1.52 2001/04/25 17:46:33 perev
2181 // HPcorrs
2182 //
2183 // Revision 1.51 2000/12/29 19:40:39 snelling
2184 // Used the new calibration file for PID
2185 //
2186 // Revision 1.50 2000/12/12 20:22:05 posk
2187 // Put log comments at end of files.
2188 // Deleted persistent StFlowEvent (old micro DST).
2189 //
2190 // Revision 1.49 2000/12/10 02:01:13 oldi
2191 // A new member (StTrackTopologyMap mTopology) was added to StFlowPicoTrack.
2192 // The evaluation of either a track originates from the FTPC or not is
2193 // unambiguous now. The evaluation itself is easily extendible for other
2194 // detectors (e.g. SVT+TPC). Old flowpicoevent.root files are treated as if
2195 // they contain TPC tracks only (backward compatibility).
2196 //
2197 // Revision 1.48 2000/12/08 17:03:38 oldi
2198 // Phi weights for both FTPCs included.
2199 //
2200 // Revision 1.47 2000/12/06 15:38:46 oldi
2201 // Including FTPC.
2202 //
2203 // Revision 1.46 2000/11/30 16:40:21 snelling
2204 // Protection against loading probability pid caused it not to work anymore
2205 // therefore protection removed again
2206 //
2207 // Revision 1.45 2000/11/07 02:36:41 snelling
2208 // Do not init prob pid when not used
2209 //
Double_t pidProbKaon() const
Returns Aihong&#39;s probability of being a kaon.
Definition: StMuTrack.h:242
static TObjArray * globalTracks()
returns pointer to the global tracks list
Definition: StMuDst.h:303
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in &#39;physical events&#39;. Therefore there is only 1 primary vert...
Definition: StMuEvent.cxx:221
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
Double_t pidProbElectron() const
Returns Aihong&#39;s probability of being an electron.
Definition: StMuTrack.h:240
Flow::ReCent_t mReCentY
Recentering parameters.
Definition: StFlowMaker.h:95
Int_t index2Global() const
Returns index of associated global track. If not in order can be set with StMuDst::fixTrackIndeces() ...
Definition: StMuTrack.h:231
Double_t pt() const
Returns pT at point of dca to primary vertex.
Definition: StMuTrack.h:256
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
Definition: StMuTrack.h:228
UShort_t nHitsDedx() const
Return number of hits used for dEdx.
Definition: StMuTrack.h:238
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
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
Definition: StHelix.cc:351
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
Definition: StMuTrack.cxx:407
UShort_t nHitsFit() const
Return total number of hits used in fit.
Definition: StMuTrack.h:239
Double_t mZDCSMDCenterEx
ZDCSMD full Psi.
Definition: StFlowMaker.h:91
double ycenter() const
x-center of circle in xy-plane
Definition: StHelix.cc:215
short flag() const
Returns flag, (see StEvent manual for type information)
Definition: StMuTrack.h:230
Short_t charge() const
Returns charge.
Definition: StMuTrack.h:255
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:259
Double_t nSigmaPion() const
Returns Craig&#39;s distance to the calculated dE/dx band for pions in units of sigma.
Definition: StMuTrack.h:245
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
Definition: StMuTrack.h:257
Double_t pidProbProton() const
Returns Aihong&#39;s probability of being a proton.
Definition: StMuTrack.h:243
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
Definition: StMuTrack.h:261
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
Definition: Stypes.h:43
Double_t nSigmaElectron() const
Returns Craig&#39;s distance to the calculated dE/dx band for electrons in units of sigma.
Definition: StMuTrack.h:244
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
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
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Double_t mZDCSMDCenterWx
ZDCSMD Beam Center.
Definition: StFlowMaker.h:92
Definition: Stypes.h:40
UShort_t nHits() const
Bingchu.
Definition: StMuTrack.h:237
Double_t chi2xy() const
Returns chi2 of fit. ATTENTIONS: does not return xy chi2 (historic)
Definition: StMuTrack.h:249
StThreeVectorF dca(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex.
Definition: StMuTrack.cxx:359
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
Definition: StMuTrack.h:262
Double_t dEdx() const
Returns measured dE/dx value.
Definition: StMuTrack.h:248
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()
Double_t phi() const
Returns phi at point of dca to primary vertex.
Definition: StMuTrack.h:258
virtual Int_t Finish()
Definition: StMaker.cxx:776
Double_t nSigmaProton() const
Returns Craig&#39;s distance to the calculated dE/dx band for protons in units of sigma.
Definition: StMuTrack.h:247
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Definition: StMuTrack.cxx:371
Double_t nSigmaKaon() const
Returns Craig&#39;s distance to the calculated dE/dx band for kaons in units of sigma.
Definition: StMuTrack.h:246
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
Double_t pidProbPion() const
Returns Aihong&#39;s probability of being a pion.
Definition: StMuTrack.h:241
double xcenter() const
aziumth in xy-plane measured from ring center
Definition: StHelix.cc:207
StTrackTopologyMap topologyMap() const
Returns topology map.
Definition: StMuTrack.h:254
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