TWiki
>
TOTEM Web
>
WebLeftBar
>
CompOfflineSw
>
CompOfflineGeometry
(revision 5) (raw view)
Edit
Attach
PDF
---++ How to detect overlaps in Geant4 geometry ? Geometry in !CMSSW can be represented by an acyclic graph (kind of tree). Volumes should be defined in such way that child volumes don't have intersection with each other and are completely inside their mother volume. Any exception from that rule (overlap) could cause !Geant4 to behave in unpredictable way. There is a [[http://cmslxr.fnal.gov/lxr/source/Validation/CheckOverlap/][CMSSW library (!SimWatcher)]] that comes together with !Geant4 and makes it possible to check detector geometry for overlaps. In order to use it one needs to prepare .py configuration file with proper geometry included (!XML files). In execution path there should be !Geant4, simulation has to be performed only for 1 event, verbosity should be enabled (i.e. by !LoggerMax). Then one has to check what is the name of root node of geometry graph. It is defined in configuration of !XMLIdealGeometryESSource, i.e. in Configuration/TotemCommon/python/geometry*_cfi.py files, in *rootNodeName* variable. To configuration file the following section has to be added (name of rootnode could be OTOTEM (typical for RP case) or OCMS (typical for T1/T2 case) and has to read from used geometry definition in included from .py file): <verbatim> process.g4SimHits.UseMagneticField = False process.g4SimHits.Physics.type = 'SimG4Core/Physics/DummyPhysics' process.g4SimHits.Physics.DummyEMPhysics = True process.g4SimHits.Watchers = cms.VPSet(cms.PSet( type = cms.string('CheckOverlap'), Resolution = cms.untracked.int32(1000), # precision, default 1000 NodeNames = cms.untracked.vstring('OTOTEM') )) </verbatim> Now we run our configuration file with _cmsRun_ command. It will take some time to test geometry. After job is done one need to inspect infos.log file (or standard output). In case overlap is found warning similar to following will appear: <verbatim> Placed PV Trap6R_CSC_for_TotemT1_Plane_1_5_1 Number 1 in mother CSC_for_TotemT1_Plane_1_5 at depth 5 Status 0 Checking overlaps for volume CornaR_CSC_for_TotemT1_Plane_1_5_1 ... WARNING - G4PVPlacement::CheckOverlaps() Overlap is detected for volume CornaR_CSC_for_TotemT1_Plane_1_5_1 with Up_CSC_for_TotemT1_Plane_1_5_1 volume's local point (289.408,0.236948,25.7519), overlapping by at least: 415.484 nm Placed PV CornaR_CSC_for_TotemT1_Plane_1_5_1 Number 2 in mother CSC_for_TotemT1_Plane_1_5 at depth 5 Status 1 Translation (364.023,655.531,-21.1825) and with rotation [ ( 0.866025 -0.5 -6.12303e-17) ( 0.5 0.866025 -6.12303e-17) Dump of Self Logical Volume CornaR_CSC_for_TotemT1_Plane_1_5_1 Solid: CornaR_CSC_for_TotemT1_Plane_1_5_1 Material: Epoxy ----------------------------------------------------------- *** Dump for solid - CornaR_CSC_for_TotemT1_Plane_1_5_1 *** =================================================== Solid type: G4Box Parameters: half length X: 52.5 mm half length Y: 60.022 mm half length Z: 0.3825 mm ----------------------------------------------------------- Dump of Mother Logical Volume CSC_for_TotemT1_Plane_1_5 Solid: CSC_for_TotemT1_Plane_1_5 Material: Air ----------------------------------------------------------- *** Dump for solid - CSC_for_TotemT1_Plane_1_5 *** =================================================== Solid type: G4Tubs Parameters: inner radius : 130 mm outer radius : 834.5 mm half length Z: 21.6 mm starting phi : 40 degrees delta phi : 100 degrees ----------------------------------------------------------- </verbatim> From this message we could read which volumes overlap. Presented method cannot be used to prove that geometry does not contain overlaps at all. It is sampling geometry graph with given precision (by default 1000 points per volume (node)). To be more sure one has to perform tests with better precision (10000 or 100000 points). Be careful - in the situation where wrong root node name was used, !SimWatcher will simply say that there is no overlap !! -- Main.LeszekGrzanka - 24-Aug-2011 ---++ How Geant4 geometry is used in CMSSW framework ? Geometry is built by [[https://svnweb.cern.ch/cern/wsvn/totem/trunk/offline/cmssw/src/SimG4Core/Application/plugins/OscarProducer.cc][OscarProducer]]. !OscarProducer uses [[https://svnweb.cern.ch/cern/wsvn/totem/trunk/offline/cmssw/src/SimG4Core/Application/src/RunManager.cc][RunManager]] to construct a [[http://cmslxr.fnal.gov/lxr/source/SimG4Core/Geometry/src/DDDWorld.cc][DDDWorld]] structure. !DDWorld uses [[http://cmslxr.fnal.gov/lxr/source/SimG4Core/Geometry/interface/DDG4Builder.h][DDG4Builder]] to process [[http://cmslxr.fnal.gov/lxr/source/DetectorDescription/Core/interface/DDCompactView.h][DDCompactView]]. DDL Geometry files are read here: [[http://cmslxr.fnal.gov/lxr/source/GeometryReaders/XMLIdealGeometryESSource/src/XMLIdealGeometryESSource.cc][cmssw/GeometryReaders/XMLIdealGeometryESSource/src/XMLIdealGeometryESSource.cc]] and this is invoked in our [[https://svnweb.cern.ch/cern/wsvn/totem/trunk/offline/cmssw/src/Configuration/TotemCommon/python/geometryGlobal_cfi.py][Geometry configuration file]]. Also, someone seems to have done a cheap copy&paste here: [[http://cmslxr.fnal.gov/lxr/source/GeometryReaders/XMLIdealGeometryESSource/src/XMLIdealGeometryESProducer.cc][cmssw/GeometryReaders/XMLIdealGeometryESSource/src/XMLIdealGeometryESProducer.cc]] The return value is !DDCompactView. The filenames are read from the configuration file and stored in a [[http://cmslxr.fnal.gov/lxr/source/GeometryReaders/XMLIdealGeometryESSource/src/GeometryConfiguration.cc][GeometryConfiguration]] object. Then, they are parsed by [[http://cmslxr.fnal.gov/lxr/source/DetectorDescription/Parser/src/DDLParser.cc][DDLParser]]. -- Main.DominikMierzejewski - 31-Aug-2010
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r6
<
r5
<
r4
<
r3
<
r2
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r5 - 2012-02-02
-
LeszekGrzanka
Log In
TOTEM
TOTEM
TOTEM home
TOTEM TWiki
TOTEM TWiki
DETECTOR
SOFTWARE
Offline Software
Monitor
TotemDQM
Trigger/DAQ
DCS
ANALYSIS
PHYSICS
DOCUMENTATION
Service links
Changes
Index
Search
About
Rules and conventions
Playground
TWiki help
TWiki formatting rules
Create personal sidebar
Cern Search
TWiki Search
Google Search
TOTEM
All webs
Copyright &© 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback