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