 |
ATLAS Offline Software
|
◆ fromRunArgs()
def TRTCalib_accu_Skeleton.fromRunArgs |
( |
|
runArgs | ) |
|
Definition at line 29 of file TRTCalib_accu_Skeleton.py.
35 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
43 if "TRTCalibAccu_ART_Output" in runArgs.outputTARFile:
44 print(
"WARNING - Testing the TRTCalib_accu transform")
46 print(
"INFO - Running TRTCalib_accu transform")
48 flags.Input.Files=runArgs.inputRAWFile
49 flags.Output.HISTFileName=runArgs.outputTARFile
61 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
64 from InDetConfig.TrackRecoConfig
import InDetTrackRecoCfg
73 with open(
"ConfigTRTCalib_accu.pkl",
"wb")
as f:
78 if not sc.isSuccess():
79 sys.exit(
not sc.isSuccess())
81 outputFile = runArgs.outputTARFile
83 nextstep(
"Generating the tracktuple and StrawStatus file")
86 os.rename(outputFile, outputFile+
'.basic.root')
87 command =
'TRTCalib_bhadd dumfile %s.basic.root' % (outputFile)
89 tryError(command,
"ERROR: Failed in process TRTCalib_bhadd\n")
92 nextstep(
"Renaming outputs from Athena and TRTCalib_bhadd")
95 command =
"mv -v tracktuple.root %s.tracktuple.root ; " % (outputFile)
96 command +=
"mv -v %s %s.straw.txt" % (glob.glob(
'TRT_StrawStatusOutput.*newFormat.txt')[0],outputFile)
98 tryError(command,
"ERROR: Failed in renaming\n")
106 files_list=glob.glob(outputFile+
".*")
108 tar = tarfile.open(outputFile,
"w:gz")
109 print(
"Compressing files in %s output file:" % outputFile)
110 for file
in files_list:
115 print(
"ERROR: Failed compressing the output files\n",e)
119 print(
"\nListing files:")
120 for file
in sorted(glob.glob(
"./*", recursive=
True)):
◆ nextstep()
def TRTCalib_accu_Skeleton.nextstep |
( |
|
text | ) |
|
◆ tryError()
def TRTCalib_accu_Skeleton.tryError |
( |
|
command, |
|
|
|
error |
|
) |
| |
Definition at line 17 of file TRTCalib_accu_Skeleton.py.
19 print(
" Running: %s\n" % (command))
20 stdout, stderr = subprocess.Popen(command, shell=
True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
21 print(
"OUTPUT: \n%s" % (stdout.decode(
'ascii')))
22 print(
"ERRORS: %s" % (
"NONE" if stderr.decode(
'ascii')==
'' else "\n"+stderr.decode(
'ascii')))
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
def tryError(command, error)
def ByteStreamReadCfg(flags, type_names=None)
def TRT_StrawStatusCfg(flags, name='InDet_TRT_StrawStatus', **kwargs)
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
def commonRunArgsToFlags(runArgs, configFlags)
void print(char *figname, TCanvas *c1)
def TRT_CalibrationMgrCfg(flags, name='TRT_CalibrationMgr', calibconstants='', Hittuple='', caltag='', **kwargs)
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.