Added AliAnalysisAlien::AddAdditionalLibrary to add individual libs. Added AliAnalysi...
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 24 Oct 2011 07:57:11 +0000 (07:57 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 24 Oct 2011 07:57:11 +0000 (07:57 +0000)
ANALYSIS/AliAnalysisAlien.cxx
ANALYSIS/AliAnalysisAlien.h
ANALYSIS/AliAnalysisGrid.h

index 537ebbf..782af0d 100644 (file)
@@ -117,6 +117,7 @@ AliAnalysisAlien::AliAnalysisAlien()
                   fJDLName(),
                   fTerminateFiles(),
                            fMergeExcludes(),
+                  fRegisterExcludes(),
                   fIncludePath(),
                   fCloseSE(),
                   fFriendChainName(),
@@ -189,6 +190,7 @@ AliAnalysisAlien::AliAnalysisAlien(const char *name)
                   fJDLName(),
                   fTerminateFiles(),
                   fMergeExcludes(),
+                  fRegisterExcludes(),
                   fIncludePath(),
                   fCloseSE(),
                   fFriendChainName(),
@@ -261,6 +263,7 @@ AliAnalysisAlien::AliAnalysisAlien(const AliAnalysisAlien& other)
                   fJDLName(other.fJDLName),
                   fTerminateFiles(other.fTerminateFiles),
                   fMergeExcludes(other.fMergeExcludes),
+                  fRegisterExcludes(other.fRegisterExcludes),
                   fIncludePath(other.fIncludePath),
                   fCloseSE(other.fCloseSE),
                   fFriendChainName(other.fFriendChainName),
@@ -375,6 +378,7 @@ AliAnalysisAlien &AliAnalysisAlien::operator=(const AliAnalysisAlien& other)
       fJDLName                 = other.fJDLName;
       fTerminateFiles          = other.fTerminateFiles;
       fMergeExcludes           = other.fMergeExcludes;
+      fRegisterExcludes        = other.fRegisterExcludes;
       fIncludePath             = other.fIncludePath;
       fCloseSE                 = other.fCloseSE;
       fFriendChainName         = other.fFriendChainName;
@@ -416,6 +420,23 @@ AliAnalysisAlien &AliAnalysisAlien::operator=(const AliAnalysisAlien& other)
 }
 
 //______________________________________________________________________________
+void AliAnalysisAlien::AddAdditionalLibrary(const char *name)
+{
+// Add a single additional library to be loaded. Extension must be present.
+   TString lib(name);
+   if (!lib.Contains(".")) {
+      Error("AddAdditionalLibrary", "Extension not defined for %s", name);
+      return;
+   }
+   if (fAdditionalLibs.Contains(name)) {
+      Warning("AddAdditionalLibrary", "Library %s already added.", name);
+      return;
+   }
+   if (!fAdditionalLibs.IsNull()) fAdditionalLibs += " ";
+   fAdditionalLibs += lib;
+}   
+
+//______________________________________________________________________________
 void AliAnalysisAlien::AddModule(AliAnalysisTaskCfg *module)
 {
 // Adding a module. Checks if already existing. Becomes owned by this.
@@ -1615,9 +1636,9 @@ Bool_t AliAnalysisAlien::CreateJDL()
             outputArchive = "log_archive.zip:std*@disk=1 ";
             // Add normal output files, extra files + terminate files
             TString files = GetListOfFiles("outextter");
-            // Do not register merge excludes
-            if (!fMergeExcludes.IsNull()) {
-               arr = fMergeExcludes.Tokenize(" ");
+            // Do not register files in fRegisterExcludes
+            if (!fRegisterExcludes.IsNull()) {
+               arr = fRegisterExcludes.Tokenize(" ");
                TIter next1(arr);
                while ((os=(TObjString*)next1())) {
                   files.ReplaceAll(Form("%s,",os->GetString().Data()),"");
@@ -1658,6 +1679,8 @@ Bool_t AliAnalysisAlien::CreateJDL()
          sout.ReplaceAll(".root", "");
          if (sout.Index("@")>0) sout.Remove(sout.Index("@"));
          if (fOutputArchive.Contains(sout)) continue;
+         // Ignore fRegisterExcludes
+         if (fRegisterExcludes.Contains(sout)) continue;
          if (!first) comment = NULL;
          if (!os->GetString().Contains("@") && fCloseSE.Length())
             fGridJDL->AddToOutputSandbox(Form("%s@%s",os->GetString().Data(), fCloseSE.Data()), comment); 
@@ -2314,6 +2337,7 @@ void AliAnalysisAlien::Print(Option_t *) const
    printf("=   List of output files to be registered: _______ %s\n", fOutputFiles.Data());
    printf("=   List of outputs going to be archived: ________ %s\n", fOutputArchive.Data());
    printf("=   List of outputs that should not be merged: ___ %s\n", fMergeExcludes.Data());
+   printf("=   List of outputs that should not be registered: %s\n", fRegisterExcludes.Data());
    printf("=   List of outputs produced during Terminate: ___ %s\n", fTerminateFiles.Data());
    printf("=====================================================================\n");
    printf("=   Job price: ___________________________________ %d\n", fPrice);
@@ -2790,8 +2814,8 @@ Bool_t AliAnalysisAlien::MergeOutputs()
             gSystem->Exec(Form("rm -f %s", outputChunk.Data()));
          }   
       }
-      if (fMergeExcludes.Length() &&
-          fMergeExcludes.Contains(outputFile.Data())) continue;
+      if (fMergeExcludes.Contains(outputFile.Data()) || 
+          fRegisterExcludes.Contains(outputFile.Data())) continue;
       // Perform a 'find' command in the output directory, looking for registered outputs    
       merged = MergeOutput(outputFile, fGridOutputDir, fMaxMergeFiles);
       if (!merged) {
@@ -3430,7 +3454,8 @@ Bool_t AliAnalysisAlien::SubmitMerging()
          outputFile = str->GetString();
          Int_t index = outputFile.Index("@");
          if (index > 0) outputFile.Remove(index);
-         if (!fMergeExcludes.Contains(outputFile)) break;
+         if (!fMergeExcludes.Contains(outputFile) && 
+             !fRegisterExcludes.Contains(outputFile)) break;
       }
       delete list;
       Bool_t done = CheckMergedFiles(outputFile, runOutDir, fMaxMergeFiles, mergeJDLName);
@@ -4121,7 +4146,7 @@ void AliAnalysisAlien::WriteMergingMacro()
       out << "   if (!TGrid::Connect(\"alien://\")) return;" << endl;
       out << "   TString outputDir = dir;" << endl;  
       out << "   TString outputFiles = \"" << GetListOfFiles("out") << "\";" << endl;
-      out << "   TString mergeExcludes = \"" << fMergeExcludes << "\";" << endl;
+      out << "   TString mergeExcludes = \"" << fMergeExcludes << " " << fRegisterExcludes << "\";" << endl;
       out << "   TObjArray *list = outputFiles.Tokenize(\",\");" << endl;
       out << "   TIter *iter = new TIter(list);" << endl;
       out << "   TObjString *str;" << endl;
index 96c670b..06d9dbe 100644 (file)
@@ -40,6 +40,7 @@ public:
    AliAnalysisAlien(const AliAnalysisAlien& other); 
    AliAnalysisAlien& operator=(const AliAnalysisAlien& other);
 // Setters   
+   virtual void        AddAdditionalLibrary(const char *name);
    virtual void        AddIncludePath(const char *path);
    virtual void        AddRunNumber(Int_t run);
    virtual void        AddRunNumber(const char *run);
@@ -89,6 +90,7 @@ public:
    virtual void        SetJDLName(const char *name="analysis.jdl")       {fJDLName = name;}
    virtual void        SetPreferedSE(const char *se);
    virtual void        SetProductionMode(Int_t mode=1)                   {fProductionMode = mode;}
+   virtual void        SetRegisterExcludes(const char *list)             {fRegisterExcludes = list;}
    virtual void        SetRunPrefix(const char *prefix);
    virtual void        SetOutputSingleFolder(const char *folder)         {fOutputSingle = folder; fSplitMode="file"; fSplitMaxInputFileNumber=1;}
    virtual void        SetFastReadOption(Bool_t on=kTRUE)                {fFastReadOption = on ? 1 : 0;}
@@ -213,6 +215,7 @@ private:
    TString          fJDLName;         // JDL file to be generated
    TString          fTerminateFiles;  // List of output files produced during Terminate
    TString          fMergeExcludes;   // List of output files excluded from merging
+   TString          fRegisterExcludes; // List of liles not to be registered/merged
    TString          fIncludePath;     // Include path
    TString          fCloseSE;         // Preffered storage element. Taken from alien_CLOSE_SE environment.
    TString          fFriendChainName; // File name to construct friend chain (for AOD)
@@ -230,6 +233,6 @@ private:
    TObjArray       *fModules;         // List of AliAnalysisTaskCfg modules
    TMap             fProofParam;      // Key-value pairs for proof mode
    
-   ClassDef(AliAnalysisAlien, 19)   // Class providing some AliEn utilities
+   ClassDef(AliAnalysisAlien, 20)   // Class providing some AliEn utilities
 };
 #endif
index 7fff29b..3e2ff0d 100644 (file)
@@ -54,6 +54,7 @@ enum EPluginBits {
 // Getters
    virtual EPluginRunMode GetRunMode() const;
 // Setters   
+   virtual void        AddAdditionalLibrary(const char *name)            = 0;
    virtual void        AddIncludePath(const char *path)                  = 0;
    virtual void        AddRunNumber(Int_t run)                           = 0;
    virtual void        AddRunNumber(const char *run)                     = 0;
@@ -91,6 +92,7 @@ enum EPluginBits {
    virtual void        SetJDLName(const char *name="analysis.jdl")       = 0;
    virtual void        SetPreferedSE(const char *se)                     = 0;
    virtual void        SetProductionMode(Int_t mode=1)                   = 0;
+   virtual void        SetRegisterExcludes(const char *list)             = 0;
    virtual void        SetRunPrefix(const char *prefix)                  = 0;
    virtual void        SetOutputSingleFolder(const char *folder)         = 0;
    virtual void        SetFastReadOption(Bool_t on=kTRUE)                = 0;