]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Sync from old structure
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Feb 2012 09:44:05 +0000 (09:44 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Feb 2012 09:44:05 +0000 (09:44 +0000)
PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.cxx
PWGLF/FORWARD/analysis2/AliPoissonCalculator.cxx
PWGLF/FORWARD/analysis2/AliPoissonCalculator.h
PWGLF/FORWARD/analysis2/trains/BuildTrain.C
PWGLF/FORWARD/analysis2/trains/TrainSetup.C

index 70685edbb68ea546b3396a1e40c68361c03c448b..c61827032a869456e2de19c44cf695f80a73a433 100644 (file)
@@ -318,7 +318,7 @@ AliFMDDensityCalculator::Calculate(const AliESDFMD&        fmd,
        return false;
       }
       // rh->fPoisson.SetObject(d,r,vtxbin,cent);
-      rh->fPoisson.Reset(nt, ns);
+      rh->fPoisson.Reset(0);
       // rh->ResetPoissonHistos(h, fEtaLumping, fPhiLumping);
       
       for (UShort_t s=0; s<ns; s++) { 
@@ -367,8 +367,8 @@ AliFMDDensityCalculator::Calculate(const AliESDFMD&        fmd,
       if ( fUsePoisson) h->Reset();
       
       TH2D* poisson = rh->fPoisson.Result();
-      for (Int_t t=0; t <= poisson->GetNbinsX(); t++) { 
-       for (Int_t s=0; s<= poisson->GetNbinsY(); s++) { 
+      for (Int_t t=0; t < poisson->GetNbinsX(); t++) { 
+       for (Int_t s=0; s < poisson->GetNbinsY(); s++) { 
          
          Double_t poissonV = poisson->GetBinContent(t+1,s+1);
          Double_t  phi  = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
@@ -825,9 +825,6 @@ AliFMDDensityCalculator::DefineOutput(TList* dir)
   RingHistos* o = 0;
   while ((o = static_cast<RingHistos*>(next()))) {
     o->fPoisson.SetLumping(fEtaLumping, fPhiLumping);
-    o->fPoisson.GetOccupancy()->SetFillColor(o->Color());
-    o->fPoisson.GetMean()->SetFillColor(o->Color());
-    o->fPoisson.GetOccupancy()->SetFillColor(o->Color());
     o->Output(d);
   }
 }
@@ -1093,9 +1090,21 @@ AliFMDDensityCalculator::RingHistos::Output(TList* dir)
   d->Add(fDensity);
   d->Add(fELossVsPoisson);
   fPoisson.Output(d);
+  fPoisson.GetOccupancy()->SetFillColor(Color());
+  fPoisson.GetMean()->SetFillColor(Color());
+  fPoisson.GetOccupancy()->SetFillColor(Color());
   d->Add(fELoss);
   d->Add(fELossUsed);
-  
+
+  Bool_t inner = (fRing == 'I' || fRing == 'i');
+  Int_t nStr = inner ? 512 : 256;
+  Int_t nSec = inner ?  20 :  40;
+  TAxis x(nStr, -.5, nStr-.5);
+  TAxis y(nSec, -.5, nSec-.5);
+  x.SetTitle("strip");
+  y.SetTitle("sector");
+  fPoisson.Define(x, y);
+
   TParameter<double>* cut = new TParameter<double>("cut", fMultCut);
   d->Add(cut);
 }
index ff02c93b7f43d9903cc957ff175f0fdcfa93b266..9d74048b1917931a49197e64ed83d0615223ae14 100644 (file)
@@ -6,13 +6,14 @@
 #include <TMath.h>
 #include <TList.h>
 #include <iostream>
+#include <TAxis.h>
 
 // 
 // A class to calculate the multiplicity in @f$(x,y)@f$ bins
 // using Poisson statistics. 
 //
-// The input is assumed to be binned in @f$(x,y)@f$ with the number of channels
-// input to the Reset member function.
+// The input is assumed to be binned in @f$(x,y)@f$ as described by
+// the 2D histogram passwd to the Reset member function.
 //
 // The data is grouped in to regions as defined by the parameters
 // fXLumping and fYLumping.  The total number of cells and number of
 // 
 //
 
+namespace {
+  const char* kBasicN = "basic";
+  const char* kEmptyN = "empty";
+  const char* kTotalN = "total";
+  const char* kBasicT = "Basic number of hits";
+  const char* kEmptyT = "Empty number of bins/region";
+  const char* kTotalT = "Total number of bins/region";
+}
+
+
+
+
 //____________________________________________________________________
 AliPoissonCalculator::AliPoissonCalculator()
   : TNamed(),
@@ -56,7 +69,7 @@ AliPoissonCalculator::AliPoissonCalculator()
 }
 
 //____________________________________________________________________
-AliPoissonCalculator::AliPoissonCalculator(const char*/*, UShort_t d, Char_t r*/)
+AliPoissonCalculator::AliPoissonCalculator(const char*)
   : TNamed("poissonCalculator", "Calculate N_ch using Poisson stat"),
     fXLumping(32), 
     fYLumping(4), 
@@ -86,7 +99,7 @@ AliPoissonCalculator::AliPoissonCalculator(const AliPoissonCalculator& o)
     fCorr(0)
 {
   Init();
-//  Reset();
+  Reset(o.fBasic);
 }
 
 //____________________________________________________________________
@@ -117,7 +130,7 @@ AliPoissonCalculator::operator=(const AliPoissonCalculator& o)
   fYLumping = o.fYLumping;
   CleanUp();
   Init();
// Reset();
 Reset(o.fBasic);
   return *this;
 }
 
@@ -134,11 +147,38 @@ AliPoissonCalculator::Init(Int_t xLumping, Int_t yLumping)
   //Create diagnostics if void
   if (fEmptyVsTotal) return;
   
-  MakeOutput();
-  
+  MakeOutput();  
+}
+//____________________________________________________________________
+void
+AliPoissonCalculator::Define(const TAxis& xaxis, const TAxis& yaxis)
+{
+  // 
+  // Initialize 
+  // 
+  const Double_t* xBins = xaxis.GetXbins()->GetArray();
+  const Double_t* yBins = yaxis.GetXbins()->GetArray();
+  Int_t           nX    = xaxis.GetNbins();
+  Int_t           nY    = yaxis.GetNbins();
+  Double_t        lX    = xaxis.GetXmin();
+  Double_t        hX    = xaxis.GetXmax();
+  Double_t        lY    = yaxis.GetXmin();
+  Double_t        hY    = yaxis.GetXmax();
   
+  if (xBins) { 
+    if (yBins) fBasic = new TH2D(kBasicN, kBasicT, nX, xBins, nY, yBins);
+    else       fBasic = new TH2D(kBasicN, kBasicT, nX, xBins, nY, lY, hY);
+  }
+  else { 
+    if (yBins) fBasic = new TH2D(kBasicN, kBasicT, nX, lX, hX, nY, yBins);
+    else       fBasic = new TH2D(kBasicN, kBasicT, nX, lX, hX, nY, lY, hY);
+  }
+  fBasic->SetXTitle(xaxis.GetTitle());
+  fBasic->SetYTitle(yaxis.GetTitle());
+
+  Reset(fBasic);
 }
- //____________________________________________________________________
+//____________________________________________________________________
 void AliPoissonCalculator::MakeOutput() {
 
   Int_t n = fXLumping * fYLumping + 1;
@@ -204,44 +244,64 @@ AliPoissonCalculator::SetLumping(UShort_t nx, UShort_t ny)
   Init(nx, ny);
 }
 
+//____________________________________________________________________
+Int_t
+AliPoissonCalculator::CheckLumping(char which, Int_t nBins, Int_t lumping) const
+{
+  if ((nBins % lumping) == 0) return lumping;
+  Int_t l = lumping;
+  do { 
+    l--;
+  } while (l > 0 && ((nBins % l) != 0));
+  Warning("CheckLumping", "%c lumping %d is not a divisor of %d, set to %d", 
+         which, lumping, nBins, l);
+  return l;
+}
+
 //____________________________________________________________________
 void
-AliPoissonCalculator::Reset(UShort_t xChannels, UShort_t yChannels)
+AliPoissonCalculator::Reset(const TH2D* base)
 {
   // 
   // Reset histogram 
   // 
-  
   if (fBasic && fTotal && fEmpty) {
     fBasic->Reset();
     fTotal->Reset();
     fEmpty->Reset();
     return;
   }
-  Int_t    nXF   = xChannels;
-  Int_t    nX    = nXF / fXLumping;
-  Double_t xMin  = -0.5;
-  Double_t xMax  = nXF - 0.5;
-  Int_t    nYF   = yChannels;
+
+  if (!base) return;
+
+  Int_t    nXF   = base->GetNbinsX();
+  Double_t xMin  = base->GetXaxis()->GetXmin();
+  Double_t xMax  = base->GetXaxis()->GetXmax();
+  Int_t    nYF   = base->GetNbinsY();
+  Double_t yMin  = base->GetYaxis()->GetXmin();
+  Double_t yMax  = base->GetYaxis()->GetXmax();
+
+  fXLumping = CheckLumping('X', nXF, fXLumping);
+  fYLumping = CheckLumping('Y', nYF, fYLumping);
+  
   Int_t    nY    = nYF / fYLumping;
-  Double_t yMin  = -0.5;
-  Double_t yMax  = nYF - 0.5;
+  Int_t    nX    = nXF / fXLumping;
 
-  fBasic = new TH2D("basic", "basic number of hits",
-                   nX, xMin, xMax, nY, yMin, yMax);
-  fBasic->SetTitle("Basic number of hits");
-  fBasic->SetDirectory(0);
-  fBasic->Sumw2();
+  if (fBasic != base) { 
+    fBasic = static_cast<TH2D*>(base->Clone(kBasicN));
+    fBasic->SetTitle(kBasicT);
+    fBasic->SetDirectory(0);
+    fBasic->Sumw2();
+  }
 
-  fTotal = new TH2D("total", "Total number of bins/region",
-                   nX, xMin, xMax, nY, yMin, yMax);
+  fTotal = new TH2D(kTotalN, kTotalT, nX, xMin, xMax, nY, yMin, yMax);
   fTotal->SetDirectory(0);
   fTotal->SetXTitle(fBasic->GetXaxis()->GetTitle());
   fTotal->SetYTitle(fBasic->GetYaxis()->GetTitle());
   fTotal->Sumw2();
     
-  fEmpty = static_cast<TH2D*>(fTotal->Clone("empty"));
-  fEmpty->SetTitle("Empty number of bins/region");
+  fEmpty = static_cast<TH2D*>(fTotal->Clone(kEmptyN));
+  fEmpty->SetTitle(kEmptyT);
   fEmpty->SetDirectory(0);
   // fEmpty->Sumw2();
 }
index a3bc73ad58cc52b6281683c134c441e6dfe05308..34d11e8be16ce1666f8dabcd3818ebdf231b3382 100644 (file)
@@ -4,6 +4,7 @@
 class TH2D;
 class TH1D;
 class TBrowser;
+class TAxis;
 
 /** 
  * A class to calculate the multiplicity in @f$(\eta,\varphi)@f$ bins
@@ -44,7 +45,7 @@ public:
    * 
    */
   AliPoissonCalculator(const char*/*, UShort_t d, Char_t r*/);
-  /** 
+  /**
    * Copy constructor
    * 
    * @param o Object to copy from
@@ -88,6 +89,13 @@ public:
    * @param yLumping If larger than 0, set the phi lumping to this
    */
   void Init(Int_t xLumping=-1, Int_t yLumping=-1);
+  
+  /** 
+   * Initialize this object.  
+   * 
+   * Also book the cache histograms 
+   */
+  void Define(const TAxis& xaxis, const TAxis& yaxis);
   /** 
    * Make output stuff for the passed list
    * 
@@ -103,10 +111,9 @@ public:
   /** 
    * Reset the cache histogram 
    * 
-   * @param xChannels number of channels in x 
-   * @param yChannels number of channels in y 
+   * @param base Base histogram 
    */
-  void Reset(UShort_t xChannels, UShort_t yChannels);
+  void Reset(const TH2D* base);
   /** 
    * Fill in an observation 
    * 
@@ -198,6 +205,16 @@ public:
   Int_t GetReducedYBin(Double_t y) const;
 
 protected:
+  /** 
+   * check that the lumping parameter makes sense  
+   * 
+   * @param which   Which axis
+   * @param nBins   Number of bins
+   * @param lumping Lumping 
+   * 
+   * @return The new value of the lumping 
+   */
+  Int_t CheckLumping(char which, Int_t nBins, Int_t lumping) const;
   /** 
    * Clean up allocated space 
    * 
index eb0d62b8c09e263bbdcca533086d61d8f730d54f..cb92bcd20399e942270be826a67ef8f4a94fe590 100644 (file)
@@ -31,6 +31,7 @@ BuildTrain(const char* script, const char* extra="", Bool_t useTmp=false)
   
   // --- Setup include path ------------------------------------------
   gSystem->AddIncludePath(Form("-I%s", fwd2Path));
+  gSystem->AddIncludePath(Form("-I%s/trains", fwd2Path));
   gSystem->AddIncludePath(Form("-I%s", aliPath));
   gSystem->AddIncludePath(Form("-I%s/include", aliPath));
 
index 871b668ec41118787f34dd9d87c2df56414e6148..af9f06c3d545918ae72e94820a2066b62ce61b9a 100644 (file)
@@ -468,6 +468,178 @@ struct TrainSetup
    */
   void SetAllowOverwrite(Bool_t allow) { fAllowOverwrite = allow; }
   //__________________________________________________________________
+  /** 
+   * Service function to make a PAR out of a script.  
+   * 
+   * The script should contain can contain a sub-class of AliAnalysisTask. 
+   * The script will be compiled on the slaves before loading the 
+   * AliAnalysisManager.  Parts to (not) be compiled can be protected like 
+   * 
+   * @code 
+   * #ifdef BUILD_PAR
+   * // This will _only_ be compiled in the servers 
+   * #endif
+   * #ifndef BUILD_PAR
+   * // This will not be compiled in the servers 
+   * #endif
+   * @endcode
+   * 
+   * @param script Script to upload and compile in the PAR
+   * @param deps   Dependency pars 
+   * 
+   * @return true on success. 
+   */
+  static Bool_t MakeScriptPAR(const char* script, const char* deps)
+  {
+    // Get the base name 
+    TString base(gSystem->BaseName(script));
+    Int_t   idx = base.Last('.');
+    if (idx != kNPOS) base.Remove(idx);
+    Bool_t retval = true;
+    Info("MakeScriptPAR", "script=%s, base=%s", script, base.Data());
+
+    try {
+      // Check name of script file 
+      TString scr(script);
+      TString ext;
+      if      (scr.EndsWith(".C"))   ext = "C"; 
+      else if (scr.EndsWith(".cxx")) ext = "cxx";
+      else                           { ext = "C"; scr.Append(".C"); }
+      
+      // Check if we can access the file 
+      TString path = TString::Format(".:%s", TROOT::GetMacroPath());
+      char* loc = gSystem->Which(path, scr);
+      if (!loc) throw TString::Format("Script %s not found in %s", 
+                                     scr.Data(), path.Data());
+      TString full(loc);
+
+      
+      // Set-up directories 
+      if (gSystem->MakeDirectory(base) < 0) {
+       base = "";
+       throw TString::Format("Could not make directory '%s'", base.Data());
+      }
+      
+      if (gSystem->MakeDirectory(Form("%s/PROOF-INF", base.Data()))) 
+       throw TString::Format("Could not make directory %s/PROOF-INF", 
+                             base.Data());
+      
+      // Copy the script to the setup directory 
+      TString dest = TString::Format("%s/%s.%s", base.Data(),
+                                    base.Data(), ext.Data());
+      Int_t ret = gSystem->CopyFile(full, dest, true);
+      switch (ret) { 
+      case -1: throw TString::Format("Couldn't open %s for copy", scr.Data());
+      case -2: throw TString::Format("File %s exists", dest.Data());
+      case -3: throw TString::Format("Error while copying %s", scr.Data());
+      }
+      
+      // Make our build file 
+      std::ofstream build(Form("%s/PROOF-INF/BUILD.sh", base.Data()));
+      if (!build) 
+       throw TString::Format("Failed to open build shell script");
+      build << "#!/bin/sh\n"
+           << "echo BUILD.sh@`hostname`: Building " << base << "\n"
+           << "root.exe -l -b -q PROOF-INF/BUILD.C 2>&1 | tee " << base << ".log\n"
+           << "echo BUILD.sh@`hostname`: done: $?\n"
+           << std::endl;
+      build.close();
+      if (gSystem->Chmod(Form("%s/PROOF-INF/BUILD.sh", base.Data()), 0755) != 0)
+       throw TString::Format("Failed to set exectuable flags on "
+                             "%s/PROOF-INF/BUILD.sh", base.Data());
+      
+      std::ofstream util(Form("%s/PROOF-INF/UTIL.C", base.Data()));
+      if (!util) 
+       throw TString::Format("Failed to open utility script");
+      util << "void LoadROOTLibs() {\n"
+          << "  gSystem->Load(\"libVMC\");\n"
+          << "  gSystem->Load(\"libNet\");\n"
+          << "  gSystem->Load(\"libTree\");\n"
+          << "  gSystem->Load(\"libPhysics\");\n"
+          << "  gSystem->Load(\"libMinuit\");\n"
+          << "}\n\n"
+          << "void AddDep(const char* env) {\n"
+          << "  TString val(gSystem->Getenv(Form(\"%s_INCLUDE\",env)));\n"
+          << "  if (val.IsNull())\n"
+          << "    Warning(\"Add\",\"%s_INCLUDE not defined\", env);\n"
+          << "  else {\n"
+          << "    gSystem->AddIncludePath(Form(\"-I../%s\",val.Data()));\n"
+          << "  }\n"
+          << "}\n\n"
+          << "void LoadDep(const char* name) {\n"
+          << "  gSystem->AddDynamicPath(Form(\"../%s\",name));\n"
+          << "  char* full = gSystem->DynamicPathName(name,true);\n"
+          << "  if (!full) \n"
+          << "   full = gSystem->DynamicPathName(Form(\"lib%s\",name),true);\n"
+          << "  if (!full) \n"
+          << "   full = gSystem->DynamicPathName(Form(\"lib%s.so\",name),true);\n"
+          << "  if (!full) {\n"
+          << "    Warning(\"LoadDep\",\"Module %s not found\", name);\n"
+          << "    return;\n"
+          << "  }\n"
+          << "  gSystem->Load(full);\n"
+          << "}\n"
+          << std::endl;
+                 
+      std::ofstream cbuild(Form("%s/PROOF-INF/BUILD.C", base.Data()));
+      if (!cbuild) 
+       throw TString::Format("Failed to open build script");
+      cbuild << "void BUILD() {\n"
+            << "  gSystem->AddIncludePath(\"-DBUILD_PAR=1\");\n"
+            << "  gROOT->LoadMacro(\"PROOF-INF/UTIL.C\");\n"
+            << "  LoadROOTLibs();\n";
+      TObjArray*  depList = TString(deps).Tokenize(",");
+      TIter       next(depList);
+      TObject*    dep = 0;
+      while ((dep = next())) {
+       cbuild << "  AddDep(\"" << dep->GetName() << "\");\t"
+              << "  LoadDep(\"" << dep->GetName() << "\");\n";
+      }
+      cbuild << "  // gDebug = 5;\n"
+            << "  int ret = gROOT->LoadMacro(\"" 
+            << base << "." << ext << "++g\");\n"
+            << "  if (ret != 0) Fatal(\"BUILD\",\"Failed to build\");\n"
+            << "  else Info(\"BUILD\", \"Made " << base << "\");\n"
+           << "}\n"
+           << std::endl;
+      cbuild.close();
+      
+      // Make our set-up script 
+      std::ofstream setup(Form("%s/PROOF-INF/SETUP.C", base.Data()));
+      if (!build) 
+       throw TString::Format("Failed to open setup script");
+      setup << "void SETUP() {\n"
+           << "  gROOT->LoadMacro(\"PROOF-INF/UTIL.C\");\n"
+           << "  LoadROOTLibs();\n"
+           << "  Info(\"SETUP\",\"Loading libraries\");\n";
+      next.Reset();
+      dep = 0;
+      while ((dep = next())) 
+       setup << "  LoadDep(\"" << dep->GetName() << "\");\n";
+      setup << "  gDebug = 5;\n"
+           << "  gSystem->Load(\"" << base << "_" << ext << ".so\");\n"
+           << "  gDebug = 0;\n"
+           << "  gROOT->ProcessLine(\".include " << base << "\");\n"
+           << "  gSystem->Setenv(\"" << base << "_INCLUDE\",\"" 
+           << base << "\");\n"
+           << "  Info(\"SETUP\", \"Done\");\n"
+           << "}\n"
+           << std::endl;
+      setup.close();
+
+      ret = gSystem->Exec(Form("tar -czvf %s.par %s", base.Data(),base.Data()));
+      if (ret != 0) 
+       throw TString::Format("Failed to create PAR file %s.PAR", base.Data());
+    }
+    catch (TString& e) { 
+      Error("MakeScriptPAR", e.Data()); 
+      retval = false;
+    }
+    if (!base.IsNull())
+      gSystem->Exec(Form("rm -vrf %s", base.Data()));
+    return retval;
+  }
+  //__________________________________________________________________
   /** 
    * Print the setup 
    * 
@@ -649,10 +821,13 @@ protected:
 
     if (mode == kProof) usePar    = true;
 
+    Info("Exec", "Connecting in mode=%d", mode);
     if (!Connect(mode)) return;
 
     TString cwd = gSystem->WorkingDirectory();
     TString nam = EscapedName();
+    Info("Exec", "Current directory=%s, escaped name=%s", 
+        cwd.Data(), nam.Data());
     if (oper != kTerminate) { 
       if (!fAllowOverwrite && !gSystem->AccessPathName(nam.Data())) {
        Error("Exec", "File/directory %s already exists", nam.Data());
@@ -660,7 +835,7 @@ protected:
       }
       if (gSystem->AccessPathName(nam.Data())) {
        if (gSystem->MakeDirectory(nam.Data())) {
-         Error("Exec", "Failed to make directory %s", nam.Data());
+         Error("Exec", "Failed to make directory '%s'", nam.Data());
          return;
        }
       }
@@ -1059,7 +1234,7 @@ protected:
     AliCentralitySelectionTask* ctask = 
       dynamic_cast<AliCentralitySelectionTask*>(mgr->GetTask("CentralitySelection"));
     if (!ctask) return;
-    ctask->SetPass(fESDPass);
+    // ctask->SetPass(fESDPass);
     if (mc) ctask->SetMCInput();
   }
   //__________________________________________________________________
@@ -1085,6 +1260,7 @@ protected:
                          
     // --- Set-up connections to Proof cluster and alien -------------
     if (mode == kProof) { 
+      Info("Connect", "Opening connection to proof server");
       // --- Find user name ------------------------------------------
       TString userName(gSystem->Getenv("alien_API_USER"));
       if (userName.IsNull()) {
@@ -1115,6 +1291,7 @@ protected:
       }
       
       // --- Add ALICE_ROOT directory to search path for packages ----
+      Info("Connect", "Set location of packages");
       gEnv->SetValue("Proof.GlobalPackageDirs", 
                     Form("%s:%s", 
                          gEnv->GetValue("Proof.GlobalPackageDirs", "."), 
@@ -1133,10 +1310,13 @@ protected:
              fProofServer.Data(), userName.Data());
        return false;
       }
+      Info("Connect", "Now connected to Proof");
+      // gProof->SetParameter("PROOF_LookupOpt", "all");
       if (lite) return true;
     }
 
     // --- Open a connection to the grid -----------------------------
+#if 0
     TGrid::Connect("alien://");
     if (!gGrid || !gGrid->IsConnected()) { 
       // This is only fatal in grid mode 
@@ -1165,7 +1345,7 @@ protected:
     // Make output directory 
     gGrid->Mkdir("proof_output");
     gGrid->Cd("proof_output");
-
+#endif
     return true;
   }      
   //__________________________________________________________________
@@ -1197,6 +1377,20 @@ protected:
       
     }
 
+#if 0
+    // We need to activate the workers here in case 
+    // we have dynamic slaves - otherwise they won't get
+    // the packages 
+    if (mode == kProof) { 
+      Info("LoadCommonLibraries", "Starting slaves");
+      if (!gProof->StartSlaves()) { 
+       Error("LoadCommonLibraries", "Failed to start slaves");
+       return false;
+      }
+      Info("LoadCommonLibraries", "Slaves started");
+    }
+#endif       
+      
     Bool_t ret   = true;
     Bool_t basic = mode == kGrid ? false : par;
     
@@ -1245,7 +1439,8 @@ protected:
       }
       break;
     case kProof: 
-      ret = gProof->UploadPackage(what);
+      Info("LoadLibrary", "Uploading %s", what);
+      ret = gProof->UploadPackage(what, TProof::kRemoveOld);
       if (ret < 0)  {  
          ret = gProof->UploadPackage(gSystem->ExpandPathName(Form("../%s.par",
                                                                   what)));
@@ -1262,6 +1457,7 @@ protected:
          }
        }
       }
+      Info("LoadLibrary", "Enabling package %s", what);
       ret = gProof->EnablePackage(what);
       break;
     }