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': []}
_check_detectors_compatiblity()[source]
_check_geometry_service_compatibility()[source]
_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 where lhcb-conditions-database

    deployment area on CVMFS is,

  • ConditionsVersion is set based on the provided DataType in Gauss.

Raises
  • ValueError – when the default lhcb-conditions-database is not provided by GIT_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 project

    that Gauss was built against

  • GeometryVersion is set based on the provided DataType 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 exist

  • ValueError – when unable to set the default version of geometry

  • NotADirectoryError – when GeometryVersion is not found in GeometryLocation

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.

_define_stream_items_geo()[source]
_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_ = []
_set_geo_service()[source]
_setup_detdesc()[source]
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

BCM

class Gauss.Detectors.BCM.BCM(*args, **kwargs)[source]

Bases: det_base

lname = 'bcm'

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'
static removeAllBeamPipeElements()[source]
static removeBeamPipeElements(det)[source]
validateBeamPipeSwitch()[source]

BLS

class Gauss.Detectors.BLS.BLS(*args, **kwargs)[source]

Bases: det_base

lname = 'bls'

CALO

class Gauss.Detectors.CALO.ECAL(*args, **kwargs)[source]

Bases: det_base

lname = 'ecal'
class Gauss.Detectors.CALO.HCAL(*args, **kwargs)[source]

Bases: det_base

lname = 'hcal'
class Gauss.Detectors.CALO.PRS(*args, **kwargs)[source]

Bases: det_base

lname = 'prs'
class Gauss.Detectors.CALO.SPD(*args, **kwargs)[source]

Bases: det_base

lname = 'spd'

FT

class Gauss.Detectors.FT.FT(*args, **kwargs)[source]

Bases: det_base

lname = 'ft'

HC

class Gauss.Detectors.HC.HC(*args, **kwargs)[source]

Bases: det_base

lname = 'hc'

IT

class Gauss.Detectors.IT.IT(*args, **kwargs)[source]

Bases: det_base

lname = 'it'

Magnet

class Gauss.Detectors.Magnet.Magnet(*args, **kwargs)[source]

Bases: det_base

active
lname = 'magnet'
monitor
simconf_name

NONE

simulate

Muon

class Gauss.Detectors.Muon.Muon(*args, **kwargs)[source]

Bases: det_base

lname = 'muon'

OT

class Gauss.Detectors.OT.OT(*args, **kwargs)[source]

Bases: det_base

lname = 'ot'

PuVeto

class Gauss.Detectors.PuVeto.PuVeto(*args, **kwargs)[source]

Bases: det_base

lname = 'puveto'

RICH

class Gauss.Detectors.RICH.RICH1(*args, **kwargs)[source]

Bases: det_base

lname = 'rich1'
class Gauss.Detectors.RICH.RICH1PMT(*args, **kwargs)[source]

Bases: det_base

lname = 'rich1pmt'
class Gauss.Detectors.RICH.RICH2(*args, **kwargs)[source]

Bases: det_base

lname = 'rich2'
class Gauss.Detectors.RICH.RICH2PMT(*args, **kwargs)[source]

Bases: det_base

lname = 'rich2pmt'

TT

class Gauss.Detectors.TT.TT(*args, **kwargs)[source]

Bases: det_base

lname = 'tt'

Shield

class Gauss.Detectors.Shield.Shield(*args, **kwargs)[source]

Bases: det_base

lname = 'shield'

SL

class Gauss.Detectors.SL.SL(*args, **kwargs)[source]

Bases: det_base

active
lname = 'sl'
monitor
simconf_name

NONE

simulate

UT

class Gauss.Detectors.UT.UT(*args, **kwargs)[source]

Bases: det_base

active
lname = 'ut'
monitor
region = 'BeforeMagnetRegion'
simconf_name

NONE

simulate

Velo

class Gauss.Detectors.Velo.Velo(*args, **kwargs)[source]

Bases: det_base

static checkVeloDDDB()[source]

Check if the Velo geometry is compatible with the chosen tags

lname = 'velo'
veloMisAlignGeometry(VeloPostMC09)[source]

File containing the list of detector element to explicitely set to have misalignement in the VELO.

VP

class Gauss.Detectors.VP.VP(*args, **kwargs)[source]

Bases: det_base

lname = 'vp'
region = 'BeforeMagnetRegion'