ATLAS Offline Software
TRTCalib_accu_tf.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 
5 __doc__ = """JobTransform to run TRT R-t Calibration jobs"""
6 
7 
8 import sys, os, glob, subprocess, tarfile, json
9 from PyJobTransforms.transform import transform
10 from PyJobTransforms.trfExe import athenaExecutor
11 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
12 import PyJobTransforms.trfArgClasses as trfArgClasses
13 from AthenaConfiguration.TestDefaults import defaultTestFiles
14 
15 if __name__ == '__main__':
16 
17  executorSet = set()
18  executorSet.add(athenaExecutor(name = 'TRTCalibAccu',
19  skeletonCA='TRT_CalibAlgs.TRTCalib_accu_Skeleton', inData = ['RAW'], outData = ['TAR']))
20 
21  trf = transform(executor = executorSet)
22  addAthenaArguments(trf.parser)
23  addDetectorArguments(trf.parser)
24 
25  # Use arggroup to get these arguments in their own sub-section (of --help)
26  trf.parser.defineArgGroup('TRTCalib_tf', 'TRT r-t calibration transform')
27 
28  # Input file! Always must be RAW data
29  trf.parser.add_argument('--inputRAWFile', nargs='+',
30  type=trfArgClasses.argFactory(trfArgClasses.argBSFile, io='input'),
31  help='Input bytestream file name. RAW data', default=trfArgClasses.argBSFile(defaultTestFiles.RAW_RUN3), group='TRTCalib_tf')
32 
33  # OutputFile name
34  trf.parser.add_argument('--outputTARFile',
35  type=trfArgClasses.argFactory(trfArgClasses.argBZ2File, io='output'),
36  help='Output TRT calib file name.', group='TRTCalib_tf')
37 
38  trf.parser.add_argument('--calibconstants', type=trfArgClasses.argFactory(trfArgClasses.argString),
39  help='Calibration constants file.',default=trfArgClasses.argString('') ,group='TRTCalib_tf')
40 
41  trf.parseCmdLineArgs(sys.argv[1:])
42 
43  trf.execute()
44  trf.generateReport()
45  if trf.exitCode != 0:
46  sys.exit(trf.exitCode)
python.trfArgs.addDetectorArguments
def addDetectorArguments(parser)
Options related to the setup of the ATLAS detector (used in simulation and digitisation as well as re...
Definition: trfArgs.py:229
PyJobTransforms.trfArgClasses
Transform argument class definitions.
python.trfArgs.addAthenaArguments
def addAthenaArguments(parser, maxEventsDefaultSubstep='first', addValgrind=True, addPerfMon=True, addVTune=True)
Options related to running athena in general TODO: Some way to mask certain options (perExec,...
Definition: trfArgs.py:59
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.