From 191b95d7b5473fb55a3b946b1f9a0c804aee80f9 Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Date: Fri, 16 Feb 2024 18:35:33 +0100 Subject: [PATCH] Add some time buffer in case the epos intermediate file with the events was not present yet while initializing the AliGenReaderHepMC reader --- MC/GeneratorConfig.C | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/MC/GeneratorConfig.C b/MC/GeneratorConfig.C index c51b7876..640ac8df 100644 --- a/MC/GeneratorConfig.C +++ b/MC/GeneratorConfig.C @@ -1162,6 +1162,28 @@ GeneratorEPOSLHC(Bool_t pileup) fifoname.Data(), nEventsEpos, projectileId, projectileEnergy, targetId, targetEnergy,pileup)); + + // Wait till 10 seconds if the crmceventfifo(_pileup) file with hep data does not exist + // try 100 times, if not, let it continue + Bool_t ok = kFALSE; + Int_t niter = 0; + while ( !ok ) + { + if ( gSystem->AccessPathName(fifoname) ) + { + printf(" ... EPOS input file not found wait 10 seconds, iteration %d ... \n", niter); + gROOT->ProcessLine(".! sleep 10"); + niter++; + } + else + { + ok = kTRUE; + } + + // Avoid more iterations, if we really get to that + if ( niter > 99 ) ok = kTRUE; + } + // // connect HepMC reader AliGenReaderHepMC *reader = new AliGenReaderHepMC();