Fixing an error in the computation of the efficiency of a whole chamber (Matthieu)
[u/mrichter/AliRoot.git] / PWG3 / muondep / RunMuonTrackingEffAnalysis.C
CommitLineData
128a8042 1// 2008
2// Macro for the running of the AliAnalysisTaskMuonTrackingEff
3//
4
5void RunMuonTrackingEffAnalysis (Bool_t alien = false,
6 const char * macroFileName = "$ALICE_ROOT/PWG3/muon/MuonTrackingEffAnalysis.C",
7 const char * esdfileName = "AliESDs.root",
8 const char * geometryFileName = "geometry.root",
9 const char * analysisParFile = "ANALYSIS",
10 const char * pwg3ParFile = "PWG3",
6db6876c 11 const Int_t run = 100
12 const Bool_t isCosmicData = kFALSE)
128a8042 13{
14 if(alien)
15 {
16 //Grid connection
17 printf("*** Connect to AliEn ***\n");
18 TGrid::Connect("alien://");
19 gSystem->Load("libProofPlayer.so");
20 }
21
22// //Load relevant libraries:
23// gSystem->Load("libTree.so");
24// gSystem->Load("libGeom.so");
25// gSystem->Load("libSTEERBase.so");
26
27// // setupPar("MUON");
28// gSystem->Load("libMUONbase.so");
29// gSystem->Load("libMUONgeometry.so");
30// gSystem->Load("libMUONmapping.so");
31
32// // setupPar("ESD");
33// gSystem->Load("libESD.so");
34
35// setupPar(analysisParFile);
36 gSystem->Load("libANALYSIS.so");
37 gSystem->Load("libANALYSISalice.so");
38
39// setupPar(pwg3ParFile);
40 gSystem->Load("libPWG3muon.so");
41
42 char macro[1024];
43 sprintf(macro,"%s++",macroFileName);
44 gROOT->LoadMacro(macro);
45// gROOT->LoadMacro("./BatchMuonTrackingEffAnalysis.C++");
46
6db6876c 47 MuonTrackingEffAnalysis(alien,run,esdfileName,geometryFileName, isCosmicData);
128a8042 48}
49
50
51
52Int_t setupPar(const char* pararchivename)
53{
54 //Setup PAR File
55 if (pararchivename) {
56 char processline[1024];
57 sprintf(processline,".! tar xvzf %s.par",pararchivename);
58 gROOT->ProcessLine(processline);
59 const char* ocwd = gSystem->WorkingDirectory();
60 gSystem->ChangeDirectory(pararchivename);
61
62 // check for BUILD.sh and execute
63 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
64 printf("*******************************\n");
65 printf("*** Building PAR archive ***\n");
66 printf("*******************************\n");
67
68 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
69 Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
70 return -1;
71 }
72 }
73 // check for SETUP.C and execute
74 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
75 printf("*******************************\n");
76 printf("*** Setup PAR archive ***\n");
77 printf("*******************************\n");
78 gROOT->Macro("PROOF-INF/SETUP.C");
79 }
80
81 gSystem->ChangeDirectory("../");
82 }
83 return 1;
84}