ATLAS Offline Software
Functions
GetTfCommand Namespace Reference

Functions

def main ()
 

Function Documentation

◆ main()

def GetTfCommand.main ( )

Definition at line 17 of file GetTfCommand.py.

17 def main():
18  parser = argparse.ArgumentParser(argument_default = argparse.SUPPRESS, description = 'GetTfCommand.py - prints the job transform commands accociated with an AMI tag.')
19  parser.add_argument('--AMI', '--AMIConfig', help = 'Production tag to be interpreted', required = True)
20  parser.add_argument('--verbose', '--debug', action = 'store_true', help = 'set logging level to DEBUG')
21  parser.add_argument('--doNotSuppressNonJobOptions', action = 'store_true', help = 'get full output from AMI')
22  parser.add_argument('--printOnlyCmdLine', action = 'store_true', help = 'simply put out the TRF command line, nothing else')
23 
24  args = vars(parser.parse_args(sys.argv[1:]))
25 
26  if 'verbose' in args:
27  msg.setLevel(stdLogLevels['DEBUG'])
28 
29  suppressNonJobOptions = True
30  if 'doNotSuppressNonJobOptions' in args:
31  suppressNonJobOptions = False
32 
33  try:
34  tag = TagInfo(args['AMI'], suppressNonJobOptions)
35  except TransformAMIException as e:
36  print('An AMI exception was raised when trying to resolve the tag {0}.'.format(args['AMI']))
37  print('Exception message was: {0}'.format(e.errMsg))
38  print('Note that you need both suitable credentials to access AMI and access to the panda database (only works from inside CERN) for GetTfCommand.py to work.')
39  sys.exit(1)
40 
41  if 'printOnlyCmdLine' not in args:
42  print(tag)
43 
44  if 'argdict' in args:
45  tag.dump(args['argdict'])
46  else:
47  # only print the command line, allows stuff like
48  # pathena --trf "`GetTfCommand --AMI q1234 --printOnlyCmdLine` --inputFile bla.input --maxEvents 42"
49  trfCmdLine = tag.trfs[0].name + " " + tag.trfs[0]._argsToString(tag.trfs[0].physics)
50  print(trfCmdLine.replace('"', '\\' + '"'))
51 
52 
vtune_athena.format
format
Definition: vtune_athena.py:14
TagInfo
This class contains the list of currently valid tags for detector description - GeoModel and IOV/Cond...
Definition: TagInfo.h:41
GetTfCommand.main
def main()
Definition: GetTfCommand.py:17
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25