2 * @file AddTaskForwardFlow.C
3 * @author Alexander Hansen alexander.hansen@cern.ch
8 * @ingroup pwglf_forward_scripts_tasks
11 * @defgroup pwglf_forward_flow Flow
12 * @ingroup pwglf_forward_topical
15 * Add Flow task to train
24 * @ingroup pwglf_forward_flow
26 void AddTaskForwardFlow(TString type = "",
28 Bool_t dispVtx = kFALSE,
33 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
35 Error("AddFMDFlowTask", "No analysis manager to connect to.");
39 AliAODInputHandler* aodInput = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
42 if (aodInput) aod = kTRUE;
44 Error("AddTaskForwardFlow", "No analysis manager to connect to.");
48 // --- Check which harmonics to calculate --- //
55 if (type.Length() > 0) {
56 if (!type.Contains("2")) v2 = kFALSE;
57 if (!type.Contains("3")) v3 = kFALSE;
58 if (!type.Contains("4")) v4 = kFALSE;
59 if (!type.Contains("5")) v5 = kFALSE;
60 if (!type.Contains("6")) v6 = kFALSE;
63 // --- Create containers for output --- //
64 AliAnalysisDataContainer* sums =
65 mgr->CreateContainer("FlowQCSums", TList::Class(),
66 AliAnalysisManager::kOutputContainer,
67 AliAnalysisManager::GetCommonFileName());
68 AliAnalysisDataContainer* output =
69 mgr->CreateContainer("FlowQCResults", TList::Class(),
70 AliAnalysisManager::kParamContainer,
71 AliAnalysisManager::GetCommonFileName());
73 // --- For the selected flow tasks the input and output is set --- //
75 AliForwardFlowTaskQC* task = 0;
77 task = new AliForwardMCFlowTaskQC("QCumulants");
79 task = new AliForwardFlowTaskQC("QCumulants");
82 // Set which harmonics to do
83 task->SetDoHarmonics(v2, v3, v4, v5, v6);
84 // Set non-default axis for vertices
86 if (!dispVtx) a = new TAxis(20, -10, 10);
87 // if (!dispVtx) a = new TAxis(1, -1, 0);
88 if ( dispVtx) a = new TAxis(6, 93.75, 318.75);
89 // if ( dispVtx) a = new TAxis(21, -393.75, 393.75);
90 task->SetVertexAxis(a);
91 if ( dispVtx) Bool_t AliForwardFlowTaskQC::fgDispVtx = kTRUE;
92 // Set detector specific sigma cuts
93 task->SetDetectorCuts(4.10, 4.10);
96 task->SetDebugLevel(0);
97 // Set up adding flow to MC input
99 AliForwardMCFlowTaskQC* mcTask =
100 static_cast<AliForwardMCFlowTaskQC*>task;
101 mcTask->SetUseImpactParameter(true);
102 mcTask->AddFlow(addFlow);
103 mcTask->AddFlowType(addFType);
104 mcTask->AddFlowOrder(addFOrder);
106 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
107 mgr->ConnectOutput(task, 1, sums);
108 mgr->ConnectOutput(task, 2, output);