]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskForwardFlow.C
Multiple fixes:
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardFlow.C
1 /**
2  * @file   AddTaskForwardFlow.C
3  * @author Alexander Hansen alexander.hansen@cern.ch 
4  * 
5  * @brief  
6  * 
7  * 
8  * @ingroup pwglf_forward_scripts_tasks
9  */
10 /** 
11  * @defgroup pwglf_forward_flow Flow 
12  *
13  * Code to deal with flow 
14  *
15  * @ingroup pwglf_forward_topical
16  */
17 /** 
18  * Add Flow task to train 
19  * 
20  * @param type          Which moments to do 
21  * @param mc            Monte-carlo input
22  * @param dispVtx       Use satellite interactions 
23  * @param outlierCutFMD Cut to remove events with outliers 
24  * @param outlierCutSPD Cut to remove events with outliers 
25  * @param addFlow       Afterburn what (MC only)
26  * @param addFType      Afterburner parameterization
27  * @param addFOrder     Afterburder order 
28  *
29  * @ingroup pwglf_forward_flow
30  */
31 void AddTaskForwardFlow(TString  type          = "", 
32                         Bool_t   mc            = kFALSE,
33                         Bool_t   dispVtx       = kFALSE,
34                         Double_t outlierCutFMD = 4.1, 
35                         Double_t outlierCutSPD = 4.1,
36                         TString  addFlow       = "",
37                         Int_t    addFType      = 0,
38                         Int_t    addFOrder     = 0)
39 {
40   // --- Get analysis manager ----------------------------------------
41   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
42   if (!mgr) 
43     Fatal("","No analysis manager to connect to.");
44
45   // --- Check that we have an AOD input handler ---------------------
46   UShort_t aodInput = 0;
47   if (!(aodInput = AliForwardUtil::CheckForAOD())) 
48     Fatal("","Cannot proceed without and AOD handler");
49   if (aodInput == 2 && 
50       (!AliForwardUtil::CheckForTask("AliForwardMultiplicityBase") ||
51        !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask")))
52     Fatal("","The relevant tasks wasn't added to the train");
53
54   // --- For the selected flow tasks the input and output is set -----
55   AliForwardFlowTaskQC* task = 0;
56   if (mc) {
57     AliForwardMCFlowTaskQC* mcTask = new AliForwardMCFlowTaskQC("QCumulants");
58     // --- Set up adding flow to MC input ----------------------------
59     mcTask->SetUseImpactParameter(true);
60     mcTask->AddFlow(addFlow);
61     mcTask->AddFlowType(addFType);
62     mcTask->AddFlowOrder(addFOrder);
63     task = mcTask;
64   }
65   else 
66     task = new AliForwardFlowTaskQC("QCumulants");
67   mgr->AddTask(task); 
68
69   // --- Check which harmonics to calculate --------------------------
70   Bool_t v2 = type.Contains("2");
71   Bool_t v3 = type.Contains("3");
72   Bool_t v4 = type.Contains("4");
73   Bool_t v5 = type.Contains("5");
74   Bool_t v6 = type.Contains("6");
75   task->SetDoHarmonics(v2, v3, v4, v5, v6);
76
77   // --- Set non-default axis for vertices ---------------------------
78   TAxis* a = 0;
79   if (dispVtx) {
80     AliForwardFlowTaskQC::fgDispVtx = true;
81     a = new TAxis(6, 93.75, 318.75);
82   }
83   else 
84     a = new TAxis(20, -10, 10);
85   task->SetVertexAxis(a);
86
87   // --- Set sigma cuts for outliers ---------------------------------
88   task->SetDetectorCuts(outlierCutFMD, outlierCutSPD);
89
90   // --- Create containers for output --------------------------------
91   AliAnalysisDataContainer* sums = 
92     mgr->CreateContainer("FlowQCSums", TList::Class(), 
93                          AliAnalysisManager::kOutputContainer, 
94                          AliAnalysisManager::GetCommonFileName());
95   AliAnalysisDataContainer* output = 
96     mgr->CreateContainer("FlowQCResults", TList::Class(), 
97                          AliAnalysisManager::kParamContainer, 
98                          AliAnalysisManager::GetCommonFileName());
99   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
100   mgr->ConnectOutput(task, 1, sums);
101   mgr->ConnectOutput(task, 2, output);
102 }
103 /*
104  * EOF
105  */