]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskForwardFlow.C
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardFlow.C
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  * 
9  * @ingroup pwglf_forward_scripts_tasks
10  */
11 /** 
12  * @defgroup pwglf_forward_flow Flow 
13  * @ingroup pwglf_forward_topical
14  */
15 /** 
16  * Add Flow task to train 
17  * 
18  * @param type 
19  * @param etabins 
20  * @param mc 
21  * @param addFlow 
22  * @param addFType 
23  * @param addFOrder 
24  *
25  * @ingroup pwglf_forward_flow
26  */
27 void AddTaskForwardFlow(TString type = "", 
28                         Int_t etabins = 48,
29                         Bool_t mc = kFALSE,
30                         TString addFlow = "",
31                         Int_t addFType = 0,
32                         Int_t addFOrder = 0)
33 {
34   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
35   if (!mgr) {
36     Error("AddFMDFlowTask", "No analysis manager to connect to.");
37     return NULL;
38   }   
39
40   AliAODInputHandler* aodInput = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
41    
42   Bool_t aod = kFALSE;
43   if (aodInput) aod = kTRUE;
44   if (!aod) {
45     Error("AddTaskForwardFlow", "No analysis manager to connect to.");
46     return NULL;
47   }
48
49   // --- Check which harmonics to calculate --- //
50
51   Bool_t v1 = kTRUE;
52   Bool_t v2 = kTRUE;
53   Bool_t v3 = kTRUE;
54   Bool_t v4 = kTRUE;
55   Bool_t v5 = kTRUE;
56   Bool_t v6 = kTRUE;
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;
63     if (!type.Contains("5")) v5 = kFALSE;
64     if (!type.Contains("6")) v6 = kFALSE;
65   }
66
67   // --- Create output containers and find input from fmd task --- //
68
69   TString outputFile = AliAnalysisManager::GetCommonFileName();
70   outputFile += ":FlowResults";
71
72   AliAnalysisDataContainer* qcout = mgr->CreateContainer("QCumulants", TList::Class(), AliAnalysisManager::kOutputContainer, outputFile);
73
74   // --- For the selected flow tasks the input and output is set --- //
75   
76   AliForwardFlowTaskQC* qc = new AliForwardFlowTaskQC("QCumulants");
77
78   qc->SetDoHarmonics(v1, v2, v3, v4, v5, v6);
79   qc->SetUseNEtaBins(etabins);
80   qc->SetMCinput(mc);
81   qc->AddFlow(addFlow);
82   qc->AddFlowType(addFType);
83   qc->AddFlowOrder(addFOrder);
84   qc->SetRefEtaBins(4);
85   
86   mgr->ConnectInput(qc, 0, mgr->GetCommonInputContainer());
87   mgr->ConnectOutput(qc, 1, qcout);
88
89   return;
90 }