ATLAS Offline Software
SimTransformUtils.py
Go to the documentation of this file.
1 from __future__ import division
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 
5 
6 import logging
7 msg = logging.getLogger(__name__)
8 
9 from PyJobTransforms.trfExe import athenaExecutor
10 
11 
13  from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addCommonSimDigTrfArgs
15  addForwardDetTrfArgs(parser)
16 
18  from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addSimIOTrfArgs, addCosmicsTrfArgs, addTrackRecordArgs
19  addSimIOTrfArgs(parser)
20  addCommonSimTrfArgs(parser)
21  addCosmicsTrfArgs(parser)
22  addTrackRecordArgs(parser)
23 
26  from SimuJobTransforms.simTrfArgs import addSim_tfArgs
27  addSim_tfArgs(parser)
28 
30  from SimuJobTransforms.simTrfArgs import addBasicDigiArgs, addPileUpTrfArgs
31  addBasicDigiArgs(parser)
32  addPileUpTrfArgs(parser)
33 
35  from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addCosmicsTrfArgs, addTrackRecordArgs, addSim_tfArgs, addReSimulationArgs
36  addCommonSimTrfArgs(parser)
37  addCosmicsTrfArgs(parser)
38  addTrackRecordArgs(parser)
40  addSim_tfArgs(parser)
41  addReSimulationArgs(parser)
42 
46 
47 def addAtlasG4Arguments(parser):
50 
52  from SimuJobTransforms.simTrfArgs import addHITSMergeArgs
53  addHITSMergeArgs(parser)
54 
58 
60  from SimuJobTransforms.simTrfArgs import addHITSValidArgs, addCommonSimDigTrfArgs
61  addHITSValidArgs(parser)
63 
65  from SimuJobTransforms.simTrfArgs import addRDOValidArgs, addCommonSimDigTrfArgs
66  addRDOValidArgs(parser)
68 
69 
72 def addSimulationSubstep(executorSet, overlayTransform = False):
73  TRExe = athenaExecutor(name = 'TRtoHITS',
74  skeletonCA = 'SimuJobTransforms.ISF_Skeleton',
75  substep = 'simTRIn', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz',
76  inData=['EVNT_TR'],
77  outData=['HITS','NULL'] )
78  executorSet.add(TRExe)
79  SimExe = athenaExecutor(name = 'EVNTtoHITS',
80  skeletonCA = 'SimuJobTransforms.ISF_Skeleton',
81  substep = 'sim', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz',
82  inData=['NULL','EVNT'],
83  outData=['EVNT_TR','HITS','NULL'] )
84  if overlayTransform:
85  from PyJobTransforms.trfUtils import releaseIsOlderThan
86  if releaseIsOlderThan(20,3):
87  SimExe.inData = [('EVNT', 'BS_SKIM')]
88  else:
89  SimExe.inData = [('EVNT','TXT_EVENTID')]
90  SimExe.outData = ['HITS']
91  SimExe.inputDataTypeCountCheck = ['EVNT']
92  executorSet.add(SimExe)
93 
94 
95 def addReSimulationSubstep(executorSet):
96  SimExe = athenaExecutor(name = 'ReSim',
97  skeletonCA = 'SimuJobTransforms.ReSimulation_Skeleton',
98  substep = 'rsm',
99  tryDropAndReload = False,
100  perfMonFile = 'ntuple.pmon.gz',
101  inData=['HITS'],
102  outData=['HITS_RSM'],
103  inputDataTypeCountCheck = ['HITS'] )
104  executorSet.add(SimExe)
105 
106 
107 def addAtlasG4Substep(executorSet):
108  executorSet.add(athenaExecutor(name = 'AtlasG4TfTRIn',
109  skeletonCA = 'SimuJobTransforms.G4AtlasAlg_Skeleton',
110  substep = 'simTRIn', tryDropAndReload = False,
111  inData=['EVNT_TR'],
112  outData=['HITS','NULL'] ))
113  executorSet.add(athenaExecutor(name = 'AtlasG4Tf',
114  skeletonCA = 'SimuJobTransforms.G4AtlasAlg_Skeleton',
115  substep = 'sim', tryDropAndReload = False,
116  inData=['NULL','EVNT'],
117  outData=['EVNT_TR','HITS','NULL'] ))
118 
119 
120 def addConfigurableSimSubstep(executorSet, confName, extraSkeleton, confSubStep, confInData, confOutData, confExtraRunargs, confRuntimeRunargs):
121  executorSet.add(athenaExecutor(name = confName, skeletonFile = extraSkeleton + ['SimuJobTransforms/skeleton.EVGENtoHIT_MC12.py'],
122  substep = confSubStep, tryDropAndReload = False,
123  inData = confInData,
124  outData = confOutData, extraRunargs = confExtraRunargs, runtimeRunargs = confRuntimeRunargs ))
125 
126 
128  executorSet.add(athenaExecutor(name = 'HITSMerge', substep="hitsmerge",
129  skeletonCA = 'SimuJobTransforms.HITSMerge_Skeleton',
130  tryDropAndReload = False, inputDataTypeCountCheck = ['HITS']))
131 
132 
133 def addDigitizationSubstep(executorSet, in_reco_chain=False):
134  executorSet.add(athenaExecutor(name = 'HITtoRDO',
135  skeletonCA='SimuJobTransforms.HITtoRDO_Skeleton',
136  substep = 'h2r', tryDropAndReload = False,
137  inData = ['HITS'], outData = ['RDO','RDO_FILT'],
138  onlyMPWithRunargs = [
139  'inputLowPtMinbiasHitsFile',
140  'inputHighPtMinbiasHitsFile',
141  'inputCavernHitsFile',
142  'inputBeamHaloHitsFile',
143  'inputBeamGasHitsFile'
144  ] if in_reco_chain else None))
145 
146 
147 def addSimValidationSubstep(executorSet):
148  executorSet.add(athenaExecutor(name = 'SimValidation',
149  skeletonCA='SimuJobTransforms.HITtoHIST_SIM_Skeleton',
150  inData = ['HITS'], outData = ['HIST_SIM'],))
151 
152 
153 def addDigiValidationSubstep(executorSet):
154  executorSet.add(athenaExecutor(name = 'DigiValidation',
155  skeletonCA='SimuJobTransforms.RDOtoHIST_DIGI_Skeleton',
156  inData = ['RDO'], outData = ['HIST_DIGI'],))
157 
158 
160  executor = set()
161  addSimulationSubstep(executor)
162  trf.appendToExecutorSet(executor)
163 
165  executor = set()
166  addAtlasG4Substep(executor)
167  trf.appendToExecutorSet(executor)
168 
169 def appendConfigurableSimTRInSubstep(trf, confName = 'AtlasG4TfTRIn',
170  extraSkeleton = [], confSubstep = 'simTRIn',
171  confInData=['EVNT_TR'],
172  confOutData=['HITS','NULL'],
173  confExtraRunargs=None, confRuntimeRunargs=None ):
174  executor = set()
175  addConfigurableSimSubstep(executor, confName, extraSkeleton, confSubstep, confInData, confOutData, confExtraRunargs, confRuntimeRunargs )
176  trf.appendToExecutorSet(executor)
177 
178 def appendConfigurableSimSubstep(trf, confName = 'AtlasG4Tf',
179  extraSkeleton = [], confSubstep = 'sim',
180  confInData=['NULL','EVNT'],
181  confOutData=['EVNT_TR','HITS','NULL'],
182  confExtraRunargs=None, confRuntimeRunargs=None ):
183  executor = set()
184  addConfigurableSimSubstep(executor, confName, extraSkeleton, confSubstep, confInData, confOutData, confExtraRunargs, confRuntimeRunargs )
185  trf.appendToExecutorSet(executor)
186 
188  executor = set()
190  trf.appendToExecutorSet(executor)
191 
193  executor = set()
194  addDigitizationSubstep(executor)
195  trf.appendToExecutorSet(executor)
196 
197 #def appendSimValidationSubstep(trf):
198 # executor = set()
199 # addSimValidationSubstep(executor)
200 # trf.appendSimVAlidationSubstep(executor)
201 
202 #def appendDigiValidationSubstep(trf):
203 # executor = set()
204 # addDigiValidationSubstep(executor)
205 # trf.appendDigiVAlidationSubstep(executor)
python.SimTransformUtils.addReSimulationSubstep
def addReSimulationSubstep(executorSet)
Definition: SimTransformUtils.py:95
python.SimTransformUtils.addSimValidationSubstep
def addSimValidationSubstep(executorSet)
Definition: SimTransformUtils.py:147
python.SimTransformUtils.addReSimulationArguments
def addReSimulationArguments(parser)
Definition: SimTransformUtils.py:34
python.simTrfArgs.addCommonSimTrfArgs
def addCommonSimTrfArgs(parser)
Add common Simulation transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:181
python.simTrfArgs.addCommonSimDigTrfArgs
def addCommonSimDigTrfArgs(parser)
Add common Simulation/Digitization transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:196
python.SimTransformUtils.addPureDigitizationArguments
def addPureDigitizationArguments(parser)
Definition: SimTransformUtils.py:29
python.simTrfArgs.addHITSMergeArgs
def addHITSMergeArgs(parser)
Definition: simTrfArgs.py:208
python.simTrfArgs.addSim_tfArgs
def addSim_tfArgs(parser)
Add arguments used only by ISF-based simulation jobs.
Definition: simTrfArgs.py:146
python.SimTransformUtils.addAtlasG4Substep
def addAtlasG4Substep(executorSet)
Definition: SimTransformUtils.py:107
python.SimTransformUtils.addCommonSimDigArguments
def addCommonSimDigArguments(parser)
Add Argument Methods.
Definition: SimTransformUtils.py:12
python.SimTransformUtils.addHITSValidArguments
def addHITSValidArguments(parser)
Definition: SimTransformUtils.py:59
python.SimTransformUtils.addPureSimulationArguments
def addPureSimulationArguments(parser)
Definition: SimTransformUtils.py:24
python.SimTransformUtils.appendDigitizationSubstep
def appendDigitizationSubstep(trf)
Definition: SimTransformUtils.py:192
python.simTrfArgs.addRDOValidArgs
def addRDOValidArgs(parser)
Add RDO validation transform arguments.
Definition: simTrfArgs.py:246
python.SimTransformUtils.addSimulationArguments
def addSimulationArguments(parser)
Definition: SimTransformUtils.py:43
python.simTrfArgs.addForwardDetTrfArgs
def addForwardDetTrfArgs(parser)
Add Forward Detector transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:13
python.SimTransformUtils.addDigitizationSubstep
def addDigitizationSubstep(executorSet, in_reco_chain=False)
Definition: SimTransformUtils.py:133
python.SimTransformUtils.appendAtlasG4Substep
def appendAtlasG4Substep(trf)
Definition: SimTransformUtils.py:164
python.SimTransformUtils.appendConfigurableSimSubstep
def appendConfigurableSimSubstep(trf, confName='AtlasG4Tf', extraSkeleton=[], confSubstep='sim', confInData=['NULL', 'EVNT'], confOutData=['EVNT_TR', 'HITS', 'NULL'], confExtraRunargs=None, confRuntimeRunargs=None)
Definition: SimTransformUtils.py:178
python.simTrfArgs.addBasicDigiArgs
def addBasicDigiArgs(parser)
Add Basic digitization arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:35
python.SimTransformUtils.addAtlasG4Arguments
def addAtlasG4Arguments(parser)
Definition: SimTransformUtils.py:47
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.SimTransformUtils.addDigiValidationSubstep
def addDigiValidationSubstep(executorSet)
Definition: SimTransformUtils.py:153
python.simTrfArgs.addSimIOTrfArgs
def addSimIOTrfArgs(parser)
Add common Simulation transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:169
python.trfUtils.releaseIsOlderThan
def releaseIsOlderThan(major, minor=None)
Test (to the best of our knowledge) if the current release is older than a major, minor version numbe...
Definition: trfUtils.py:261
python.SimTransformUtils.appendHITSMergeSubstep
def appendHITSMergeSubstep(trf)
Definition: SimTransformUtils.py:187
python.SimTransformUtils.appendConfigurableSimTRInSubstep
def appendConfigurableSimTRInSubstep(trf, confName='AtlasG4TfTRIn', extraSkeleton=[], confSubstep='simTRIn', confInData=['EVNT_TR'], confOutData=['HITS', 'NULL'], confExtraRunargs=None, confRuntimeRunargs=None)
Definition: SimTransformUtils.py:169
python.SimTransformUtils.addSimulationSubstep
def addSimulationSubstep(executorSet, overlayTransform=False)
Add Sub-step Methods.
Definition: SimTransformUtils.py:72
python.SimTransformUtils.addStandardHITSMergeSubstep
def addStandardHITSMergeSubstep(executorSet)
Definition: SimTransformUtils.py:127
PyJobTransforms.trfExe
Transform execution functions.
python.simTrfArgs.addHITSValidArgs
def addHITSValidArgs(parser)
Add HITS validation transform arguments.
Definition: simTrfArgs.py:233
python.SimTransformUtils.addRDOValidArguments
def addRDOValidArguments(parser)
Definition: SimTransformUtils.py:64
PyJobTransforms.trfUtils
Transform utility functions.
python.SimTransformUtils.appendSimulationSubstep
def appendSimulationSubstep(trf)
Append Sub-step Methods.
Definition: SimTransformUtils.py:159
python.simTrfArgs.addPileUpTrfArgs
def addPileUpTrfArgs(parser)
Add Pile-up related transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:73
python.SimTransformUtils.addDigitizationArguments
def addDigitizationArguments(parser)
Definition: SimTransformUtils.py:55
python.SimTransformUtils.addHITSMergeArguments
def addHITSMergeArguments(parser)
Definition: SimTransformUtils.py:51
python.simTrfArgs.addCosmicsTrfArgs
def addCosmicsTrfArgs(parser)
Add Cosmics related transform arguments to an argparse ArgumentParser.
Definition: simTrfArgs.py:119
python.SimTransformUtils.addCommonSimulationArguments
def addCommonSimulationArguments(parser)
Definition: SimTransformUtils.py:17
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
python.simTrfArgs.addReSimulationArgs
def addReSimulationArgs(parser)
Add Re-simulation transform arguments.
Definition: simTrfArgs.py:222
python.SimTransformUtils.addConfigurableSimSubstep
def addConfigurableSimSubstep(executorSet, confName, extraSkeleton, confSubStep, confInData, confOutData, confExtraRunargs, confRuntimeRunargs)
Definition: SimTransformUtils.py:120