]>
Commit | Line | Data |
---|---|---|
ffca499d | 1 | /** |
2 | * @file AddTaskForwardFlow.C | |
2b556440 | 3 | * @author Alexander Hansen alexander.hansen@cern.ch |
4 | * @date Wed Sep 07 12:14:17 2011 | |
ffca499d | 5 | * |
6 | * @brief | |
7 | * | |
8 | * | |
bd6f5206 | 9 | * @ingroup pwglf_forward_scripts_tasks |
ffca499d | 10 | */ |
11 | /** | |
bd6f5206 | 12 | * @defgroup pwglf_forward_flow Flow |
13 | * @ingroup pwglf_forward_topical | |
ffca499d | 14 | */ |
15 | /** | |
16 | * Add Flow task to train | |
17 | * | |
d226802c | 18 | * @param type |
19 | * @param etabins | |
20 | * @param mc | |
21 | * @param addFlow | |
22 | * @param addFType | |
23 | * @param addFOrder | |
ffca499d | 24 | * |
bd6f5206 | 25 | * @ingroup pwglf_forward_flow |
ffca499d | 26 | */ |
58f5fae2 | 27 | void AddTaskForwardFlow(TString type = "", |
d226802c | 28 | Bool_t mc = kFALSE, |
58f5fae2 | 29 | TString addFlow = "", |
30 | Int_t addFType = 0, | |
31 | Int_t addFOrder = 0) | |
d2bea14e | 32 | { |
33 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
34 | if (!mgr) { | |
35 | Error("AddFMDFlowTask", "No analysis manager to connect to."); | |
36 | return NULL; | |
37 | } | |
38 | ||
d226802c | 39 | AliAODInputHandler* aodInput = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); |
d2bea14e | 40 | |
d226802c | 41 | Bool_t aod = kFALSE; |
42 | if (aodInput) aod = kTRUE; | |
43 | if (!aod) { | |
d2bea14e | 44 | Error("AddTaskForwardFlow", "No analysis manager to connect to."); |
45 | return NULL; | |
46 | } | |
47 | ||
d226802c | 48 | // --- Check which harmonics to calculate --- // |
49 | ||
d2bea14e | 50 | Bool_t v1 = kTRUE; |
51 | Bool_t v2 = kTRUE; | |
52 | Bool_t v3 = kTRUE; | |
53 | Bool_t v4 = kTRUE; | |
d226802c | 54 | Bool_t v5 = kTRUE; |
55 | Bool_t v6 = kTRUE; | |
d2bea14e | 56 | |
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; | |
d226802c | 62 | if (!type.Contains("5")) v5 = kFALSE; |
63 | if (!type.Contains("6")) v6 = kFALSE; | |
d2bea14e | 64 | } |
65 | ||
2b556440 | 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()); | |
d2bea14e | 75 | |
d226802c | 76 | // --- For the selected flow tasks the input and output is set --- // |
77 | ||
2b556440 | 78 | AliForwardFlowTaskQC* task = 0; |
79 | if (mc) | |
80 | task = new AliForwardMCFlowTaskQC("QCumulants"); | |
81 | else | |
82 | task = new AliForwardFlowTaskQC("QCumulants"); | |
83 | mgr->AddTask(task); | |
d2bea14e | 84 | |
4b5b52b7 | 85 | // Set which harmonics to do |
2b556440 | 86 | task->SetDoHarmonics(v1, v2, v3, v4, v5, v6); |
4b5b52b7 | 87 | // Set non-default axis for vertices |
88 | TAxis* a = new TAxis(20, -10, 10); | |
89 | task->SetVertexAxis(a); | |
90 | // Set debug flag | |
91 | task->SetDebugLevel(0); | |
92 | // Set up adding flow to MC input | |
2b556440 | 93 | if (mc) { |
94 | AliForwardMCFlowTaskQC* mcTask = | |
95 | static_cast<AliForwardMCFlowTaskQC*>task; | |
4b5b52b7 | 96 | mcTask->SetUseImpactParameter(true); |
2b556440 | 97 | mcTask->AddFlow(addFlow); |
98 | mcTask->AddFlowType(addFType); | |
99 | mcTask->AddFlowOrder(addFOrder); | |
100 | } | |
101 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
102 | mgr->ConnectOutput(task, 1, sums); | |
103 | mgr->ConnectOutput(task, 2, output); | |
d2bea14e | 104 | |
105 | return; | |
106 | } |