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