2 // Example to generate the PWG3base library from a par file
3 // par file is created in ALICE_ROOT directory via make PGW3base.par
4 // To run the generation of AOD you also need the PWG0base.par file
5 // Gines Martinez, Nantes oct 2007
7 // Copy the par file to your working directory and execute root
8 // .L $ALICE_ROOT/PWG3/RunAnalysis.C
9 // setupPar("PWG3base")
10 // setupPar("PWG0base")
11 // Now you can run you analysis macro
12 // .L RunAODGeneration.C
15 Int_t setupPar(const char* pararchivename) {
20 char processline[1024];
21 sprintf(processline,".! tar xvzf %s.par",pararchivename);
22 gROOT->ProcessLine(processline);
23 const char* ocwd = gSystem->WorkingDirectory();
24 gSystem->ChangeDirectory(pararchivename);
26 // check for BUILD.sh and execute
27 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
28 printf("*******************************\n");
29 printf("*** Building PAR archive ***\n");
30 printf("*******************************\n");
32 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
33 Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
37 // check for SETUP.C and execute
38 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
39 printf("*******************************\n");
40 printf("*** Setup PAR archive ***\n");
41 printf("*******************************\n");
42 gROOT->Macro("PROOF-INF/SETUP.C");
45 gSystem->ChangeDirectory("../");