Skip to content

Commit

Permalink
Add some time buffer in case the epos intermediate file with the even…
Browse files Browse the repository at this point in the history
…ts was not present yet while initializing the AliGenReaderHepMC reader
  • Loading branch information
gconesab committed Feb 16, 2024
1 parent dee0ed9 commit 191b95d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions MC/GeneratorConfig.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 191b95d

Please sign in to comment.