diff --git a/Generators/src/GeneratorHybrid.cxx b/Generators/src/GeneratorHybrid.cxx index 2741d874b1681..fdca64beeb701 100644 --- a/Generators/src/GeneratorHybrid.cxx +++ b/Generators/src/GeneratorHybrid.cxx @@ -17,6 +17,7 @@ #include #include #include +#include "TGrid.h" namespace o2 { @@ -37,7 +38,26 @@ GeneratorHybrid::GeneratorHybrid(const std::string& inputgens) setMomentumUnit(1.); setEnergyUnit(1.); - if (!parseJSON(inputgens)) { + // Pull file from alien for dynamic configuration if needed + bool isAlien = false; + if (inputgens.starts_with("alien://")) { + if (!gGrid) { + TGrid::Connect("alien://"); + if (!gGrid) { + LOG(fatal) << "AliEn connection failed, check token."; + exit(1); + } + } + TString aliencp = Form("alien_cp %s file:./%s", + inputgens.c_str(), "hybridAlien.json"); + if (gSystem->Exec(aliencp.Data()) != 0) { + LOG(fatal) << "Error: Issues in fetching file" << inputgens; + exit(1); + } + isAlien = true; + } + + if (!parseJSON(isAlien ? "hybridAlien.json" : inputgens)) { LOG(fatal) << "Failed to parse JSON configuration from input generators"; exit(1); }