Geometry
Configuration related to the geometry used during the simulation phase.
Main Geometry Configuration
- class Gauss.Geometry.GaussGeometry(*args, **kwargs)[source]
Bases:
GaussinoConfigurable
- __apply_configuration__()[source]
Function to be overridden to convert the high level configuration into a low level one. The default implementation calls applyConf, which is the method defined in some ConfigurableUser implementations.
- _base_pieces = {'AfterDownstreamRegion': [], 'AfterMagnetRegion': [], 'BeforeMagnetRegion': [], 'BeforeUpstreamRegion': [], 'DownstreamRegion': [], 'MagnetRegion': [], 'UpstreamRegion': []}
- _configure_dd4hep_conditions() tuple[str, str] [source]
Sets the properties of the conditions database that will be used by Gauss.
By default:
ConditionsLocation
is set to wherelhcb-conditions-database
deployment area on CVMFS is,
ConditionsVersion
is set based on the providedDataType
in Gauss.
- Raises
ValueError – when the default
lhcb-conditions-database
is not provided byGIT_CONDDBS
.NotADirectoryError – when the path to conditions database does not exist.
ValueError – when the default version for a given datatype was not found.
- Returns
Parsed location and version of the conditions database.
- Return type
tuple[str, str]
- _configure_dd4hep_geometry() tuple[str, str] [source]
Sets the DD4hep geometry properties that will be used by Gauss. In particular, Gauss has to control what is provided by the Detector project:
XML files under
GeometryLocation
/GeometryVersion
,as well as detector element files implemented in C++.
By default:
GeometryLocation
is set to the same location as the Detector projectthat Gauss was built against
GeometryVersion
is set based on the providedDataType
in Gauss.
The main
LHCb.xml
file has to be rebuilt every single time you run Gauss because in Gauss it should be possible to simulate full or partial LHCb geometry and therefore we must be able to decide which sub-detectors’ XML files are included in the final LHCb.xml file. This new file is created at initialize time and stored in /tmp directory.- Raises
NotADirectoryError – when directory
GeometryLocation
does not existValueError – when unable to set the default version of geometry
NotADirectoryError – when
GeometryVersion
is not found inGeometryLocation
- Returns
New location and version of the temporary LHCb.xml file.
- Return type
tuple[str, str]
- _configure_dd4hep_svc() None [source]
Sets up the properties of the main DD4hep geometry service:
DD4hepSvc
based on what datatype, sub-detectors, etc. were chosen in Gauss. In particular, the following properties are modified:geometry properties,
conditions properties,
list of detectors.
Gaussino is also configured to use a dedicated geometry conversion service:
LHCbDD4hepCnvSvc
.DDDBConf is also configured and handles the dispatching of the Conditions GitLab repository
Todo
We still have to configure
LHCbApp
. This can be removed in the future.
- _det_pieces = {'AfterDownstreamRegion': [], 'AfterMagnetRegion': [], 'BeforeMagnetRegion': [], 'BeforeUpstreamRegion': [], 'DownstreamRegion': [], 'MagnetRegion': [], 'UpstreamRegion': []}
- _lhcb_dd4hep_det_map = {'Ecal': 'Ecal', 'FT': 'FT', 'Hcal': 'Hcal', 'MP': 'MP', 'Magnet': 'Magnet', 'Muon': 'Muon', 'Rich1Pmt': 'Rich1', 'Rich2Pmt': 'Rich2', 'TV': 'TV', 'UP': 'UP', 'UT': 'UT', 'VP': 'VP'}
- _listOfGeoObjects_ = []
- _listOfXMLIncludes_ = []
- datatype = False
- only_generation_phase = False
- run1or2 = False
- run4or5 = False
Validating geometry
Overlap checks
Geant4 provides an internal tool to look for the overlaps between volumes in the geometry description. It will scan the whole hierarchy of volumes and will print out in the console if any overlaps were found or not.
We have to add a few internal Geant4 UI commands that will be triggered at the beginning of the run:
from Configurables import GaussSimulation
GaussSimulation().G4BeginRunCommand += [
"/geometry/test/verbosity true", # increase verbosity
"/geometry/test/tolerance 0 mm", # tolerance of overlaps
"/geometry/test/recursion_start 0", # 0 - > beginning of the hierarchy
"/geometry/test/recursion_depth 5", # -1 -> will scan the whole tree
"/geometry/test/maximum_errors 1",
"/geometry/test/run",
]
If there are no overlaps, you should see something like this:
G4WT0 > Checking overlaps for volume AV_3570!lvMuon_1#1!Copper30micBox_8#8 (G4Box) ... OK!
On the other hand, if an overlap was found, the output should look like:
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
Overlap is detected for volume AV_3570!lvMuon_1#1!SupportPanel_0#0:1502 (G4SubtractionSolid)
with AV_3570!lvMuon_1#1!lvM5ASideBeamPlug_10#10:12 (G4SubtractionSolid) volume's
local point (-80.8058,-221.315,-17.9971), overlapping by at least: 1.5685 cm
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Available detectors
BeamPipe
- class Gauss.Detectors.BeamPipe.BeamPipe(*args, **kwargs)[source]
Bases:
det_base
- _beamPipeElements = {'AfterMagnetRegion': ['/dd/Structure/LHCb/AfterMagnetRegion/PipeAfterT', '/dd/Structure/LHCb/AfterMagnetRegion/PipeSupportsAfterMagnet'], 'downstreamregion': ['/dd/Structure/LHCb/DownstreamRegion/PipeDownstream', '/dd/Structure/LHCb/DownstreamRegion/PipeSupportsDownstream', '/dd/Structure/LHCb/DownstreamRegion/PipeBakeoutDownstream'], 'magnet': ['/dd/Structure/LHCb/MagnetRegion/PipeInMagnet', '/dd/Structure/LHCb/MagnetRegion/PipeSupportsInMagnet'], 'rich1': ['/dd/Structure/LHCb/BeforeMagnetRegion/Rich1/PipeInRich1BeforeSubM', '/dd/Structure/LHCb/BeforeMagnetRegion/Rich1/PipeInRich1SubMaster', '/dd/Structure/LHCb/BeforeMagnetRegion/Rich1/PipeInRich1AfterSubM', '/dd/Structure/LHCb/BeforeMagnetRegion/Rich1/Rich1BeamPipe'], 'rich2': ['/dd/Structure/LHCb/AfterMagnetRegion/Rich2/Rich2BeamPipe'], 't': ['/dd/Structure/LHCb/AfterMagnetRegion/T/PipeInT'], 'tt': ['/dd/Structure/LHCb/BeforeMagnetRegion/TT/PipeInTT'], 'ut': ['/dd/Structure/LHCb/BeforeMagnetRegion/UT/PipeInUT'], 'velo': ['/dd/Structure/LHCb/BeforeMagnetRegion/Velo/DownStreamWakeFieldCone', '/dd/Structure/LHCb/BeforeMagnetRegion/Velo/UpStreamWakeFieldCone', '/dd/Structure/LHCb/BeforeMagnetRegion/Velo/DownstreamPipeSections', '/dd/Structure/LHCb/BeforeMagnetRegion/Velo/VacTank']}
- _beamPipeStates = ['beampipeon', 'beampipeoff', 'beampipeindet']
- lname = 'beampipe'