2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaConfiguration.Enums
import LHCPeriod
5 from SimulationConfig.SimEnums
import BeamPipeSimMode
6 from AthenaCommon.Logging
import logging
8 RegionCreator=CompFactory.RegionCreator
12 kwargs.setdefault(
"DumpRegion",
not flags.Exec.QuietMode)
19 theLog = logging.getLogger(
"BeampipeFwdCutPhysicsRegionToolCfg")
20 kwargs.setdefault(
"RegionName",
'BeampipeFwdCut')
22 if flags.GeoModel.Run
is LHCPeriod.Run1:
23 volumeList = [
'BeamPipe::SectionF47',
'BeamPipe::SectionF48',
'BeamPipe::SectionF61']
25 volumeList = [
'BeamPipe::SectionF198',
'BeamPipe::SectionF199',
'BeamPipe::SectionF200']
26 if flags.GeoModel.Run > LHCPeriod.Run4:
27 theLog.warning(
'check that RUN2 beampipe volume names are correct for this geometry tag')
28 kwargs.setdefault(
"VolumeList", volumeList)
30 if flags.Sim.BeamPipeSimMode
is BeamPipeSimMode.FastSim:
31 kwargs.setdefault(
"ElectronCut", 10.)
32 kwargs.setdefault(
"PositronCut", 10.)
33 kwargs.setdefault(
"GammaCut", 10.)
34 theLog.info(
'Adding fast sim model to the beampipe!')
36 assert flags.Sim.BeamPipeCut
37 if flags.Sim.BeamPipeCut < 1:
38 msg =
"Setting the forward beam pipe range cuts to %e mm " % flags.Sim.BeamPipeCut
39 msg +=
"-- cut is < 1 mm, I hope you know what you're doing!"
41 if flags.Sim.BeamPipeSimMode
is BeamPipeSimMode.EGammaRangeCuts:
42 kwargs.setdefault(
"ElectronCut", flags.Sim.BeamPipeCut)
43 kwargs.setdefault(
"PositronCut", flags.Sim.BeamPipeCut)
44 kwargs.setdefault(
"GammaCut", flags.Sim.BeamPipeCut)
45 elif flags.Sim.BeamPipeSimMode
is BeamPipeSimMode.EGammaPRangeCuts:
46 kwargs.setdefault(
"ElectronCut", flags.Sim.BeamPipeCut)
47 kwargs.setdefault(
"PositronCut", flags.Sim.BeamPipeCut)
48 kwargs.setdefault(
"GammaCut", flags.Sim.BeamPipeCut)
49 kwargs.setdefault(
"ProtonCut", flags.Sim.BeamPipeCut)
54 kwargs.setdefault(
"RegionName",
'FWDBeamLine')
55 if flags.GeoModel.Run
is LHCPeriod.Run1:
56 volumeList = [
'BeamPipe::SectionF46']
58 volumeList = [
'BeamPipe::SectionF197']
59 if flags.GeoModel.Run > LHCPeriod.Run4:
60 theLog = logging.getLogger(
"FWDBeamLinePhysicsRegionToolCfg")
61 theLog.warning(
'Check that RUN2 beampipe volume names are correct for this geometry tag')
62 kwargs.setdefault(
"VolumeList", volumeList)
68 kwargs.setdefault(
"RegionName",
'FwdRegion')
69 volumeList = [
'FwdRegion::ForwardRegionGeoModel']
70 kwargs.setdefault(
"VolumeList", volumeList)
71 kwargs.setdefault(
"ElectronCut", 200.)
72 kwargs.setdefault(
"PositronCut", 200.)
73 kwargs.setdefault(
"GammaCut", 200.)
79 kwargs.setdefault(
"RegionName",
'Pixel')
80 volumeList = [
'Pixel::siLog',
'Pixel::siBLayLog']
81 if flags.GeoModel.Run
in [LHCPeriod.Run2, LHCPeriod.Run3]:
83 volumeList += [
'Pixel::dbmDiamondLog']
84 kwargs.setdefault(
"VolumeList", volumeList)
89 kwargs.setdefault(
"ElectronCut", 0.05)
90 kwargs.setdefault(
"PositronCut", 0.05)
91 kwargs.setdefault(
"GammaCut", 0.05)
96 kwargs.setdefault(
"RegionName",
'SCT')
97 volumeList = [
'SCT::BRLSensor',
'SCT::ECSensor0',
'SCT::ECSensor1',
98 'SCT::ECSensor2',
'SCT::ECSensor3']
99 kwargs.setdefault(
"VolumeList", volumeList)
100 kwargs.setdefault(
"ElectronCut", 0.05)
101 kwargs.setdefault(
"PositronCut", 0.05)
102 kwargs.setdefault(
"GammaCut", 0.05)
107 kwargs.setdefault(
"RegionName",
'ITkPixel')
108 volumeList = [
'ITkPixel::InnerBarrelSingleMod_Sensor',
109 'ITkPixel::InnerRingSingleMod_Sensor',
110 'ITkPixel::InnerQuadMod_Sensor',
111 'ITkPixel::OuterQuadMod_Sensor',
112 'ITkPixel::InclinedQuadMod_Sensor']
113 kwargs.setdefault(
"VolumeList", volumeList)
114 kwargs.setdefault(
"ElectronCut", 0.05)
115 kwargs.setdefault(
"PositronCut", 0.05)
116 kwargs.setdefault(
"GammaCut", 0.05)
121 kwargs.setdefault(
"RegionName",
'ITkStrip')
122 volumeList = [
'ITkStrip::BRLSensorSS',
'ITkStrip::BRLSensorMS',
123 'ITkStrip::ECSensor0',
'ITkStrip::ECSensor1',
'ITkStrip::ECSensor2',
124 'ITkStrip::ECSensor3',
'ITkStrip::ECSensor4',
'ITkStrip::ECSensor5',
125 'ITkStrip::ECSensorBack0',
'ITkStrip::ECSensorBack1',
'ITkStrip::ECSensorBack2',
126 'ITkStrip::ECSensorBack3',
'ITkStrip::ECSensorBack4',
'ITkStrip::ECSensorBack5']
127 kwargs.setdefault(
"VolumeList", volumeList)
128 kwargs.setdefault(
"ElectronCut", 0.05)
129 kwargs.setdefault(
"PositronCut", 0.05)
130 kwargs.setdefault(
"GammaCut", 0.05)
135 kwargs.setdefault(
"RegionName",
'HGTD')
136 if flags.HGTD.Geometry.useGeoModelXml:
137 volumeList = [
'HGTD::HGTDSiSensorPosL0',
"HGTD::HGTDSiSensorPosL1",
138 'HGTD::HGTDSiSensorPosL2',
'HGTD::HGTDSiSensorPosL3',
139 'HGTD::HGTDSiSensorNegL0',
'HGTD::HGTDSiSensorNegL1',
140 'HGTD::HGTDSiSensorNegL2',
'HGTD::HGTDSiSensorNegL3',
141 'HGTD::HGTDSiSensor']
143 volumeList = [
'HGTD::HGTDSiSensor0',
'HGTD::HGTDSiSensor1',
144 'HGTD::HGTDSiSensor2',
'HGTD::HGTDSiSensor3']
145 kwargs.setdefault(
"VolumeList", volumeList)
146 kwargs.setdefault(
"ElectronCut", 0.05)
147 kwargs.setdefault(
"PositronCut", 0.05)
148 kwargs.setdefault(
"GammaCut", 0.05)
153 rangeCut = flags.Sim.TRTRangeCut
154 kwargs.setdefault(
"RegionName",
'TRT')
155 volumeList = [
'TRT::Gas']
156 if flags.GeoModel.Run
in [LHCPeriod.Run2]:
157 volumeList += [
"TRT::GasMA"]
158 kwargs.setdefault(
"VolumeList", volumeList)
159 kwargs.setdefault(
"ElectronCut", rangeCut)
160 kwargs.setdefault(
"PositronCut", rangeCut)
162 kwargs.setdefault(
"GammaCut", 0.05)
167 kwargs.setdefault(
"RegionName",
'TRT_Ar')
168 volumeList = [
'TRT::Gas_Ar',
'TRT::GasMA_Ar']
169 kwargs.setdefault(
"VolumeList", volumeList)
170 kwargs.setdefault(
"ElectronCut", 30.0)
171 kwargs.setdefault(
"PositronCut", 30.0)
172 kwargs.setdefault(
"GammaCut", 0.05)
177 kwargs.setdefault(
"RegionName",
'TRT_Kr')
178 volumeList = [
'TRT::Gas_Kr',
'TRT::GasMA_Kr']
179 kwargs.setdefault(
"VolumeList", volumeList)
180 kwargs.setdefault(
"ElectronCut", 15.0)
181 kwargs.setdefault(
"PositronCut", 15.0)
182 kwargs.setdefault(
"GammaCut", 0.05)
186 kwargs.setdefault(
"RegionName",
'CALO')
187 volumeList = [
'CALO::CALO',
'LArMgr::LAr::Endcap::Cryostat::Cylinder::Mixed',
'LArMgr::LAr::Barrel::Cryostat::MotherVolume',
'LArMgr::ModeratorTube']
188 kwargs.setdefault(
"VolumeList", volumeList)
193 kwargs.setdefault(
"RegionName",
'EMB')
194 volumeList = [
'LArMgr::LAr::EMB::STAC']
195 kwargs.setdefault(
"VolumeList", volumeList)
197 if '_EMV' not in flags.Sim.PhysicsList
and '_EMX' not in flags.Sim.PhysicsList:
199 kwargs.setdefault(
"ElectronCut", rangeEMB)
200 kwargs.setdefault(
"PositronCut", rangeEMB)
201 kwargs.setdefault(
"GammaCut", rangeEMB)
206 kwargs.setdefault(
"RegionName",
'EMEC')
207 volumeList = [
'LArMgr::LAr::EMEC::Mother']
208 kwargs.setdefault(
"VolumeList", volumeList)
210 if '_EMV' not in flags.Sim.PhysicsList
and '_EMX' not in flags.Sim.PhysicsList:
212 kwargs.setdefault(
"ElectronCut", rangeEMEC)
213 kwargs.setdefault(
"PositronCut", rangeEMEC)
214 kwargs.setdefault(
"GammaCut", rangeEMEC)
219 kwargs.setdefault(
"RegionName",
'HEC')
220 volumeList = [
'LArMgr::LAr::HEC::LiquidArgon']
221 kwargs.setdefault(
"VolumeList", volumeList)
223 if '_EMV' not in flags.Sim.PhysicsList
and '_EMX' not in flags.Sim.PhysicsList:
225 kwargs.setdefault(
"ElectronCut", rangeHEC)
226 kwargs.setdefault(
"PositronCut", rangeHEC)
227 kwargs.setdefault(
"GammaCut", rangeHEC)
232 kwargs.setdefault(
"RegionName",
'FCAL')
233 volumeList = [
'LArMgr::LAr::FCAL::LiquidArgonC']
234 kwargs.setdefault(
"VolumeList", volumeList)
235 kwargs.setdefault(
"ElectronCut", 0.03)
236 kwargs.setdefault(
"PositronCut", 0.03)
237 kwargs.setdefault(
"GammaCut", 0.03)
242 kwargs.setdefault(
"RegionName",
'EMECPara')
243 volumeList = [
'LArMgr::LAr::EMEC::Pos::InnerWheel',
'LArMgr::LAr::EMEC::Pos::OuterWheel',
244 'LArMgr::LAr::EMEC::Neg::InnerWheel',
'LArMgr::LAr::EMEC::Neg::OuterWheel']
245 kwargs.setdefault(
"VolumeList", volumeList)
247 if '_EMV' not in flags.Sim.PhysicsList
and '_EMX' not in flags.Sim.PhysicsList:
249 kwargs.setdefault(
"ElectronCut", rangeEMEC)
250 kwargs.setdefault(
"PositronCut", rangeEMEC)
251 kwargs.setdefault(
"GammaCut", rangeEMEC)
256 kwargs.setdefault(
"RegionName",
'FCALPara')
257 volumeList = [
'LArMgr::LAr::FCAL::Module1::Absorber']
258 kwargs.setdefault(
"VolumeList", volumeList)
259 kwargs.setdefault(
"ElectronCut", 0.03)
260 kwargs.setdefault(
"PositronCut", 0.03)
261 kwargs.setdefault(
"GammaCut", 0.03)
266 kwargs.setdefault(
"RegionName",
'FCAL2Para')
267 volumeList = [
'LArMgr::LAr::FCAL::Module2::Absorber',
'LArMgr::LAr::FCAL::Module3::Absorber']
268 kwargs.setdefault(
"VolumeList", volumeList)
269 kwargs.setdefault(
"ElectronCut", 0.03)
270 kwargs.setdefault(
"PositronCut", 0.03)
271 kwargs.setdefault(
"GammaCut", 0.03)
276 kwargs.setdefault(
"RegionName",
'PreSampLAr')
277 volumeList = [
'LArMgr::LAr::Endcap::Presampler::LiquidArgon']
278 kwargs.setdefault(
"VolumeList", volumeList)
283 kwargs.setdefault(
"RegionName",
'DeadMaterial')
286 if flags.GeoModel.Run
is LHCPeriod.Run1:
288 endRange = 47
if flags.Sim.BeamPipeSimMode
is not BeamPipeSimMode.Normal
else 49
290 if not flags.Detector.GeometryFwdRegion
and (flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC):
293 sectionList += [ 51, 52, 53, 54 ]
296 endRange = 198
if flags.Sim.BeamPipeSimMode
is not BeamPipeSimMode.Normal
else 200
298 if not flags.Detector.GeometryFwdRegion
and (flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC):
301 if flags.GeoModel.Run > LHCPeriod.Run4:
302 print(
'DeadMaterialPhysicsRegionToolCfg: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
303 for section
in sectionList:
304 volumeList += [
'BeamPipe::SectionF'+
str(section)]
305 volumeList += [
'LArMgr::LAr::Endcap::Cryostat::Cylinder',
306 'LArMgr::LAr::Endcap::Cryostat::Cylinder::Mixed',
307 'LArMgr::LAr::Endcap::Cryostat::Cone::Mixed',
308 'LArMgr::LAr::Endcap::Cryostat::Cone',
309 'DiskShieldingPlugs',
'ToroidShieldingInnerPlugs',
310 'ForwardShieldingMainCylinder']
311 kwargs.setdefault(
"VolumeList", volumeList)
312 kwargs.setdefault(
"ElectronCut", 1.0)
313 kwargs.setdefault(
"PositronCut", 1.0)
314 kwargs.setdefault(
"GammaCut", 1.0)
320 kwargs.setdefault(
"RegionName",
'DriftWall')
321 volumeList = [
'Muon::MDTDriftWall' if not flags.Muon.usePhaseIIGeoSetup
else 'MuonR4::MDTDriftWall' ]
322 kwargs.setdefault(
"VolumeList", volumeList)
323 kwargs.setdefault(
"ElectronCut", 0.05)
324 kwargs.setdefault(
"PositronCut", 0.05)
329 kwargs.setdefault(
"RegionName",
'DriftWall1')
330 volumeList = [
'Muon::Endplug' if not flags.Muon.usePhaseIIGeoSetup
else 'MuonR4::Endplug']
331 kwargs.setdefault(
"VolumeList", volumeList)
332 kwargs.setdefault(
"ElectronCut", 1.0)
333 kwargs.setdefault(
"PositronCut", 1.0)
338 kwargs.setdefault(
"RegionName",
'DriftWall2')
339 volumeList = [
'Muon::SensitiveGas' if not flags.Muon.usePhaseIIGeoSetup
else 'MuonR4::MDTDriftGas']
340 kwargs.setdefault(
"VolumeList", volumeList)
341 kwargs.setdefault(
"ElectronCut", 1.0)
342 kwargs.setdefault(
"PositronCut", 1.0)
347 kwargs.setdefault(
"RegionName",
'MuonSystemFastRegion')
349 from SimulationConfig.SimEnums
import CavernBackground
350 if flags.Sim.CavernBackground
in [CavernBackground.SignalWorld, CavernBackground.WriteWorld]:
351 if flags.GeoModel.Run < LHCPeriod.Run4:
352 volumeList += [
'BeamPipe::BeamPipe',
'IDET::IDET']
354 volumeList += [
'BeamPipe::BeamPipe',
'ITK::ITK']
355 volumeList = [
'Muon::MuonSys']
356 kwargs.setdefault(
"VolumeList", volumeList)
357 kwargs.setdefault(
"ElectronCut", 1.0)
358 kwargs.setdefault(
"PositronCut", 1.0)
363 kwargs.setdefault(
"RegionName",
'MuonSys')
364 volumeList = [
'Muon::MuonSys']
365 kwargs.setdefault(
"VolumeList", volumeList)
366 kwargs.setdefault(
"ElectronCut", 0.1)
367 kwargs.setdefault(
"PositronCut", 0.1)
368 kwargs.setdefault(
"GammaCut", 0.1)
374 kwargs.setdefault(
"RegionName",
'SX1')
375 volumeList = [
'CavernInfra::SX1Air']
376 kwargs.setdefault(
"VolumeList", volumeList)
377 kwargs.setdefault(
"ElectronCut", 2000.)
378 kwargs.setdefault(
"PositronCut", 2000.)
379 kwargs.setdefault(
"GammaCut", 2000.)
384 kwargs.setdefault(
"RegionName",
'BEDROCK')
385 volumeList = [
'CavernInfra::BEDROCK']
386 kwargs.setdefault(
"VolumeList", volumeList)
387 kwargs.setdefault(
"ElectronCut", 1000000.)
388 kwargs.setdefault(
"PositronCut", 1000000.)
389 kwargs.setdefault(
"GammaCut", 1000000.)
394 kwargs.setdefault(
"RegionName",
'CAV_SHAFTS_CONC')
395 volumeList = [
'CavernInfra::CAV_SHAFTS_CONC']
396 kwargs.setdefault(
"VolumeList", volumeList)
397 kwargs.setdefault(
"ElectronCut", 150.)
398 kwargs.setdefault(
"PositronCut", 150.)
399 kwargs.setdefault(
"GammaCut", 150.)
416 kwargs.setdefault(
"RegionName",
'SCTSiliconRegion')
417 volumeList = [
'SCT::ECSensor0']
418 kwargs.setdefault(
"VolumeList", volumeList)
419 kwargs.setdefault(
"ElectronCut", 0.01)