]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/macros/RunPerformanceTrain.C
new macro and small modifications
[u/mrichter/AliRoot.git] / PWG1 / macros / RunPerformanceTrain.C
1 //
2 // Macro to run performance QA train
3 // locally. The TPC performance task is attached.
4 // 
5 //
6 //13.10.2009 -  J.Otwinowski@gsi.de
7
8 //_____________________________________________________________________________
9 void RunPerformanceTrain(Char_t *list="esdList.txt", Int_t nFiles=20, Int_t fistFile=0, Bool_t bUseMCInfo=kTRUE, Bool_t bUseESDfriend=kTRUE)
10 {
11   //
12   // Swtich off all AliInfo (too much output!)
13   //
14   AliLog::SetGlobalLogLevel(AliLog::kError);
15
16   //
17   // Create input ESD chain
18   //
19   gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
20   TChain* chain = CreateESDChain(list,nFiles,fistFile);
21   if(!chain) { 
22     Error("RunPerformanceTrain","ESD chain not created!");
23     return;
24   }
25   chain->Lookup();
26
27   //
28   // Create analysis manager
29   //
30   AliAnalysisManager *mgr = new AliAnalysisManager;
31   if(!mgr) { 
32     Error("RunPerformanceTrain","AliAnalysisManager not set!");
33     return;
34   }
35
36   //
37   // Set ESD input handler
38   //
39   AliESDInputHandler* esdH = new AliESDInputHandler;
40   if(!esdH) { 
41     Error("RunPerformanceTrain","AliESDInputHandler not created!");
42     return;
43   }
44   if(bUseESDfriend) esdH->SetActiveBranches("ESDfriend");
45   mgr->SetInputEventHandler(esdH);
46
47   //
48   // Set MC input handler
49   //
50   if(bUseMCInfo) {
51     AliMCEventHandler* mcH = new AliMCEventHandler;
52     if(!esdH) { 
53       Error("RunPerformanceTrain","AliMCEventHandler not created!");
54       return;
55     }
56     mcH->SetReadTR(kTRUE);
57     mgr->SetMCtruthEventHandler(mcH);
58   }
59   //
60   // Add task to AliAnalysisManager
61   //
62   gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPC.C");
63   AliPerformanceTask *tpcQA = AddTaskPerformanceTPC(bUseMCInfo,bUseESDfriend);
64   if(!tpcQA) { 
65       Error("RunPerformanceTrain","TaskPerformanceTPC not created!");
66       return;
67   }
68
69   //
70   // Disable debug printouts
71   //
72   mgr->SetDebugLevel(0);
73
74   if (!mgr->InitAnalysis())
75     return;
76
77   mgr->PrintStatus();
78   mgr->StartAnalysis("local",chain);
79 }
80