2 Macros to run PWG1 train:
4 void runPWG1Train(const char *macros = "AddTask*.C", const char *fname="AliESDs.root");
6 // macros: run the train for selected tasks
7 // tasks are expected to be in the working directory
8 // fname : name of the input file or input list
14 // load libraries needed for train
16 gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT -I$ALICE_ROOT/TRD -I$ALICE_ROOT/PWG1/TRD/macros/ ");
17 gSystem->Load("libANALYSIS.so");
18 gSystem->Load("libANALYSISalice.so");
19 gSystem->Load("libTENDER.so");
20 gSystem->Load("libCORRFW.so");
21 gSystem->Load("libPWG0base.so");
22 gSystem->Load("libPWG0dep.so");
23 gSystem->Load("libPWG0selectors.so");
24 gSystem->Load("libPWG1.so");
25 gSystem->Load("libPWG2.so");
26 gSystem->Load("libPWG3muon.so");
27 gSystem->Load("libPWG3muondep.so");
28 gSystem->Load("libPWG2forward.so");
29 gSystem->Load("libPWG4PartCorrBase.so");
30 gSystem->Load("libPWG4PartCorrDep.so");
33 void AddMacros(const char *addmacros){
35 // add tasks from selected macros - * convention can be used
36 // Macro expected to be in the working directory
37 // Macros has to be without arguments
40 TString macroList = gSystem->GetFromPipe(Form("ls %s",addmacros));
41 TObjArray * array = macroList.Tokenize("\n");
43 if (!array) { printf("No task specified"); return;}
44 if (array->GetEntries()==0) {
45 printf("Empty list of tasks");
48 for (Int_t itask=0; itask<array->GetEntries(); itask++){
49 gROOT->Macro(array->At(itask)->GetName());
53 void AddToChain(TChain * chain, TString inputList){
55 // add the files form inputList into chain
58 in.open(inputList.Data());
63 if (!currentFile.Contains(".root")) continue;
64 chain->Add(currentFile.Data());
65 printf("%d\t%s\n",counter,currentFile.Data());
75 TTree * tree = AliSysInfo::MakeTree("syswatch.log");
78 entries=tree->Draw("VM:id0","id0>10","goff");
79 gr=new TGraph(entries, tree->GetV2(),tree->GetV1());
82 printf("SysInfoMem:\t%f\n",f1->GetParameter(1));
84 entries=tree->Draw("T:id0","id0>10","goff");
85 gr=new TGraph(entries, tree->GetV2(),tree->GetV1());
88 printf("SysInfoTime:\t%f\n",f1->GetParameter(1));
91 void runPWG1Train(const char *macros = "AddTask*.C", TString inputList ="esd.list", Int_t debugLevel=0) {
93 // macros: run the train for selected tasks
94 // tasks are expected to be in the working directory
95 // fname : name of the input file or input list
100 //____________________________________________
101 // Make the analysis manager
103 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
104 mgr->SetDebugLevel(debugLevel);
106 AliInputEventHandler* esdH = new AliESDInputHandlerRP();
107 esdH->SetActiveBranches("ESDfriend");
108 mgr->SetInputEventHandler(esdH);
112 TChain* chain = new TChain("esdTree");
113 if (inputList.Contains(".root")){
114 chain->AddFile(inputList);
116 if (inputList.Contains(".list")){
117 AddToChain(chain, inputList);
124 mgr->SetNSysInfo(1000);
125 if (!mgr->InitAnalysis())
130 mgr->StartAnalysis("local", chain);