ATLAS Offline Software
FastChain_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 # FastChain_tf.py
6 # One step transform to run SIM+DIGI as one job, then reco
7 # to ESD/AOD output
8 # Richard Hawkings, adapted from FullChain_tf.py by Graeme Stewart
9 
10 import sys
11 import time
12 
13 # Setup core logging here
14 from PyJobTransforms.trfLogger import msg
15 msg.info('logging set in %s', sys.argv[0])
16 
17 from PyJobTransforms.transform import transform
18 from PyJobTransforms.trfExe import athenaExecutor
19 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments, addTriggerArguments
20 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
21 from RecJobTransforms.recTransformUtils import addRecoSubsteps, addAllRecoArgs
22 from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addBasicDigiArgs, addCommonSimDigTrfArgs, addTrackRecordArgs, addSim_tfArgs, addSimIOTrfArgs, addPileUpTrfArgs
23 from DerivationFrameworkConfiguration.DerivationTransformHelpers import addDerivationArguments, addDerivationSubstep, addPhysicsValidationArguments, addPhysicsValidationSubstep
24 
25 from PyJobTransforms.trfArgClasses import argFactory, argList, argRDOFile
26 
27 @stdTrfExceptionHandler
28 @sigUsrStackTrace
29 def main():
30 
31  msg.info('This is %s', sys.argv[0])
32 
33  trf = getTransform()
34  trf.parseCmdLineArgs(sys.argv[1:])
35  trf.execute()
36  trf.generateReport()
37 
38  msg.info("%s stopped at %s, trf exit code %d", sys.argv[0], time.asctime(), trf.exitCode)
39  sys.exit(trf.exitCode)
40 
42  executorSet = set()
43 
44  addRecoSubsteps(executorSet)
45 
46  executorSet.add(athenaExecutor(name = 'EVNTtoRDO',
47  skeletonCA = 'FullChainTransforms.FastChainSkeleton',
48  substep = 'simdigi', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz',
49  inData=['NULL','EVNT', 'RDO_BKG', 'BS_SKIM'],
50  outData=['RDO', 'HITS', 'NULL'] ))
51 
52  # Derivation
53  addDerivationSubstep(executorSet)
54  addPhysicsValidationSubstep(executorSet)
55 
56  trf = transform(executor = executorSet, description = 'Fast chain ATLAS transform with ISF simulation, digitisation'
57  ' and reconstruction. Inputs can be EVNT, with outputs of RDO, ESD, AOD or DPDs.'
58  ' See https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/FastChainTf for more details.')
59 
60  # Common arguments
61  addAthenaArguments(trf.parser)
62  addDetectorArguments(trf.parser)
63  addTriggerArguments(trf.parser)
64 
65  # Reconstruction arguments and outputs (use the factorised 'do it all' function)
66  addAllRecoArgs(trf)
67 
68  # Simulation and digitisation options
69  addCommonSimTrfArgs(trf.parser)
70  addCommonSimDigTrfArgs(trf.parser)
71  addBasicDigiArgs(trf.parser)
72  addSim_tfArgs(trf.parser)
73  addSimIOTrfArgs(trf.parser)
74  # addForwardDetTrfArgs(trf.parser)
75  addPileUpTrfArgs(trf.parser)
76  addTrackRecordArgs(trf.parser)
77  addFastChainTrfArgs(trf.parser)
78 
79  # Overlay arguments
80  from OverlayConfiguration.OverlayTransformHelpers import addOverlayArguments
81  addOverlayArguments(trf.parser)
82 
83  # Derivation agruments
84  addDerivationArguments(trf.parser)
86 
87  return trf
88 
89 def addFastChainTrfArgs(parser):
90  "Add transformation arguments for fast chain"
91  parser.defineArgGroup('FastChain','Fast chain options')
92  parser.add_argument('--preSimExec',type=argFactory(argList),nargs='+',
93  help='preExec before simulation step',
94  group='FastChain')
95  parser.add_argument('--postSimExec',type=argFactory(argList),nargs='+',
96  help='postExec after simulation step',
97  group='FastChain')
98  parser.add_argument('--preDigiExec',type=argFactory(argList),nargs='+',
99  help='preExec before digitisation step',
100  group='FastChain')
101  parser.add_argument('--preSimInclude',type=argFactory(argList),nargs='+',
102  help='preInclude before simulation step',
103  group='FastChain')
104  parser.add_argument('--postSimInclude',type=argFactory(argList),nargs='+',
105  help='postInclude after simulation step',
106  group='FastChain')
107  parser.add_argument('--preDigiInclude',type=argFactory(argList),nargs='+',
108  help='preInclude before digitisation step',
109  group='FastChain')
110  parser.defineArgGroup('MCOverlay', 'MC Overlay Options')
111  parser.add_argument('--inputRDO_BKGFile', nargs='+',
112  type=argFactory(argRDOFile, io='input'),
113  help='Input background RDO for MC+MC overlay',
114  group='MCOverlay')
115 
116 
117 if __name__ == '__main__':
118  main()
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
python.trfArgs.addTriggerArguments
def addTriggerArguments(parser, addTrigFilter=True)
Add trigger related arguments.
Definition: trfArgs.py:515
python.simTrfArgs.addCommonSimTrfArgs
def addCommonSimTrfArgs(parser)
Add common Simulation transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:181
python.DerivationTransformHelpers.addPhysicsValidationArguments
def addPhysicsValidationArguments(parser)
Definition: DerivationTransformHelpers.py:47
python.simTrfArgs.addCommonSimDigTrfArgs
def addCommonSimDigTrfArgs(parser)
Add common Simulation/Digitization transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:196
python.simTrfArgs.addSim_tfArgs
def addSim_tfArgs(parser)
Add arguments used only by ISF-based simulation jobs.
Definition: simTrfArgs.py:146
python.DerivationTransformHelpers.addDerivationArguments
def addDerivationArguments(parser)
Definition: DerivationTransformHelpers.py:9
FastChain_tf.addFastChainTrfArgs
def addFastChainTrfArgs(parser)
Definition: FastChain_tf.py:89
PyJobTransforms.trfArgClasses
Transform argument class definitions.
python.recTransformUtils.addRecoSubsteps
def addRecoSubsteps(executorSet)
Add reconstruction substeps to a set object.
Definition: recTransformUtils.py:96
FastChain_tf.main
def main()
Definition: FastChain_tf.py:29
python.OverlayTransformHelpers.addOverlayArguments
def addOverlayArguments(parser, in_reco_chain=False)
Definition: OverlayTransformHelpers.py:63
python.DerivationTransformHelpers.addPhysicsValidationSubstep
def addPhysicsValidationSubstep(executor_set)
Definition: DerivationTransformHelpers.py:78
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
python.simTrfArgs.addBasicDigiArgs
def addBasicDigiArgs(parser)
Add Basic digitization arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:35
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
python.simTrfArgs.addSimIOTrfArgs
def addSimIOTrfArgs(parser)
Add common Simulation transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:169
FastChain_tf.getTransform
def getTransform()
Definition: FastChain_tf.py:41
PyJobTransforms.trfExe
Transform execution functions.
python.recTransformUtils.addAllRecoArgs
def addAllRecoArgs(trf)
The standard suite of reconstruction specific arguments.
Definition: recTransformUtils.py:127
python.DerivationTransformHelpers.addDerivationSubstep
def addDerivationSubstep(executor_set)
Definition: DerivationTransformHelpers.py:64
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
python.simTrfArgs.addPileUpTrfArgs
def addPileUpTrfArgs(parser)
Add Pile-up related transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:73
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
python.simTrfArgs.addTrackRecordArgs
def addTrackRecordArgs(parser)
Add arguments used by simulation jobs which may read in or write out TrackRecord files.
Definition: simTrfArgs.py:132