]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskCentralMCCorr.C
Added scripts for Casper/Valentina style P(N_{ch}) analysis
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskCentralMCCorr.C
CommitLineData
fc6d3e14 1/**
2 * @file AddTaskCentralMCCorr.C
3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Tue Apr 26 09:55:29 2011
5 *
6 * @brief
7 *
bd6f5206 8 * @ingroup pwglf_forward_scripts_tasks
fc6d3e14 9 *
10 */
11
12/**
13 * Add a Central MC correction generator task to train
14 *
15 *
16 * @return Added task
17 *
bd6f5206 18 * @ingroup pwglf_central_mc
fc6d3e14 19 */
20AliAnalysisTask*
bfab35d9 21AddTaskCentralMCCorr(Bool_t eff=false)
fc6d3e14 22{
56236b95 23 // --- Load libraries ----------------------------------------------
bd6f5206 24 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
56236b95 25
fc6d3e14 26 // --- Creating the manager and handlers ---------------------------
27 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
28 if (!mgr->GetMCtruthEventHandler()) {
29 Error("AddTaskCentralMCCorr",
30 "No MC input handler defined - cannot continue");
31 return 0;
32 }
33
34 // --- Add our task ------------------------------------------------
4a9f6ae6 35 AliCentralMCCorrectionsTask* task = new AliCentralMCCorrectionsTask("spd");
36 mgr->AddTask(task);
37 // This has to match the binning used in the AliAODCentralMult
38 // class. Currently, this is set to 20.
39 task->SetNPhiBins(20);
bfab35d9 40 task->SetEffectiveCorrection(eff);
bcd522ff 41// task->SetVertexAxis(40, -20., 20.);
fc6d3e14 42
43 // --- create containers for input/output --------------------------
44 AliAnalysisDataContainer *sums =
fda2cdd8 45 mgr->CreateContainer("CentralCorrSums", TList::Class(),
fc6d3e14 46 AliAnalysisManager::kOutputContainer,
47 AliAnalysisManager::GetCommonFileName());
48 AliAnalysisDataContainer *output =
fda2cdd8 49 mgr->CreateContainer("CentralCorrResults", TList::Class(),
fc6d3e14 50 AliAnalysisManager::kParamContainer,
51 AliAnalysisManager::GetCommonFileName());
52
53 // --- connect input/output ----------------------------------------
54 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
55 mgr->ConnectOutput(task, 1, sums);
56 mgr->ConnectOutput(task, 2, output);
57
58 return task;
59}
60//
61// EOF
62//