1 //=============================================================================
2 // Compilation of all PAR archives for resonance analysis.
3 // Returns an integer error message if some compilation fails.
6 // - "UNTAR" --> explodes the .par files in the working directory
7 // - "CLEAR" --> removes the PAR archive directory and automatically
8 // recreates it by exploding again the .par file
9 //=============================================================================
11 Int_t SetupPar(const char* parName, Bool_t untar = kTRUE)
14 // Operations to set up the PAR archive
18 Error("SetupPar", "NULL argument passed - Abort!");
22 // if the directory does not exist, the package is
24 if (!gSystem->OpenDirectory(parName)) untar = kTRUE;
26 // unzip + untar (optional)
28 Char_t processLine[1024];
29 sprintf(processLine, ".! tar xvzf ./%s.par", parName);
30 gROOT->ProcessLine(processLine);
33 // change from working directory to sub-dir containing PAR archive
34 const char* ocwd = gSystem->WorkingDirectory();
35 gSystem->ChangeDirectory(parName);
37 // check for existence of appropriate 'BUILD.sh' script (in PROOF-INF.<parName>)
38 // and execute it (non-zero return values mean that errors occurred)
39 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
40 cout << "*** Building PAR archive \"" << parName << "\"" << endl;
41 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
42 Error("SetupPar", "Cannot Build the PAR Archive - Abort!");
47 // check for existence of appropriate 'SETUP.C' macro (in PROOF-INF.<parName>)
49 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
50 cout << "*** Setting up PAR archive \"" << parName << "\"" << endl;
51 gROOT->Macro("PROOF-INF/SETUP.C");
54 // return to working directory
55 gSystem->ChangeDirectory("../");
57 // return 1 if everything is OK
61 Int_t AliRsnLoad(Option_t *option = "BUILD+UNTAR")
64 // Main function of this macro
65 // Sets up all the packages useful for resonance analysis.
66 // Depending on the support (PROOF / others), the functions are different.
72 // check for the UNTAR option
73 Bool_t untar = opt.Contains("UNTAR");
75 // check for the CLEAR option
76 // if this is found automatically is required the UNTAR
77 if (opt.Contains("CLEAR")) {
78 gSystem->Exec("rm -rf STEERBase ESD AOD ANALYSIS ANALYSISalice PWG2resonances");
82 // build all libraries with the defined options
83 SetupPar("STEERBase", untar);
84 SetupPar("ESD", untar);
85 SetupPar("AOD", untar);
86 SetupPar("ANALYSIS", untar);
87 SetupPar("ANALYSISalice", untar);
88 SetupPar("PWG2resonances", untar);