AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LoadLibraries.C
Go to the documentation of this file.
1 Int_t setupPar(const char* pararchivename);
2 
3 void LoadLibraries(Bool_t useParFiles=kFALSE) {
4 
5  gSystem->Load("libTree");
6  gSystem->Load("libGeom");
7  gSystem->Load("libPhysics");
8  gSystem->Load("libVMC");
9  gSystem->Load("libMinuit");
10  gSystem->Load("libSTEERBase");
11  gSystem->Load("libESD");
12  gSystem->Load("libAOD");
13  gSystem->Load("libANALYSIS");
14  gSystem->Load("libOADB");
15  gSystem->Load("libANALYSISalice");
16  gSystem->Load("libCORRFW");
17  gSystem->Load("libPWGHFbase");
18  gSystem->Load("libPWGflowBase");
19  gSystem->Load("libPWGflowTasks");
20  gSystem->Load("libPWGHFvertexingHF");
21  //gSystem->Load("libPWGmuon");
22 
23 
24  if(useParFiles) {
25  setupPar("STEERBase");
26  setupPar("ESD");
27  setupPar("AOD");
28  setupPar("ANALYSIS");
29  setupPar("OADB");
30  setupPar("ANALYSISalice");
31  setupPar("CORRFW");
32  setupPar("PWGHFbase");
33  setupPar("PWGHFvertexingHF");
34  //setupPar("PWG3muon");
35  }
36 
37  return;
38 }
39 //------------------------------------------------------------------------
40 Int_t setupPar(const char* pararchivename) {
42  // Setup PAR File//
44 
45  if (pararchivename) {
46  char processline[1024];
47  TString base = gSystem->BaseName(pararchivename);
48  TString dir = gSystem->DirName(pararchivename);
49  TString ocwd = gSystem->WorkingDirectory();
50  // Move to dir where the par files are and unpack
51  gSystem->ChangeDirectory(dir.Data());
52  sprintf(processline,".! tar xvzf %s.par",base.Data());
53  gROOT->ProcessLine(processline);
54  // Move to par folder
55  gSystem->ChangeDirectory(base.Data());
56 
57  // check for BUILD.sh and execute
58  if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
59  printf("*******************************\n");
60  printf("*** Building PAR archive ***\n");
61  printf("*******************************\n");
62 
63  if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
64  Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
65  gSystem->ChangeDirectory(ocwd.Data());
66  return -1;
67  }
68  }
69  // check for SETUP.C and execute
70  if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
71  printf("*******************************\n");
72  printf("*** Setup PAR archive ***\n");
73  printf("*******************************\n");
74  // If dir not empty, set the full include path
75  if (dir.Length()) {
76  sprintf(processline, ".include %s", pararchivename);
77  gROOT->ProcessLine(processline);
78  }
79  gROOT->Macro("PROOF-INF/SETUP.C");
80  }
81  gSystem->ChangeDirectory(ocwd.Data());
82  }
83  return 1;
84 }
Int_t setupPar(const char *pararchivename)
Definition: LoadLibraries.C:40
TSystem * gSystem
int Int_t
Definition: External.C:63
bool Bool_t
Definition: External.C:53
void LoadLibraries(Bool_t useParFiles=kFALSE)
Definition: LoadLibraries.C:3