Skip to content
Snippets Groups Projects
Commit 8ec04b1a authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'tetst' into 'main'

EvgenJobTransforms: demand the correct extenssion of the HEPMC tarred file

See merge request !77897
parents aa040c78 92d5eff5
No related branches found
No related tags found
7 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77897EvgenJobTransforms: demand the correct extenssion of the HEPMC tarred file,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method
......@@ -3,6 +3,7 @@
# For the exit code at the end
import sys
import re
# For translating the run arguments into flags
from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
......@@ -39,10 +40,13 @@ def fromRunArgs(runArgs):
flags.Input.Files = runArgs.inputEVNTFile
else:
log.error('Input EVNT file required for EVNTtoHEPMC')
# Set the output file
if hasattr(runArgs, 'outputHEPMCFile'):
my_output_HepMCFile = 'tmp_'+runArgs.outputHEPMCFile
if ('.tar' in runArgs.outputHEPMCFile):
index = re.search(".tar",runArgs.outputHEPMCFile).span()[0]
my_output_HepMCFile = runArgs.outputHEPMCFile[:index]
else:
log.error('Output should be a tar.gz file but it is '+runArgs.outputHEPMCFile)
else:
log.error('OutputHEPMCFile required for EVNTtoHEPMC')
......@@ -90,7 +94,7 @@ def fromRunArgs(runArgs):
# Compress the output file
log.info('Compressing HEPMC output (may take a moment)')
import tarfile
with tarfile.open(my_output_HepMCFile[4:],'w:gz') as out_tar:
with tarfile.open(runArgs.outputHEPMCFile,'w:gz') as out_tar:
out_tar.add( my_output_HepMCFile )
# And remove the uncompressed version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment