ATLAS Offline Software
DerivationTransformHelpers.py
Go to the documentation of this file.
1 """Main derivation transform configuration helpers
2 
3 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 """
5 
6 from PyJobTransforms.trfArgClasses import argFactory, argList, argNTUPFile, argPOOLFile, argSubstepBool
7 from PyJobTransforms.trfExe import athenaExecutor, reductionFrameworkExecutor
8 
10  """Add common derivation command-line parser arguments."""
11  parser.defineArgGroup('Derivation', 'Derivation Options')
12  parser.add_argument('--formats', nargs='+',
13  type=argFactory(argList),
14  help='List of required D(2)AOD formats',
15  group='Derivation')
16  parser.add_argument('--augmentations', nargs='*',
17  type=argFactory(argList),
18  help='List of augmentations CHILD:PARENT',
19  group='Derivation')
20  parser.add_argument('--inputAODFile', nargs='+',
21  type=argFactory(argPOOLFile, io='input'),
22  help='Input AOD for DAOD building',
23  group='Derivation')
24  parser.add_argument('--inputDAOD_PHYSFile', nargs='+',
25  type=argFactory(argPOOLFile, io='input'),
26  help='Input DAOD_PHYS for D2AOD building',
27  group='Derivation')
28  parser.add_argument('--inputEVNTFile', nargs='+',
29  type=argFactory(argPOOLFile, io='input'),
30  help='Input EVNT for DAOD_TRUTHX building',
31  group='Derivation')
32  parser.add_argument('--outputDAODFile', nargs='+',
33  type=argFactory(argPOOLFile, io='output'),
34  help='Output DAOD filename stub, DAOD_X will be prepended to it',
35  group='Derivation')
36  parser.add_argument('--outputD2AODFile', nargs='+',
37  type=argFactory(argPOOLFile, io='output'),
38  help='Output D2AOD filename stub, D2AOD_X will be prepended to it',
39  group='Derivation')
40  parser.add_argument('--passThrough',
41  type=argFactory(argSubstepBool, defaultSubstep = 'Derivation', runarg=True),
42  metavar='BOOL',
43  help='Disable all skimming and write every event',
44  group='Derivation')
45 
46 
48  """Add validation command-line parser arguments."""
49  parser.defineArgGroup('Physics Validation', 'Physics validation options')
50  parser.add_argument('--validationFlags', nargs='+',
51  type=argFactory(argList),
52  help='Physics validation histogram switches',
53  group='Physics Validation')
54  parser.add_argument('--inputDAOD_PHYSVALFile', nargs='+',
55  type=argFactory(argPOOLFile, io='input'),
56  help='Input DAOD_PHYSVAL for validation ntuples building',
57  group='Physics Validation')
58  parser.add_argument('--outputNTUP_PHYSVALFile',
59  type=argFactory(argNTUPFile, io='output'),
60  help='Output physics validation file',
61  group='Physics Validation')
62 
63 
64 def addDerivationSubstep(executor_set):
65  # We use the existing DF executor which inherits from the athenaExecutor.
66  # It handles the composite output filenames and inserts them into the transform's dataDictionary.
67  # If this isn't done the file validation will run over the wrong file name.
68  executor = reductionFrameworkExecutor(name='Derivation',
69  skeletonCA='DerivationFrameworkConfiguration.DerivationSkeleton',
70  substep='DerivationFramework',
71  tryDropAndReload=False,
72  perfMonFile='ntuple.pmon.gz',
73  inData=['EVNT', 'AOD', 'DAOD_PHYS'],
74  outData=['DAOD', 'D2AOD'])
75  executor_set.add(executor)
76 
77 
78 def addPhysicsValidationSubstep(executor_set):
79  executor = athenaExecutor(name='PhysicsValidation',
80  skeletonCA='DerivationFrameworkConfiguration.PhysicsValidationSkeleton',
81  substep='PhysicsValidation',
82  tryDropAndReload=False,
83  perfMonFile='ntuple.pmon.gz',
84  inData=['DAOD_PHYSVAL'],
85  outData=['NTUP_PHYSVAL'])
86  executor_set.add(executor)
python.DerivationTransformHelpers.addPhysicsValidationArguments
def addPhysicsValidationArguments(parser)
Definition: DerivationTransformHelpers.py:47
python.DerivationTransformHelpers.addDerivationArguments
def addDerivationArguments(parser)
Definition: DerivationTransformHelpers.py:9
PyJobTransforms.trfArgClasses
Transform argument class definitions.
python.DerivationTransformHelpers.addPhysicsValidationSubstep
def addPhysicsValidationSubstep(executor_set)
Definition: DerivationTransformHelpers.py:78
PyJobTransforms.trfExe
Transform execution functions.
python.DerivationTransformHelpers.addDerivationSubstep
def addDerivationSubstep(executor_set)
Definition: DerivationTransformHelpers.py:64