# 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
#Module.StartConfig
__R_ADDTASK__->SelectCollisionCandidates();
#Module.EndConfig
// 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)
//______________________________________________________________________________
fLibs(),
fDeps(),
fDataTypes(),
+ fOutputFile(),
+ fTerminateFile(),
fMacro(0),
fConfigDeps(0),
fRAddTask(0)
fLibs(),
fDeps(),
fDataTypes(),
+ fOutputFile(),
+ fTerminateFile(),
fMacro(0),
fConfigDeps(0),
fRAddTask(0)
fLibs(other.fLibs),
fDeps(other.fDeps),
fDataTypes(other.fDataTypes),
+ fOutputFile(other.fOutputFile),
+ fTerminateFile(other.fTerminateFile),
fMacro(0),
fConfigDeps(0),
fRAddTask(0)
fLibs = other.fLibs;
fDeps = other.fDeps;
fDataTypes = other.fDataTypes;
+ fOutputFile = other.fOutputFile;
+ fTerminateFile = other.fTerminateFile;
if (other.fMacro) fMacro = new TMacro(*other.fMacro);
if (other.fConfigDeps) fConfigDeps = new TMacro(*other.fConfigDeps);
fRAddTask = other.fRAddTask;
{
// Returns number of requested libraries.
if (fLibs.IsNull()) return 0;
- Int_t nlibs = fLibs.CountChar(',')+1;
+ TObjArray *list = fLibs.Tokenize(",");
+ Int_t nlibs = list->GetEntriesFast();
+ delete list;
return nlibs;
}
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;
}
//______________________________________________________________________________
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;
}
//______________________________________________________________________________
out << "#Module.Libs " << fLibs << endl;
out << "#Module.Deps " << fDeps << endl;
out << "#Module.DataTypes " << fDataTypes << endl;
+ out << "#Module.OutputFile " << fOutputFile << endl;
+ out << "#Module.TerminateFile " << fTerminateFile << endl;
out << "#Module.MacroName " << fMacroName << endl;
out << "#Module.MacroArgs " << fMacroArgs << endl;
if (fConfigDeps) {
// Data types
decode = AliAnalysisTaskCfg::DecodeValue(line);
cfg->SetDataTypes(decode);
+ } else if (cfg && line.BeginsWith("#Module.OutputFile")) {
+ // Desired output file name (via SetCommonOutput)
+ decode = AliAnalysisTaskCfg::DecodeValue(line);
+ cfg->SetOutputFileName(decode);
+ } else if (cfg && line.BeginsWith("#Module.TerminateFile")) {
+ // Custom file name produced in Terminate if any
+ decode = AliAnalysisTaskCfg::DecodeValue(line);
+ cfg->SetTerminateFileName(decode);
} else if (cfg && line.BeginsWith("#Module.MacroName")) {
// Name of the add task macro (including path)
decode = AliAnalysisTaskCfg::DecodeValue(line);
} 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")) {