2 * @file AddTaskForwardFlow.C
3 * @author Alexander Hansen alexander.hansen@cern.ch
4 * @date Wed Sep 07 12:14:17 2011
9 * @ingroup pwglf_forward_scripts_tasks
12 * @defgroup pwglf_forward_flow Flow
13 * @ingroup pwglf_forward_topical
16 * Add Flow task to train
25 * @ingroup pwglf_forward_flow
27 void AddTaskForwardFlow(TString type = "",
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 --- //
57 if (type.Length() > 0) {
58 if (!type.Contains("1")) v1 = kFALSE;
59 if (!type.Contains("2")) v2 = kFALSE;
60 if (!type.Contains("3")) v3 = kFALSE;
61 if (!type.Contains("4")) v4 = kFALSE;
62 if (!type.Contains("5")) v5 = kFALSE;
63 if (!type.Contains("6")) v6 = kFALSE;
66 // --- Create containers for output --- //
67 AliAnalysisDataContainer* sums =
68 mgr->CreateContainer("FlowQCSums", TList::Class(),
69 AliAnalysisManager::kOutputContainer,
70 AliAnalysisManager::GetCommonFileName());
71 AliAnalysisDataContainer* output =
72 mgr->CreateContainer("FlowQCResults", TList::Class(),
73 AliAnalysisManager::kParamContainer,
74 AliAnalysisManager::GetCommonFileName());
76 // --- For the selected flow tasks the input and output is set --- //
78 AliForwardFlowTaskQC* task = 0;
80 task = new AliForwardMCFlowTaskQC("QCumulants");
82 task = new AliForwardFlowTaskQC("QCumulants");
85 // Set which harmonics to do
86 task->SetDoHarmonics(v1, v2, v3, v4, v5, v6);
87 // Set non-default axis for vertices
88 TAxis* a = new TAxis(20, -10, 10);
89 task->SetVertexAxis(a);
91 task->SetDebugLevel(0);
92 // Set up adding flow to MC input
94 AliForwardMCFlowTaskQC* mcTask =
95 static_cast<AliForwardMCFlowTaskQC*>task;
96 mcTask->SetUseImpactParameter(true);
97 mcTask->AddFlow(addFlow);
98 mcTask->AddFlowType(addFType);
99 mcTask->AddFlowOrder(addFOrder);
101 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
102 mgr->ConnectOutput(task, 1, sums);
103 mgr->ConnectOutput(task, 2, output);