]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskForwardFlow.C
Count also all events analyzed, not only the selected ones
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardFlow.C
CommitLineData
ffca499d 1/**
2 * @file AddTaskForwardFlow.C
2b556440 3 * @author Alexander Hansen alexander.hansen@cern.ch
ffca499d 4 *
5 * @brief
6 *
7 *
bd6f5206 8 * @ingroup pwglf_forward_scripts_tasks
ffca499d 9 */
10/**
bd6f5206 11 * @defgroup pwglf_forward_flow Flow
290052e7 12 *
13 * Code to deal with flow
14 *
bd6f5206 15 * @ingroup pwglf_forward_topical
ffca499d 16 */
17/**
18 * Add Flow task to train
19 *
290052e7 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
ffca499d 28 *
bd6f5206 29 * @ingroup pwglf_forward_flow
ffca499d 30 */
68589651 31void AddTaskForwardFlow(TString type = "234",
32 Bool_t useEtaGap = kFALSE,
290052e7 33 Bool_t mc = kFALSE,
68589651 34 Double_t outlierCutFMD = 4.0,
35 Double_t outlierCutSPD = 0,
36 Double_t etaGap = 2.0,
37 Bool_t useCent = kFALSE,
38 Bool_t satVtx = kFALSE,
290052e7 39 TString addFlow = "",
40 Int_t addFType = 0,
41 Int_t addFOrder = 0)
d2bea14e 42{
290052e7 43 // --- Get analysis manager ----------------------------------------
d2bea14e 44 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
290052e7 45 if (!mgr)
46 Fatal("","No analysis manager to connect to.");
d2bea14e 47
290052e7 48 // --- Check that we have an AOD input handler ---------------------
49 UShort_t aodInput = 0;
50 if (!(aodInput = AliForwardUtil::CheckForAOD()))
51 Fatal("","Cannot proceed without and AOD handler");
52 if (aodInput == 2 &&
53 (!AliForwardUtil::CheckForTask("AliForwardMultiplicityBase") ||
54 !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask")))
008eda2b 55 Fatal("","The relevant tasks weren't added to the train");
290052e7 56
57 // --- For the selected flow tasks the input and output is set -----
68589651 58 const char* name = (useEtaGap ? "ForwardQCumulantsEtaGap", "ForwardQCumulants");
290052e7 59 AliForwardFlowTaskQC* task = 0;
68589651 60 // --- Set up adding flow to MC input ----------------------------
290052e7 61 if (mc) {
68589651 62 AliForwardMCFlowTaskQC* mcTask = new AliForwardMCFlowTaskQC(name);
63 mcTask->SetUseImpactParameter(!useCent);
64 if (addFlow.Data()[0] != '\0') {
65 mcTask->AddFlow(addFlow);
66 mcTask->AddFlowType(addFType);
67 mcTask->AddFlowOrder(addFOrder);
68 }
290052e7 69 task = mcTask;
d2bea14e 70 }
68589651 71 // --- Or use normal task ----------------------------------------
290052e7 72 else
68589651 73 task = new AliForwardFlowTaskQC(name);
74
290052e7 75 mgr->AddTask(task);
d2bea14e 76
68589651 77 // --- Set flow flags --------------------------------------------
78 UShort_t flags = AliForwardFlowTaskQC::kSymEta;
79 if (useEtaGap) flags |= AliForwardFlowTaskQC::kEtaGap;
80 if (satVtx) flags |= AliForwardFlowTaskQC::kSatVtx;
81 if (useEtaGap || satVtx) flags ^= AliForwardFlowTaskQC::kSymEta;
82 task->SetFlowFlags(flags);
83
84 // --- Set eta gap value -----------------------------------------
85 task->SetEtaGapValue(etaGap);
86
290052e7 87 // --- Check which harmonics to calculate --------------------------
68589651 88 const char* harm = type.Data();
89 Int_t i = 0;
008eda2b 90 std::cout << "Type string: " << type.Data();
91 std::cout << "\t harm string: " << harm << std::endl;
68589651 92 while (i < type.Length()) {
93 char c = harm[i];
008eda2b 94 std::cout << "Adding moment: " << c << std::endl;
68589651 95 Short_t n = atoi(&c);
008eda2b 96 std::cout << "Adding moment: " << n << std::endl;
68589651 97 task->AddFlowMoment(n);
98 i++;
99 }
d2bea14e 100
290052e7 101 // --- Set non-default axis for vertices ---------------------------
102 TAxis* a = 0;
68589651 103 if (satVtx) {
290052e7 104 a = new TAxis(6, 93.75, 318.75);
d2bea14e 105 }
290052e7 106 else
107 a = new TAxis(20, -10, 10);
108 task->SetVertexAxis(a);
109
110 // --- Set sigma cuts for outliers ---------------------------------
111 task->SetDetectorCuts(outlierCutFMD, outlierCutSPD);
d2bea14e 112
290052e7 113 // --- Create containers for output --------------------------------
68589651 114 const char* sumName = (useEtaGap ? "FlowQCSumsEtaGap" : "FlowQCSums");
115 const char* resName = (useEtaGap ? "FlowQCResultsEtaGap" : "FlowQCResults");
2b556440 116 AliAnalysisDataContainer* sums =
68589651 117 mgr->CreateContainer(sumName, TList::Class(),
2b556440 118 AliAnalysisManager::kOutputContainer,
119 AliAnalysisManager::GetCommonFileName());
120 AliAnalysisDataContainer* output =
68589651 121 mgr->CreateContainer(resName, TList::Class(),
2b556440 122 AliAnalysisManager::kParamContainer,
123 AliAnalysisManager::GetCommonFileName());
2b556440 124 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
125 mgr->ConnectOutput(task, 1, sums);
126 mgr->ConnectOutput(task, 2, output);
d2bea14e 127}
290052e7 128/*
129 * EOF
130 */