From Christian Klein-Boesing: New method :
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Jan 2010 16:06:58 +0000 (16:06 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Jan 2010 16:06:58 +0000 (16:06 +0000)
SetAdditionalRootLibs(const char *list) // strings separated by blancs
to add a string that holds libs that have to be loaded BEFORE other analysis libs/par file compilation.

ANALYSIS/AliAnalysisAlien.cxx
ANALYSIS/AliAnalysisAlien.h

index 7de448e..c348750 100644 (file)
@@ -62,6 +62,7 @@ AliAnalysisAlien::AliAnalysisAlien()
                   fExecutableArgs(),
                   fAnalysisMacro(),
                   fAnalysisSource(),
+                  fAdditionalRootLibs(),
                   fAdditionalLibs(),
                   fSplitMode(),
                   fAPIVersion(),
@@ -114,6 +115,7 @@ AliAnalysisAlien::AliAnalysisAlien(const char *name)
                   fExecutableArgs(),
                   fAnalysisMacro(),
                   fAnalysisSource(),
+                  fAdditionalRootLibs(),
                   fAdditionalLibs(),
                   fSplitMode(),
                   fAPIVersion(),
@@ -166,6 +168,7 @@ AliAnalysisAlien::AliAnalysisAlien(const AliAnalysisAlien& other)
                   fExecutableArgs(other.fExecutableArgs),
                   fAnalysisMacro(other.fAnalysisMacro),
                   fAnalysisSource(other.fAnalysisSource),
+                  fAdditionalRootLibs(other.fAdditionalRootLibs),
                   fAdditionalLibs(other.fAdditionalLibs),
                   fSplitMode(other.fSplitMode),
                   fAPIVersion(other.fAPIVersion),
@@ -246,6 +249,7 @@ AliAnalysisAlien &AliAnalysisAlien::operator=(const AliAnalysisAlien& other)
       fExecutableArgs          = other.fExecutableArgs;
       fAnalysisMacro           = other.fAnalysisMacro;
       fAnalysisSource          = other.fAnalysisSource;
+      fAdditionalRootLibs      = other.fAdditionalRootLibs;
       fAdditionalLibs          = other.fAdditionalLibs;
       fSplitMode               = other.fSplitMode;
       fAPIVersion              = other.fAPIVersion;
@@ -1795,7 +1799,21 @@ void AliAnalysisAlien::WriteAnalysisMacro()
       out << "   gSystem->Load(\"libVMC\");" << endl;
       out << "   gSystem->Load(\"libPhysics\");" << endl << endl;
       out << "   gSystem->Load(\"libMinuit\");" << endl << endl;
+      if (fAdditionalRootLibs.Length()) {
+       // in principle libtree /lib geom libvmc etc. can go into this list, too
+       out << "// Add aditional libraries" << endl;
+       TObjArray *list = fAdditionalRootLibs.Tokenize(" ");
+       TIter next(list);
+       TObjString *str;
+       while((str=(TObjString*)next())) {
+         if (str->GetString().Contains(".so"))
+           out << "   gSystem->Load(\"" << str->GetString().Data() << "\");" << endl;
+         }
+       if (list) delete list;
+      }
       out << "// Load analysis framework libraries" << endl;
+
+
       if (!fPackages) {
          out << "   gSystem->Load(\"libSTEERBase\");" << endl;
          out << "   gSystem->Load(\"libESD\");" << endl;
index c639a70..a4bcf29 100644 (file)
@@ -42,6 +42,7 @@ public:
    virtual void        SetAnalysisMacro(const char *name="myAnalysis.C") {fAnalysisMacro = name;}
    virtual void        SetAnalysisSource(const char *name="myAnalysisClass.cxx") {fAnalysisSource = name;}
    virtual void        SetAdditionalLibs(const char *list)               {fAdditionalLibs = list;}
+   virtual void        SetAdditionalRootLibs(const char *list)           {fAdditionalRootLibs = list;}
    virtual void        SetPrice(Int_t price=1)                           {fPrice = price;}
    virtual void        SetRunRange(Int_t min, Int_t max)                 {fRunRange[0] = min; fRunRange[1] = max;}
    virtual void        SetJobTag(const char *tag="")                     {fJobTag = tag;}
@@ -127,7 +128,8 @@ private:
    TString          fExecutableArgs;  // arguments added to the executable script after the analysis macro
    TString          fAnalysisMacro;   // Root macro steering the analysis
    TString          fAnalysisSource;  // User analysis implementation (.cxx) file(s)
-   TString          fAdditionalLibs;  // List (separated by blacs) of additional libraries needed for the analysis
+   TString          fAdditionalRootLibs;  // List (separated by blacs) of additional libraries needed for/before analysis libs/par file compilation
+   TString          fAdditionalLibs;  // List (separated by blacs) of additional libraries needed for the analysis loaded AFTER all par files
    TString          fSplitMode;       // Job split mode
    TString          fAPIVersion;      // API version
    TString          fROOTVersion;     // ROOT version
@@ -153,6 +155,6 @@ private:
    TObjArray       *fInputFiles;      // List of input files to be processed by the job
    TObjArray       *fPackages;        // List of packages to be used
    
-   ClassDef(AliAnalysisAlien, 9)   // Class providing some AliEn utilities
+   ClassDef(AliAnalysisAlien, 10)   // Class providing some AliEn utilities
 };
 #endif