5 """ This is the main skeleton for creating FCS_NTUP from ESD files.
9 from AthenaCommon.Logging
import logging
10 log = logging.getLogger(
'FCS_Ntup_tf')
11 log.info(
'****************** STARTING Ntuple Production *****************' )
14 log.info(
'**** Transformation run arguments')
15 log.info(
str(runArgs))
18 log.info(
'**** Setting up configuration flags')
20 from PyJobTransforms.CommonRunArgsToFlags
import commonRunArgsToFlags
21 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
23 flags.Exec.EventPrintoutInterval = 100
27 if hasattr(runArgs,
"inputESDFile"):
28 flags.Input.Files = runArgs.inputESDFile
30 raise RuntimeError(
'Could NOT determine the input files!')
33 if hasattr(runArgs,
"outputNTUP_FCSFile"):
35 flags.Output.HISTFileName = runArgs.outputNTUP_FCSFile
37 log.warning(
'No output file set! Using output.NTUP_FCS.root')
38 flags.Output.HISTFileName =
'output.NTUP_FCS.root'
41 outputGeoFileName =
None
42 if hasattr(runArgs,
"outputGeoFileName"):
43 outputGeoFileName = runArgs.outputGeoFileName
46 if hasattr(runArgs,
'detectors'):
47 detectors = runArgs.detectors
51 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
52 setupDetectorFlags(flags, detectors, use_metadata=
True, toggle_geometry=
True, keep_beampipe=
True)
56 if hasattr(runArgs,
"doG4Hits"):
57 doG4HitsArg = runArgs.doG4Hits
60 doClusterInfoArg =
False
61 if hasattr(runArgs,
"doClusterInfo"):
62 doClusterInfoArg = runArgs.doClusterInfo
65 saveAllBranchesArg =
False
66 if hasattr(runArgs,
"saveAllBranches"):
67 saveAllBranchesArg = runArgs.saveAllBranches
70 NTruthParticlesArg = 1
71 if hasattr(runArgs,
"NTruthParticles"):
72 NTruthParticlesArg = runArgs.NTruthParticles
75 from PerfMonComps.PerfMonConfigHelpers
import setPerfmonFlagsFromRunArgs
79 from PyJobTransforms.TransformUtils
import processPreExec, processPreInclude, processPostExec, processPostInclude
80 log.info(
'**** Processing preInclude')
84 log.info(
'**** Processing preExec')
88 log.info(
'**** Processing athenaopts')
92 log.info(
'**** Locking configuration flags')
96 log.info(
'**** Setting up job components')
99 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
103 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
106 from ISF_FastCaloSimParametrization.ISF_FastCaloSimParametrizationConfig
import ISF_HitAnalysisCfg
108 NTruthParticles=NTruthParticlesArg, saveAllBranches=saveAllBranchesArg,
109 doG4Hits=doG4HitsArg, doClusterInfo=doClusterInfoArg, outputGeoFileName=outputGeoFileName))
113 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
114 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
118 log.info(
'**** Processing postInclude')
122 log.info(
'**** Processing postExec')
128 sys.exit(
not sc.isSuccess())