]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskForwardMult.C
Doxygen updates
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardMult.C
CommitLineData
7c1a1f1d 1/**
bd6f5206 2 * @defgroup pwglf_forward_scripts Scripts used in the analysis
7c1a1f1d 3 *
290052e7 4 * These scripts add tasks to the analysis train
5 *
bd6f5206 6 * @ingroup pwglf_forward
7c1a1f1d 7 */
ffca499d 8/**
290052e7 9 * @defgroup pwglf_forward_scripts_tasks Add tasks to manager
10 *
11 * Scripts to add tasks to the analysis manager
12 *
bd6f5206 13 * @ingroup pwglf_forward_scripts
ffca499d 14 */
15/**
16 * @file AddTaskForwardMult.C
17 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
18 * @date Wed Mar 23 12:13:54 2011
7c1a1f1d 19 *
ffca499d 20 * @brief
21 *
22 *
bd6f5206 23 * @ingroup pwglf_forward_scripts_tasks
7c1a1f1d 24 */
7e4038b5 25/**
4bcdcbc1 26 * This is the script to include the Forward multiplicity in a train.
7e4038b5 27 *
290052e7 28 * @param mc Define as true for MC input.
29 * @param sys Collision system (0: deduce, 1: pp, 2: pbpb, 3:pA)
30 * @param sNN Collision energy
31 * @param field L3 field setting.
32 * @param config Configuration file to use
33438b4c 33 * @param corrs Corrections to use
4bcdcbc1 34 *
35 * @return newly allocated analysis task
36 *
bd6f5206 37 * @ingroup pwglf_forward_aod
7e4038b5 38 */
2d68d438 39AliAnalysisTask*
2a276c75 40AddTaskForwardMult(Bool_t mc,
41 UShort_t sys=0,
42 UShort_t sNN=0,
43 Short_t field=0,
9201c66b 44 const char* config="ForwardAODConfig.C",
45 const char* corrs=0)
7e4038b5 46{
56236b95 47 // --- Load libraries ----------------------------------------------
bd6f5206 48 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
1c762251 49
56236b95 50 // --- Get analysis manager ----------------------------------------
7e4038b5 51 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
52 if (!mgr) {
ffca499d 53 Error("AddTaskForwardMult", "No analysis manager to connect to.");
7e4038b5 54 return NULL;
55 }
56
6b908a3f 57 // --- Make the task and add it to the manager ---------------------
e797efbb 58 AliForwardMultiplicityBase* task = 0;
2a276c75 59 if (mc) task = new AliForwardMCMultiplicityTask("FMD");
60 else task = new AliForwardMultiplicityTask("FMD");
290052e7 61 task->Configure(config);
6b908a3f 62 mgr->AddTask(task);
3c5497d0 63
9201c66b 64 // --- Set alternative corrections path ----------------------------
65 AliForwardCorrectionManager& cm = AliForwardCorrectionManager::Instance();
66 if (corrs && corrs[0] != '\0') cm.SetPrefix(corrs);
67
6c3615d3 68 // --- Do a local initialisation with assumed values ---------------
2a276c75 69 if (sys > 0 && sNN > 0) {
70 UInt_t what = AliForwardCorrectionManager::kAll;
71 what ^= AliForwardCorrectionManager::kDoubleHit;
72 what ^= AliForwardCorrectionManager::kVertexBias;
73 what ^= AliForwardCorrectionManager::kMergingEfficiency;
5934a3e3 74 what ^= AliForwardCorrectionManager::kAcceptance;
9201c66b 75 if (!cm.Init(sys,sNN,field,mc,what))
2a276c75 76 Fatal("AddTaskForwardMult", "Failed to initialize corrections");
9d05ffeb 77 }
7e4038b5 78
0bd4b00f 79 // --- Make the output container and connect it --------------------
7e4038b5 80 AliAnalysisDataContainer* histOut =
81 mgr->CreateContainer("Forward", TList::Class(),
5934a3e3 82 AliAnalysisManager::kOutputContainer,
83 AliAnalysisManager::GetCommonFileName());
84 AliAnalysisDataContainer *output =
85 mgr->CreateContainer("ForwardResults", TList::Class(),
86 AliAnalysisManager::kParamContainer,
87 AliAnalysisManager::GetCommonFileName());
88
7e4038b5 89 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
90 mgr->ConnectOutput(task, 1, histOut);
5934a3e3 91 mgr->ConnectOutput(task, 2, output);
7e4038b5 92
93 return task;
94}
4bcdcbc1 95
96/**
97 * This is the script to include the Forward multiplicity in a train.
98 *
99 * @param type Data type (if it contains MC, assume MC input):
100 * - ppb, p-pb, pa, p-a: proton-lead
101 * - pp, p-p: proton-proton
102 * - pbpb, pb-pb, a-a: lead-lead
103 *
104 * @param energy Collision energy in GeV
105 * @param bfield L3 field setting in kG (-5, 0, 5)
106 *
107 * @return newly allocated analysis task
108 *
109 * @ingroup pwglf_forward_aod
110 */
111AliAnalysisTask*
112AddTaskForwardMult(const Char_t* type,
113 Float_t energy=0,
114 Float_t bfield=0)
115{
116 // --- Load libraries ----------------------------------------------
117 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
118
119 // --- Deduce parameters -------------------------------------------
120 TString t(type);
121 Bool_t mc = t.Contains("MC", TString::kIgnoreCase);
122 UShort_t sys = AliForwardUtil::ParseCollisionSystem(type);
123 UShort_t sNN = AliForwardUtil::ParseCenterOfMassEnergy(sys, energy);
124 Short_t field = AliForwardUtil::ParseMagneticField(field);
125
126 return AddTaskForwardMult(mc, sys, sNN, field);
127}
128//
129// EOF
130//