1 /* Macro for setup of Lambda* analysis in PPb collisions.
2 // Created by Sarita Sahoo, 30 Jan. 2014
5 // This macro sets all the aspects of configuration of an Analysis Train run
6 // which are always the same for all kinds of analysis (local, PROOF, AliEn)
10 // - nmix = number of mixings to do (if > 0, initialize mixing stuff)
11 // - options = a set of keywords which drive some configurations
12 // - outputFileName = name of file produced by train
13 // - configPath = a path where all required config macros are stored
17 // - in case the source is an ESD, and if inputs are a MC production
18 // the MC input handler is created by default
22 // - if successful: the name of the expected input TTree (esdTree or aodTree)
30 const char *outputFileName,
31 const char *macroPath = "."
40 // === EXAMINE OPTIONS ==========================================================================
43 // this is done using the utility 'RsnOptions.C'
44 // which provides a unique way to interpret them
49 Bool_t isMC = opt.Contains("MC") || (!opt.Contains("DATA"));
50 Bool_t isPP = opt.Contains("PP") || (!opt.Contains("PBPB"));
51 Bool_t isESD = opt.Contains("ESD");
52 Bool_t useTender = opt.Contains("TENDER");
53 Bool_t noV0 = opt.Contains("NOV0");
56 // === LOAD LIBRARIES ===========================================================================
59 // load analysis libraries
60 gSystem->Load("libCore.so");
61 gSystem->Load("libGeom.so");
62 gSystem->Load("libVMC.so");
63 gSystem->Load("libMinuit.so");
64 gSystem->Load("libPhysics.so");
65 gSystem->Load("libTree.so");
66 gSystem->Load("libSTEERBase.so");
67 gSystem->Load("libESD.so");
68 gSystem->Load("libAOD.so");
69 gSystem->Load("libANALYSIS.so");
70 gSystem->Load("libANALYSISalice.so");
71 gSystem->Load("libEventMixing.so");
72 gSystem->Load("libCORRFW.so");
73 gSystem->Load("libPWGLFresonances.so");
76 // tender-related libraries
77 if (isESD && useTender) {
78 ::Info("AnalysisSetup", "Loading tender libraries");
79 gSystem->Load("libTENDER.so");
80 gSystem->Load("libTENDERSupplies.so");
85 // load development RSN library
86 if (!AliAnalysisAlien::SetupPar("PWGLFresonances.par")) return "";
89 // === CREATE ANALYSIS MANAGER ==================================================================
92 AliAnalysisManager *mgr = new AliAnalysisManager("RsnAnalysisManager");
93 mgr->SetCommonFileName(outputFileName);
94 ::Info("AnalysisSetup", "Common file name: %s", outputFileName);
97 // === INPUT / OUTPUT HANDLER CONFIGURATION =====================================================
102 ::Info("AnalysisSetup", "Creating ESD handler");
103 AliESDInputHandler *esdHandler = new AliESDInputHandler();
104 mgr->SetInputEventHandler(esdHandler);
106 ::Info("AnalysisSetup", "Creating MC handler");
107 AliMCEventHandler *mcHandler = new AliMCEventHandler();
108 mgr->SetMCtruthEventHandler(mcHandler);
112 ::Info("AnalysisSetup", "Creating AOD handler");
113 AliAODInputHandler *aodHandler = new AliAODInputHandler();
114 mgr->SetInputEventHandler(aodHandler);
118 // === TENDER TASK (ESD only -- optional) =======================================================
121 if (isESD && useTender) {
122 ::Info("AnalysisSetup", "Adding tender (and then accepting V0 info)", options);
123 gROOT->LoadMacro(Form("%s/AddTaskTender.C", macroPath));
129 // === PHYSICS SELECTION (ESD only) =============================================================
133 ::Info("AnalysisSetup", "Add physics selection by default on ESD analysis");
134 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPhysicsSelection.C");
135 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC);
137 ::Info("AnalysisSetup", "Skip of V0 info is required");
138 physSelTask->GetPhysicsSelection()->SetSkipV0(kTRUE);
143 // === CENTRALITY/PLANE (ESD only) ==============================================================
145 if (isESD && !isPP) {
146 ::Info("AnalysisSetup", "Add centrality and event plane computation tasks");
147 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskCentrality.C");
148 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskEventplane.C");
149 AliCentralitySelectionTask* taskCentrality = (AliCentralitySelectionTask*)AddTaskCentrality();
151 ::Info("AnalysisSetup", "Setting centrality computation for MC");
152 taskCentrality->SetMCInput();
157 // === PID RESPONSE =============================================================================
160 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDResponse.C");
161 AddTaskPIDResponse(isMC,kTRUE,kTRUE);
163 //gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPIDqa.C ");
167 // === OTHER TASKS ==============================================================================
171 gROOT->LoadMacro(Form("%s/AddTaskLStarPPb.C", macroPath));
172 if (!AddTaskLStarPPb(isMC, isPP, macroPath, nmix)) return "";
174 ::Info("AnalysisSetup", "Setup successful");