lhcb simulation tutorial cern, 21 st -22 nd february 2012 01 10 100 111 01 1 01 01 00 01 01 010 10...

9
LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 0110100111 0110101000 10101010 110100 B00le How to pass a detector geometry to Geant4 Modeling the geometry with Geant4

Upload: randolph-davidson

Post on 23-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

LHCb Simulation Tutorial

CERN, 21st-22nd February 2012

0110100111011010100010101010110100B00le

How to pass a detector geometry to Geant4

Modeling the geometry with Geant4

Page 2: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Making the geometry known to Geant4

Geant4

PersistencyService

DataFiles

Transient Event Store

PersistencyService Data

Files

Transient Detector

Store

GiGaService

G4 HitsG4 Kine

Kine‘Convertion’ Algorithms

ActionAction

Hits ‘Conversion’Algorithms

G4 GeomGiGaGeomConversion

Service

Gauss (Gaudi)

Gauss uses a dedicated set of services, algorithm and converters to transform the geometry to simulate into the Geant4 description

Simulation Tutorial - Feb. 2012 - 2

Page 3: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Geant4PersistencyService

geo

DB

Transient Detector

Store

GiGaService

GiGa GeometryConversio

nService

“Geo”(Gaudi Algorithm)

Converters and GiGaGeo Service

G4geometry

Transferring the geometry in practice

condition

DB

from Configurables import GiGaInputStreamgeo = GiGaInputStream(”Geo”, ConversionSvcName=“GiGaGeo”, DataProviderSvc=‘DetectorDataSvc’, ExecuteOnce=True )

geo.StreamItems += ["/dd/Structure/LHCb/BeforeMagnetRegion/Rich1”] geo.StreamItems += ["/dd/Geometry/BeforeMagnetRegion/Rich1/Rich1Surfaces”]

Example from Gauss()

List of detectors (elements) to give to model to Geant4 as property of the algorithm

Simulation Tutorial - Feb. 2012 - 3

Page 4: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Positions and calibrationsDetector information varying with time is separate from the geometry structure

DetectorElement

MuonStation

GeometryInfo

IGeometryInfo

Specific detector

description

LVolume

PVolume

SolidISolid

Detector Description Geometry

IDetectorElementILVolume

SolidSolidSolidBox

IPVolume

*

info about misalignment

GiGaLVolumeCnv

convert to G4 all its geometry tree with their positions

GiGaDetectorElementCnv

only called when given as StreamItems

position as given in geometry tree

Same geometry

tree exists in

G4

Material

Alignment

Exploited in a 1 to 1 mapping when passing the information to G4

Simulation Tutorial - Feb. 2012 4

Page 5: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Positions and misalignmentTo 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

CloseVelo SemiOpenVelo OpenVelo

Simulation Tutorial - Feb. 2012 5

Page 6: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

LHCb predefined geometriesThe 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

- 6Simulation Tutorial - Feb. 2012

from Configurables import Gaussprint Gauss()-DetectorGeo = {'VELO': ['Velo', 'PuVeto'], 'MUON': ['Muon'], 'TT': ['TT'], 'IT': ['IT'], 'MAGNET': True, 'RICH': ['Rich1', 'Rich2'], 'CALO': ['Spd', 'Prs', 'Ecal', 'Hcal'], 'OT': ['OT']}

From python prompt:

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

Page 7: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Not predefined geometryNew 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

7Simulation Tutorial - Feb. 2012

Gauss().DetectorSim = {'VELO': ['Velo', 'PuVeto'], 'TT': ['TT'], 'MAGNET': True, 'RICH': ['Rich1’], 'IT': ['IT'], 'OT': ['OT’], 'CALO': [], 'MUON': []}Gauss().DetectorMoni = …

geo = GiGaInputStream(”Geo”)geo.StreamItems.remove(‘/dd/Structure/MagnetRegion/PipeInMagnet’)

Must be switched off via “Geo” algorithm

Page 8: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Not standard behaviorIn some cases the checks in Gauss() prevent changing things

if you know what you are doing you can force the behavior

8Simulation Tutorial - Feb. 2012

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!!

Page 9: LHCb Simulation Tutorial CERN, 21 st -22 nd February 2012 01 10 100 111 01 1 01 01 00 01 01 010 10 11 01 00 B 00 l e How to pass a detector geometry to

Geometry To Geant4

Checking!Always check what you are doing!

9Simulation Tutorial - Feb. 2012

gaudirun.py –n –v $DECFILESROOT/options/52210050.py $LBPGUNSROOT/options/PGuns.py MyOwnOptions.py $GAUSSOPTS/GaussJob.py

Does not execute the job

Shows the full python configuration

'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']},

Snippet of what would you see if you only use what in previous page

It is probably NOT what you want...