Added possibility to give extra arguments to the command running the analysis macro...
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Dec 2009 17:10:44 +0000 (17:10 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Dec 2009 17:10:44 +0000 (17:10 +0000)
plugin->SetExecutableArgs(args)

ANALYSIS/AliAnalysisAlien.cxx
ANALYSIS/AliAnalysisAlien.h

index 71c432a..3d8ae12 100644 (file)
@@ -58,6 +58,7 @@ AliAnalysisAlien::AliAnalysisAlien()
                   fExecutable(),
                   fExecutableCommand(),
                   fArguments(),
+                  fExecutableArgs(),
                   fAnalysisMacro(),
                   fAnalysisSource(),
                   fAdditionalLibs(),
@@ -108,6 +109,7 @@ AliAnalysisAlien::AliAnalysisAlien(const char *name)
                   fExecutable(),
                   fExecutableCommand(),
                   fArguments(),
+                  fExecutableArgs(),
                   fAnalysisMacro(),
                   fAnalysisSource(),
                   fAdditionalLibs(),
@@ -158,6 +160,7 @@ AliAnalysisAlien::AliAnalysisAlien(const AliAnalysisAlien& other)
                   fExecutable(other.fExecutable),
                   fExecutableCommand(other.fExecutableCommand),
                   fArguments(other.fArguments),
+                  fExecutableArgs(other.fExecutableArgs),
                   fAnalysisMacro(other.fAnalysisMacro),
                   fAnalysisSource(other.fAnalysisSource),
                   fAdditionalLibs(other.fAdditionalLibs),
@@ -236,6 +239,7 @@ AliAnalysisAlien &AliAnalysisAlien::operator=(const AliAnalysisAlien& other)
       fExecutable              = other.fExecutable;
       fExecutableCommand       = other.fExecutableCommand;
       fArguments               = other.fArguments;
+      fExecutableArgs          = other.fExecutableArgs;
       fAnalysisMacro           = other.fAnalysisMacro;
       fAnalysisSource          = other.fAnalysisSource;
       fAdditionalLibs          = other.fAdditionalLibs;
@@ -1272,6 +1276,8 @@ void AliAnalysisAlien::Print(Option_t *) const
    printf("=   Executable command: __________________________ %s\n", fExecutableCommand.Data());
    if (fArguments.Length()) 
    printf("=   Arguments for the execution script: __________ %s\n",fArguments.Data());
+   if (fExecutableArgs.Length()) 
+   printf("=   Arguments after macro name in executable______ %s\n",fExecutableArgs.Data());
    printf("=   Name of the generated analysis macro: ________ %s\n",fAnalysisMacro.Data());
    printf("=   User analysis files to be deployed: __________ %s\n",fAnalysisSource.Data());
    printf("=   Additional libs to be loaded or souces to be compiled runtime: <%s>\n",fAdditionalLibs.Data());
@@ -1314,6 +1320,7 @@ void AliAnalysisAlien::SetDefaults()
    fExecutable                 = "analysis.sh";
    fExecutableCommand          = "root -b -q";
    fArguments                  = "";
+   fExecutableArgs             = "";
    fAnalysisMacro              = "myAnalysis.C";
    fAnalysisSource             = "";
    fAdditionalLibs             = "";
@@ -2064,7 +2071,7 @@ void AliAnalysisAlien::WriteExecutable()
       // Make sure we can properly compile par files
       if (TObject::TestBit(AliAnalysisGrid::kUsePars)) out << "export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH" << endl;
       out << fExecutableCommand << " "; 
-      out << fAnalysisMacro.Data() << endl << endl;
+      out << fAnalysisMacro.Data() << " " << fExecutableArgs.Data() << endl << endl;
       out << "echo \"======== " << fAnalysisMacro.Data() << " finished with exit code: $? ========\"" << endl;
       out << "echo \"############## memory after: ##############\"" << endl;
       out << "free -m" << endl;
index 11c0f98..e44e14d 100644 (file)
@@ -38,6 +38,7 @@ public:
    virtual void        SetExecutable(const char *name="analysis.sh")     {fExecutable = name;}
    virtual void        SetExecutableCommand(const char *command="root -b -q") {fExecutableCommand = command;}
    virtual void        SetArguments(const char *name="")                 {fArguments = name;}
+   virtual void        SetExecutableArgs(const char *name="")            {fExecutableArgs = name;}
    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;}
@@ -120,6 +121,7 @@ private:
    TString          fExecutable;      // Executable script for AliEn job
    TString          fExecutableCommand;  // Command(s) to be executed in the executable script
    TString          fArguments;       // Arguments for the executable script
+   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