]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAnalysisTaskCfg.cxx
added functionality to run with calo-calo and conv-calo neutral pions to omega task
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskCfg.cxx
index c2b575262055874750c7d4a56393c077f19e3279..bba0499eab18aa07c8ff841306f99441cec913d2 100644 (file)
 # Lines that do not start with #Module are ignored, except those in embedded
   macro blocks
 #Module.Begin        QAsym
-#Module.Libs         PWG1
+#Module.Libs         PWGPP
 #Module.Deps         PhysicsSelection
 #Module.DataTypes    ESD, AOD, MC
-#Module.MacroName    $ALICE_ROOT/PWG1/PilotTrain/AddTaskQAsym.C
+#Module.MacroName    $ALICE_ROOT/PWGPP/PilotTrain/AddTaskQAsym.C
 #Module.MacroArgs    0, AliVEvent::kAnyINT, AliVEvent::kHighMult, AliVEvent::kEMC7, AliVEvent::kMUU7
 #Module.OutputFile   
 #Module.TerminateFile
@@ -73,6 +73,11 @@ __R_ADDTASK__->SelectCollisionCandidates();
 // the right order in the grid handler to generate train macros.
 
 
+using std::cout;
+using std::endl;
+using std::ios;
+using std::ofstream;
+using std::ifstream;
 ClassImp(AliAnalysisTaskCfg)
 
 //______________________________________________________________________________
@@ -332,7 +337,19 @@ const char *AliAnalysisTaskCfg::GetDependency(Int_t i) const
 Bool_t AliAnalysisTaskCfg::NeedsDependency(const char *dep) const
 {
 // Check if a given library is needed by the module.
-   return fDeps.Contains(dep);
+   Int_t indmin = 0;
+   Int_t indmax = 0;
+   Int_t len = fDeps.Length();
+   TString crt;
+   while (indmax<len) {
+      indmax = fDeps.Index(",",indmin);
+      if (indmax < 0) indmax = len;
+      // indmin points to the beginning of the string while indmax to the end+1
+      crt = fDeps(indmin, indmax-indmin);
+      if (crt==dep) return kTRUE;
+      indmin = indmax+1;
+   }
+   return kFALSE;
 }
 
 //______________________________________________________________________________
@@ -378,7 +395,14 @@ Long64_t AliAnalysisTaskCfg::ExecuteConfigMacro()
       Error("ExecuteConfigMacro", "Cannot load requested libraries: %s", fLibs.Data());
       return -1;
    }
-   return fConfigDeps->Exec();
+   Int_t error = 0;
+   Long64_t retval = fConfigDeps->Exec("", &error);
+   if (error != TInterpreter::kNoError)
+   {
+      Error("ExecuteMacro", "Macro interpretation failed");
+      return -1;
+   }
+   return retval;
 }
 
 //______________________________________________________________________________
@@ -538,12 +562,13 @@ TObjArray *AliAnalysisTaskCfg::ExtractModulesFrom(const char *filename)
       } else if (cfg && line.BeginsWith("#Module.StartConfig")) {
          // Marker for start of the configuration macro
          addConfig = new TMacro();
-         TString shortName = gSystem->BaseName(cfg->GetMacroName());
-         shortName = shortName(0,shortName.Index("."));
-         shortName += "Config";
+//         TString shortName = gSystem->BaseName(cfg->GetMacroName());
+//         shortName = shortName(0,shortName.Index("."));
+         TString shortName = cfg->GetName();
+         shortName += "_Config";
          addConfig->SetName(shortName);
-         shortName.Prepend("/");
-         shortName.Prepend(gSystem->DirName(cfg->GetMacroName()));
+//         shortName.Prepend("/");
+//         shortName.Prepend(gSystem->DirName(cfg->GetMacroName()));
          shortName += ".C";
          addConfig->SetTitle(shortName);
       } else if (cfg && line.BeginsWith("#Module.EndMacro")) {