100 likes | 237 Views
Modeling the geometry with Geant4. How to pass a detector geometry to Geant4. Persistency Service. Data Files. Kine ‘ Convertion ’ Algorithms. Transient Event Store. G4 Kine. Hits ‘Conversion’ Algorithms. G4 Hits. GiGa Service. Geant4. GiGaGeom Conversion Service.
E N D
Modeling the geometry with Geant4 How to pass a detector geometry to Geant4
Geometry To Geant4 Persistency Service Data Files Kine ‘Convertion’ Algorithms Transient Event Store G4 Kine Hits ‘Conversion’ Algorithms G4 Hits GiGa Service Geant4 GiGaGeom Conversion Service Transient Detector Store Action Action G4 Geom Persistency Service Data Files Making the geometry known to Geant4 Gauss (Gaudi) Gauss uses a dedicated set of services, algorithm and converters to transform the geometry to simulate into the Geant4 description
Geometry To Geant4 GiGa Service Persistency Service Geant4 GiGa Geometry Conversion Service Transient Detector Store condition DB geo DB Transferring the geometry in practice Converters andGiGaGeo Service G4 geometry “Geo” (Gaudi Algorithm) List of detectors (elements) to give to model to Geant4 as property of the algorithm Example from Gauss() from Configurables import GiGaInputStream geo = GiGaInputStream(”Geo”, ConversionSvcName=“GiGaGeo”, DataProviderSvc=‘DetectorDataSvc’, ExecuteOnce=True ) geo.StreamItems += ["/dd/Structure/LHCb/BeforeMagnetRegion/Rich1”] geo.StreamItems += ["/dd/Geometry/BeforeMagnetRegion/Rich1/Rich1Surfaces”]
Detector information varying with time is separate from the geometry structure Geometry To Geant4 DetectorElement MuonStation SolidBox Solid Solid LVolume PVolume Solid Positions and calibrations info about misalignment position as given in geometry tree IGeometryInfo IDetectorElement ILVolume GeometryInfo Material * ISolid Same geometry tree exists in G4 Alignment IPVolume Specific detector description Exploited in a 1 to 1 mapping when passing the information to G4 Detector Description Geometry GiGaDetectorElementCnv only called when given as StreamItems GiGaLVolumeCnv convert to G4 all its geometry tree with their positions
To take into account the misalignment from the DetectorElement take the geometry information from it instead of the Physical Volume but… • There must be a single one-to-one correspondence between a PhysicalVolume and a DetectorElement • Children are positioned with respect to their parents and it is not possible to take into account misalignment of both parent and child volume automatically • Must pass all detectors (elements) to misalign as options of Geo.StreamItems • Also pass all geometry at the same level to what needs to be misaligned Geometry To Geant4 Positions and misalignment CloseVelo OpenVelo SemiOpenVelo
The standard configuration of the LHCb detector to model is predefined in the Gauss() configurable • The standard detectors can be switched on/off via Gauss() • It provides internal checking and takes care of special cases as when geometry changes with databases Geometry To Geant4 LHCb predefined geometries From python prompt: from Configurables import Gauss print Gauss() -DetectorGeo = {'VELO': ['Velo', 'PuVeto'], 'MUON': ['Muon'], 'TT': ['TT'], 'IT': ['IT'], 'MAGNET': True, 'RICH': ['Rich1', 'Rich2'], 'CALO': ['Spd', 'Prs', 'Ecal', 'Hcal'], 'OT': ['OT']} Gauss().DetectorGeo = {'VELO': ['Velo', 'PuVeto'], 'MUON': [], 'TT': ['TT'], 'MAGNET': True, 'RICH': ['Rich1’], 'IT': ['IT'], 'OT': ['OT’], 'CALO': [],} Switch off everything after the trackers but for beam pipe
New geometry can be added in the Gauss configurable or for private development adding it directly to the “Geo” algorithm items list • Gauss() takes care of consistency but … • When switching off geometry make sure you also switch off the corresponding retrieval of hits and monitoring • Some infrastructure not yet controllable. A finer granularity will be provided via the Gauss() configurable Geometry To Geant4 Not predefined geometry Gauss().DetectorSim = {'VELO': ['Velo', 'PuVeto'], 'TT': ['TT'], 'MAGNET': True, 'RICH': ['Rich1’], 'IT': ['IT'], 'OT': ['OT’], 'CALO': [], 'MUON': []} Gauss().DetectorMoni = … Must be switched off via “Geo” algorithm geo = GiGaInputStream(”Geo”) geo.StreamItems.remove(‘/dd/Structure/MagnetRegion/PipeInMagnet’)
In some cases the checks in Gauss() prevent changing things • if you know what you are doing you can force the behavior Geometry To Geant4 Not standard behavior def wholeVeloGeometry(): from Configurables import GiGaInputStream geo = GiGaInputStream('Geo') geo.StreamItems += ["/dd/Structure/LHCb/UpstreamRegion/Velo"] appendPostConfigAction(wholeVeloGeometry) To be done with extreme care!! And only as a last resort!!
Always check what you are doing! Geometry To Geant4 Checking! Shows the full python configuration Does not execute the job gaudirun.py –n –v$DECFILESROOT/options/52210050.py $LBPGUNSROOT/options/PGuns.py MyOwnOptions.py $GAUSSOPTS/GaussJob.py Snippet of what would you see if you only use what in previous page 'Geo': {'ConversionSvcName': 'GiGaGeo', 'DataProviderSvcName': 'DetectorDataSvc’, ‘ExecuteOnce': True, 'StreamItems': ['/dd/Structure/LHCb/DownstreamRegion/PipeDownstream', … '/dd/Structure/LHCb/BeforeMagnetRegion/Velo/VacTank', '/dd/Structure/LHCb/BeforeMagnetRegion/Velo/VeloRight/RFFoilRight', '/dd/Structure/LHCb/BeforeMagnetRegion/Velo/VeloLeft/RFFoilLeft', '/dd/Structure/LHCb/BeforeMagnetRegion/Velo']}, It is probably NOT what you want...