00001 00002 // 00003 // $Id: doFlowEvents.C,v 1.7 2011/07/25 15:54:47 posk Exp $ 00004 // Put a link to this at /StRoot/macros/analysis/doFlowEvents.C 00005 // 00006 // Description: 00007 // Chain to read events from files into StFlowEvent and analyze. 00008 // It reads dst.root, event.root, MuDst.root, or picoevent.root 00009 // files to fill StFlowEvent 00010 // 00011 // Environment: 00012 // Software developed for the STAR Detector at Brookhaven National Laboratory 00013 // 00014 // Ways to run: 00015 // If you specify a path, all DST files below that path will be 00016 // found, and 'nEvents' events will be analyzed. 00017 // The type of DST files searched for is taken from the 'file' parameter. 00018 // If 'file' ends in '.dst.root', ROOT DSTs are searched for. 00019 // If 'file' ends in '.event.root' a StEvent file is used. 00020 // If 'file' ends in 'MuDst.root' a StMuDST file is used. 00021 // If 'file' ends in 'flowpicoevent.root' a StFlowPicoEvent file is used. 00022 // 00023 // inputs: 00024 // nEvents = # events to process 00025 // path = a. directory you want files from 00026 // b. "-" to get just the one file you want 00027 // file = a. file names in directory (takes all files) 00028 // b. the one particular full file name (with directory) you want 00029 // firstPass = kTRUE runs StFlowPhiWgtMaker or StFlowReCentMaker only 00030 // 00031 // Usage: 00032 // doFlowEvents.C(nEvents, "-", "some_directory/some_dst_file.root") 00033 // doFlowEvents.C(nEvents, "some_directory", "*.root") 00034 // doFlowEvents.C(nEvents, "some_directory/some_dst_file.root") 00035 // doFlowEvents.C(nEvents) // default file 00036 // doFlowEvents.C() // 2 events 00037 // 00038 // Parameters, RunType and OutPicoDir, may be passed from the calling shell script 00039 // (see pdsf:: ~posk/doFlowSubmit.pl): 00040 // root4star -b << eof >& $LOG 00041 // Int_t RunType = $runNo; 00042 // const Char_t* OutPicoDir = "./$outPicoDir/"; 00043 // .L $doFile 00044 // doFlowEvents.C 00045 // .q 00046 //eof 00047 // 00048 // Author List: Torre Wenaus, BNL 2/99 00049 // Victor Perevoztchikov 00050 // Art Poskanzer 00051 // Raimond Snellings 00052 // Kirill Filimonov 00053 // Markus Oldenburg 00054 // 00056 class StChain; 00057 StChain *chain = 0; 00058 TBrowser *b = 0; 00059 Int_t RunType; 00060 Char_t* OutPicoDir; 00061 class StFileI; 00062 StFileI* setFiles = 0; 00063 TString mainBranch; 00064 00065 const char *dstFile = 0; 00066 const char *fileList[] = {dstFile, 0}; 00067 00068 //--------- Prototypes ----------- 00069 void doFlowEvents(Int_t nEvents, const Char_t **fileList, Bool_t firstPass = kFALSE); 00070 void doFlowEvents(Int_t nEvents, const Char_t *path, const Char_t *file, 00071 Bool_t firstPass = kFALSE); 00072 void doFlowEvents(Int_t nEvents, const Char_t *path/file, Bool_t firstPass = kFALSE); 00073 void doFlowEvents(Int_t nEvents = 2, Bool_t firstPass = kFALSE); 00074 00075 // -------- Here is the actual method ---------- 00076 void doFlowEvents(Int_t nEvents, const Char_t **fileList, Bool_t firstPass) 00077 { 00078 cout << endl << endl <<" doFlowEvents - input # events = " << nEvents << endl; 00079 Int_t ilist = 0; 00080 while (fileList[ilist]) { 00081 cout << " doFlowEvents - input fileList = " << fileList[ilist] << endl; 00082 ilist++; 00083 } 00084 00085 Int_t maxTheta = 5; // LYZ 00086 Int_t nSels = 2; 00087 Bool_t reCent = kFALSE; 00088 00089 if (firstPass) { 00090 cout << " doFlowEvents - firstPass makers = kTRUE" << endl; 00091 } else { 00092 cout << " doFlowEvents - firstPass makers = kFALSE" << endl; 00093 } 00094 if (reCent) { 00095 cout << " doFlowEvents - reCent = kTRUE" << endl; 00096 } else { 00097 cout << " doFlowEvents - phiWgt = kTRUE" << endl; 00098 } 00099 cout << endl << endl; 00100 00101 // 00102 // First load some shared libraries we need 00103 // 00104 gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C"); 00105 loadSharedLibraries(); 00106 gSystem->Load("StFlowMaker"); 00107 gSystem->Load("StFlowAnalysisMaker"); 00108 00109 // Make a chain with a file list 00110 chain = new StChain("StChain"); 00111 setFiles = new StFile(fileList); 00112 00113 // 00114 // Make Selection objects 00115 // 00116 char makerName[30]; 00117 StFlowSelection flowSelect; 00118 // particles:h+, h-, pi+, pi-, pi, k+, k-, k, e-, e+, e, pr-, pr+, pr, d+, d-, and d 00119 // flowSelect.SetPidPart("pr-"); // for parts. wrt plane 00120 // flowSelect.SetPtPart(0.15, 6.0); // for parts. wrt plane 00121 // flowSelect.SetPtPart(0.15, 2.0); // for parts. wrt plane 00122 // flowSelect.SetPtBinsPart(60); // for parts. wrt plane 00123 // flowSelect.SetPPart(0.15, 5.); // for parts. wrt plane 00124 // flowSelect.SetEtaPart(-1.1, 1.1); // for parts. wrt plane 00125 // flowSelect.SetFitPtsPart(20, 50); // for parts. wrt plane 00126 // flowSelect.SetFitOverMaxPtsPart(0.52, 1.); // for parts. wrt plane 00127 // flowSelect.SetChiSqPart(0.1, 1.3); // for parts. wrt plane 00128 // flowSelect.SetDcaGlobalPart(0., 2.0); // for parts. wrt plane 00129 // flowSelect.SetYPart(-0.5, 0.5); // for parts. wrt plane 00130 00131 // Uncomment next line if you make a selection object. Always! 00132 sprintf(makerName, "Flow"); 00133 00134 // Determine the kind of file and instantiate the FlowMaker after the IOMaker 00135 StIOMaker *IOMk = new StIOMaker("IO", "r", setFiles, "bfcTree"); 00136 IOMk->SetIOMode("r"); 00137 IOMk->SetBranch("*",0,"0"); // deactivate all branches 00138 if (!mainBranch.IsNull()) { IOMk->SetBranch(mainBranch,0,"r"); } 00139 00140 if (strstr(fileList[0], "MuDst.root")) { 00141 // Read mu-DST 00142 if (makerName[0]=='\0') { 00143 StFlowMaker* flowMaker = new StFlowMaker(); 00144 } else { 00145 StFlowMaker* flowMaker = new StFlowMaker(makerName, flowSelect); 00146 } 00147 flowMaker->MuEventRead(kTRUE); 00148 flowMaker->SetMuEventFileName(setFiles); 00149 00150 } else if (strstr(fileList[0], "picoevent.root")) { 00151 // Read pico-DST 00152 if (makerName[0]=='\0') { 00153 StFlowMaker* flowMaker = new StFlowMaker(); 00154 } else { 00155 StFlowMaker* flowMaker = new StFlowMaker(makerName, flowSelect); 00156 } 00157 flowMaker->PicoEventRead(kTRUE); 00158 flowMaker->SetPicoEventFileName(setFiles); 00159 00160 } else if (strstr(fileList[0], ".dst.root") || 00161 strstr(fileList[0], ".event.root")) { 00162 // Read raw events and make StEvents or read StEvents 00163 mainBranch = fileList[0]; 00164 mainBranch.ReplaceAll(".root",""); 00165 int idot = strrchr((char*)mainBranch,'.') - mainBranch.Data(); 00166 mainBranch.Replace(0,idot+1,""); 00167 mainBranch += "Branch"; 00168 printf("*** mainBranch=%s ***\n",mainBranch.Data()); 00169 00170 // Maker to read events from file or database into StEvent 00171 if (!mainBranch.Contains("eventBranch")) { 00172 gSystem->Load("StEventMaker"); 00173 StEventMaker *readerMaker = new StEventMaker("events","title"); 00174 } 00175 if (makerName[0]=='\0') { 00176 StFlowMaker* flowMaker = new StFlowMaker(); 00177 } else { 00178 StFlowMaker* flowMaker = new StFlowMaker(makerName, flowSelect); 00179 } 00180 } else { 00181 cout << "##### doFlowEvents: unknown file name = " << fileList[0] << endl; 00182 } 00183 00185 // Flow Makers 00186 // The AnalysisMaker, CumulantMaker, ScalarProdMaker, DirectCumulantMaker, and LeeYangZerosMaker 00187 // may be used with a selection object. 00188 Bool_t reCentMaker; 00189 Bool_t phiWgtMaker; 00190 Bool_t anaMaker; 00191 Bool_t cumuMaker; 00192 Bool_t spMaker; 00193 Bool_t lyzMaker; 00194 Bool_t dirCumuMaker; 00195 if (firstPass) { 00196 if (reCent) { 00197 reCentMaker = kTRUE; 00198 phiWgtMaker = kFALSE; 00199 } else { 00200 reCentMaker = kFALSE; 00201 phiWgtMaker = kTRUE; 00202 } 00203 anaMaker = kFALSE; 00204 cumuMaker = kFALSE; 00205 spMaker = kFALSE; 00206 lyzMaker = kFALSE; 00207 } else { 00208 reCentMaker = kFALSE; 00209 phiWgtMaker = kFALSE; 00210 anaMaker = kTRUE; 00211 cumuMaker = kFALSE; 00212 spMaker = kFALSE; 00213 lyzMaker = kFALSE; 00214 dirCumuMaker= kFALSE; 00215 } 00216 Bool_t includeTpcTracks = kTRUE; 00217 Bool_t includeFtpcTracks = kTRUE; // must be kTRUE if sel 1 is FTPC EP 00218 00219 // For LYZ and anaMaker 00220 Float_t ptRange_for_vEta[2] = {0.15, 2.}; 00221 Float_t etaRange_for_vPt[2] = {0., 1.1}; // show only TPC particles in v(pt) 00222 // Float_t ptRange_for_vEta[2] = {0., 0.}; // integrate over the full pt range 00223 // Float_t etaRange_for_vPt[2] = {0., 0.}; // integrate over the full eta range 00224 // Float_t etaRange_for_vPt[2] = {2.5, 4.}; // show only FTPC particles in v(pt) 00225 00226 // Set recentering FALSE except for ana and LYZ makers 00227 // For LYZ: If recentering is TRUE, pass zero will be run to calculate the recentering 00228 // parameters 00229 // For ana: If recentering is TRUE, first pass will calculate 00230 // the recentering parameters and write them to flow.reCentAnaNew.root 00231 if (anaMaker) { 00232 if (reCent) { 00233 flowMaker->SetPhiWgtCalc(kFALSE); 00234 flowMaker->SetReCentCalc(kTRUE); 00235 } else { 00236 flowMaker->SetPhiWgtCalc(kTRUE); 00237 flowMaker->SetReCentCalc(kFALSE); 00238 } 00239 } else if (lyzMaker) { 00240 flowMaker->SetReCentCalc(); 00241 } else { 00242 flowMaker->SetPhiWgtCalc(); 00243 flowMaker->SetReCentCalc(kFALSE); 00244 } 00245 00246 // To calculate v1{EP1,EP2} use the following switch. 00247 // Since v1{EP1} doesn't work very well at RHIC energies, v1{EP1,EP2} is set to be 00248 // the default. 00249 // To make full use of it, the cuts for Har1 should allow for FTPC tracks only, 00250 // while the cuts for Har2 should use TPC tracks only. This method works for 00251 // FTPC eta subevents (SetEtaSubs(kTRUE)) and random subevents (SetEtaSubs(kFALSE)). 00252 Bool_t v1Ep1Ep2 = kFALSE; 00253 00254 if (makerName[0]=='\0') { // blank if there is no selection object 00255 if (anaMaker) { 00256 StFlowAnalysisMaker* flowAnalysisMaker = new StFlowAnalysisMaker(); 00257 flowAnalysisMaker->SetHistoRanges(includeFtpcTracks); 00258 flowAnalysisMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]); 00259 flowAnalysisMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]); 00260 flowAnalysisMaker->SetV1Ep1Ep2(v1Ep1Ep2); 00261 } 00262 if (cumuMaker) { 00263 StFlowCumulantMaker* flowCumulantMaker = new StFlowCumulantMaker(); 00264 flowCumulantMaker->SetHistoRanges(includeFtpcTracks); 00265 } 00266 if (spMaker) { 00267 StFlowScalarProdMaker* flowScalarProdMaker = new StFlowScalarProdMaker(); 00268 flowScalarProdMaker->SetHistoRanges(includeFtpcTracks); 00269 } 00270 if (lyzMaker) { 00271 StFlowLeeYangZerosMaker* flowLeeYangZerosMaker = new StFlowLeeYangZerosMaker(); 00272 flowLeeYangZerosMaker->SetHistoRanges(includeFtpcTracks); 00273 flowLeeYangZerosMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]); 00274 flowLeeYangZerosMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]); 00275 } 00276 if (dirCumuMaker) { 00277 StFlowDirectCumulantMaker* flowDirectCumulantMaker = new StFlowDirectCumulantMaker(); 00278 } 00279 } else { 00280 if (anaMaker) { 00281 sprintf(makerName, "FlowAnalysis"); 00282 StFlowAnalysisMaker* flowAnalysisMaker = new 00283 StFlowAnalysisMaker(makerName, flowSelect); 00284 flowAnalysisMaker->SetHistoRanges(includeFtpcTracks); 00285 flowAnalysisMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]); 00286 flowAnalysisMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]); 00287 flowAnalysisMaker->SetV1Ep1Ep2(v1Ep1Ep2); 00288 } 00289 if (cumuMaker) { 00290 sprintf(makerName, "FlowCumulant"); 00291 StFlowCumulantMaker* flowCumulantMaker = new 00292 StFlowCumulantMaker(makerName, flowSelect); 00293 flowCumulantMaker->SetHistoRanges(includeFtpcTracks); 00294 } 00295 if (spMaker) { 00296 sprintf(makerName, "FlowScalarProd"); 00297 StFlowScalarProdMaker* flowScalarProdMaker = new 00298 StFlowScalarProdMaker(makerName, flowSelect); 00299 flowScalarProdMaker->SetHistoRanges(includeFtpcTracks); 00300 } 00301 if (lyzMaker) { 00302 sprintf(makerName, "FlowLeeYangZeros"); 00303 StFlowLeeYangZerosMaker* flowLeeYangZerosMaker = new 00304 StFlowLeeYangZerosMaker(makerName, flowSelect); 00305 flowLeeYangZerosMaker->SetHistoRanges(includeFtpcTracks); 00306 flowLeeYangZerosMaker->SetPtRange_for_vEta(ptRange_for_vEta[0], ptRange_for_vEta[1]); 00307 flowLeeYangZerosMaker->SetEtaRange_for_vPt(etaRange_for_vPt[0], etaRange_for_vPt[1]); 00308 } 00309 if (dirCumuMaker) { 00310 sprintf(makerName, "FlowDirectCumulant"); 00311 StFlowDirectCumulantMaker* flowDirectCumulantMaker = new 00312 StFlowDirectCumulantMaker(makerName, flowSelect); 00313 } 00314 } 00315 if (phiWgtMaker) { 00316 StFlowPhiWgtMaker* flowPhiWgtMaker = new StFlowPhiWgtMaker(); 00317 } 00318 if (reCentMaker) { 00319 StFlowReCentMaker* flowReCentMaker = new StFlowReCentMaker(); 00320 } 00321 00322 // Set write flages and file names 00323 // flowMaker->PicoEventWrite(kTRUE); 00324 // cout << " doFlowEvents - OutPicoDir = " << OutPicoDir << endl; 00325 // flowMaker->SetPicoEventDir(OutPicoDir); 00326 // flowMaker->SetPicoEventDir("../"); 00327 // flowMaker->SetPicoEventDir("./"); 00328 00329 // Set Debug status 00330 // IOMk->SetDebug(1); 00331 // flowMaker->SetDebug(); 00332 // flowAnalysisMaker->SetDebug(); 00333 // flowPhiWgtMaker->SetDebug(); 00334 // flowCumulantMaker->SetDebug(); 00335 // flowScalarProdMaker->SetDebug(); 00336 // flowLeeYangZerosMaker->SetDebug(); 00337 // flowDirectCumulantMaker->SetDebug(); 00338 // chain->SetDebug(); 00339 // StMuDebug::setLevel(0); 00340 00341 // 00342 // Initialize chain 00343 // 00344 Int_t iInit = chain->Init(); 00345 chain->PrintInfo(); 00346 if (iInit) { 00347 chain->Fatal(iInit, "on init"); 00348 goto END; 00349 } 00350 00351 // 00352 // Set the parameters 00353 // 00354 00355 // Get centrality from RunType 00356 // For centrality=0 there is no centrality selection 00357 if (RunType) { 00358 Int_t centrality = RunType % 10 ; // last digit 00359 StFlowCutEvent::SetCent(centrality, centrality); 00360 } 00361 00362 // Set the event cuts 00363 // StFlowCutEvent::SetCent(5, 5); 00364 // StFlowCutEvent::SetMult(0, 0); 00365 // StFlowCutEvent::SetVertexX(0., 0.); 00366 // StFlowCutEvent::SetVertexY(0., 0.); 00367 StFlowCutEvent::SetVertexZ(-30., 30.); 00368 // StFlowCutEvent::SetEtaSymTpc(0., 0.); 00369 StFlowCutEvent::SetEtaSymFtpc(0., 0.); // no FTPC eta sym cut 00370 if (firstPass) { // all centralities 00371 StFlowCutEvent::SetCent(0, 0); 00372 } 00373 00374 // Set the track cuts 00375 StFlowCutTrack::IncludeTpcTracks(includeTpcTracks); 00376 // StFlowCutTrack::SetFitPtsTpc(0, 0); 00377 // StFlowCutTrack::SetFitOverMaxPts(0., 0.); 00378 // StFlowCutTrack::SetChiSqTpc(0., 0.); 00379 // StFlowCutTrack::SetPtTpc(0.15, 2.); // for integrated cumulant 00380 // StFlowCutTrack::SetEtaTpc(-1.1, 1.1); // for integrated cumulant 00381 // StFlowCutTrack::SetChgTpc(0., 0.); 00382 00383 StFlowCutTrack::IncludeFtpcTracks(includeFtpcTracks); 00384 // StFlowCutTrack::SetFitPtsFtpc(0, 0); 00385 StFlowCutTrack::SetChiSqFtpc(0., 4.); 00386 StFlowCutTrack::SetDcaFtpc(0., 2.); 00387 // StFlowCutTrack::SetDcaGlobalFtpc(0., 0.); 00388 StFlowCutTrack::SetPtFtpc(0.15, 2.); 00389 // StFlowCutTrack::SetEtaFtpc(-4.0, -2.5, 2.5, 4.0); 00390 // StFlowCutTrack::SetChgFtpc(0, 0); 00391 00392 // Set the event plane selections 00393 // Harmonic 1 means odd, harmonic 2 means even 00394 // For selection 1 = FTPC event plane, selection 2 = TPC event plane 00395 // (Must include FTPC paticles>): 00396 StFlowEvent::SetEtaTpcCut(9., 10., 0, 0); // harmonic 1, selection 1, no TPC 00397 StFlowEvent::SetEtaTpcCut(9., 10., 1, 0); // harmonic 2, selection 1, no TPC 00398 StFlowEvent::SetEtaFtpcCut(-10., -9., 9., 10., 0, 1); // harmonic 1, selection 2, no FTPC 00399 StFlowEvent::SetEtaFtpcCut(-10., -9., 9., 10., 1, 1); // harmonic 2, selection 2, no FTPC 00400 // TPC 00401 // StFlowEvent::SetEtaTpcCut(0.5, 2., 0, 0); // harmonic 1, selection 1 00402 // StFlowEvent::SetEtaTpcCut(0.0, 1., 1, 0); // harmonic 2, selection 1 00403 // StFlowEvent::SetPtTpcCut(0.0, 1., 1, 1); // harmonic 2, selection 2 00404 // StFlowEvent::SetDcaGlobalTpcCut(0., 1.); // for event plane 00405 // FTPC 00406 // StFlowEvent::SetPtFtpcCut(0., 10., 0, 0); // harmonic 1, selection 1 00407 // StFlowEvent::SetPtFtpcCut(0., 10., 1, 0); // harmonic 2, selection 1 00408 // StFlowEvent::SetPtFtpcCut(0., 10., 0, 1); // harmonic 1, selection 2 00409 // StFlowEvent::SetPtFtpcCut(0., 10., 1, 1); // harmonic 2, selection 2 00410 // StFlowEvent::SetDcaGlobalFtpcCut(0., 1.); // for event plane 00411 00412 // particles:h+, h-, pi+, pi-, pi, k+, k-, k, e-, e+, e, pr-, pr+, pr, d+, d-, and d 00413 // StFlowEvent::SetPid("h-"); // for event plane 00414 00415 // Make Eta or Random subevents 00416 // These correlate each particle with the other subevent plane. 00417 // With neither flag set the standard method is used, which 00418 // corelates each particle with the event plane from the full event 00419 // minus the particle of interest, and subevents are made according to eta. 00420 // Don't set both of these at the same time. 00421 // StFlowEvent::SetEtaSubs(); 00422 // StFlowEvent::SetRanSubs(); 00423 // With either of these set the higher harmonics are done with respect to the event planes 00424 // of the higher harmonic. This is not a good idea as the second harmonic full event plane 00425 // would be better. 00426 00427 // Disable weights for the event plane and integrated flow for LYZ 00428 if (reCent && lyzMaker) { 00429 StFlowEvent::SetPtWgt(kFALSE); 00430 } 00431 // StFlowEvent::SetPtWgtSaturation(1.); 00432 StFlowEvent::SetPtWgt(kTRUE); 00433 StFlowEvent::SetEtaWgt(kFALSE); 00434 00435 // In LeeYangZeros do not use mixed harmonics for v1 00436 // StFlowLeeYangZerosMaker::SetV1Mixed(kFALSE); 00437 00438 // use ZDCSMD for the event plane 00439 // StFlowEvent::SetUseZDCSMD(kTRUE); 00440 00441 // Use Aihong's probability PID method 00442 // StFlowEvent::SetProbPid(); 00443 00444 // Set the PID deviant windows 00445 // StFlowEvent::SetPiPlusCut(-3., 3.); 00446 // StFlowEvent::SetPiMinusCut(-3., 3.); 00447 // StFlowEvent::SetProtonCut(-3., 3.); 00448 // StFlowEvent::SetAntiProtonCut(-3., 3.); 00449 // StFlowEvent::SetKPlusCut(-3., 3.); 00450 // StFlowEvent::SetKMinusCut(-3., 3.); 00451 // StFlowEvent::SetDeuteronCut(-3., 3.); 00452 // StFlowEvent::SetAntiDeuteronCut(-3., 3.); 00453 // StFlowEvent::SetElectronCut(-3., 3.); 00454 // StFlowEvent::SetPositronCut(-3., 3.); 00455 00456 // 00457 // Event loop 00458 // 00459 int istat = 0, iEvt = 1; 00460 EventLoop: if (iEvt <= nEvents && istat != 2) { 00461 00462 cout << "===== Event " << iEvt << " start ===== " << endl; 00463 chain->Clear(); 00464 istat = chain->Make(iEvt); 00465 if (istat == 2) 00466 {cout << "Last event processed. Status = " << istat << endl;} 00467 if (istat == 3) 00468 {cout << "Error event processed. Status = " << istat << endl;} 00469 00470 iEvt++; 00471 goto EventLoop; 00472 } 00473 00474 iEvt--; 00475 cout << "============================ Event " << iEvt 00476 << " finish ============================" << endl; 00477 00478 // 00479 // Chain Finish 00480 // 00481 if (nEvents > 1) { 00482 chain->Finish(); 00483 } else { 00484 if (!b) { b = new TBrowser; } 00485 } 00486 00487 TVectorD* cumulConstants = new TVectorD(30); // temporary fix for a root bug 00488 TObjString* cumulMethodTag = new TObjString( "cumulNew" ); 00489 00490 // Move the flow.cumulant.root, flow.scalar.root, and flow.LeeYangZeros.root files 00491 // into the flow.hist.root file. 00492 if (cumuMaker) { 00493 TFile cumuFile("flow.cumulant.root", "READ"); 00494 if (cumuFile.IsOpen()) { 00495 cumuFile.ReadAll(); 00496 for (int mm=0; mm<30; mm++) // temporary fix for a root bug 00497 (*cumulConstants)(mm) = 00498 (*((TVectorD* )cumuFile.Get("CumulConstants")))(mm); 00499 } else { 00500 cout << "### Can't find file flow.cumulant.root" << endl; 00501 } 00502 } 00503 if (spMaker) { 00504 TFile spFile("flow.scalar.root", "READ"); 00505 if (spFile.IsOpen()) { 00506 spFile.ReadAll(); 00507 } else { 00508 cout << "### Can't find file flow.scalar.root" << endl; 00509 } 00510 } 00511 if (lyzMaker) { 00512 // combine the zero, first, and second pass outputs 00513 TFile lyzFirstPassFile("flow.firstPassLYZ.root", "READ"); 00514 if (lyzFirstPassFile.IsOpen()) { 00515 TFile lyzZeroPassFile("flow.reCent.root", "READ"); 00516 if (lyzZeroPassFile.IsOpen()) { 00517 lyzZeroPassFile.ReadAll(); 00518 TList* zeroPassList = lyzZeroPassFile.GetList(); 00519 //zeroPassList->ls(); 00520 } 00521 lyzFirstPassFile.ReadAll(); 00522 TList* firstPassList = lyzFirstPassFile.GetList(); 00523 //firstPassList->ls(); 00524 TString* histTitle; // remove ReG and ImG 00525 for (int k = 0; k < nSels; k++) { 00526 for (int j = 0; j < 2; j++) { // only 2 harmonics in the first pass file 00527 for (int Ntheta = 0; Ntheta < maxTheta; Ntheta++) { 00528 histTitle = new TString("FlowImGtheta"); 00529 *histTitle += Ntheta; 00530 *histTitle += "_Sel"; 00531 *histTitle += k+1; 00532 *histTitle += "_Har"; 00533 *histTitle += j+1; 00534 hist = firstPassList->FindObject(histTitle->Data()); 00535 firstPassList->Remove(hist); 00536 delete histTitle; 00537 histTitle = new TString("FlowReGtheta"); 00538 *histTitle += Ntheta; 00539 *histTitle += "_Sel"; 00540 *histTitle += k+1; 00541 *histTitle += "_Har"; 00542 *histTitle += j+1; 00543 hist = firstPassList->FindObject(histTitle->Data()); 00544 firstPassList->Remove(hist); 00545 delete histTitle; 00546 } 00547 } 00548 } 00549 //firstPassList->ls(); 00550 TFile lyzFile("flow.LeeYangZeros.root", "UPDATE"); 00551 if (lyzFile.IsOpen()) { 00552 if (lyzZeroPassFile.IsOpen()) { 00553 zeroPassList->Write(); 00554 } 00555 firstPassList->Write(); 00556 lyzFile.Close(); 00557 } 00558 } 00559 TFile lyzFile("flow.LeeYangZeros.root", "READ"); 00560 if (lyzFile.IsOpen()) { 00561 lyzFile.ReadAll(); 00562 } else { 00563 cout << "### Can't find file flow.LeeYangZeros.root" << endl; 00564 } 00565 } 00566 if (anaMaker) { 00567 TFile anaFile("flow.hist.root", "UPDATE"); 00568 } else { 00569 TFile anaFile("flow.hist.root", "RECREATE"); 00570 } 00571 if (anaFile.IsOpen()) { 00572 if (cumuMaker) { 00573 cumuFile.GetList()->Write(); 00574 cumulConstants->Write("CumulConstants",TObject::kOverwrite | TObject::kSingleKey); 00575 cumulMethodTag->Write("CumulMethodTag",TObject::kOverwrite | TObject::kSingleKey); 00576 } 00577 if (spMaker) { spFile.GetList()->Write(); } 00578 if (lyzMaker) { lyzFile.GetList()->Write(); } 00579 //anaFile.ls(); 00580 anaFile.Close(); 00581 } else { 00582 cout << "### Can't find file flow.hist.root" << endl; 00583 } 00584 00585 END: 00586 } 00587 00588 // ----------- This concatenates the path and the file name --------------------- 00589 void doFlowEvents(Int_t nEvents, const Char_t *path, const Char_t *file, 00590 Bool_t firstPass) 00591 { 00592 const char *fileListQQ[] = {0,0}; 00593 if (path[0] == '-') { 00594 fileListQQ[0] = file; 00595 } else { 00596 fileListQQ[0] = gSystem->ConcatFileName(path,file); 00597 } 00598 doFlowEvents(nEvents, fileListQQ, firstPass); 00599 } 00600 00601 // ----------- When only a file is specified --------------------- 00602 void doFlowEvents(Int_t nEvents, const char *file, Bool_t firstPass) 00603 { 00604 printf("*file = %s\n",file); 00605 const char *fileListQQ[]={0,0}; 00606 fileListQQ[0]=file; 00607 cout << "Calling (nEvents, fileListQQ, firstPass)" << endl; 00608 doFlowEvents(nEvents, fileListQQ, firstPass); 00609 } 00610 00611 // ----------- This sets default path and file names --------------------------- 00612 void doFlowEvents(Int_t nEvents, Bool_t firstPass) { 00613 00614 // Char_t* filePath="./"; 00615 // Char_t* fileExt="*.flowpicoevent.root"; 00616 // Char_t* fileExt="*.event.root"; 00617 // Char_t* fileExt="*.MuDst.root"; 00618 00619 // 200 GeV 00620 00621 // run 4 P05ic 00622 // muDST files 00623 // Char_t* filePath="/eliza9/starprod/reco/productionMinBias/ReversedFullField/P05ic/2004/024/"; 00624 // if (nEvents < 450) { 00625 // Char_t* fileExt="st_physics_5024001_raw_1010001.MuDst.root"; 00626 // //Char_t* fileExt="st_physics_5024092_raw_1010002.MuDst.root"; 00627 // } else { 00628 // Char_t* fileExt="*.MuDst.root"; 00629 // } 00630 00631 // run 7 P07id 00632 // muDST files 00633 // Char_t* filePath="/eliza3/starprod/reco/2007ProductionMinBias/FullField/P07id/2007/131/8131027/"; 00634 // //Char_t* filePath="./outDir/muDST/"; 00635 // if (nEvents < 450) { 00636 // //Char_t* fileExt="st_physics_8102049_raw_1010001.MuDst.root"; // 45 events 00637 // Char_t* fileExt="st_physics_8131027_raw_1010001.MuDst.root"; 00638 // } else { 00639 // Char_t* fileExt="*.MuDst.root"; 00640 // } 00641 00642 // run 7 P08ic 00643 // muDST files 00644 Char_t* filePath="/eliza9/starprod/reco/2007ProductionMinBias/FullField/P08ic/2007/125/"; 00645 if (nEvents < 450) { 00646 Char_t* fileExt="st_physics_8125119_raw_1040090.MuDst.root"; 00647 } else { 00648 Char_t* fileExt="st_physics_*.MuDst.root"; 00649 } 00650 00651 // run 10 39 GeV 00652 // muDST files 00653 // Char_t* filePath="/eliza17/star/starprod/reco/2010Production/reco/AuAu39_production/ReversedFullField/P10ik/2010/"; 00654 // if (nEvents < 450) { 00655 // Char_t* fileExt="099/11099061/st_physics_11099061_raw_5030001.MuDst.root"; 00656 // } else { 00657 // Char_t* fileExt="st_physics_*.MuDst.root"; 00658 // } 00659 00660 doFlowEvents(nEvents, filePath, fileExt, firstPass); 00661 } 00662 00664 // 00665 // $Log: doFlowEvents.C,v $ 00666 // Revision 1.7 2011/07/25 15:54:47 posk 00667 // Added correction for non-flatness of event plane. 00668 // 00669 // Revision 1.6 2011/03/10 18:56:28 posk 00670 // Added histogram for laboratory azimuthal distribution of particles. 00671 // 00672 // Revision 1.5 2010/09/30 19:28:15 posk 00673 // Instead of reversing the weight for negative pseudrapidity for odd harmonics, 00674 // it is now done only for the first harmonic. 00675 // Recentering is now done for all harmonics. 00676 // 00677 // Revision 1.4 2010/07/23 21:01:46 posk 00678 // Added a comment about higher harmonics with the subevent method. 00679 // 00680 // Revision 1.3 2010/06/10 16:33:59 posk 00681 // Correction to macro directCumulants_v2.C . 00682 // 00683 // Revision 1.2 2010/03/08 16:54:49 posk 00684 // Added StFlowDirectCumulantMaker written by Dhevan Gangadharan. 00685 // 00686 // Revision 1.65 2009/11/24 19:40:35 posk 00687 // Added reCenter to remove acceptance correlations as an option instead of phiWgt. 00688 // Default selection 1 now calculates the event plane from the FTPCs and selection 2 from the main TPC. 00689 // 00690 // Revision 1.64 2009/07/24 21:00:11 posk 00691 // Removed John Wu's Grid Collector. 00692 // 00693 // Revision 1.61 2006/03/22 22:15:26 posk 00694 // Updated to read the flow.firstPassLYZ.root files. 00695 // 00696 // Revision 1.60 2006/02/22 19:48:08 posk 00697 // Added StFlowLeeYangZerosMaker 00698 // For MuDsts, the IOMaker is now the default 00699 // 00700 // Revision 1.59 2005/08/31 15:03:09 fisyak 00701 // Add dependence StMagF vs StarMagField 00702 // 00703 // Revision 1.58 2005/02/10 18:01:38 posk 00704 // Option for working with the Grid Collector. 00705 // 00706 // Revision 1.57 2004/12/17 16:54:13 aihong 00707 // temporary fix for a root bug on TVectorD 00708 // 00709 // Revision 1.56 2004/11/19 18:05:19 posk 00710 // A bit more like doEvents.C 00711 // 00712 // Revision 1.55 2004/06/23 20:06:02 perev 00713 // const Int_t replaced by Int_t 00714 // 00715 // Revision 1.54 2004/03/11 18:01:56 posk 00716 // Added Random Subs analysis method. 00717 // 00718 // Revision 1.53 2003/12/19 21:23:43 posk 00719 // Changed File->IsOpen() to File.IsOpen(). 00720 // 00721 // Revision 1.52 2003/12/12 02:29:40 oldi 00722 // Minor code clean-ups. Some comments added. 00723 // 00724 // Revision 1.51 2003/11/14 20:01:22 oldi 00725 // Implementation of v1{EP1,EP2}. This method is set to be the default for v1 now! 00726 // Minor code clean-ups. 00727 // 00728 // Revision 1.50 2003/09/05 18:01:37 posk 00729 // Updated list of shared libraries. 00730 // 00731 // Revision 1.49 2003/08/26 21:18:12 posk 00732 // update 00733 // 00734 // Revision 1.48 2003/08/06 20:54:26 oldi 00735 // Introduction of possibility to exclude pt ranges for v(eta) and eta regions 00736 // for v(pt) histograms. Default behavior stays the same (all available tracks 00737 // are included in v(pt) and v(eta)). 00738 // 00739 // Revision 1.47 2003/07/30 22:09:18 oldi 00740 // Eta cuts for event plane selection separated for FTPC east and west. 00741 // PtWgtSaturation parameter introduced (default set to 2. -> no change of default behavior). 00742 // 00743 // Revision 1.46 2003/06/27 21:17:18 posk 00744 // Event plane cuts now only odd and even, instead of different for each harmonic. 00745 // 00746 // Revision 1.45 2003/05/16 20:47:33 posk 00747 // Runs only StFlowPhiWgtMaker if called with phiWgtOnly=kTRUE. 00748 // 00749 // Revision 1.44 2003/01/14 14:12:07 oldi 00750 // Possibility to exclude TPC tracks completely (= FTPC only). 00751 // 00752 // Revision 1.43 2003/01/10 16:42:39 oldi 00753 // Several changes to comply with FTPC tracks: 00754 // - Switch to include/exclude FTPC tracks introduced. 00755 // The same switch changes the range of the eta histograms. 00756 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots. 00757 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East, 00758 // West, FarWest (depending on vertex.z()). 00759 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added. 00760 // - Cut to exclude mu-events with no primary vertex introduced. 00761 // (This is possible for UPC events and FTPC tracks.) 00762 // - Global DCA cut for FTPC tracks added. 00763 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks. 00764 // - Charge cut for FTPC tracks added. 00765 // 00766 // Revision 1.42 2002/07/01 16:11:54 posk 00767 // Removed StFlowTagMaker. 00768 // 00769 // Revision 1.41 2002/06/10 22:56:40 posk 00770 // pt and eta weighting now default. 00771 // 00772 // Revision 1.40 2002/06/07 17:29:43 kirill 00773 // Introduced MuDst reader 00774 // 00775 // Revision 1.39 2002/02/13 22:37:09 posk 00776 // Added SetEtaWeight(bool) command. 00777 // 00778 // Revision 1.38 2002/02/05 17:00:37 posk 00779 // Added commands for SetPtBinsPart and h+/h- 00780 // 00781 // Revision 1.37 2002/01/30 13:05:13 oldi 00782 // Trigger cut implemented. 00783 // 00784 // Revision 1.36 2002/01/15 17:36:34 posk 00785 // Can instantiate StFlowScalarProdMaker. 00786 // 00787 // Revision 1.35 2001/12/18 19:32:02 posk 00788 // "proton" and "antiproton" replaced with "pr+" and "pr-". 00789 // 00790 // Revision 1.34 2001/12/11 22:14:33 posk 00791 // Combined histogram output files from the CumulantMaker and the AnalysisMaker. 00792 // 00793 // Revision 1.33 2001/11/09 21:44:34 posk 00794 // Added StFlowCumulantMaker. 00795 // 00796 // Revision 1.32 2001/06/07 20:12:12 posk 00797 // Added global dca cut for event plane particles. 00798 // Changed SePtWgt() to SetPtWgt(Bool_t). 00799 // 00800 // Revision 1.31 2001/05/22 19:58:42 posk 00801 // Can take centrality from the shell script. 00802 // Removed multiple instances feature. 00803 // 00804 // Revision 1.30 2000/12/12 18:49:18 posk 00805 // Moved log comments to the end of the file. 00806 // 00807 // Revision 1.29 2000/12/08 17:04:36 oldi 00808 // Phi weights for both FTPCs included. 00809 // 00810 // Revision 1.27 2000/11/15 14:41:51 posk 00811 // Protected against running Finish() twice. 00812 // 00813 // Revision 1.26 2000/11/13 01:32:35 snelling 00814 // load StEventUtilities 00815 // 00816 // Revision 1.25 2000/11/09 17:39:14 snelling 00817 // Added switch for probability pid 00818 // 00819 // Revision 1.24 2000/09/16 22:21:15 snelling 00820 // Added lines to set selection on P and global DCA 00821 // 00822 // Revision 1.23 2000/09/15 22:54:44 posk 00823 // Added Pt weighting for event plane calculation. 00824 // 00825 // Revision 1.22 2000/09/15 01:22:27 snelling 00826 // Added the new selection options to the macro 00827 // 00828 // Revision 1.21 2000/09/05 16:29:43 snelling 00829 // Added cuts for new particles 00830 // 00831 // Revision 1.18 2000/08/28 16:15:50 snelling 00832 // Added Pt and Eta cuts to macro 00833 // 00834 // Revision 1.17 2000/08/26 21:39:51 snelling 00835 // Modified IO for multiple pico events 00836 // 00837 // Revision 1.15 2000/06/30 14:57:34 posk 00838 // Updated to latest doEvents.C . 00839 // 00840 // Revision 1.11 2000/05/17 16:20:59 kathy 00841 // add some print stmts and also run some IOMaker methods in order to get default input files that are softlinks to other files working correctly 00842 // 00843 // Revision 1.10 2000/05/16 20:57:31 posk 00844 // Voloshin's flownanoevent.root added. 00845 // 00846 // Revision 1.9 2000/05/11 00:22:28 posk 00847 // Can read StEvent files which have extention .event.root . 00848 // 00849 // Revision 1.8 2000/05/09 19:38:22 kathy 00850 // update to use standard default input files and only process few events by default - to make it easy to run in automatic macro testing script 00851 // 00852 // Revision 1.6 2000/04/13 21:46:34 kathy 00853 // remove loading of libtpc_Tables since l3Track table is now dst_track type from global 00854 // 00855 // Revision 1.5 2000/04/12 15:06:53 kathy 00856 // changed all macros that read DSTs to load Tables from libraries: gen,sim,global,dst instead of ALL Tables (previously loaded St_Tables); currently, if you are using DEV to read a DST in NEW,PRO, you must comment out the loading of libtpc_Tables because of a mismatch with tpt_track table 00857 // 00858 // Revision 1.4 2000/03/28 23:26:46 posk 00859 // Allow multiple instances of the AnalysisMaker. 00860 // 00861 // Revision 1.3 2000/03/15 23:33:54 posk 00862 // Added StFlowSelection. 00863 // 00864 // Revision 1.2 2000/03/07 17:51:23 snelling 00865 // Added switch for Nano DST 00866 // 00867 // Revision 1.1 2000/03/02 23:49:11 posk 00868 // Version of doEvents.C for flow analysis which can set cut parameters. 00869 //
1.5.9