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