3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 xvert_low = -1000.*200.
9 xvert_high = 1000.*200.
10 zvert_low = -1000.*200.
11 zvert_high = 1000.*200.
15 EminDict = {
'slice1': 10.*1000.,
18 'slice4': 1000.*1000.,
20 EmaxDict = {
'slice1': 100.*1000.,
22 'slice3': 1000.*1000.,
23 'slice4': 5000.*1000.,
25 xvert_lowDict = {
'slice1': -1000.*200.,
26 'slice2': -1000.*600.,
27 'slice3': -1000.*1000.,
28 'slice4': -1000.*3000.,
30 xvert_highDict = {
'slice1': 1000.*200.,
32 'slice3': 1000.*1000.,
33 'slice4': 1000.*3000.,
35 zvert_lowDict = {
'slice1': -1000.*200.,
36 'slice2': -1000.*600.,
37 'slice3': -1000.*1000.,
38 'slice4': -1000.*3000.,
40 zvert_highDict = {
'slice1': 1000.*200.,
42 'slice3': 1000.*1000.,
43 'slice4': 1000.*3000.,
47 if flags.Sim.CosmicPtSlice ==
'Off':
48 if 'Muon' in flags.Sim.CosmicFilterVolumeNames:
54 if 'Pixel' in flags.Sim.CosmicFilterVolumeNames:
57 n_value = flags.Sim.CosmicPtSlice
128 Note that in this coordinate frame the y-axis points upward
129 such that the cosmics arrive from upward to downward in y.
132 if (newSize > 350000.):
133 print (
"Resizing bedrock (mm) to fit cosmic generator:",newSize)
134 GeoModelSvc = cfg.getService(
'GeoModelSvc')
135 if (newSize <= 500000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock500'
136 elif (newSize <= 1000000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock1000'
137 elif (newSize <= 1500000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock1500'
138 elif (newSize <= 2000000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock2000'
139 elif (newSize <= 3000000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock3000'
140 elif (newSize <= 4000000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock4000'
141 elif (newSize <= 5000000) : GeoModelSvc.CavernInfraVersionOverride =
'CavernInfra-03-Bedrock5000'
143 print (
"No need to resize the bedrock for cosmic generation")
151 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
152 kwargs.setdefault(
'PartPropSvc', result.getPrimaryAndMerge(
PartPropSvcCfg(flags)).name)
155 from RngComps.RngCompsConfig
import AthRNGSvcCfg
156 kwargs.setdefault(
'RndmSvc', result.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
158 from CosmicGenerator.CosmicGeneratorConfig
import CavernPropertyCalculator
174 kwargs.setdefault(
'emin', theCavern.CosmicEmin(flags))
175 kwargs.setdefault(
'emax', theCavern.CosmicEmax(flags))
179 kwargs.setdefault(
'xvert_low', theCavern.CosmicLowVertex_X(flags) )
180 kwargs.setdefault(
'xvert_hig', theCavern.CosmicHighVertex_X(flags))
181 kwargs.setdefault(
'zvert_low', theCavern.CosmicLowVertex_Z(flags) )
182 kwargs.setdefault(
'zvert_hig', theCavern.CosmicHighVertex_Z(flags))
183 kwargs.setdefault(
'Radius', theCavern.CosmicRadius(flags))
184 kwargs.setdefault(
'yvert_val', 57300.+41000.)
185 kwargs.setdefault(
'ctcut', 0.)
186 kwargs.setdefault(
'OptimizeForCavern',
True)
187 kwargs.setdefault(
'IPx', 0.)
188 kwargs.setdefault(
'IPy', 0.)
189 kwargs.setdefault(
'IPz', 0.)
191 if len(flags.Sim.CosmicFilterVolumeNames)>0:
192 print (
'Using %s Volume setup of Cosmic Generator...' % flags.Sim.CosmicFilterVolumeNames[0])
194 if 'Pixel' in flags.Sim.CosmicFilterVolumeNames:
195 kwargs.setdefault(
'doPathLengthCut',
True)
196 kwargs.setdefault(
'energyCutThreshold', 100.)
197 kwargs.setdefault(
'doAimedAtPixelsCut',
True)
198 kwargs.setdefault(
'pixelplane_maxx', 1150.)
199 kwargs.setdefault(
'pixelplane_maxz', 1650.)
200 kwargs.setdefault(
'doReweighting',
True)
201 kwargs.setdefault(
'rvert_max', 300000.)
204 kwargs.setdefault(
"Dsid", flags.Input.RunNumbers[0])
207 result.addEventAlgo(CompFactory.CosmicGenerator(
'CosmicGenerator', **kwargs))
213 if flags.Sim.CosmicPtSlice !=
'NONE':
214 print (
"Configuring cosmic pT slice: %s" % flags.Sim.CosmicPtSlice)
215 theCavern.reconfigureCavernGeometry(flags,cfg)