65 const char *dstFile = 0;
66 const char *fileList[] = {dstFile, 0};
69 void doFlowEvents(Int_t nEvents,
const Char_t **fileList, Bool_t firstPass = kFALSE);
70 void doFlowEvents(Int_t nEvents,
const Char_t *path,
const Char_t *file,
71 Bool_t firstPass = kFALSE);
72 void doFlowEvents(Int_t nEvents,
const Char_t *path/file, Bool_t firstPass = kFALSE);
73 void doFlowEvents(Int_t nEvents = 2, Bool_t firstPass = kFALSE);
76 void doFlowEvents(Int_t nEvents,
const Char_t **fileList, Bool_t firstPass)
78 cout << endl << endl <<
" doFlowEvents - input # events = " << nEvents << endl;
80 while (fileList[ilist]) {
81 cout <<
" doFlowEvents - input fileList = " << fileList[ilist] << endl;
87 Bool_t reCent = kFALSE;
90 cout <<
" doFlowEvents - firstPass makers = kTRUE" << endl;
92 cout <<
" doFlowEvents - firstPass makers = kFALSE" << endl;
95 cout <<
" doFlowEvents - reCent = kTRUE" << endl;
97 cout <<
" doFlowEvents - phiWgt = kTRUE" << endl;
104 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
105 loadSharedLibraries();
106 gSystem->Load(
"StFlowMaker");
107 gSystem->Load(
"StFlowAnalysisMaker");
110 chain =
new StChain(
"StChain");
111 setFiles =
new StFile(fileList);
132 sprintf(makerName,
"Flow");
137 IOMk->SetBranch(
"*",0,
"0");
138 if (!mainBranch.IsNull()) { IOMk->SetBranch(mainBranch,0,
"r"); }
140 if (strstr(fileList[0],
"MuDst.root")) {
142 if (makerName[0]==
'\0') {
147 flowMaker->MuEventRead(kTRUE);
148 flowMaker->SetMuEventFileName(setFiles);
150 }
else if (strstr(fileList[0],
"picoevent.root")) {
152 if (makerName[0]==
'\0') {
157 flowMaker->PicoEventRead(kTRUE);
158 flowMaker->SetPicoEventFileName(setFiles);
160 }
else if (strstr(fileList[0],
".dst.root") ||
161 strstr(fileList[0],
".event.root")) {
163 mainBranch = fileList[0];
164 mainBranch.ReplaceAll(
".root",
"");
165 int idot = strrchr((
char*)mainBranch,
'.') - mainBranch.Data();
166 mainBranch.Replace(0,idot+1,
"");
167 mainBranch +=
"Branch";
168 printf(
"*** mainBranch=%s ***\n",mainBranch.Data());
171 if (!mainBranch.Contains(
"eventBranch")) {
172 gSystem->Load(
"StEventMaker");
175 if (makerName[0]==
'\0') {
181 cout <<
"##### doFlowEvents: unknown file name = " << fileList[0] << endl;
198 phiWgtMaker = kFALSE;
200 reCentMaker = kFALSE;
208 reCentMaker = kFALSE;
209 phiWgtMaker = kFALSE;
214 dirCumuMaker= kFALSE;
216 Bool_t includeTpcTracks = kTRUE;
217 Bool_t includeFtpcTracks = kTRUE;
220 Float_t ptRange_for_vEta[2] = {0.15, 2.};
221 Float_t etaRange_for_vPt[2] = {0., 1.1};
233 flowMaker->SetPhiWgtCalc(kFALSE);
234 flowMaker->SetReCentCalc(kTRUE);
236 flowMaker->SetPhiWgtCalc(kTRUE);
237 flowMaker->SetReCentCalc(kFALSE);
239 }
else if (lyzMaker) {
240 flowMaker->SetReCentCalc();
242 flowMaker->SetPhiWgtCalc();
243 flowMaker->SetReCentCalc(kFALSE);
252 Bool_t v1Ep1Ep2 = kFALSE;
254 if (makerName[0]==
'\0') {
257 flowAnalysisMaker->SetHistoRanges(includeFtpcTracks);
258 flowAnalysisMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]);
259 flowAnalysisMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]);
260 flowAnalysisMaker->SetV1Ep1Ep2(v1Ep1Ep2);
264 flowCumulantMaker->SetHistoRanges(includeFtpcTracks);
268 flowScalarProdMaker->SetHistoRanges(includeFtpcTracks);
272 flowLeeYangZerosMaker->SetHistoRanges(includeFtpcTracks);
273 flowLeeYangZerosMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]);
274 flowLeeYangZerosMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]);
281 sprintf(makerName,
"FlowAnalysis");
284 flowAnalysisMaker->SetHistoRanges(includeFtpcTracks);
285 flowAnalysisMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]);
286 flowAnalysisMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]);
287 flowAnalysisMaker->SetV1Ep1Ep2(v1Ep1Ep2);
290 sprintf(makerName,
"FlowCumulant");
293 flowCumulantMaker->SetHistoRanges(includeFtpcTracks);
296 sprintf(makerName,
"FlowScalarProd");
299 flowScalarProdMaker->SetHistoRanges(includeFtpcTracks);
302 sprintf(makerName,
"FlowLeeYangZeros");
305 flowLeeYangZerosMaker->SetHistoRanges(includeFtpcTracks);
306 flowLeeYangZerosMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]);
307 flowLeeYangZerosMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]);
310 sprintf(makerName,
"FlowDirectCumulant");
344 Int_t iInit = chain->Init();
347 chain->Fatal(iInit,
"on init");
358 Int_t centrality = RunType % 10 ;
359 StFlowCutEvent::SetCent(centrality, centrality);
367 StFlowCutEvent::SetVertexZ(-30., 30.);
369 StFlowCutEvent::SetEtaSymFtpc(0., 0.);
371 StFlowCutEvent::SetCent(0, 0);
375 StFlowCutTrack::IncludeTpcTracks(includeTpcTracks);
383 StFlowCutTrack::IncludeFtpcTracks(includeFtpcTracks);
385 StFlowCutTrack::SetChiSqFtpc(0., 4.);
386 StFlowCutTrack::SetDcaFtpc(0., 2.);
388 StFlowCutTrack::SetPtFtpc(0.15, 2.);
396 StFlowEvent::SetEtaTpcCut(9., 10., 0, 0);
397 StFlowEvent::SetEtaTpcCut(9., 10., 1, 0);
398 StFlowEvent::SetEtaFtpcCut(-10., -9., 9., 10., 0, 1);
399 StFlowEvent::SetEtaFtpcCut(-10., -9., 9., 10., 1, 1);
428 if (reCent && lyzMaker) {
429 StFlowEvent::SetPtWgt(kFALSE);
432 StFlowEvent::SetPtWgt(kTRUE);
433 StFlowEvent::SetEtaWgt(kFALSE);
459 int istat = 0, iEvt = 1;
460 EventLoop:
if (iEvt <= nEvents && istat != 2) {
462 cout <<
"===== Event " << iEvt <<
" start ===== " << endl;
464 istat = chain->
Make(iEvt);
466 {cout <<
"Last event processed. Status = " << istat << endl;}
468 {cout <<
"Error event processed. Status = " << istat << endl;}
475 cout <<
"============================ Event " << iEvt
476 <<
" finish ============================" << endl;
484 if (!b) { b =
new TBrowser; }
487 TVectorD* cumulConstants =
new TVectorD(30);
488 TObjString* cumulMethodTag =
new TObjString(
"cumulNew" );
493 TFile cumuFile(
"flow.cumulant.root",
"READ");
494 if (cumuFile.IsOpen()) {
496 for (
int mm=0; mm<30; mm++)
497 (*cumulConstants)(mm) =
498 (*((TVectorD* )cumuFile.Get(
"CumulConstants")))(mm);
500 cout <<
"### Can't find file flow.cumulant.root" << endl;
504 TFile spFile(
"flow.scalar.root",
"READ");
505 if (spFile.IsOpen()) {
508 cout <<
"### Can't find file flow.scalar.root" << endl;
513 TFile lyzFirstPassFile(
"flow.firstPassLYZ.root",
"READ");
514 if (lyzFirstPassFile.IsOpen()) {
515 TFile lyzZeroPassFile(
"flow.reCent.root",
"READ");
516 if (lyzZeroPassFile.IsOpen()) {
517 lyzZeroPassFile.ReadAll();
518 TList* zeroPassList = lyzZeroPassFile.GetList();
521 lyzFirstPassFile.ReadAll();
522 TList* firstPassList = lyzFirstPassFile.GetList();
525 for (
int k = 0; k < nSels; k++) {
526 for (
int j = 0; j < 2; j++) {
527 for (
int Ntheta = 0; Ntheta < maxTheta; Ntheta++) {
528 histTitle =
new TString(
"FlowImGtheta");
529 *histTitle += Ntheta;
530 *histTitle +=
"_Sel";
532 *histTitle +=
"_Har";
534 hist = firstPassList->FindObject(histTitle->Data());
535 firstPassList->Remove(hist);
537 histTitle =
new TString(
"FlowReGtheta");
538 *histTitle += Ntheta;
539 *histTitle +=
"_Sel";
541 *histTitle +=
"_Har";
543 hist = firstPassList->FindObject(histTitle->Data());
544 firstPassList->Remove(hist);
550 TFile lyzFile(
"flow.LeeYangZeros.root",
"UPDATE");
551 if (lyzFile.IsOpen()) {
552 if (lyzZeroPassFile.IsOpen()) {
553 zeroPassList->Write();
555 firstPassList->Write();
559 TFile lyzFile(
"flow.LeeYangZeros.root",
"READ");
560 if (lyzFile.IsOpen()) {
563 cout <<
"### Can't find file flow.LeeYangZeros.root" << endl;
567 TFile anaFile(
"flow.hist.root",
"UPDATE");
569 TFile anaFile(
"flow.hist.root",
"RECREATE");
571 if (anaFile.IsOpen()) {
573 cumuFile.GetList()->Write();
574 cumulConstants->Write(
"CumulConstants",TObject::kOverwrite | TObject::kSingleKey);
575 cumulMethodTag->Write(
"CumulMethodTag",TObject::kOverwrite | TObject::kSingleKey);
577 if (spMaker) { spFile.GetList()->Write(); }
578 if (lyzMaker) { lyzFile.GetList()->Write(); }
582 cout <<
"### Can't find file flow.hist.root" << endl;
589 void doFlowEvents(Int_t nEvents,
const Char_t *path,
const Char_t *file,
592 const char *fileListQQ[] = {0,0};
593 if (path[0] ==
'-') {
594 fileListQQ[0] = file;
596 fileListQQ[0] = gSystem->ConcatFileName(path,file);
598 doFlowEvents(nEvents, fileListQQ, firstPass);
602 void doFlowEvents(Int_t nEvents,
const char *file, Bool_t firstPass)
604 printf(
"*file = %s\n",file);
605 const char *fileListQQ[]={0,0};
607 cout <<
"Calling (nEvents, fileListQQ, firstPass)" << endl;
608 doFlowEvents(nEvents, fileListQQ, firstPass);
612 void doFlowEvents(Int_t nEvents, Bool_t firstPass) {
644 Char_t* filePath=
"/eliza9/starprod/reco/2007ProductionMinBias/FullField/P08ic/2007/125/";
646 Char_t* fileExt=
"st_physics_8125119_raw_1040090.MuDst.root";
648 Char_t* fileExt=
"st_physics_*.MuDst.root";
660 doFlowEvents(nEvents, filePath, fileExt, firstPass);
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.