message: Treatment of env var as in lego train test
diff: @@ -18,14 +18,51 @@ AliAnalysisTaskSEVertexingHFRun3Conversion *AddTaskVertexingHFRun3Conversion(TSt
  return NULL;
  }
  + auto getProdData = [](int &runnumber, TString &collSys, TString &prodType, TString &prodTag)
  + {
  + // This works in the lego trains where the file env.sh is sourced
  + runnumber = -1;
  + if (gSystem->Getenv("ALIEN_JDL_LPMRUNNUMBER")) {
  + runnumber = atoi(gSystem->Getenv("ALIEN_JDL_LPMRUNNUMBER"));
  + collSys = gSystem->Getenv("ALIEN_JDL_LPMINTERACTIONTYPE");
  + prodType = gSystem->Getenv("ALIEN_JDL_LPMPRODUCTIONTYPE");
  + prodTag = gSystem->Getenv("ALIEN_JDL_LPMPRODUCTIONTAG");
  + return 0;
  + }
  + if (!gSystem->Getenv("CHILD_DATASETS")) {
  + ::Error("AddTaskVertexingHF","Environment variable CHILD_DATASETS not found. Cannot configure task.");
  + return 1;
  + }
  + int num_children = atoi(gSystem->Getenv("CHILD_DATASETS"));
  + char varname[50];
  + for (int i = 1; i <= num_children; ++i) {
  + // Check if child is active
  + sprintf(varname, "RUNNO_child_%d", i);
  + if (!gSystem->Getenv(varname)) continue;
  + sprintf(varname, "ALIEN_JDL_child_%d_LPMRUNNUMBER", i);
  + runnumber = atoi(gSystem->Getenv(varname));
  + sprintf(varname, "ALIEN_JDL_child_%d_LPMINTERACTIONTYPE", i);
  + collSys = gSystem->Getenv(varname);
  + sprintf(varname, "ALIEN_JDL_child_%d_LPMPRODUCTIONTYPE", i);
  + prodType = gSystem->Getenv(varname);
  + sprintf(varname, "ALIEN_JDL_child_%d_LPMPRODUCTIONTAG", i);
  + prodTag = gSystem->Getenv(varname);
  + return 0;
  + }
  + // No child is active -> error
  + ::Error("AddTaskVertexingHF","No child of this train seems to be active. Cannot configure task.");
  + return 1;
  + };
  +
  TString localdir=".";
  Int_t runnumber=-1;
  - if(gSystem->Getenv("LPMRunNumber")) runnumber = atoi(gSystem->Getenv("LPMRunNumber"));
  TString collSyst="";
  - if(gSystem->Getenv("LPMInteractionType")) collSyst=gSystem->Getenv("LPMInteractionType");
  TString prodType="";
  - if(gSystem->Getenv("LPMProductionType")) prodType=gSystem->Getenv("LPMProductionType");
  + TString prodTag="";
  + Int_t readEnv=getProdData(runnumber, collSyst, prodType, prodTag);
  + if(readEnv!=0) return NULL;
  + ::Info("AddTaskVertexingHF","Found: runno=%d collSys=%s prodType=%s prodTag=%s\n", runnumber, collSyst.Data(), prodType.Data(),prodTag.Data());
  // Copy the needed Config file in the current directory
  if(configfilename.IsNull()){
  if(collSyst.IsNull()){
  @@ -45,8 +82,6 @@ AliAnalysisTaskSEVertexingHFRun3Conversion *AddTaskVertexingHFRun3Conversion(TSt
  }
  if(runnumber>=295424)configPWG3d2h="$ALICE_PHYSICS/PWGHF/vertexingHF/ConfigVertexingHF_Pb_AllCent_NoLS_PIDLc_PtDepSel_LcMinpt1_DsMinPt15_2018opt.C";
  if (prodType=="MC"){
  - TString prodTag="";
  - if(gSystem->Getenv("LPMProductionTag")) prodTag=gSystem->Getenv("LPMProductionTag");
  if(prodTag.IsNull()){
  ::Error("AddTaskVertexingHF","LPMProductionTag (needed for MCs of Pb-Pb or Xe-Xe) not available and custom config not passed in the arguments");
  return NULL;
  