ATLAS Offline Software
ForwardTransportSvcConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from ForwardRegionProperties.ForwardRegionPropertiesConfig import resolveTwissBeamFilePath, buildTwissFilePath
6 
7 def ForwardTransportBeta055mPreInclude(flags): # TODO think of a better name for this preInclude
8  flags.Sim.TwissFileBeam1="3.5TeV/0000.55m/nominal/v01/beam1.tfs"
9  flags.Sim.TwissFileBeam2="3.5TeV/0000.55m/nominal/v01/beam2.tfs"
10  from AthenaCommon.SystemOfUnits import TeV,m
11  flags.Beam.Energy=3.5*TeV
12  flags.Sim.TwissFileBeta=0.55*m
13  flags.Sim.TwissFileNomReal='nominal'
14  flags.Sim.TwissFileVersion="v01"
15 
16 
17 def ForwardTransportBeta90mPreInclude(flags): # TODO think of a better name for this preInclude
18  flags.Sim.TwissFileBeam1="3.5TeV/0090.00m/nominal/v02/beam1.tfs"
19  flags.Sim.TwissFileBeam2="3.5TeV/0090.00m/nominal/v02/beam2.tfs"
20  from AthenaCommon.SystemOfUnits import TeV,m
21  flags.Beam.Energy=3.5*TeV
22  flags.Sim.TwissFileBeta=90.*m
23  flags.Sim.TwissFileNomReal='nominal'
24  flags.Sim.TwissFileVersion="v02"
25 
26 
27 def ForwardTransportSvcCfg(flags, name="ForwardTransportSvc", **kwargs):
28  from AthenaCommon.Logging import logging
29  msg = logging.getLogger("ForwardTransportSvcCfg")
30  # Settings of optics to be used
31  twiss_beam1 = resolveTwissBeamFilePath(flags.Sim.TwissFileBeam1, msg)
32  twiss_beam2 = resolveTwissBeamFilePath(flags.Sim.TwissFileBeam2, msg)
33  if twiss_beam1 is None or twiss_beam2 is None:
34  msg.info("Attempting to build TwissFileBeam paths manually")
35  # Getting paths to the twiss files, momentum calculation; you can switch to local files
36  twiss_beam1 = buildTwissFilePath(flags, msg, 'beam1.tfs')
37  twiss_beam2 = buildTwissFilePath(flags, msg, 'beam2.tfs')
38 
39  # properties of the field set according to the optics settings above
40  kwargs.setdefault("TwissFile1", twiss_beam1)
41  kwargs.setdefault("TwissFile2", twiss_beam2)
42  kwargs.setdefault("PositionC1", 149)
43  kwargs.setdefault("PositionC2", 184)
44  kwargs.setdefault("ApertureC1", 999)
45  kwargs.setdefault("ApertureC2", 999)
46  if flags.Detector.GeometryALFA or flags.Detector.GeometryAFP:
47  return ALFAForwardTransportSvcCfg(name, **kwargs)
48  if flags.Detector.GeometryZDC:
49  return ZDCForwardTransportSvcCfg (name, **kwargs)
50  msg.warning("ALFA and ZDC are deactivated.")
51  return ComponentAccumulator()
52 
53 
54 def ALFAForwardTransportSvcCfg(name="ForwardTransportSvc", **kwargs):
55  result = ComponentAccumulator()
56  kwargs.setdefault("EndMarker", 236.888)
57  kwargs.setdefault("TransportFlag", 1)
58  kwargs.setdefault("EtaCut", 7.5)
59  kwargs.setdefault("XiCut", 0.8)
60  result.addService(CompFactory.ForwardTransportSvc(name,**kwargs), create=True, primary=True)
61  return result
62 
63 
64 def ZDCForwardTransportSvcCfg(name="ForwardTransportSvc", **kwargs):
65  result = ComponentAccumulator()
66  kwargs.setdefault("EndMarker", 141.580)
67  kwargs.setdefault("TransportFlag", 0)
68  kwargs.setdefault("EtaCut", 7.5)
69  kwargs.setdefault("XiCut", 0)
70  result.addService(CompFactory.ForwardTransportSvc(name,**kwargs), create=True, primary=True)
71  return result
SystemOfUnits
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ForwardTransportSvcConfig.ForwardTransportBeta055mPreInclude
def ForwardTransportBeta055mPreInclude(flags)
Definition: ForwardTransportSvcConfig.py:7
ForwardTransportSvcConfig.ForwardTransportSvcCfg
def ForwardTransportSvcCfg(flags, name="ForwardTransportSvc", **kwargs)
Definition: ForwardTransportSvcConfig.py:27
ForwardRegionPropertiesConfig.resolveTwissBeamFilePath
def resolveTwissBeamFilePath(twiss_beam, msg)
Definition: ForwardRegionPropertiesConfig.py:7
ForwardRegionPropertiesConfig.buildTwissFilePath
def buildTwissFilePath(flags, msg, filename, twiss_path=None)
Definition: ForwardRegionPropertiesConfig.py:23
ForwardTransportSvcConfig.ALFAForwardTransportSvcCfg
def ALFAForwardTransportSvcCfg(name="ForwardTransportSvc", **kwargs)
Definition: ForwardTransportSvcConfig.py:54
ForwardTransportSvcConfig.ZDCForwardTransportSvcCfg
def ZDCForwardTransportSvcCfg(name="ForwardTransportSvc", **kwargs)
Definition: ForwardTransportSvcConfig.py:64
ForwardTransportSvcConfig.ForwardTransportBeta90mPreInclude
def ForwardTransportBeta90mPreInclude(flags)
Definition: ForwardTransportSvcConfig.py:17