ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecJobTransforms
scripts
Reco_tf.py
Go to the documentation of this file.
1
#! /usr/bin/env python
2
3
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4
5
7
8
import
sys
9
import
time
10
11
# Setup core logging here
12
from
PyJobTransforms.trfLogger
import
msg
13
msg.info(
'logging set in %s'
, sys.argv[0])
14
15
from
PyJobTransforms.transform
import
transform
16
from
PyJobTransforms.trfArgs
import
addAthenaArguments, addDetectorArguments, addTriggerArguments
17
from
PyJobTransforms.trfDecorators
import
stdTrfExceptionHandler, sigUsrStackTrace
18
from
RecJobTransforms.recTransformUtils
import
addAllRecoArgs, addRecoSubsteps
19
20
ListOfDefaultPositionalKeys=[
'--AFPOn'
,
'--ALFAOn'
,
'--AMIConfig'
,
'--AMITag'
,
'--AddCaloDigi'
,
'--CA'
,
'--DBRelease'
,
'--DataRunNumber'
,
'--FwdRegionOn'
,
'--HGTDOn'
,
'--LucidOn'
,
'--PileUpPresampling'
,
'--ZDCOn'
,
'--argJSON'
,
'--asetup'
,
'--athena'
,
'--athenaMPEventsBeforeFork'
,
'--athenaMPMergeTargetSize'
,
'--athenaMPStrategy'
,
'--athenaMPUseEventOrders'
,
'--athenaopts'
,
'--attempt'
,
'--autoConfiguration'
,
'--beamType'
,
'--bunchSpacing'
,
'--checkEventCount'
,
'--command'
,
'--conditionsTag'
,
'--detectors'
,
'--digiRndmSvc'
,
'--digiSeedOffset1'
,
'--digiSeedOffset2'
,
'--digiSteeringConf'
,
'--doAllNoise'
,
'--dumpJSON'
,
'--dumpPickle'
,
'--env'
,
'--eventAcceptanceEfficiency'
,
'--eventService'
,
'--execOnly'
,
'--fileValidation'
,
'--geometryVersion'
,
'--ignoreErrors'
,
'--ignoreFiles'
,
'--ignorePatterns'
,
'--imf'
,
'--inputAODFile'
,
'--inputBSFile'
,
'--inputBeamGasHitsFile'
,
'--inputBeamHaloHitsFile'
,
'--inputCavernHitsFile'
,
'--inputDRAW_EMUFile'
,
'--inputDRAW_ZEEFile'
,
'--inputDRAW_ZMUMUFile'
,
'--inputESDFile'
,
'--inputEVNTFile'
,
'--inputFileValidation'
,
'--inputHITSFile'
,
'--inputHighPtMinbiasHitsFile'
,
'--inputLowPtMinbiasHitsFile'
,
'--inputNTUP_COMMONFile'
,
'--inputRDOFile'
,
'--outputRDO_PUFile'
,
'--inputRDO_BKGFile'
,
'--inputRDO_TRIGFile'
,
'--jobNumber'
,
'--jobid'
,
'--maxEvents'
,
'--multiprocess'
,
'--multithreaded'
,
'--numberOfBeamGas'
,
'--numberOfBeamHalo'
,
'--numberOfCavernBkg'
,
'--numberOfHighPtMinBias'
,
'--numberOfLowPtMinBias'
,
'--outputAODFile'
,
'--outputAOD_RPRFile'
,
'--outputAOD_SKIMFile'
,
'--outputDAOD_TLAFile'
,
'--outputDAOD_TLAFTAGPEBFile'
,
'--outputDAOD_TLADJETPEBFile'
,
'--outputDAOD_TLAEGAMPEBFile'
,
'--outputBSFile'
,
'--outputDAODFile'
,
'--outputDAOD_HSG2File'
,
'--outputDAOD_IDNCBFile'
,
'--outputDAOD_IDPIXLUMIFile'
,
'--outputDAOD_IDTIDEFile'
,
'--outputDAOD_IDTRKLUMIFile'
,
'--outputDAOD_IDTRKVALIDFile'
,
'--outputDAOD_L1CALO1File'
,
'--outputDAOD_L1CALO2File'
,
'--outputDAOD_L1CALO3File'
,
'--outputDAOD_L1CALO4File'
,
'--outputDAOD_L1CALO5File'
,
'--outputDAOD_PIXELVALIDFile'
,
'--outputDAOD_SCTVALIDFile'
,
'--outputDESDM_ALLCELLSFile'
,
'--outputDESDM_CALJETFile'
,
'--outputDESDM_EGAMMAFile'
,
'--outputDESDM_EOVERPFile'
,
'--outputDESDM_EXOTHIPFile'
,
'--outputDESDM_IDALIGNFile'
,
'--outputDESDM_MCPFile'
,
'--outputDESDM_PHOJETFile'
,
'--outputDESDM_SGLELFile'
,
'--outputDESDM_SLTTMUFile'
,
'--outputDESDM_TILEMUFile'
,
'--outputDESDM_ZMUMUFile'
,
'--outputDESD_DEDXFile'
,
'--outputDNTUPFile'
,
'--outputDRAW_BCID1File'
,
'--outputDRAW_BCID2File'
,
'--outputDRAW_BCID3File'
,
'--outputDRAW_BCID4File'
,
'--outputDRAW_EGJPSIFile'
,
'--outputDRAW_EGZFile'
,
'--outputDRAW_TAULHFile'
,
'--outputDRAW_JETFile'
,
'--outputDRAW_EMUFile'
,
'--outputDRAW_RPVLLFile'
,
'--outputDRAW_TAUMUHFile'
,
'--outputDRAW_TOPSLMUFile'
,
'--outputDRAW_ZMUMUFile'
,
'--outputESDFile'
,
'--outputFileValidation'
,
'--outputHEPMCFile'
,
'--outputHISTFile'
,
'--outputHIST_AODFile'
,
'--outputNTUP_ENHBIASFile'
,
'--outputNTUP_FASTMONFile'
,
'--outputNTUP_FastCaloSimFile'
,
'--outputNTUP_HECNOISEFile'
,
'--outputNTUP_HIGHMULTFile'
,
'--outputNTUP_LARNOISEFile'
,
'--outputNTUP_MCPScaleFile'
,
'--outputNTUP_MCPTPFile'
,
'--outputNTUP_MUONCALIBFile'
,
'--outputNTUP_PHYSVALFile'
,
'--outputNTUP_PILEUPFile'
,
'--outputNTUP_PROMPTPHOTFile'
,
'--outputNTUP_SCTFile'
,
'--outputNTUP_SUSYTRUTHFile'
,
'--outputNTUP_TRKVALIDFile'
,
'--outputNTUP_TRTFile'
,
'--outputNTUP_TRUTHFile'
,
'--outputNTUP_WZFile'
,
'--outputRDOFile'
,
'--outputRDO_FILTFile'
,
'--outputRDO_SGNLFile'
,
'--outputRDO_TRIGFile'
,
'--outputTXT_JIVEXMLTGZFile'
,
'--parallelFileValidation'
,
'--passThrough'
,
'--pileupFinalBunch'
,
'--pileupInitialBunch'
,
'--postExec'
,
'--postInclude'
,
'--preExec'
,
'--preInclude'
,
'--reductionConf'
,
'--reportName'
,
'--reportType'
,
'--runNumber'
,
'--samplingFractionDbTag'
,
'--sharedWriter'
,
'--showGraph'
,
'--showPath'
,
'--showSteps'
,
'--skipEvents'
,
'--steering'
,
'--taskid'
,
'--tcmalloc'
,
'--testPileUpConfig'
,
'--topOptions'
,
'--trigFilterList'
,
'--trigStream'
,
'--triggerConfig'
,
'--valgrind'
,
'--valgrindDefaultOpts'
,
'--valgrindExtraOpts'
,
'--valid'
,
'--validationFlags'
]
21
22
@stdTrfExceptionHandler
23
@sigUsrStackTrace
24
def
main
():
25
26
msg.info(
'This is %s'
, sys.argv[0])
27
28
trf =
getTransform
()
29
trf.parseCmdLineArgs(sys.argv[1:])
30
31
# Just add a note here that this is the place to insert extra checks or manipulations
32
# after the arguments are known, but before the transform tries to trace the graph
33
# path or actually execute (e.g., one can add some steering based on defined arguments)
34
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
41
42
def
getTransform
():
43
executorSet =
set
()
44
addRecoSubsteps(executorSet)
45
46
trf = transform(executor = executorSet, description =
'General purpose ATLAS digitisation and reconstruction transform'
47
' Inputs can be HITS, RDO, BS, ESD or AOD, with outputs of RDO, ESD, AOD or DAODs.'
48
' See https://twiki.cern.ch/twiki/bin/view/AtlasComputing/RecoTf for more details.'
)
49
50
addAthenaArguments(trf.parser)
51
addDetectorArguments(trf.parser)
52
addTriggerArguments(trf.parser)
53
addAllRecoArgs(trf)
54
55
# For digi step - make sure we can add the digitisation/simulation arguments
56
# before we add this substep; allows Reco_tf to work without AtlasSimulation
57
try
:
58
from
SimuJobTransforms.simTrfArgs
import
addForwardDetTrfArgs, addPileUpTrfArgs, addCommonSimDigTrfArgs
59
from
SimuJobTransforms.SimTransformUtils
import
addDigitizationSubstep
60
# NB "Basic Digi Args" are added by the overlay setup below, so no need for addBasicDigiArgs here
61
addForwardDetTrfArgs(trf.parser)
62
addPileUpTrfArgs(trf.parser)
63
addCommonSimDigTrfArgs(trf.parser)
64
simStepSet =
set
()
65
addDigitizationSubstep(simStepSet, in_reco_chain=
True
)
66
trf.appendToExecutorSet(list(simStepSet)[0])
67
except
ImportError
as
e:
68
msg.warning(
'Failed to import digitisation arguments ({0}). Digitisation substep will not be available.'
.format(e))
69
70
# Add HEPMC conversion as an optional step
71
from
PyJobTransforms.trfExe
import
athenaExecutor
72
execHEPMC =
set
()
73
execHEPMC.add( athenaExecutor(name =
'POOLtoHEPMC'
, skeletonCA =
'EvgenJobTransforms.POOLtoHEPMC_Skeleton'
,
74
substep =
"p2h"
, perfMonFile =
'ntuple.pmon.gz'
, inData=[
'HITS'
,
'RDO'
], outData=[
'HEPMC'
]) )
75
trf.appendToExecutorSet( execHEPMC )
76
77
# Again, protect core functionality from too tight a dependence on EventOverlay
78
try
:
79
from
OverlayConfiguration.OverlayTransformHelpers
import
addOverlayArguments, appendOverlaySubstep
80
addOverlayArguments(trf.parser, in_reco_chain=
True
)
81
appendOverlaySubstep(trf, in_reco_chain=
True
)
82
except
ImportError
as
e:
83
msg.warning(
'Failed to import overlay arguments ({0}). Overlay substep will not be available.'
.format(e))
84
85
return
trf
86
87
88
if
__name__ ==
'__main__'
:
89
main
()
set
STL class.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.trfLogger
Logging configuration for ATLAS job transforms.
Reco_tf.main
main()
Definition
Reco_tf.py:24
Reco_tf.getTransform
getTransform()
Definition
Reco_tf.py:42
Generated on
for ATLAS Offline Software by
1.17.0