fAPIVersion(),
fROOTVersion(),
fAliROOTVersion(),
+ fExternalPackages(),
fUser(),
fGridWorkingDir(),
fGridDataDir(),
fCloseSE(),
fFriendChainName(),
fJobTag(),
+ fOutputSingle(),
fInputFiles(0),
fPackages(0)
{
fAPIVersion(),
fROOTVersion(),
fAliROOTVersion(),
+ fExternalPackages(),
fUser(),
fGridWorkingDir(),
fGridDataDir(),
fCloseSE(),
fFriendChainName(),
fJobTag(),
+ fOutputSingle(),
fInputFiles(0),
fPackages(0)
{
fAPIVersion(other.fAPIVersion),
fROOTVersion(other.fROOTVersion),
fAliROOTVersion(other.fAliROOTVersion),
+ fExternalPackages(other.fExternalPackages),
fUser(other.fUser),
fGridWorkingDir(other.fGridWorkingDir),
fGridDataDir(other.fGridDataDir),
fCloseSE(other.fCloseSE),
fFriendChainName(other.fFriendChainName),
fJobTag(other.fJobTag),
+ fOutputSingle(other.fOutputSingle),
fInputFiles(0),
fPackages(0)
{
fAPIVersion = other.fAPIVersion;
fROOTVersion = other.fROOTVersion;
fAliROOTVersion = other.fAliROOTVersion;
+ fExternalPackages = other.fExternalPackages;
fUser = other.fUser;
fGridWorkingDir = other.fGridWorkingDir;
fGridDataDir = other.fGridDataDir;
fCloseSE = other.fCloseSE;
fFriendChainName = other.fFriendChainName;
fJobTag = other.fJobTag;
+ fOutputSingle = other.fOutputSingle;
if (other.fInputFiles) {
fInputFiles = new TObjArray();
TIter next(other.fInputFiles);
if (!fInputFiles) fInputFiles = new TObjArray();
fInputFiles->Add(new TObjString(lfn));
}
-
+
+//______________________________________________________________________________
+void AliAnalysisAlien::AddExternalPackage(const char *package)
+{
+// Adds external packages w.r.t to the default ones (root,aliroot and gapi)
+ if (fExternalPackages) fExternalPackages += " ";
+ fExternalPackages += package;
+}
+
//______________________________________________________________________________
Bool_t AliAnalysisAlien::Connect()
{
fGridJDL->AddToPackages("ROOT", fROOTVersion);
if (fAPIVersion.Length())
fGridJDL->AddToPackages("APISCONFIG", fAPIVersion);
+ if (!fExternalPackages.IsNull()) {
+ arr = fExternalPackages.Tokenize(" ");
+ TIter next(arr);
+ while ((os=(TObjString*)next())) {
+ TString pkgname = os->GetString();
+ Int_t index = pkgname.Index("::");
+ TString pkgversion = pkgname(index+2, pkgname.Length());
+ pkgname.Remove(index);
+ fGridJDL->AddToPackages(pkgname, pkgversion);
+ }
+ delete arr;
+ }
fGridJDL->SetInputDataListFormat(fInputFormat);
fGridJDL->SetInputDataList("wn.xml");
fGridJDL->AddToInputSandbox(Form("LF:%s/%s", workdir.Data(), fAnalysisMacro.Data()));
}
// Copy jdl to grid workspace
if (copy) {
+ if (TestBit(AliAnalysisGrid::kSubmit)) {
+ Info("CreateJDL", "\n##### Copying JDL file <%s> to your AliEn output directory", fJDLName.Data());
+ TString locjdl = Form("%s/%s", fGridOutputDir.Data(),fJDLName.Data());
+ if (fProductionMode)
+ locjdl = Form("%s/%s", workdir.Data(),fJDLName.Data());
+ if (FileExists(locjdl)) gGrid->Rm(locjdl);
+ TFile::Cp(Form("file:%s",fJDLName.Data()), Form("alien://%s", locjdl.Data()));
+ }
if (fAdditionalLibs.Length()) {
arr = fAdditionalLibs.Tokenize(" ");
TObjString *os;
TIter next(fInputFiles);
while ((os=(TObjString*)next()))
fGridJDL->AddToInputDataCollection(Form("LF:%s,nodownload", os->GetString().Data()));
- fGridJDL->SetOutputDirectory(Form("%s/#alien_counter_03i#", fGridOutputDir.Data()));
+ if (!fOutputSingle.IsNull())
+ fGridJDL->SetOutputDirectory(Form("#alienfulldir#/%s",fOutputSingle.Data()));
+ else
+ fGridJDL->SetOutputDirectory(Form("%s/#alien_counter_03i#", fGridOutputDir.Data()));
} else {
// One jdl to be submitted with 2 input parameters: data collection name and output dir prefix
fGridJDL->AddToInputDataCollection(Form("LF:%s/$1,nodownload", workdir.Data()));
+ if (!fOutputSingle.IsNull())
+ fGridJDL->SetOutputDirectory(Form("#alienfulldir#/%s",fOutputSingle.Data()));
fGridJDL->SetOutputDirectory(Form("%s/$2/#alien_counter_03i#", fGridOutputDir.Data()));
}
index = sjdl.Index("Executable");
if (index >= 0) sjdl.Insert(index, "\n# This is the startup script\n");
index = sjdl.Index("Split ");
- if (index >= 0) sjdl.Insert(index, "\n# We split per storage element\n");
+ if (index >= 0) sjdl.Insert(index, "\n# We split per SE or file\n");
index = sjdl.Index("SplitMaxInputFileNumber");
if (index >= 0) sjdl.Insert(index, "\n# We want each subjob to get maximum this number of input files\n");
index = sjdl.Index("InputDataCollection");
out << " gSystem->Load(\"libGeom\");" << endl;
out << " gSystem->Load(\"libVMC\");" << endl;
out << " gSystem->Load(\"libPhysics\");" << endl << endl;
+ out << " gSystem->Load(\"libMinuit\");" << endl << endl;
out << "// Load analysis framework libraries" << endl;
if (!fPackages) {
out << " gSystem->Load(\"libSTEERBase\");" << endl;
virtual void AddRunNumber(Int_t run);
virtual void AddRunNumber(const char *run);
virtual void AddDataFile(const char *lfn);
+ virtual void AddExternalPackage(const char *name);
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 SetJDLName(const char *name="analysis.jdl") {fJDLName = name;}
virtual void SetPreferedSE(const char *se) {fCloseSE = se;}
virtual void SetProductionMode(Int_t mode=1) {fProductionMode = mode;}
+ virtual void SetOutputSingleFolder(const char *folder) {fOutputSingle = folder; fSplitMode="file"; fSplitMaxInputFileNumber=1;}
TGridJDL *GetGridJDL() {return fGridJDL;}
const char *GetGridOutputDir() const {return fGridOutputDir;}
TString fAPIVersion; // API version
TString fROOTVersion; // ROOT version
TString fAliROOTVersion; // AliROOT version
+ TString fExternalPackages; // External packages
TString fUser; // AliEn user name
TString fGridWorkingDir; // AliEn directory containing the input packages
TString fGridDataDir; // AliEn data production directory
TString fCloseSE; // Preffered storage element. Taken from alien_CLOSE_SE environment.
TString fFriendChainName; // File name to construct friend chain (for AOD)
TString fJobTag; // Job tag
+ TString fOutputSingle; // Directory name for the output when split is per file
TObjArray *fInputFiles; // List of input files to be processed by the job
TObjArray *fPackages; // List of packages to be used
- ClassDef(AliAnalysisAlien, 7) // Class providing some AliEn utilities
+ ClassDef(AliAnalysisAlien, 8) // Class providing some AliEn utilities
};
#endif