1 /////////////////////////////////////////////////////////////
5 // Author: Emanuele Simili
7 /////////////////////////////////////////////////////////////
9 // Description: ROOT macro to perform the AliFlowAnalysis
11 /////////////////////////////////////////////////////////////
21 #include "TStopwatch.h"
23 using namespace std; //required for resolving the 'cout' symbol
25 void makeAnal(TString wch = "ESD")
27 cout << " . Here the newly compiled flow analysis . " << endl ;
28 cout << " . AliFlowEvent(s) --> root histograms " << endl ;
31 gSystem->Load("libPhysics.so");
32 gSystem->Load("libPWG2.so");
33 gSystem->Load("libPWG2flow.so");
35 //char *loadFrom = gSystem->ExpandPathName("$ALICE_ROOT/PWG2/FLOW/AliFlow_Anal.so") ;
36 //cout << " . *** Loading libs from ' " << loadFrom << " ' ." << endl ;
37 //gSystem->Load(loadFrom);
38 cout << " . ...libs loaded" << endl ;
40 int cc = -1 ; // centrality class
41 TString ver = "h_" ; // names ... according to the FlowMaker
42 int selNumber = 0 ; // ...
47 AliFlowSelection* select = new AliFlowSelection() ;
50 select->SetCentralityCut(-1) ;
51 select->SetRunIdCut(-1) ;
53 // R.P. calculation cuts
54 for(int j=0;j<Flow::nHars;j++)
56 select->SetEtaCut(0., 1.1, j, 1) ;
57 select->SetPtCut(0.1, 10. , j, 1);
59 select->SetConstrainCut(kTRUE) ;
60 select->SetDcaGlobalCut(0.,0.1);
61 //select->SetNhitsCut(3., 1) ;
62 //select->SetPidCut("pi");
64 // Correlation analysis cuts
65 select->SetEtaPart(-1.1,1.1);
66 select->SetPtPart(0.1,10.);
67 select->SetConstrainablePart(kTRUE);
68 select->SetDcaGlobalPart(0.,0.1);
69 //select->SetPPart(0.1,10.);
70 //select->SetEtaAbsPart(0.5,1.1);
71 //select->SetPidPart("pi");
72 //select->SetYPart(..,..);
73 //select->SetPidProbPart(0.5,1.);
74 //select->SetFitPtsPart(3, 480);
75 //select->SetFitOverMaxPtsPart(0.1,3.);
76 //select->SetDedxPtsPart(1.,0.);
77 //select->SetChiSqPart(0.,100.);
80 //select->SetV0DcaCross(0.,0.1) ;
81 select->SetV0Mass(0.4875,0.5078) ; // Mk0 = 0.49765
82 select->SetV0SideBands(0.08) ;
83 //select->SetV0P(0.,10.) ;
84 select->SetV0Pt(0.1,10.) ;
85 select->SetV0Eta(-2.1,2.1) ;
86 //select->SetV0EtaAbs(0.,0.9) ;
87 //select->SetV0Pid("0") ;
88 //select->SetV0Y(0.,10.) ;
89 //select->SetV0Lenght(0.,100.) ;
90 //select->SetV0LenghtOverSigma(0.,5.) ;
91 //select->SetV0ChiSqPart(0.,100.) ;
93 cout << " . Selection for R.P. calculation: " << endl ;
94 select->PrintSelectionList() ;
95 cout << " . Selection for correlation analysis: " << endl ;
97 cout << " . Selection for V0 analysis: " << endl ;
98 select->PrintV0List() ;
100 AliFlowAnalysisMaker* flow = new AliFlowAnalysisMaker("FlowAnal",*select) ;
102 // Input/Output/Wgt files : auto-naming
103 TString inpt = ver ; inpt += wch ; inpt += "flow" ;
104 TString outp = inpt ; outp += "AnalPlot" ;
105 if(selNumber) { outp += selNumber ; }
106 if(cc>=0) { outp += "_" ; outp += cc ; }
107 TString wgt = "flowPhiWgt." ; wgt += wch ;
108 inpt += ".root" ; outp += ".root" ; wgt += ".root" ;
110 // tmporary setting ---
111 inpt = "flowEvtS.root" ;
112 outp = "flowEvtSanalPlot.root" ;
113 // tmporary setting ---
116 flow->SetHistFileName(outp.Data()); // __MC/ESDflowAnalPlot.root
117 cout << " . Writing Histograms on : " << flow->GetHistFileName() << " . " << endl ;
120 flow->SetOneInputFile(kTRUE) ;
121 flow->SetInputFileName(inpt.Data()) ; // __MC/ESDflow.root
122 cout << " . Reading FlowEvents from : " << flow->GetInputFileName() << " . " << endl ;
123 //INput: one flowEvent file
124 //flow->SetOneInputFile(kTRUE) ;
125 //flow->SetInputFileName("neo_ESDflow.root") ;
126 //INput: more than one file
127 // //flow->SetInputFileNames("...") ;
128 // cout << " . Reading FlowEvents from : " << " tot files " << endl ;
131 flow->SetPhiWgtFileName(wgt.Data()); // flowPhiWgt.MC/ESD.root
132 cout << "# Weights File (if there) : " << flow->GetPhiWgtFileName() << " . " << endl ;
136 flow->SetFlowForV0() ; // default kTRUE.
137 // flow->SetEtaSub() ; // default is Disabled - DO NOT USE (kFALSE) AS AN ARGUMENT !!!
138 //flow->SetV1Ep1Ep2() ; // default kFALSE.
139 flow->SetShuffle() ; // default kFALSE. shuffles track array
140 //flow->SetRedoWgt(); // default kFALSE. recalculates phiWgt (even if phiWgt file is already there)
141 flow->SetUsePhiWgt() ; // default kTRUE if phiWgt file is there, kFALSE if not (& phiWgt file is created)
142 //flow->SetUseBayWgt() ; // default kFALSE. uses bayesian weights in P.id.
143 //flow->SetUsePtWgt(); // default kFALSE. uses pT as a weight for RP determination
144 //flow->SetUseEtaWgt(); // default kFALSE. uses eta as a weight for RP determination
145 flow->SetUseOnePhiWgt() ; // or // flow->SetUseFirstLastPhiWgt() ; // uses 1 or 3 wgt histograms (default is 1)
147 flow->SetMakeAll() ; // default kTRUE. this should speed up the execution time
148 flow->SetMaxLabel(1000) ; // THERE WAS A CRASH WHEN LOOPING OVER MORE FLOWEVENT FILES !!!
149 flow->SetFillLabels(kFALSE) ; // ... ~A CHANGE WAS MADE IN THE ANALYSIS TO FIX IT (// *temp*)
151 flow->SetDebugg(1) ; // more couts
152 //Flow::mDebug = kTRUE ; // more couts from singleton
154 // init (make histograms, start the analysis)
156 step += flow->Init() ;
157 if(step<1) { cout << "#! UNEXPECTED TERMINATION !# " << step << endl ; break ; }
160 step += flow->Make() ;
161 if(step<2) { cout << "#! UNEXPECTED TERMINATION !# " << step << endl ; break ; }
163 cout << "Particles normalized abundance:" << endl; // shows the bayesian vector
164 flow->PrintRunBayesian() ; cout << endl;
166 // finish (save hists, close files)
167 step += flow->Finish() ;
168 if(step<3) { cout << "#! UNEXPECTED TERMINATION !# " << step << endl ; break ; }
172 cout << " . " ; timer.Print();
173 cout << " . here it was (analysis) ... " << endl ; //juice!