6 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
12 if 'outputlevel' not in configMy.jobConfig: configMy.jobConfig[
'outputlevel'] = 3
13 if 'maxEvents' not in configMy.jobConfig: configMy.jobConfig[
'maxEvents'] = -1
14 if 'skipEvents' not in configMy.jobConfig: configMy.jobConfig[
'skipEvents'] = 0
15 if 'MsgLimit' not in configMy.jobConfig: configMy.jobConfig[
'MsgLimit'] = 20
17 if 'outputfileprefix' not in configMy.jobConfig: configMy.jobConfig[
'outputfileprefix'] =
''
18 if 'outputfile' not in configMy.jobConfig: configMy.jobConfig[
'outputfile'] = configMy.jobConfig[
'outputfileprefix']+
'beamspot.db'
19 if 'histfile' not in configMy.jobConfig: configMy.jobConfig[
'histfile'] = configMy.jobConfig[
'outputfileprefix']+
'nt.root'
20 if 'monfile' not in configMy.jobConfig: configMy.jobConfig[
'monfile'] = configMy.jobConfig[
'outputfileprefix']+
'beamspotmonitoring.root'
21 if 'jobpostprocsteps' not in configMy.jobConfig: configMy.jobConfig[
'jobpostprocsteps'] =
'MergeNt PlotBeamSpot LinkResults AveBeamSpot DQBeamSpot'
22 if 'doMonitoring' not in configMy.jobConfig: configMy.jobConfig[
'doMonitoring'] =
True
23 if 'VertexNtuple' not in configMy.jobConfig: configMy.jobConfig[
'VertexNtuple'] =
True
24 if 'WriteAllVertices' not in configMy.jobConfig: configMy.jobConfig[
'WriteAllVertices'] =
False
25 if 'VertexTreeName' not in configMy.jobConfig: configMy.jobConfig[
'VertexTreeName'] =
'Vertices'
28 if 'UseBCID' not in configMy.jobConfig: configMy.jobConfig[
'UseBCID'] = []
29 if 'UseFilledBCIDsOnly' not in configMy.jobConfig: configMy.jobConfig[
'UseFilledBCIDsOnly'] =
True
32 if 'MinTracksPerVtx' not in configMy.jobConfig: configMy.jobConfig[
'MinTracksPerVtx'] = 5
33 if 'MaxTracksPerVtx' not in configMy.jobConfig: configMy.jobConfig[
'MaxTracksPerVtx'] = 1000000
34 if 'MinVtxNum' not in configMy.jobConfig: configMy.jobConfig[
'MinVtxNum'] = 100
35 if 'MaxVtxChi2' not in configMy.jobConfig: configMy.jobConfig[
'MaxVtxChi2'] = 10
36 if 'MaxTransverseErr' not in configMy.jobConfig: configMy.jobConfig[
'MaxTransverseErr'] = 1000000
37 if 'VertexTypes' not in configMy.jobConfig: configMy.jobConfig[
'VertexTypes'] = [
'PriVtx']
38 if 'MinVtxProb' not in configMy.jobConfig: configMy.jobConfig[
'MinVtxProb'] = .001
39 if 'VertexContainer' not in configMy.jobConfig: configMy.jobConfig[
'VertexContainer'] =
'PrimaryVertices'
40 if 'MaxAbsCorrelXY' not in configMy.jobConfig: configMy.jobConfig[
'MaxAbsCorrelXY'] = 0.8
43 if 'LumiRange' not in configMy.jobConfig: configMy.jobConfig[
'LumiRange'] = 0
44 if 'RunRange' not in configMy.jobConfig: configMy.jobConfig[
'RunRange'] = 0
48 if 'GroupFitsBy' not in configMy.jobConfig: configMy.jobConfig[
'GroupFitsBy'] =
'none'
49 if 'EventRange' not in configMy.jobConfig: configMy.jobConfig[
'EventRange'] = 0
52 if 'InitialKFactor' not in configMy.jobConfig: configMy.jobConfig[
'InitialKFactor'] = 1.0
53 if 'ConstantKFactor' not in configMy.jobConfig: configMy.jobConfig[
'ConstantKFactor'] =
False
56 if 'MaxSigmaTr' not in configMy.jobConfig: configMy.jobConfig[
'MaxSigmaTr'] = 20.
57 if 'MaxSigmaVtx' not in configMy.jobConfig: configMy.jobConfig[
'MaxSigmaVtx'] = 2.0
58 if 'TruncatedRMS' not in configMy.jobConfig: configMy.jobConfig[
'TruncatedRMS'] =
True
59 if 'SetInitialRMS' not in configMy.jobConfig: configMy.jobConfig[
'SetInitialRMS'] =
False
60 if 'OutlierChi2Tr' not in configMy.jobConfig: configMy.jobConfig[
'OutlierChi2Tr'] = 20.
61 if 'BeamSpotToolList' not in configMy.jobConfig: configMy.jobConfig[
'BeamSpotToolList'] = [
'InDetBeamSpotRooFit',
'InDetBeamSpotVertex']
62 if 'FixWidth' not in configMy.jobConfig: configMy.jobConfig[
'FixWidth'] =
False
65 if 'RooFitMaxTransverseErr' not in configMy.jobConfig: configMy.jobConfig[
'RooFitMaxTransverseErr'] = 0.05
68 if 'MinTrackPt' not in configMy.jobConfig: configMy.jobConfig[
'MinTrackPt'] = 500.
69 if 'useBeamSpot' not in configMy.jobConfig:
71 configMy.jobConfig[
'useBeamSpot'] = configMy.jobConfig.get(
'beamspottag',
'')!=
'' or configMy.jobConfig.get(
'beamspotfile',
'')!=
''
74 print(
"Job configuration: ")
75 for option
in configMy.jobConfig:
76 print(
" ",option,
': ',configMy.jobConfig[option])
79 flags.Exec.OutputLevel = configMy.jobConfig[
'outputlevel']
80 flags.Exec.SkipEvents = configMy.jobConfig[
'skipEvents']
81 flags.Exec.MaxEvents = configMy.jobConfig[
'maxEvents']
83 flags.Input.Files = []
84 for path
in configMy.jobConfig[
'inputfiles']:
86 print(
"glob: ",glob(path))
87 flags.Input.Files += glob(path)
90 flags.Trigger.triggerConfig =
"DB"
91 flags.DQ.enableLumiAccess =
False
92 flags.Output.HISTFileName = configMy.jobConfig[
'monfile']
93 flags.Exec.EventPrintoutInterval = 10000
97 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
99 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
101 acc.getService(
"MessageSvc").defaultLimit = configMy.jobConfig[
'MsgLimit']
103 from InDetBeamSpotFinder.InDetBeamSpotFinderConfig
import InDetBeamSpotFinderCfg
106 from AthenaConfiguration.ComponentFactory
import CompFactory
107 acc.addService(CompFactory.THistSvc(
108 Output = [
"INDETBEAMSPOTFINDER DATAFILE='%s' OPT='RECREATE'" % configMy.jobConfig[
'histfile']]))
110 if configMy.jobConfig[
'doMonitoring']:
111 from AthenaMonitoring
import AthMonitorCfgHelper
112 helper = AthMonitorCfgHelper(flags,
"BeamSpotMonitoring")
113 from InDetGlobalMonitoringRun3Test.InDetGlobalBeamSpotMonAlgCfg
import (
114 InDetGlobalBeamSpotMonAlgCfg )
116 acc.merge(helper.result())
118 acc.printConfig(withDetails=
True)
125 sys.exit(
not sc.isSuccess())