]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskForwardFlow.C
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardFlow.C
CommitLineData
ffca499d 1/**
2 * @file AddTaskForwardFlow.C
3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Wed Mar 23 12:14:17 2011
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 27void AddTaskForwardFlow(TString type = "",
d226802c 28 Int_t etabins = 48,
29 Bool_t mc = kFALSE,
58f5fae2 30 TString addFlow = "",
31 Int_t addFType = 0,
32 Int_t addFOrder = 0)
d2bea14e 33{
34 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
35 if (!mgr) {
36 Error("AddFMDFlowTask", "No analysis manager to connect to.");
37 return NULL;
38 }
39
d226802c 40 AliAODInputHandler* aodInput = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
d2bea14e 41
d226802c 42 Bool_t aod = kFALSE;
43 if (aodInput) aod = kTRUE;
44 if (!aod) {
d2bea14e 45 Error("AddTaskForwardFlow", "No analysis manager to connect to.");
46 return NULL;
47 }
48
d226802c 49 // --- Check which harmonics to calculate --- //
50
d2bea14e 51 Bool_t v1 = kTRUE;
52 Bool_t v2 = kTRUE;
53 Bool_t v3 = kTRUE;
54 Bool_t v4 = kTRUE;
d226802c 55 Bool_t v5 = kTRUE;
56 Bool_t v6 = kTRUE;
d2bea14e 57
58 if (type.Length() > 0) {
59 if (!type.Contains("1")) v1 = kFALSE;
60 if (!type.Contains("2")) v2 = kFALSE;
61 if (!type.Contains("3")) v3 = kFALSE;
62 if (!type.Contains("4")) v4 = kFALSE;
d226802c 63 if (!type.Contains("5")) v5 = kFALSE;
64 if (!type.Contains("6")) v6 = kFALSE;
d2bea14e 65 }
66
d226802c 67 // --- Create output containers and find input from fmd task --- //
d2bea14e 68
69 TString outputFile = AliAnalysisManager::GetCommonFileName();
70 outputFile += ":FlowResults";
71
d226802c 72 AliAnalysisDataContainer* qcout = mgr->CreateContainer("QCumulants", TList::Class(), AliAnalysisManager::kOutputContainer, outputFile);
d2bea14e 73
d226802c 74 // --- For the selected flow tasks the input and output is set --- //
75
d2bea14e 76 AliForwardFlowTaskQC* qc = new AliForwardFlowTaskQC("QCumulants");
77
d226802c 78 qc->SetDoHarmonics(v1, v2, v3, v4, v5, v6);
d2bea14e 79 qc->SetUseNEtaBins(etabins);
d226802c 80 qc->SetMCinput(mc);
58f5fae2 81 qc->AddFlow(addFlow);
82 qc->AddFlowType(addFType);
83 qc->AddFlowOrder(addFOrder);
d226802c 84 qc->SetRefEtaBins(4);
d2bea14e 85
58f5fae2 86 mgr->ConnectInput(qc, 0, mgr->GetCommonInputContainer());
d2bea14e 87 mgr->ConnectOutput(qc, 1, qcout);
88
89 return;
90}