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
11 .L $ALICE_ROOT/PWG1/PWG1macros/runPWG1Train.C
18 // load libraries needed for train
20 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/ ");
21 gSystem->Load("libANALYSIS.so");
22 gSystem->Load("libANALYSISalice.so");
23 gSystem->Load("libTENDER.so");
24 gSystem->Load("libCORRFW.so");
25 gSystem->Load("libPWG0base.so");
26 gSystem->Load("libPWG0dep.so");
27 gSystem->Load("libPWG0selectors.so");
28 gSystem->Load("libPWG1.so");
29 gSystem->Load("libPWG2.so");
30 gSystem->Load("libPWG3muon.so");
31 gSystem->Load("libPWG3muondep.so");
32 gSystem->Load("libPWG2forward.so");
33 gSystem->Load("libPWG4PartCorrBase.so");
34 gSystem->Load("libPWG4PartCorrDep.so");
41 void AddMacros(const char *addmacros){
43 // add tasks from selected macros - * convention can be used
44 // Macro expected to be in the working directory
45 // Macros has to be without arguments
48 TString macroList = gSystem->GetFromPipe(Form("cat ConfigTask.txt |grep %s",addmacros));
49 TObjArray * array = macroList.Tokenize("\n");
51 if (!array) { printf("No task specified"); return;}
52 if (array->GetEntries()==0) {
53 printf("Empty list of tasks");
56 for (Int_t itask=0; itask<array->GetEntries(); itask++){
57 gROOT->Macro(array->At(itask)->GetName());
61 void AddToChain(TChain * chain, TString inputList){
63 // add the files form inputList into chain
66 in.open(inputList.Data());
71 if (!currentFile.Contains(".root")) continue;
72 chain->Add(currentFile.Data());
73 printf("%d\t%s\n",counter,currentFile.Data());
83 TTree * tree = AliSysInfo::MakeTree("syswatch.log");
86 entries=tree->Draw("VM:id0","id0>10","goff");
87 gr=new TGraph(entries, tree->GetV2(),tree->GetV1());
90 printf("SysInfoMem:\t%f\n",f1->GetParameter(1));
92 entries=tree->Draw("T:id0","id0>10","goff");
93 gr=new TGraph(entries, tree->GetV2(),tree->GetV1());
96 printf("SysInfoTime:\t%f\n",f1->GetParameter(1));
99 void runPWG1Train(const char *macros = "AddTask*.C", TString inputList ="esd.list", Int_t debugLevel=0) {
101 // macros: run the train for selected tasks
102 // tasks are expected to be in the working directory
103 // fname : name of the input file or input list
108 //____________________________________________
109 // Make the analysis manager
111 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
112 mgr->SetDebugLevel(debugLevel);
114 AliInputEventHandler* esdH = new AliESDInputHandlerRP();
115 esdH->SetActiveBranches("ESDfriend");
116 mgr->SetInputEventHandler(esdH);
120 TChain* chain = new TChain("esdTree");
121 if (inputList.Contains(".root")){
122 chain->AddFile(inputList);
124 if (inputList.Contains(".list")){
125 AddToChain(chain, inputList);
132 mgr->SetNSysInfo(1000);
133 if (!mgr->InitAnalysis())
138 mgr->StartAnalysis("local", chain);