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 // - taskList = a string containin all the 'add-task' macros to be used
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
21 const char *outputFileName,
22 const char *configPath
26 // === EXAMINE OPTIONS ==========================================================================
29 // this is done using the utility 'RsnOptions.C'
30 // which provides a unique way to interpret them
34 opt.ReplaceAll(" ", "");
36 Bool_t isMix = opt.Contains("MIX");
37 Bool_t isESD = opt.Contains("ESD");
38 Bool_t isAOD = opt.Contains("AOD");
39 Bool_t central = opt.Contains("CEN");
40 Bool_t peripheral = opt.Contains("PER");
41 Bool_t useTender = opt.Contains("TENDER");
42 Bool_t usePhysSel = opt.Contains("PHYS");
43 Bool_t noV0 = opt.Contains("NOV0");
46 // === LOAD LIBRARIES ===========================================================================
49 gSystem->Load("libVMC.so");
50 gSystem->Load("libTree.so");
51 gSystem->Load("libPhysics.so");
52 gSystem->Load("libMatrix.so");
53 gSystem->Load("libMinuit.so");
54 gSystem->Load("libXMLParser.so");
55 gSystem->Load("libGui.so");
56 gSystem->Load("libSTEERBase.so");
57 gSystem->Load("libESD.so");
58 gSystem->Load("libAOD.so");
59 gSystem->Load("libANALYSIS.so");
60 gSystem->Load("libANALYSISalice.so");
61 gSystem->Load("libEventMixing.so");
62 gSystem->Load("libCORRFW.so");
65 ::Info("AnalysisSetup", "Loading tender libraries");
66 gSystem->Load("libTENDER.so");
67 gSystem->Load("libTENDERSupplies.so");
70 if (!AliAnalysisAlien::SetupPar("PWG2resonances.par")) return kFALSE;
73 // === ANALYSIS MANAGER CONFIGURATION ===========================================================
76 // create analysis manager
77 AliAnalysisManager *mgr = new AliAnalysisManager("RsnAnalysisManager");
78 mgr->SetCommonFileName(outputFileName);
79 ::Info("AnalysisSetup", "Common file name: %s", outputFileName);
82 // === INPUT / OUTPUT HANDLER CONFIGURATION =====================================================
85 // create input handler
86 // since there is an exit point above if the job
87 // isn't either ESD or AOD, here we don't recheck that
89 ::Info("AnalysisSetup", "Configuring for ESD");
90 AliESDInputHandler *esdHandler = new AliESDInputHandler();
91 mgr->SetInputEventHandler(esdHandler);
92 // if possible, create also MC handler
94 ::Info("AnalysisSetup", "Creating MC handler");
95 AliMCEventHandler *mcHandler = new AliMCEventHandler();
96 mgr->SetMCtruthEventHandler(mcHandler);
99 ::Info("AnalysisSetup", "Configuring for AOD");
100 AliAODInputHandler *aodHandler = new AliAODInputHandler();
101 mgr->SetInputEventHandler(aodHandler);
103 ::Error("AnalysisSetup", "Require ESD or AOD");
108 // === CONFIGURE AND INSERT PHYSICS SELECTION & TENDER SUPPLY ===================================
111 // add event selection for data if running ESD
113 // add tender supply for TOF
115 ::Info("AnalysisSetup", "options '%s' require to add tender", options);
116 gROOT->LoadMacro(Form("%s/AddTenderSupplies.C", configPath));
117 AddTenderSupplies(100.0, kTRUE, kFALSE);
120 // add event selection for data
121 // and swtich off VZERO if tender is not used
123 ::Info("AnalysisSetup", "options '%s' require to add physics selection", options);
124 gROOT->LoadMacro("$(ALICE_ROOT)/ANALYSIS/macros/AddTaskPhysicsSelection.C");
125 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC);
127 ::Info("AnalysisSetup", "options '%s' require to skip V0 info", options);
128 physSelTask->GetPhysicsSelection()->SetSkipV0(kTRUE);
133 ::Info("AnalysisSetup", "Setup successful");