|
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
58 flags = flags.cloneAndReplace(
59 "Tracking.ActiveConfig",
60 f
"Tracking.{flags.Tracking.PrimaryPassConfig.value}Pass",
70 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
73 from InDetConfig.TrackRecoConfig
import InDetTrackRecoCfg
82 with open(
"ConfigTRTCalib_accu.pkl",
"wb")
as f:
87 if not sc.isSuccess():
88 sys.exit(
not sc.isSuccess())
90 outputFile = runArgs.outputTARFile
92 nextstep(
"Generating the tracktuple and StrawStatus file")
95 os.rename(outputFile, outputFile+
'.basic.root')
96 command =
'TRTCalib_bhadd dumfile %s.basic.root' % (outputFile)
98 tryError(command,
"ERROR: Failed in process TRTCalib_bhadd\n")
101 nextstep(
"Renaming outputs from Athena and TRTCalib_bhadd")
104 command =
"mv -v tracktuple.root %s.tracktuple.root ; " % (outputFile)
105 command +=
"mv -v %s %s.straw.txt" % (glob.glob(
'TRT_StrawStatusOutput.*newFormat.txt')[0],outputFile)
107 tryError(command,
"ERROR: Failed in renaming\n")
115 files_list=glob.glob(outputFile+
".*")
117 tar = tarfile.open(outputFile,
"w:gz")
118 print(
"Compressing files in %s output file:" % outputFile)
119 for file
in files_list:
124 print(
"ERROR: Failed compressing the output files\n",e)
128 print(
"\nListing files:")
129 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')))
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)
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
void print(char *figname, TCanvas *c1)
def TRT_CalibrationMgrCfg(flags, name='TRT_CalibrationMgr', calibconstants='', Hittuple='', caltag='', **kwargs)
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.