2 // This macro sets all the aspects of configuration of an Analysis Train run
3 // which are always the same for all kinds of analysis (local, PROOF, AliEn)
7 // - nmix = number of mixings to do (if > 0, initialize mixing stuff)
8 // - options = a set of keywords which drive some configurations
9 // - outputFileName = name of file produced by train
10 // - configPath = a path where all required config macros are stored
14 // - in case the source is an ESD, and if inputs are a MC production
15 // the MC input handler is created by default
19 // - if successful: the name of the expected input TTre (esdTree or aodTree)
26 const char *outputFileName,
27 const char *macroPath = "."
34 // === EXAMINE OPTIONS ==========================================================================
37 // this is done using the utility 'RsnOptions.C'
38 // which provides a unique way to interpret them
43 Bool_t isMC = opt.Contains("MC") || (!opt.Contains("DATA"));
44 Bool_t isPP = opt.Contains("PP") || (!opt.Contains("PBPB"));
45 Bool_t isESD = opt.Contains("ESD");
46 Bool_t useTender = opt.Contains("Tender");
47 Bool_t noV0 = opt.Contains("NOV0");
50 // === LOAD LIBRARIES ===========================================================================
53 // load analysis libraries
54 gSystem->Load("libSTEERBase");
55 gSystem->Load("libESD");
56 gSystem->Load("libAOD");
57 gSystem->Load("libANALYSIS");
58 gSystem->Load("libANALYSISalice");
59 gSystem->Load("libEventMixing");
60 gSystem->Load("libCORRFW");
62 // tender-related libraries
63 if (isESD && useTender) {
64 ::Info("AnalysisSetup", "Loading tender libraries");
65 gSystem->Load("libTender");
66 gSystem->Load("libTenderSupplies");
71 gSystem->Load("libPWGLFresonances");
73 // // load development RSN library
74 // if (!AliAnalysisAlien::SetupPar("PWG2resonances.par")) return "";
77 // === CREATE ANALYSIS MANAGER ==================================================================
80 AliAnalysisManager *mgr = new AliAnalysisManager("RsnAnalysisManager");
81 mgr->SetCommonFileName(outputFileName);
82 ::Info("AnalysisSetup", "Common file name: %s", outputFileName);
85 // === INPUT / OUTPUT HANDLER CONFIGURATION =====================================================
90 ::Info("AnalysisSetup", "Creating ESD handler");
91 AliESDInputHandler *esdHandler = new AliESDInputHandler();
92 mgr->SetInputEventHandler(esdHandler);
94 ::Info("AnalysisSetup", "Creating MC handler");
95 AliMCEventHandler *mcHandler = new AliMCEventHandler();
96 mgr->SetMCtruthEventHandler(mcHandler);
100 ::Info("AnalysisSetup", "Creating AOD handler");
101 AliAODInputHandler *aodHandler = new AliAODInputHandler();
102 mgr->SetInputEventHandler(aodHandler);
106 // === PID RESPONSE =============================================================================
109 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDResponse.C");
110 AddTaskPIDResponse(isMC);
112 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDqa.C ");
117 // === Tender TASK (ESD only -- optional) =======================================================
120 if (isESD && useTender) {
121 ::Info("AnalysisSetup", "Adding tender (and then accepting V0 info)", options);
122 // gROOT->LoadMacro(Form("%s/AddTaskTender.C", macroPath)); //for developers usage
123 // gROOT->LoadMacro(Form("$(ALICE_ROOT)/PWGLF/RESONANCES/macros/mini/AddTaskTender.C")); //deprecated
124 gROOT->LoadMacro(Form("$(ALICE_ROOT)/ANALYSIS/TenderSupplies/AddTaskTender.C"));
130 // === PHYSICS SELECTION (ESD only) =============================================================
134 ::Info("AnalysisSetup", "Add physics selection by default on ESD analysis");
135 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPhysicsSelection.C");
136 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC);
138 ::Info("AnalysisSetup", "Skip of V0 info is required");
139 physSelTask->GetPhysicsSelection()->SetSkipV0(kTRUE);
144 // === CENTRALITY/PLANE (ESD only) ==============================================================
146 if (isESD && !isPP) {
147 ::Info("AnalysisSetup", "Add centrality and event plane computation tasks");
148 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskCentrality.C");
149 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskEventplane.C");
150 AliCentralitySelectionTask* taskCentrality = (AliCentralitySelectionTask*)AddTaskCentrality();
152 ::Info("AnalysisSetup", "Setting centrality computation for MC");
153 taskCentrality->SetMCInput();
158 // // === PID RESPONSE =============================================================================
161 // gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDResponse.C");
162 // AddTaskPIDResponse(isMC);
164 // //gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDqa.C ");
168 // === OTHER TASKS ==============================================================================
172 gROOT->LoadMacro(Form("%s/AddAnalysisTaskRsnMini.C", macroPath));
173 if (!AddAnalysisTaskRsnMini(isMC, isPP, macroPath, nmix)) return "";
175 ::Info("AnalysisSetup", "Setup successful");