#include "AliAnalysisDataContainer.h"
#include "AliMultiInputEventHandler.h"
+using std::ofstream;
+using std::ifstream;
+using std::ios;
+using std::endl;
ClassImp(AliAnalysisAlien)
#if 0
;
TString lib;
for (Int_t i=0; i<nlibs; i++) {
lib = mod->GetLibrary(i);
- if (fAdditionalLibs.Contains(lib)) continue;
lib = Form("lib%s.so", lib.Data());
+ if (fAdditionalLibs.Contains(lib)) continue;
if (!fAdditionalLibs.IsNull()) fAdditionalLibs += " ";
fAdditionalLibs += lib;
}
}
}
if (fOutputArchive.Length()) {
- arr = fOutputArchive.Tokenize(" ");
+ TString outputArchive = fOutputArchive;
+ if (!fRegisterExcludes.IsNull()) {
+ arr = fRegisterExcludes.Tokenize(" ");
+ TIter next1(arr);
+ while ((os=(TObjString*)next1())) {
+ outputArchive.ReplaceAll(Form("%s,",os->GetString().Data()),"");
+ outputArchive.ReplaceAll(os->GetString(),"");
+ }
+ delete arr;
+ }
+ arr = outputArchive.Tokenize(" ");
TIter next(arr);
Bool_t first = kTRUE;
const char *comment = "Files to be archived";
}
delete arr;
// Output archive for the merging jdl
- TString outputArchive;
if (TestBit(AliAnalysisGrid::kDefaultOutputs)) {
outputArchive = "log_archive.zip:std*@disk=1 ";
// Add normal output files, extra files + terminate files
chain->Add(esdFile);
file->Close();
if (!fFriendChainName.IsNull()) {
- if (esdFile.Index("#") > -1)
- esdFile.Remove(esdFile.Index("#"));
- esdFile = gSystem->DirName(esdFile);
- esdFile += "/" + fFriendChainName;
-
+ if (esdFile.Index("#") > -1)
+ esdFile.Remove(esdFile.Index("#"));
+ esdFile = gSystem->DirName(esdFile);
+ esdFile += "/" + fFriendChainName;
file = TFile::Open(esdFile);
if (file && !file->IsZombie()) {
file->Close();
Fatal("GetChainForTestMode", "Cannot open friend file: %s", esdFile.Data());
return 0;
}
- }
+ }
} else {
Error("GetChainforTestMode", "Skipping un-openable file: %s", esdFile.Data());
}
out << " TStopwatch timer;" << endl;
out << " timer.Start();" << endl << endl;
// Change temp directory to current one
+ if (!IsLocalTest()) {
+ out << "// connect to AliEn and make the chain" << endl;
+ out << " if (!TGrid::Connect(\"alien://\")) return;" << endl;
+ }
out << "// Set temporary merging directory to current one" << endl;
out << " gSystem->Setenv(\"TMPDIR\", gSystem->pwd());" << endl << endl;
out << "// Set temporary compilation directory to current one" << endl;
out << " gEnv->SetValue(\"XNet.ReconnectTimeout\",50);" << endl;
out << " gEnv->SetValue(\"XNet.FirstConnectMaxCnt\",1);" << endl << endl;
}
- if (!IsLocalTest()) {
- out << "// connect to AliEn and make the chain" << endl;
- out << " if (!TGrid::Connect(\"alien://\")) return;" << endl;
- }
out << "// read the analysis manager from file" << endl;
TString analysisFile = fExecutable;
analysisFile.ReplaceAll(".sh", ".root");
else
out << " plugin->SetFileForTestMode(\"" << fFileForTestMode << "\");" << endl;
out << " plugin->SetNtestFiles(" << fNtestFiles << ");" << endl;
+ if (!fFriendChainName.IsNull())
+ out << " plugin->SetFriendChainName(\"" << fFriendChainName << "\");" << endl;
out << " mgr->SetGridHandler(plugin);" << endl;
if (AliAnalysisManager::GetAnalysisManager()) {
out << " mgr->SetDebugLevel(" << AliAnalysisManager::GetAnalysisManager()->GetDebugLevel() << ");" << endl;
out << " chain->Add(filename);" << endl;
if(fFriendChainName!="") {
out << " TString fileFriend=coll->GetTURL(\"\");" << endl;
- out << " fileFriend.ReplaceAll(\"AliAOD.root\",\""<<fFriendChainName.Data()<<"\");" << endl;
- out << " fileFriend.ReplaceAll(\"AliAODs.root\",\""<<fFriendChainName.Data()<<"\");" << endl;
- out << " chainFriend->Add(fileFriend.Data());" << endl;
+ out << " if (fileFriend.Index(\"#\") > -1) fileFriend.Remove(fileFriend.Index(\"#\"));" << endl;
+ out << " fileFriend = gSystem->DirName(fileFriend);" << endl;
+ out << " fileFriend += \"/\";" << endl;
+ out << " fileFriend += \"" << fFriendChainName << "\";";
+ out << " TFile *file = TFile::Open(fileFriend);" << endl;
+ out << " if (file) {" << endl;
+ out << " file->Close();" << endl;
+ out << " chainFriend->Add(fileFriend.Data());" << endl;
+ out << " } else {" << endl;
+ out << " ::Fatal(\"CreateChain\", \"Cannot open friend file: %s\", fileFriend.Data());" << endl;
+ out << " return 0;" << endl;
+ out << " }" << endl;
}
out << " }" << endl;
out << " if (!chain->GetNtrees()) {" << endl;
out << " gEnv->SetValue(\"XNet.FirstConnectMaxCnt\",1);" << endl << endl;
}
// Change temp directory to current one
+ out << "// Connect to AliEn" << endl;
+ out << " if (!TGrid::Connect(\"alien://\")) return;" << endl;
out << "// Set temporary merging directory to current one" << endl;
out << " gSystem->Setenv(\"TMPDIR\", gSystem->pwd());" << endl << endl;
out << "// Set temporary compilation directory to current one" << endl;
out << " gSystem->SetBuildDir(gSystem->pwd(), kTRUE);" << endl << endl;
- out << "// Connect to AliEn" << endl;
- out << " if (!TGrid::Connect(\"alien://\")) return;" << endl;
out << " TString outputDir = dir;" << endl;
out << " TString outputFiles = \"" << GetListOfFiles("out") << "\";" << endl;
out << " TString mergeExcludes = \"" << fMergeExcludes << " " << fRegisterExcludes << "\";" << endl;