2 // Macro to run performance QA train
3 // locally. The TPC performance task is attached.
6 //13.10.2009 - J.Otwinowski@gsi.de
13 1. Start train macro (real data from GSI::SE). Source your own Alien environment.
15 source /u/jacek/alien/set_alien_env.sh
16 aliroot -b -q 'RunPerformanceTrain.C("AliESDs.root",2,kFALSE,kTRUE,kTRUE)'
18 3. Start train macro (real data from lustre)
20 aliroot -b -q 'RunPerformanceTrain.C("AliESDs.root",2,kFALSE,kTRUE,kFALSE)'
24 //_____________________________________________________________________________
25 void RunPerformanceTrain(Char_t *file="esd.root", Int_t runNumber = 2, const char* triggerClass ="CINT1B-ABCE-NOPF-ALL", Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, Bool_t bGrid=kFALSE)
31 gSystem->Setenv("alien_CLOSE_SE","ALICE::GSI::SE");
32 TGrid * alien = TGrid::Connect("alien://",0,0,"t");
33 gSystem->Setenv("alien_CLOSE_SE","ALICE::GSI::SE");
37 // Train Configuration
39 Int_t iPWG1perfTPC = 1; // Test TPC performance
40 Int_t iPWG1perfTRD = 0; // Test TRD performance
41 Int_t iPWG1perfITS = 0; // Test ITS performance
42 Int_t iPWG1perfCalo = 0; // Test Calo performance
43 Int_t iPWG1perfMuonTrig = 0; // Test Muon Trigger performance
44 Int_t iPWG1perfMuonEff = 0; // Test Muon Efficiency performance
45 Int_t iPWG1perfTOF = 0; // Test TOF-TPC matching performance
46 Int_t iPWG1perfPrimVertex = 0; // Test Primary Vertex performance
47 Int_t iPWG1v0QA = 0; // V0 algorithm QA task
52 gSystem->Load("libANALYSIS");
53 gSystem->Load("libANALYSISalice");
54 gSystem->Load("libTENDER");
55 gSystem->Load("libCORRFW");
57 gSystem->Load("libTPCcalib.so");
58 gSystem->Load("libPWG1");
60 gSystem->Load("libPHOSUtils");
61 gSystem->Load("libEMCALUtils");
62 gSystem->Load("libPWG4PartCorrBase");
63 gSystem->Load("libPWG4PartCorrDep");
65 gSystem->Load("libPWG3muon.so"); // The class is here
70 AliCDBManager *cdbManager = AliCDBManager::Instance();
71 cdbManager->SetDefaultStorage("local:///lustre/alice/alien/alice/data/2009/OCDB");
72 //cdbManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
73 //cdbManager->SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd()));
74 cdbManager->SetRun(runNumber);
75 //cdbManager->SetCacheFlag(kFALSE);
76 // initialize magnetic field from the GRP manager.
77 //if(magField==0) TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 0., 0., AliMagF::k2kG));
78 //if(magField==1) TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k2kG));
79 //if(magField==2) TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
83 grpMan.ReadGRPEntry();
85 AliRunInfo *runInfo = grpMan.GetRunInfo();
91 AliGeomManager::LoadGeometry();
94 // Swtich off all AliInfo (too much output!)
96 AliLog::SetGlobalLogLevel(AliLog::kError);
99 // Create input ESD chain
102 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
103 TChain* chain = CreateESDChain(list,nFiles,fistFile);
105 Error("RunPerformanceTrain","ESD chain not created!");
109 TChain *chain = new TChain("esdTree");
111 Error("RunPerformanceTrain","ESD chain not created!");
118 // Create analysis manager
120 AliAnalysisManager *mgr = new AliAnalysisManager;
122 Error("RunPerformanceTrain","AliAnalysisManager not set!");
127 // Set ESD input handler
129 AliESDInputHandler* esdH = new AliESDInputHandler;
131 Error("RunPerformanceTrain","AliESDInputHandler not created!");
134 if(bUseESDfriend) esdH->SetActiveBranches("ESDfriend");
135 mgr->SetInputEventHandler(esdH);
139 // Set RecPoints and ESD input handler
141 AliESDInputHandlerRP* rpH = new AliESDInputHandlerRP;
143 Error("RunPerformanceTrain","AliESDInputHandlerRP not created!");
146 if(bUseESDfriend) rpH->SetActiveBranches("ESDfriend");
147 mgr->SetInputEventHandler(rpH);
151 // Set MC input handler
154 AliMCEventHandler* mcH = new AliMCEventHandler;
156 Error("RunPerformanceTrain","AliMCEventHandler not created!");
159 mcH->SetReadTR(kTRUE);
160 mgr->SetMCtruthEventHandler(mcH);
165 // Add task to AliAnalysisManager
172 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPC.C");
173 AliPerformanceTask *tpcQA = AddTaskPerformanceTPC(bUseMCInfo,bUseESDfriend,triggerClass);
175 Error("RunPerformanceTrain","AliPerformanceTask not created!");
180 Printf("RunPerformanceTrain: TPC Performance - EXCLUDED!");
186 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTrainPerformanceTRD.C");
187 if(!AddTrainPerformanceTRD(bUseMCInfo,bUseESDfriend)) {
188 Error("RunPerformanceTrain","TrainPerformanceTRD not created!");
192 Printf("RunPerformanceTrain: TRD TrainPerformanceTRD - EXCLUDED!");
198 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceITS.C");
199 AliAnalysisTaskITSTrackingCheck *itsQA = AddTaskPerformanceITS(bUseMCInfo);
201 Error("RunPerformanceTrain","AliAnalysisTaskITSTrackingCheck not created!");
206 Printf("RunPerformanceTrain: AliAnalysisTaskITSTrackingCheck - EXCLUDED!");
209 // Calorimeter Performance
212 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskCalorimeterQA.C");
213 AliAnalysisTaskParticleCorrelation *taskCaloQA = AddTaskCalorimeterQA("ESD",bUseMCInfo,kFALSE);
215 Error("RunPerformanceTrain","AliAnalysisTaskParticleCorrelation not created!");
218 mgr->AddTask(taskCaloQA);
221 Printf("RunPerformanceTrain: AliAnalysisTaskParticleCorrelation - EXCLUDED!");
226 if(iPWG1perfMuonTrig) {
227 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskMTRchamberEfficiency.C");
228 AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency();
230 Error("RunPerformanceTrain","AliAnalysisTaskTrigChEff not created!");
233 mgr->AddTask(taskMuonTrig);
236 Printf("RunPerformanceTrain: AliAnalysisTaskTrigChEff - EXCLUDED!");
241 if(iPWG1perfMuonEff) {
242 gROOT->LoadMacro("$ALICE_ROOT/PWG3/muondep/AddTaskMUONTrackingEfficiency.C");
243 AliAnalysisTaskMuonTrackingEff *taskMuonTrackEff = AliAnalysisTaskMuonTrackingEff();
244 if(!taskMuonTrackEff) {
245 Error("RunPerformanceTrain","AliAnalysisTaskMuonTrackingEff not created!");
248 mgr->AddTask(taskMuonTrackEff);
251 Printf("RunPerformanceTrain: Muon Efficiency - EXCLUDED!");
260 Printf("RunPerformanceTrain: TOF - EXCLUDED!");
263 // PWG1 Primary Vertex
265 if(iPWG1perfPrimVertex) {
266 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskVertexESD.C");
267 AliAnalysisTaskVertexESD *taskPrimVertex = AddTaskVertexESD();
268 if(!taskPrimVertex) {
269 Error("RunPerformanceTrain","AliAnalysisTaskVertexESD not created!");
274 Printf("RunPerformanceTrain: AliAnalysisTaskVertexESD - EXCLUDED!");
280 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskV0QA.C");
281 AliAnalysisTaskV0QA *taskv0QA = AddTaskV0QA(bUseMCInfo);
283 Error("RunPerformanceTrain","AliAnalysisTaskV0QA not created!");
288 Printf("RunPerformanceTrain: AliAnalysisTaskV0QA - EXCLUDED!");
292 // Disable debug printouts
294 mgr->SetDebugLevel(0);
296 if (!mgr->InitAnalysis())
300 //mgr->StartAnalysis("local",chain, nEvents, firstEvent);
301 mgr->StartAnalysis("local",chain);