]>
Commit | Line | Data |
---|---|---|
7c1a1f1d | 1 | /** |
2 | * @defgroup pwg2_forward_scripts Scripts used in the analysis | |
3 | * | |
4 | * @ingroup pwg2_forward | |
5 | */ | |
6 | /** | |
7 | * @file | |
8 | * @ingroup pwg2_forward_scripts | |
9 | * | |
10 | */ | |
7e4038b5 | 11 | /** |
12 | * This is the macro to include the Forward multiplicity in a train. | |
13 | * | |
7c1a1f1d | 14 | * @ingroup pwg2_forward_scripts |
7e4038b5 | 15 | */ |
2d68d438 | 16 | AliAnalysisTask* |
e28f5fc5 | 17 | AddTaskFMD(Bool_t mc, UShort_t sys=0, UShort_t sNN=0, Short_t field=0) |
7e4038b5 | 18 | { |
1c762251 | 19 | gSystem->Load("libPWG2forward2"); |
20 | ||
7e4038b5 | 21 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
22 | if (!mgr) { | |
23 | Error("AddTaskFMD", "No analysis manager to connect to."); | |
24 | return NULL; | |
25 | } | |
26 | ||
6b908a3f | 27 | // --- Make the task and add it to the manager --------------------- |
e797efbb | 28 | AliForwardMultiplicityBase* task = 0; |
29 | if (mc) task = new AliForwardMCMultiplicityTask("FMD"); | |
30 | else task = new AliForwardMultiplicityTask("FMD"); | |
6b908a3f | 31 | mgr->AddTask(task); |
3c5497d0 | 32 | |
6c3615d3 | 33 | // --- Do a local initialisation with assumed values --------------- |
34 | if (sys > 0 && sNN > 0) | |
35 | AliForwardCorrectionManager::Instance().Init(sys,sNN,field); | |
0bd4b00f | 36 | |
9d05ffeb | 37 | // --- Configure the task ------------------------------------------ |
9d05ffeb | 38 | const char* config = gSystem->Which(gROOT->GetMacroPath(), |
39 | "ForwardAODConfig.C"); | |
40 | if (!config) | |
41 | Warning("AddTaskFMD", "ForwardAODConfig.C not found in %s", | |
42 | gROOT->GetMacroPath()); | |
43 | else { | |
44 | Info("AddTaskFMD", | |
e1f47419 | 45 | "Loading configuration of '%s' from %s", |
46 | task->ClassName(), config); | |
9d05ffeb | 47 | gROOT->Macro(Form("%s((AliForwardMultiplicityBase*)%p)", config, task)); |
48 | delete config; | |
49 | } | |
7e4038b5 | 50 | |
0bd4b00f | 51 | // --- Make the output container and connect it -------------------- |
7e4038b5 | 52 | TString outputfile = AliAnalysisManager::GetCommonFileName(); |
0bd4b00f | 53 | // outputfile += ":PWG2forwardDnDeta"; |
54 | // Form(":%s",pars->GetDndetaAnalysisName()); | |
7e4038b5 | 55 | AliAnalysisDataContainer* histOut = |
56 | mgr->CreateContainer("Forward", TList::Class(), | |
57 | AliAnalysisManager::kOutputContainer,outputfile); | |
7e4038b5 | 58 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); |
59 | mgr->ConnectOutput(task, 1, histOut); | |
60 | ||
61 | return task; | |
62 | } |