]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskForwardFlowQC.C
Merge branch 'workdir'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardFlowQC.C
CommitLineData
ffca499d 1/**
87f694ab 2 * @file AddTaskForwardFlowQC.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 *
87f694ab 20 * @param maxMom Max moment to do
33438b4c 21 * @param useEtaGap Whehter to use @f$\eta@f$ gaps
290052e7 22 * @param mc Monte-carlo input
290052e7 23 * @param outlierCutFMD Cut to remove events with outliers
24 * @param outlierCutSPD Cut to remove events with outliers
87f694ab
AH
25 * @param etaGap Size of @f$\eta@f$ gap
26 * @param useCent Whether to use centrality or impact parameter for MC
27 * @param useMCVtx Whether to use vertex info from MC header
28 * @param satVtx Use satellite interactions
290052e7 29 * @param addFlow Afterburn what (MC only)
30 * @param addFType Afterburner parameterization
31 * @param addFOrder Afterburder order
ffca499d 32 *
bd6f5206 33 * @ingroup pwglf_forward_flow
ffca499d 34 */
87f694ab
AH
35void AddTaskForwardFlowQC(Int_t maxMom = 5,
36 TString fwdDet = "FMD",
37 Bool_t useEtaGap = kFALSE,
38 Bool_t use3cor = kFALSE,
39 Bool_t mc = kFALSE,
40 Double_t outlierCutFMD = 4.0,
41 Double_t outlierCutSPD = 4.0,
42 Double_t etaGap = 2.0,
43 Bool_t useTPCForRef = kFALSE,
44 Bool_t useCent = kFALSE,
45 Bool_t useMCVtx = kFALSE,
46 Bool_t satVtx = kFALSE,
47 TString addFlow = "",
48 Int_t addFType = 0,
49 Int_t addFOrder = 0)
d2bea14e 50{
290052e7 51 // --- Get analysis manager ----------------------------------------
d2bea14e 52 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
290052e7 53 if (!mgr)
54 Fatal("","No analysis manager to connect to.");
d2bea14e 55
290052e7 56 // --- Check that we have an AOD input handler ---------------------
57 UShort_t aodInput = 0;
58 if (!(aodInput = AliForwardUtil::CheckForAOD()))
59 Fatal("","Cannot proceed without and AOD handler");
60 if (aodInput == 2 &&
61 (!AliForwardUtil::CheckForTask("AliForwardMultiplicityBase") ||
62 !AliForwardUtil::CheckForTask("AliCentralMultiplicityTask")))
008eda2b 63 Fatal("","The relevant tasks weren't added to the train");
290052e7 64
65 // --- For the selected flow tasks the input and output is set -----
87f694ab
AH
66 fwdDet.ToUpper();
67
68 // --- Set flow flags --------------------------------------------
69 if (useEtaGap && use3cor)
70 Fatal("", "You're doing it wrong! Cannot do both eta-gap and 3-sub");
71 UShort_t flags = AliForwardFlowTaskQC::kStdQC|AliForwardFlowTaskQC::kSymEta;
72 if (useEtaGap) flags = AliForwardFlowTaskQC::kEtaGap;
73 if (use3cor) flags = AliForwardFlowTaskQC::k3Cor;
74 if (satVtx) flags |= AliForwardFlowTaskQC::kSatVtx;
75 if (fwdDet.Contains("FMD")) flags |= AliForwardFlowTaskQC::kNUAcorr;
76 if (fwdDet.Contains("FMD")) flags |= AliForwardFlowTaskQC::kFMD;
77 else if (fwdDet.Contains("VZERO")) flags |= AliForwardFlowTaskQC::kVZERO;
78 if (useTPCForRef) flags |= AliForwardFlowTaskQC::kTPC;
79
80 const char* name = Form("ForwardFlowQC%s%s", fwdDet.Data(), AliForwardFlowTaskQC::GetQCType(flags, false));
290052e7 81 AliForwardFlowTaskQC* task = 0;
68589651 82 // --- Set up adding flow to MC input ----------------------------
290052e7 83 if (mc) {
68589651 84 AliForwardMCFlowTaskQC* mcTask = new AliForwardMCFlowTaskQC(name);
85 mcTask->SetUseImpactParameter(!useCent);
87f694ab 86 mcTask->SetUseMCHeaderVertex(useMCVtx);
68589651 87 if (addFlow.Data()[0] != '\0') {
88 mcTask->AddFlow(addFlow);
89 mcTask->AddFlowType(addFType);
90 mcTask->AddFlowOrder(addFOrder);
91 }
290052e7 92 task = mcTask;
d2bea14e 93 }
68589651 94 // --- Or use normal task ----------------------------------------
290052e7 95 else
68589651 96 task = new AliForwardFlowTaskQC(name);
97
87f694ab
AH
98 mgr->AddTask(task);
99// mgr->SetSkipTerminate(true);
100// task->SelectCollisionCandidates(AliVEvent::kCentral);
68589651 101 task->SetFlowFlags(flags);
102
103 // --- Set eta gap value -----------------------------------------
104 task->SetEtaGapValue(etaGap);
105
290052e7 106 // --- Check which harmonics to calculate --------------------------
87f694ab
AH
107 task->SetMaxFlowMoment(maxMom);
108
290052e7 109 // --- Set non-default axis for vertices ---------------------------
110 TAxis* a = 0;
68589651 111 if (satVtx) {
290052e7 112 a = new TAxis(6, 93.75, 318.75);
d2bea14e 113 }
290052e7 114 else
115 a = new TAxis(20, -10, 10);
87f694ab 116// a = new TAxis(10, -5, 5);
290052e7 117 task->SetVertexAxis(a);
118
87f694ab
AH
119 // --- Set non-default axis for centrality -------------------------
120 Double_t cent[] = {0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100 };
121 //Double_t cent[] = {0, 2.5, 15, 25, 50, 100 };
122 //Double_t cent[] = {0, 100};
123 Int_t nBins = sizeof(cent)/sizeof(Double_t) -1;
124 TAxis* centAxis = new TAxis(nBins, cent);
125 task->SetCentralityAxis(centAxis);
126
290052e7 127 // --- Set sigma cuts for outliers ---------------------------------
128 task->SetDetectorCuts(outlierCutFMD, outlierCutSPD);
d2bea14e 129
290052e7 130 // --- Create containers for output --------------------------------
87f694ab
AH
131 const char* sumName = Form("FlowQCSums%s%s", fwdDet.Data(), AliForwardFlowTaskQC::GetQCType(flags, false));
132 const char* resName = Form("FlowQCResults%s%s", fwdDet.Data(), AliForwardFlowTaskQC::GetQCType(flags, false));
2b556440 133 AliAnalysisDataContainer* sums =
68589651 134 mgr->CreateContainer(sumName, TList::Class(),
2b556440 135 AliAnalysisManager::kOutputContainer,
136 AliAnalysisManager::GetCommonFileName());
137 AliAnalysisDataContainer* output =
68589651 138 mgr->CreateContainer(resName, TList::Class(),
2b556440 139 AliAnalysisManager::kParamContainer,
140 AliAnalysisManager::GetCommonFileName());
2b556440 141 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
142 mgr->ConnectOutput(task, 1, sums);
143 mgr->ConnectOutput(task, 2, output);
d2bea14e 144}
290052e7 145/*
146 * EOF
147 */