]>
Commit | Line | Data |
---|---|---|
daf66719 | 1 | ///////////////////////////////////////////////////////////////////////////////////////////// |
2 | // | |
3 | // AddTask* macro for flow analysis | |
4 | // Creates a Flow Event task and adds it to the analysis manager. | |
5 | // Sets the cuts using the correction framework (CORRFW) classes. | |
6 | // Also creates Flow Analysis tasks and connects them to the output of the flow event task. | |
7 | // | |
8 | ///////////////////////////////////////////////////////////////////////////////////////////// | |
9 | ||
78104bcd | 10 | void AddTaskFlowCentrality( Float_t centrMin=0., |
11 | Float_t centrMax=100., | |
121a84bb | 12 | TString fileNameBase="AnalysisResults") |
78104bcd | 13 | { |
121a84bb | 14 | //Define the range for eta subevents (for SP method) |
78104bcd | 15 | Double_t minA = -0.9; |
16 | Double_t maxA = -0.5; | |
121a84bb | 17 | Double_t minB = 0.5; |
18 | Double_t maxB = 0.9; | |
daf66719 | 19 | |
121a84bb | 20 | //AFTERBURNER |
78104bcd | 21 | Bool_t useAfterBurner=kFALSE; |
22 | Double_t v1=0.0; | |
23 | Double_t v2=0.0; | |
24 | Double_t v3=0.0; | |
25 | Double_t v4=0.0; | |
26 | Int_t numberOfTrackClones=0; //non-flow | |
daf66719 | 27 | |
121a84bb | 28 | //Define a range of the detector to exclude |
78104bcd | 29 | Bool_t ExcludeRegion = kFALSE; |
30 | Double_t excludeEtaMin = -0.; | |
121a84bb | 31 | Double_t excludeEtaMax = 0.; |
32 | Double_t excludePhiMin = 0.; | |
33 | Double_t excludePhiMax = 0.; | |
daf66719 | 34 | |
121a84bb | 35 | //use physics selection class |
78104bcd | 36 | Bool_t UsePhysicsSelection = kTRUE; |
daf66719 | 37 | |
121a84bb | 38 | //separate QA task |
39 | Bool_t runQAtask =kFALSE; | |
40 | Bool_t FillQAntuple =kFALSE; | |
78104bcd | 41 | Bool_t DoQAcorrelations=kFALSE; |
121a84bb | 42 | //============================================================================= |
43 | ||
44 | //Flow analysis method can be:(set to kTRUE or kFALSE) | |
45 | Bool_t MCEP = kFALSE; // correlation with Monte Carlo reaction plane | |
46 | Bool_t SP = kFALSE; // scalar product method (similar to eventplane method) | |
47 | Bool_t GFC = kFALSE; // cumulants based on generating function | |
48 | Bool_t QC = kFALSE; // cumulants using Q vectors | |
49 | Bool_t FQD = kFALSE; // fit of the distribution of the Q vector (only integrated v) | |
50 | Bool_t LYZ1SUM = kTRUE; // Lee Yang Zeroes using sum generating function (integrated v) | |
51 | Bool_t LYZ1PROD = kTRUE; // Lee Yang Zeroes using product generating function (integrated v) | |
52 | Bool_t LYZ2SUM = kFALSE; // Lee Yang Zeroes using sum generating function (second pass differential v) | |
53 | Bool_t LYZ2PROD = kFALSE; // Lee Yang Zeroes using product generating function (second pass differential v) | |
54 | Bool_t LYZEP = kFALSE; // Lee Yang Zeroes Event plane using sum generating function (gives eventplane + weight) | |
78104bcd | 55 | Bool_t MH = kFALSE; // azimuthal correlators in mixed harmonics |
56 | Bool_t NL = kFALSE; // nested loops (for instance distribution of phi1-phi2 for all distinct pairs) | |
78104bcd | 57 | Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP,MH,NL}; |
78104bcd | 58 | Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta) |
121a84bb | 59 | //============================================================================= |
daf66719 | 60 | |
121a84bb | 61 | UInt_t eventSelMask = AliVEvent::kMUSPB; |
62 | //AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kTPCstandalone; | |
63 | //AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kV0; | |
64 | AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kSPDtracklet; | |
65 | AliFlowTrackCuts::trackParameterType poitype = AliFlowTrackCuts::kMUON; | |
daf66719 | 66 | |
121a84bb | 67 | AliFlowTrackCuts::trackParameterMix rpmix = AliFlowTrackCuts::kPure; |
78104bcd | 68 | AliFlowTrackCuts::trackParameterMix poimix = AliFlowTrackCuts::kPure; |
03d364db | 69 | |
121a84bb | 70 | const char* rptypestr = AliFlowTrackCuts::GetParamTypeName(rptype); |
78104bcd | 71 | const char* poitypestr = AliFlowTrackCuts::GetParamTypeName(poitype); |
121a84bb | 72 | printf("CREATE CUTS\n"); cout << "Used for RP: " << rptypestr << endl; |
73 | cout << "Used for POI: " << poitypestr << endl; | |
74 | //============================================================================= | |
d178bd1f | 75 | |
441ea1cf | 76 | AliFlowEventCuts* cutsEvent = new AliFlowEventCuts("event cuts"); |
7d9ab4fb | 77 | cutsEvent->SetCentralityPercentileRange(centrMin,centrMax); |
7d9ab4fb | 78 | cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kV0); |
121a84bb | 79 | //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kSPD1tracklets); |
dc8887a1 | 80 | cutsEvent->SetNContributorsRange(2); |
4ea2bb6b | 81 | cutsEvent->SetPrimaryVertexZrange(-7.,7.); |
121a84bb | 82 | //cutsEvent->SetCutSPDvertexerAnomaly(); //"Francesco's cut" |
83 | //cutsEvent->SetCutZDCtiming(); | |
84 | //cutsEvent->SetCutTPCmultiplicityOutliers(); | |
85 | //cutsEvent->SetUseCentralityUnchecked(); | |
86 | //cutsEvent->SetRefMultMethod(AliESDtrackCuts::kTrackletsITSTPC); // Tracklets + Global tracks (default) | |
87 | //cutsEvent->SetRefMultMethod(AliESDtrackCuts::kTrackletsITSSA); // Tracklets + ITS SA tracks | |
88 | cutsEvent->SetRefMultMethod(AliESDtrackCuts::kTracklets); // Tracklets | |
89 | ||
90 | AliFlowTrackCuts* cutsRP = 0x0; | |
91 | if (rptype==AliFlowTrackCuts::kTPCstandalone) cutsRP = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010(); | |
92 | if (rptype==AliFlowTrackCuts::kV0) { | |
93 | minA=-10.; maxA=-0.5; minB=0.5; maxB=10.; | |
94 | cutsRP = AliFlowTrackCuts::GetStandardVZEROOnlyTrackCuts(); | |
95 | } if (rptype==AliFlowTrackCuts::kSPDtracklet) { | |
96 | minA=-0.8; maxA=-0.4; minB=0.4; maxB=0.8; | |
97 | cutsRP = new AliFlowTrackCuts("SPDtrackletRP"); | |
98 | cutsRP->SetParamType(rptype); | |
99 | cutsRP->SetParamMix(rpmix); | |
100 | cutsRP->SetEtaRange(-0.8,0.8); | |
101 | } | |
102 | ||
103 | AliFlowTrackCuts* cutsPOI = AliFlowTrackCuts::GetStandardMuonTrackCuts(); | |
104 | //============================================================================= | |
105 | ||
106 | TString fileName(fileNameBase); fileName.Append(".root"); | |
499fe731 | 107 | TString outputSlotName(""); |
108 | outputSlotName+=Form("%.0f",centrMin); | |
109 | outputSlotName+="-"; | |
110 | outputSlotName+=Form("%.0f",centrMax); | |
111 | outputSlotName+=" "; | |
2ed97fda | 112 | outputSlotName+=cutsRP->GetName(); |
499fe731 | 113 | |
daf66719 | 114 | Bool_t useWeights = WEIGHTS[0] || WEIGHTS[1] || WEIGHTS[2]; |
115 | if (useWeights) cout<<"Weights are used"<<endl; | |
116 | else cout<<"Weights are not used"<<endl; | |
d178bd1f | 117 | |
daf66719 | 118 | // Get the pointer to the existing analysis manager via the static access method. |
119 | //============================================================================== | |
120 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
121 | if (!mgr) { | |
122 | Error("AddTaskFlowEvent", "No analysis manager to connect to."); | |
123 | return NULL; | |
d178bd1f | 124 | } |
daf66719 | 125 | |
126 | // Check the analysis type using the event handlers connected to the analysis | |
59dab33a | 127 | // manager. The availability of MC handler can also be checked here. |
daf66719 | 128 | //============================================================================== |
129 | if (!mgr->GetInputEventHandler()) { | |
130 | ::Error("AddTaskFlowEvent", "This task requires an input event handler"); | |
131 | return NULL; | |
132 | } | |
d178bd1f | 133 | |
daf66719 | 134 | // Open external input files |
135 | //=========================================================================== | |
136 | //weights: | |
137 | TFile *weightsFile = NULL; | |
138 | TList *weightsList = NULL; | |
139 | ||
140 | if(useWeights) { | |
141 | //open the file with the weights: | |
142 | weightsFile = TFile::Open("weights.root","READ"); | |
143 | if(weightsFile) { | |
144 | //access the list which holds the histos with weigths: | |
145 | weightsList = (TList*)weightsFile->Get("weights"); | |
146 | } | |
147 | else { | |
148 | cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl; | |
149 | break; | |
150 | } | |
151 | } | |
d178bd1f | 152 | |
daf66719 | 153 | //LYZ2 |
154 | if (LYZ2SUM || LYZ2PROD) { | |
155 | //read the outputfile of the first run | |
121a84bb | 156 | TString outputFileName = "AnalysisResultsRedoFinishLYZ1.root"; |
daf66719 | 157 | TString pwd(gSystem->pwd()); |
158 | pwd+="/"; | |
159 | pwd+=outputFileName.Data(); | |
160 | TFile *outputFile = NULL; | |
161 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
162 | cout<<"WARNING: You do not have an output file:"<<endl; | |
163 | cout<<" "<<pwd.Data()<<endl; | |
164 | exit(0); | |
d178bd1f | 165 | } else { outputFile = TFile::Open(pwd.Data(),"READ");} |
daf66719 | 166 | |
167 | if (LYZ2SUM){ | |
168 | // read the output directory from LYZ1SUM | |
169 | TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis" ; | |
12b2b8bc | 170 | inputFileNameLYZ2SUM += rptypestr; |
daf66719 | 171 | cout<<"The input directory is "<<inputFileNameLYZ2SUM.Data()<<endl; |
172 | TFile* fInputFileLYZ2SUM = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2SUM.Data()); | |
173 | if(!fInputFileLYZ2SUM || fInputFileLYZ2SUM->IsZombie()) { | |
174 | cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; | |
175 | break; | |
176 | } | |
177 | else { | |
121a84bb | 178 | // TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get("LYZ1SUM"); |
179 | TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get(Form("LYZ1SUM_%s",outputSlotName.Data())); | |
daf66719 | 180 | if (!fInputListLYZ2SUM) {cout<<"list is NULL pointer!"<<endl;} |
181 | } | |
182 | cout<<"LYZ2SUM input file/list read..."<<endl; | |
183 | } | |
184 | ||
185 | if (LYZ2PROD){ | |
186 | // read the output directory from LYZ1PROD | |
187 | TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis" ; | |
12b2b8bc | 188 | inputFileNameLYZ2PROD += rptypestr; |
daf66719 | 189 | cout<<"The input directory is "<<inputFileNameLYZ2PROD.Data()<<endl; |
190 | TFile* fInputFileLYZ2PROD = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2PROD.Data()); | |
191 | if(!fInputFileLYZ2PROD || fInputFileLYZ2PROD->IsZombie()) { | |
192 | cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; | |
193 | break; | |
194 | } | |
195 | else { | |
121a84bb | 196 | // TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get("LYZ1PROD"); |
197 | TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get(Form("LYZ1PROD_%s",outputSlotName.Data())); | |
daf66719 | 198 | if (!fInputListLYZ2PROD) {cout<<"list is NULL pointer!"<<endl;} |
199 | } | |
200 | cout<<"LYZ2PROD input file/list read..."<<endl; | |
201 | } | |
202 | } | |
203 | ||
daf66719 | 204 | if (LYZEP) { |
205 | //read the outputfile of the second run | |
121a84bb | 206 | TString outputFileName = "AnalysisResultsRedoFinishLYZ2.root"; |
daf66719 | 207 | TString pwd(gSystem->pwd()); |
208 | pwd+="/"; | |
209 | pwd+=outputFileName.Data(); | |
210 | TFile *outputFile = NULL; | |
211 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
212 | cout<<"WARNING: You do not have an output file:"<<endl; | |
213 | cout<<" "<<pwd.Data()<<endl; | |
214 | exit(0); | |
215 | } else { | |
216 | outputFile = TFile::Open(pwd.Data(),"READ"); | |
217 | } | |
d178bd1f | 218 | |
daf66719 | 219 | // read the output file from LYZ2SUM |
220 | TString inputFileNameLYZEP = "outputLYZ2SUManalysis" ; | |
12b2b8bc | 221 | inputFileNameLYZEP += rptypestr; |
daf66719 | 222 | cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl; |
223 | TFile* fInputFileLYZEP = (TFile*)outputFile->FindObjectAny(inputFileNameLYZEP.Data()); | |
224 | if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) { | |
225 | cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; | |
226 | break; | |
227 | } | |
228 | else { | |
499fe731 | 229 | TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("LYZ2SUM"); |
daf66719 | 230 | if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;} |
231 | } | |
232 | cout<<"LYZEP input file/list read..."<<endl; | |
233 | } | |
234 | ||
235 | ||
236 | // Create the FMD task and add it to the manager | |
237 | //=========================================================================== | |
12b2b8bc | 238 | if (rptypestr == "FMD") { |
daf66719 | 239 | AliFMDAnalysisTaskSE *taskfmd = NULL; |
12b2b8bc | 240 | if (rptypestr == "FMD") { |
daf66719 | 241 | taskfmd = new AliFMDAnalysisTaskSE("TaskFMD"); |
242 | mgr->AddTask(taskfmd); | |
d178bd1f | 243 | |
daf66719 | 244 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); |
245 | pars->Init(); | |
246 | pars->SetProcessPrimary(kTRUE); //for MC only | |
247 | pars->SetProcessHits(kFALSE); | |
d178bd1f | 248 | |
daf66719 | 249 | //pars->SetRealData(kTRUE); //for real data |
250 | //pars->SetProcessPrimary(kFALSE); //for real data | |
daf66719 | 251 | } |
252 | } | |
253 | ||
daf66719 | 254 | // Create the task, add it to the manager. |
255 | //=========================================================================== | |
256 | AliAnalysisTaskFlowEvent *taskFE = NULL; | |
daf66719 | 257 | |
d178bd1f | 258 | if(useAfterBurner) |
daf66719 | 259 | { |
12b2b8bc | 260 | taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent","",kFALSE,1); |
daf66719 | 261 | taskFE->SetFlow(v1,v2,v3,v4); |
262 | taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones); | |
263 | taskFE->SetAfterburnerOn(); | |
264 | } | |
12b2b8bc | 265 | else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent","",kFALSE); } |
d178bd1f | 266 | if (ExcludeRegion) { |
267 | taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); | |
59dab33a | 268 | } |
d178bd1f | 269 | taskFE->SetSubeventEtaRange(minA, maxA, minB, maxB); |
270 | if (UsePhysicsSelection) { | |
121a84bb | 271 | // taskFE->SelectCollisionCandidates(AliVEvent::kUserDefined); |
272 | taskFE->SelectCollisionCandidates(eventSelMask); | |
d178bd1f | 273 | cout<<"Using Physics Selection"<<endl; |
daf66719 | 274 | } |
d178bd1f | 275 | mgr->AddTask(taskFE); |
59dab33a | 276 | |
d178bd1f | 277 | // Pass cuts for RPs and POIs to the task: |
278 | taskFE->SetCutsEvent(cutsEvent); | |
279 | ||
59dab33a | 280 | // Pass cuts for RPs and POIs to the task: |
281 | taskFE->SetCutsRP(cutsRP); | |
282 | taskFE->SetCutsPOI(cutsPOI); | |
644f1368 | 283 | if (cutsRP->GetParamType()==AliFlowTrackCuts::kV0) |
284 | { | |
285 | //TODO: since this is set in a static object all analyses in an analysis train | |
286 | //will be affected. | |
287 | taskFE->SetHistWeightvsPhiMin(0.); | |
288 | taskFE->SetHistWeightvsPhiMax(200.); | |
289 | } | |
7d9ab4fb | 290 | |
daf66719 | 291 | // Create the analysis tasks, add them to the manager. |
292 | //=========================================================================== | |
293 | if (SP){ | |
294 | AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",WEIGHTS[0]); | |
295 | taskSP->SetRelDiffMsub(1.0); | |
121a84bb | 296 | taskSP->SetApplyCorrectionForNUA(kTRUE); |
dd442cd2 | 297 | //taskSP->SetHarmonic(2); // default is v2 |
daf66719 | 298 | mgr->AddTask(taskSP); |
299 | } | |
300 | if (LYZ1SUM){ | |
301 | AliAnalysisTaskLeeYangZeros *taskLYZ1SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kTRUE); | |
302 | taskLYZ1SUM->SetFirstRunLYZ(kTRUE); | |
303 | taskLYZ1SUM->SetUseSumLYZ(kTRUE); | |
304 | mgr->AddTask(taskLYZ1SUM); | |
305 | } | |
306 | if (LYZ1PROD){ | |
307 | AliAnalysisTaskLeeYangZeros *taskLYZ1PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kTRUE); | |
308 | taskLYZ1PROD->SetFirstRunLYZ(kTRUE); | |
309 | taskLYZ1PROD->SetUseSumLYZ(kFALSE); | |
310 | mgr->AddTask(taskLYZ1PROD); | |
311 | } | |
312 | if (LYZ2SUM){ | |
313 | AliAnalysisTaskLeeYangZeros *taskLYZ2SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kFALSE); | |
314 | taskLYZ2SUM->SetFirstRunLYZ(kFALSE); | |
315 | taskLYZ2SUM->SetUseSumLYZ(kTRUE); | |
316 | mgr->AddTask(taskLYZ2SUM); | |
317 | } | |
318 | if (LYZ2PROD){ | |
319 | AliAnalysisTaskLeeYangZeros *taskLYZ2PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kFALSE); | |
320 | taskLYZ2PROD->SetFirstRunLYZ(kFALSE); | |
321 | taskLYZ2PROD->SetUseSumLYZ(kFALSE); | |
322 | mgr->AddTask(taskLYZ2PROD); | |
323 | } | |
324 | if (LYZEP){ | |
325 | AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane"); | |
326 | mgr->AddTask(taskLYZEP); | |
327 | } | |
328 | if (GFC){ | |
329 | AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",useWeights); | |
330 | taskGFC->SetUsePhiWeights(WEIGHTS[0]); | |
331 | taskGFC->SetUsePtWeights(WEIGHTS[1]); | |
332 | taskGFC->SetUseEtaWeights(WEIGHTS[2]); | |
333 | mgr->AddTask(taskGFC); | |
334 | } | |
335 | if (QC){ | |
336 | AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",useWeights); | |
337 | taskQC->SetUsePhiWeights(WEIGHTS[0]); | |
338 | taskQC->SetUsePtWeights(WEIGHTS[1]); | |
339 | taskQC->SetUseEtaWeights(WEIGHTS[2]); | |
dd442cd2 | 340 | taskQC->SetCalculateCumulantsVsM(kFALSE); |
daf66719 | 341 | taskQC->SetnBinsMult(10000); |
342 | taskQC->SetMinMult(0.); | |
343 | taskQC->SetMaxMult(10000.); | |
dd442cd2 | 344 | //taskQC->SetHarmonic(2); // default is v2 |
121a84bb | 345 | taskQC->SetApplyCorrectionForNUA(kTRUE); |
dd442cd2 | 346 | taskQC->SetFillMultipleControlHistograms(kFALSE); |
daf66719 | 347 | mgr->AddTask(taskQC); |
348 | } | |
349 | if (FQD){ | |
350 | AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE); | |
351 | taskFQD->SetUsePhiWeights(WEIGHTS[0]); | |
352 | taskFQD->SetqMin(0.); | |
353 | taskFQD->SetqMax(1000.); | |
354 | taskFQD->SetqNbins(10000); | |
355 | mgr->AddTask(taskFQD); | |
356 | } | |
357 | if (MCEP){ | |
358 | AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane"); | |
359 | mgr->AddTask(taskMCEP); | |
360 | } | |
361 | if (MH){ | |
362 | AliAnalysisTaskMixedHarmonics *taskMH = new AliAnalysisTaskMixedHarmonics("TaskMixedHarmonics",useWeights); | |
363 | taskMH->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
dc8887a1 | 364 | taskMH->SetNoOfMultipicityBins(10000); |
365 | taskMH->SetMultipicityBinWidth(1.); | |
366 | taskMH->SetMinMultiplicity(1.); | |
daf66719 | 367 | taskMH->SetCorrectForDetectorEffects(kTRUE); |
368 | taskMH->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: two nested loops) | |
369 | taskMH->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
370 | mgr->AddTask(taskMH); | |
371 | } | |
372 | if (NL){ | |
373 | AliAnalysisTaskNestedLoops *taskNL = new AliAnalysisTaskNestedLoops("TaskNestedLoops",useWeights); | |
374 | taskNL->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
375 | taskNL->SetEvaluateNestedLoopsForRAD(kTRUE); // RAD = Relative Angle Distribution | |
376 | taskNL->SetEvaluateNestedLoopsForMH(kTRUE); // evalaute <<cos[n(phi1+phi2-2phi3)]>> (Remark: three nested loops) | |
377 | taskNL->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: three nested loops) | |
378 | taskNL->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
379 | mgr->AddTask(taskNL); | |
380 | } | |
b0e1585b | 381 | |
daf66719 | 382 | // Create the output container for the data produced by the task |
383 | // Connect to the input and output containers | |
384 | //=========================================================================== | |
385 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
386 | ||
12b2b8bc | 387 | if (rptypestr == "FMD") { |
daf66719 | 388 | AliAnalysisDataContainer *coutputFMD = |
499fe731 | 389 | mgr->CreateContainer(Form("BackgroundCorrected_%s",outputSlotName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer); |
daf66719 | 390 | //input and output taskFMD |
391 | mgr->ConnectInput(taskfmd, 0, cinput1); | |
392 | mgr->ConnectOutput(taskfmd, 1, coutputFMD); | |
393 | //input into taskFE | |
394 | mgr->ConnectInput(taskFE,1,coutputFMD); | |
395 | } | |
396 | ||
397 | AliAnalysisDataContainer *coutputFE = | |
499fe731 | 398 | mgr->CreateContainer(Form("FlowEventSimple_%s",outputSlotName.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer); |
daf66719 | 399 | mgr->ConnectInput(taskFE,0,cinput1); |
400 | mgr->ConnectOutput(taskFE,1,coutputFE); | |
499fe731 | 401 | |
a14b8f3c | 402 | if (taskFE->GetQAOn()) |
499fe731 | 403 | { |
404 | AliAnalysisDataContainer* coutputFEQA = | |
405 | mgr->CreateContainer(Form("QA %s",outputSlotName.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:QA %s",fileName,rptypestr)); | |
406 | mgr->ConnectOutput(taskFE,2,coutputFEQA); | |
407 | } | |
daf66719 | 408 | |
409 | // Create the output containers for the data produced by the analysis tasks | |
410 | // Connect to the input and output containers | |
411 | //=========================================================================== | |
412 | if (useWeights) { | |
499fe731 | 413 | AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer(Form("Weights_%s",outputSlotName.Data()), |
d178bd1f | 414 | TList::Class(),AliAnalysisManager::kInputContainer); |
daf66719 | 415 | } |
416 | ||
417 | if(SP) { | |
418 | TString outputSP = fileName; | |
419 | outputSP += ":outputSPanalysis"; | |
12b2b8bc | 420 | outputSP+= rptypestr; |
499fe731 | 421 | AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("SP_%s",outputSlotName.Data()), |
d178bd1f | 422 | TList::Class(),AliAnalysisManager::kOutputContainer,outputSP); |
daf66719 | 423 | mgr->ConnectInput(taskSP,0,coutputFE); |
424 | mgr->ConnectOutput(taskSP,1,coutputSP); | |
121a84bb | 425 | if (useWeights) { |
daf66719 | 426 | mgr->ConnectInput(taskSP,1,cinputWeights); |
427 | cinputWeights->SetData(weightsList); | |
d178bd1f | 428 | } |
daf66719 | 429 | } |
430 | if(LYZ1SUM) { | |
431 | TString outputLYZ1SUM = fileName; | |
432 | outputLYZ1SUM += ":outputLYZ1SUManalysis"; | |
12b2b8bc | 433 | outputLYZ1SUM+= rptypestr; |
499fe731 | 434 | AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("LYZ1SUM_%s",outputSlotName.Data()), |
d178bd1f | 435 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM); |
436 | mgr->ConnectInput(taskLYZ1SUM,0,coutputFE); | |
437 | mgr->ConnectOutput(taskLYZ1SUM,1,coutputLYZ1SUM); | |
daf66719 | 438 | } |
439 | if(LYZ1PROD) { | |
440 | TString outputLYZ1PROD = fileName; | |
441 | outputLYZ1PROD += ":outputLYZ1PRODanalysis"; | |
12b2b8bc | 442 | outputLYZ1PROD+= rptypestr; |
499fe731 | 443 | AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("LYZ1PROD_%s",outputSlotName.Data()), |
d178bd1f | 444 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD); |
daf66719 | 445 | mgr->ConnectInput(taskLYZ1PROD,0,coutputFE); |
446 | mgr->ConnectOutput(taskLYZ1PROD,1,coutputLYZ1PROD); | |
447 | } | |
448 | if(LYZ2SUM) { | |
499fe731 | 449 | AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer(Form("LYZ2SUMin_%s",outputSlotName.Data()), |
d178bd1f | 450 | TList::Class(),AliAnalysisManager::kInputContainer); |
daf66719 | 451 | TString outputLYZ2SUM = fileName; |
452 | outputLYZ2SUM += ":outputLYZ2SUManalysis"; | |
12b2b8bc | 453 | outputLYZ2SUM+= rptypestr; |
daf66719 | 454 | |
499fe731 | 455 | AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("LYZ2SUM_%s",outputSlotName.Data()), |
d178bd1f | 456 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM); |
daf66719 | 457 | mgr->ConnectInput(taskLYZ2SUM,0,coutputFE); |
458 | mgr->ConnectInput(taskLYZ2SUM,1,cinputLYZ2SUM); | |
459 | mgr->ConnectOutput(taskLYZ2SUM,1,coutputLYZ2SUM); | |
460 | cinputLYZ2SUM->SetData(fInputListLYZ2SUM); | |
461 | } | |
462 | if(LYZ2PROD) { | |
499fe731 | 463 | AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer(Form("LYZ2PRODin_%s",outputSlotName.Data()), |
d178bd1f | 464 | TList::Class(),AliAnalysisManager::kInputContainer); |
daf66719 | 465 | TString outputLYZ2PROD = fileName; |
466 | outputLYZ2PROD += ":outputLYZ2PRODanalysis"; | |
12b2b8bc | 467 | outputLYZ2PROD+= rptypestr; |
daf66719 | 468 | |
499fe731 | 469 | AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("LYZ2PROD_%s",outputSlotName.Data()), |
d178bd1f | 470 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD); |
daf66719 | 471 | mgr->ConnectInput(taskLYZ2PROD,0,coutputFE); |
472 | mgr->ConnectInput(taskLYZ2PROD,1,cinputLYZ2PROD); | |
473 | mgr->ConnectOutput(taskLYZ2PROD,1,coutputLYZ2PROD); | |
474 | cinputLYZ2PROD->SetData(fInputListLYZ2PROD); | |
475 | } | |
476 | if(LYZEP) { | |
499fe731 | 477 | AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer(Form("LYZEPin_%s",outputSlotName.Data()), |
d178bd1f | 478 | TList::Class(),AliAnalysisManager::kInputContainer); |
daf66719 | 479 | TString outputLYZEP = fileName; |
480 | outputLYZEP += ":outputLYZEPanalysis"; | |
12b2b8bc | 481 | outputLYZEP+= rptypestr; |
daf66719 | 482 | |
499fe731 | 483 | AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("LYZEP_%s",outputSlotName.Data()), |
d178bd1f | 484 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP); |
daf66719 | 485 | mgr->ConnectInput(taskLYZEP,0,coutputFE); |
486 | mgr->ConnectInput(taskLYZEP,1,cinputLYZEP); | |
487 | mgr->ConnectOutput(taskLYZEP,1,coutputLYZEP); | |
488 | cinputLYZEP->SetData(fInputListLYZEP); | |
489 | } | |
490 | if(GFC) { | |
491 | TString outputGFC = fileName; | |
492 | outputGFC += ":outputGFCanalysis"; | |
12b2b8bc | 493 | outputGFC+= rptypestr; |
daf66719 | 494 | |
499fe731 | 495 | AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("GFC_%s",outputSlotName.Data()), |
d178bd1f | 496 | TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC); |
daf66719 | 497 | mgr->ConnectInput(taskGFC,0,coutputFE); |
498 | mgr->ConnectOutput(taskGFC,1,coutputGFC); | |
499 | if (useWeights) { | |
500 | mgr->ConnectInput(taskGFC,1,cinputWeights); | |
501 | cinputWeights->SetData(weightsList); | |
502 | } | |
503 | } | |
504 | if(QC) { | |
505 | TString outputQC = fileName; | |
506 | outputQC += ":outputQCanalysis"; | |
12b2b8bc | 507 | outputQC+= rptypestr; |
daf66719 | 508 | |
499fe731 | 509 | AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("QC_%s",outputSlotName.Data()), |
d178bd1f | 510 | TList::Class(),AliAnalysisManager::kOutputContainer,outputQC); |
daf66719 | 511 | mgr->ConnectInput(taskQC,0,coutputFE); |
512 | mgr->ConnectOutput(taskQC,1,coutputQC); | |
513 | if (useWeights) { | |
514 | mgr->ConnectInput(taskQC,1,cinputWeights); | |
515 | cinputWeights->SetData(weightsList); | |
d178bd1f | 516 | } |
daf66719 | 517 | } |
518 | if(FQD) { | |
519 | TString outputFQD = fileName; | |
520 | outputFQD += ":outputFQDanalysis"; | |
12b2b8bc | 521 | outputFQD+= rptypestr; |
daf66719 | 522 | |
499fe731 | 523 | AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("FQD_%s",outputSlotName.Data()), |
d178bd1f | 524 | TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD); |
daf66719 | 525 | mgr->ConnectInput(taskFQD,0,coutputFE); |
526 | mgr->ConnectOutput(taskFQD,1,coutputFQD); | |
527 | if(useWeights) { | |
528 | mgr->ConnectInput(taskFQD,1,cinputWeights); | |
529 | cinputWeights->SetData(weightsList); | |
530 | } | |
531 | } | |
532 | if(MCEP) { | |
533 | TString outputMCEP = fileName; | |
534 | outputMCEP += ":outputMCEPanalysis"; | |
12b2b8bc | 535 | outputMCEP+= rptypestr; |
daf66719 | 536 | |
499fe731 | 537 | AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("MCEP_%s",outputSlotName.Data()), |
d178bd1f | 538 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP); |
539 | mgr->ConnectInput(taskMCEP,0,coutputFE); | |
daf66719 | 540 | mgr->ConnectOutput(taskMCEP,1,coutputMCEP); |
541 | } | |
542 | if(MH) { | |
543 | TString outputMH = fileName; | |
544 | outputMH += ":outputMHanalysis"; | |
12b2b8bc | 545 | outputMH += rptypestr; |
daf66719 | 546 | |
499fe731 | 547 | AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("MH_%s",outputSlotName.Data()), |
d178bd1f | 548 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMH); |
daf66719 | 549 | mgr->ConnectInput(taskMH,0,coutputFE); |
550 | mgr->ConnectOutput(taskMH,1,coutputMH); | |
551 | //if (useWeights) { | |
552 | // mgr->ConnectInput(taskMH,1,cinputWeights); | |
553 | // cinputWeights->SetData(weightsList); | |
554 | //} | |
555 | } | |
556 | if(NL) { | |
557 | TString outputNL = fileName; | |
558 | outputNL += ":outputNLanalysis"; | |
12b2b8bc | 559 | outputNL += rptypestr; |
d178bd1f | 560 | |
499fe731 | 561 | AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("NL_%s",outputSlotName.Data()), |
d178bd1f | 562 | TList::Class(),AliAnalysisManager::kOutputContainer,outputNL); |
563 | mgr->ConnectInput(taskNL,0,coutputFE); | |
564 | mgr->ConnectOutput(taskNL,1,coutputNL); | |
daf66719 | 565 | //if (useWeights) { |
566 | // mgr->ConnectInput(taskNL,1,cinputWeights); | |
567 | // cinputWeights->SetData(weightsList); | |
568 | //} | |
569 | } | |
b0e1585b | 570 | |
9bfaa57c | 571 | /////////////////////////////////////////////////////////////////////////////////////////// |
572 | if (runQAtask) | |
573 | { | |
574 | AliAnalysisTaskQAflow* taskQAflow = new AliAnalysisTaskQAflow("TaskQAflow"); | |
575 | taskQAflow->SetEventCuts(cutsEvent); | |
576 | taskQAflow->SetTrackCuts(cutsRP); | |
577 | taskQAflow->SetFillNTuple(FillQAntuple); | |
578 | taskQAflow->SetDoCorrelations(DoQAcorrelations); | |
579 | mgr->AddTask(taskQAflow); | |
580 | ||
499fe731 | 581 | Printf("outputSlotName %s",outputSlotName.Data()); |
9bfaa57c | 582 | TString taskQAoutputFileName(fileNameBase); |
583 | taskQAoutputFileName.Append("_QA.root"); | |
499fe731 | 584 | AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("flowQA_%s",outputSlotName.Data()), |
9bfaa57c | 585 | TObjArray::Class(), |
586 | AliAnalysisManager::kOutputContainer, | |
587 | taskQAoutputFileName); | |
499fe731 | 588 | AliAnalysisDataContainer* coutputQAtaskTree = mgr->CreateContainer(Form("flowQAntuple_%s",outputSlotName.Data()), |
9bfaa57c | 589 | TNtuple::Class(), |
590 | AliAnalysisManager::kOutputContainer, | |
591 | taskQAoutputFileName); | |
592 | mgr->ConnectInput(taskQAflow,0,mgr->GetCommonInputContainer()); | |
593 | mgr->ConnectInput(taskQAflow,1,coutputFE); | |
594 | mgr->ConnectOutput(taskQAflow,1,coutputQAtask); | |
595 | if (FillQAntuple) mgr->ConnectOutput(taskQAflow,2,coutputQAtaskTree); | |
596 | } | |
daf66719 | 597 | } |