2 * @defgroup pwg2_forward_scripts Scripts used in the analysis
4 * @ingroup pwg2_forward
7 * @defgroup pwg2_forward_scripts_tasks Scripts to add tasks to manager
8 * @ingroup pwg2_forward_scripts
11 * @file AddTaskForwardMult.C
12 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
13 * @date Wed Mar 23 12:13:54 2011
18 * @ingroup pwg2_forward_scripts_tasks
21 * This is the macro to include the Forward multiplicity in a train.
23 * @ingroup pwg2_forward_aod
26 AddTaskForwardMult(Bool_t mc, UShort_t sys=0, UShort_t sNN=0, Short_t field=0)
28 // --- Load libraries ----------------------------------------------
29 gROOT->LoadClass("AliAODForwardMult", "libPWG2forward2");
31 // --- Get analysis manager ----------------------------------------
32 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
34 Error("AddTaskForwardMult", "No analysis manager to connect to.");
38 // --- Make the task and add it to the manager ---------------------
39 AliForwardMultiplicityBase* task = 0;
42 task = new AliForwardMCMultiplicityTask("FMD");
44 task = new AliForwardMultiplicityTask("FMD");
47 // --- Do a local initialisation with assumed values ---------------
48 if (sys > 0 && sNN > 0)
49 AliForwardCorrectionManager::Instance().Init(sys,sNN,field,mc);
51 // --- Configure the task ------------------------------------------
52 TString macroPath(gROOT->GetMacroPath());
53 if (!macroPath.Contains("$(ALICE_ROOT)/PWG2/FORWARD/analysis2")) {
54 macroPath.Append(":$(ALICE_ROOT)/PWG2/FORWARD/analysis2");
55 gROOT->SetMacroPath(macroPath);
57 const char* config = gSystem->Which(gROOT->GetMacroPath(),
58 "ForwardAODConfig.C");
60 Warning("AddTaskForwardMult", "ForwardAODConfig.C not found in %s",
61 gROOT->GetMacroPath());
63 Info("AddTaskForwardMult",
64 "Loading configuration of '%s' from %s",
65 task->ClassName(), config);
66 gROOT->Macro(Form("%s((AliForwardMultiplicityBase*)%p)", config, task));
70 // --- Make the output container and connect it --------------------
71 TString outputfile = AliAnalysisManager::GetCommonFileName();
72 // outputfile += ":PWG2forwardDnDeta";
73 // Form(":%s",pars->GetDndetaAnalysisName());
74 AliAnalysisDataContainer* histOut =
75 mgr->CreateContainer("Forward", TList::Class(),
76 AliAnalysisManager::kOutputContainer,outputfile);
77 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
78 mgr->ConnectOutput(task, 1, histOut);