Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Visualising a detector geometry |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Visualising a detector geometry | ||||||||
Line: 11 to 11 | ||||||||
There are various formats used to describe a detector geometry.
The info in the compact.xml is not enough to describe the detector - drivers are needed to expand info from the XML and create all the volumes. Mokka or SLIC for example create ways of inputting objects in Geant4 without programming volumes in Geant4. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 46 to 46 | ||||||||
geoConverter -compact2lcdd -input compact.xml -output dd4hep.lcdd gGeoManager->Export(“clic-crr.gdml”) | ||||||||
Changed: | ||||||||
< < | or use Export(“clic-crr.root”) to export in root format. | |||||||
> > | or use Export(“clic-crr.root”) to export in ROOT format. | |||||||
From Mokka, one can create a GDML file with | ||||||||
Line: 59 to 59 | ||||||||
Visualisation | ||||||||
Changed: | ||||||||
< < | To visualise a GDML file in Root: open Root, then | |||||||
> > | To visualise a GDML file in ROOT: open ROOT, then | |||||||
TGeoManager::Import(“myclic.gdml”); gGeoManager->GetTopVolume()->Draw(“ogl”); | ||||||||
Changed: | ||||||||
< < | where ogl selects the OpenGL engine. | |||||||
> > | where ogl selects the OpenGL engine. All figures from this section were produced like that. | |||||||
From SLIC, do | ||||||||
Added: | ||||||||
> > | source ~/ilc_soft/slic/v03-01-06/init_ilcsoft.sh | |||||||
slic -g clic-sid_cdr.lcdd -n | ||||||||
Changed: | ||||||||
< < | to get a Geant4 prompt, i.e. a Geant4 interface with the geometry loaded; use commands like /vis/open OGL ... etc. to visualise the geometry. | |||||||
> > | to get a Geant4 prompt, i.e. a Geant4 interface with the geometry loaded; use Geant4 commands like to visualise the geometry:
Idle> /vis/open OGL Idle> /vis/scene/create Idle> /vis/drawVolume Idle> /vis/viewer/set/viewpointThetaPhi 60 45 Idle> /vis/viewer/set/background whitewhich, with this geometry, will display something like this: | |||||||
From Mokka, one can visualise the DB geometry via Geant4 as above. See this example. | ||||||||
Line: 79 to 90 | ||||||||
java -jar GeomConverter-2.4-bin.jar | ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Visualising a detector geometry | ||||||||
Line: 20 to 20 | ||||||||
How to create the LCDD file: | ||||||||
Changed: | ||||||||
< < | From GeomConverter - start with GeomConverter's compact.xml , use the java converter to produce the LCDD file: | |||||||
> > | From GeomConverter - start with GeomConverter's compact.xml (from here, for example), use the java converter to produce the LCDD file: | |||||||
cd /afs/cern.ch/eng/clic/software/GeomConverter/GeomConverter-2_4/target |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Visualising a detector geometry | ||||||||
Line: 73 to 73 | ||||||||
to get a Geant4 prompt, i.e. a Geant4 interface with the geometry loaded; use commands like /vis/open OGL ... etc. to visualise the geometry. | ||||||||
Changed: | ||||||||
< < | From Mokka, one can visualise the DB geometry via Geant4 as above. | |||||||
> > | From Mokka, one can visualise the DB geometry via Geant4 as above. See this example. | |||||||
To visualise a HEPREP file use jas3. With the SLIC setup described above, one can see the GUI by doing: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Visualising a detector geometryIn order to implement and validate a detector geometry in DD4hep, it is important to be able to visualise it. This wiki explores the existing options. Lots of thanks to Nikiforos Nikiforou for explaining how everything works.Geometry description formatsThere are various formats used to describe a detector geometry. The info in thecompact.xml is not enough to describe the detector - drivers are needed to expand info from the XML and create all the volumes. Mokka or SLIC for example create ways of inputting objects in Geant4 without programming volumes in Geant4.
Format conversionsHow to create the LCDD file: From GeomConverter - start with GeomConverter'scompact.xml , use the java converter to produce the LCDD file:
cd /afs/cern.ch/eng/clic/software/GeomConverter/GeomConverter-2_4/targetConvert by doing java -jar GeomConverter-2.4-bin.jar -o lcdd <input> <output>One can then delete by hand all sensitive detector info to be left with a pure GDML file. From SLIC, use slic -g clic-sid_cdr.lcddfor example to load the geometry in memory, then slic -G clic-sid_cdr.lcddto dump the geometry. This allows to see how SLIC loads the geometry, basically debugging SLIC as well. Beware of some bugs in SLIC related to assemblies and the order of rotations. From DD4hep, use geoConverter -compact2lcdd -input compact.xml -output dd4hep.lcdd gGeoManager->Export(“clic-crr.gdml”)or use Export(“clic-crr.root”) to export in root format.
From Mokka, one can create a GDML file with
/Mokka/Visu/Detector/DumpGDMLBy default this will dump the World volume (whole detector) in World.gdml . If one provides a subdetector as argument, it will dump just the subdetector. See the help function for more info.
Beware of bug related to VACUUM material (delete the VACUUM and dummy entries by hand). One can also create a Gear file etc.
VisualisationTo visualise a GDML file in Root: open Root, thenTGeoManager::Import(“myclic.gdml”); gGeoManager->GetTopVolume()->Draw(“ogl”);where ogl selects the OpenGL engine.
From SLIC, do
slic -g clic-sid_cdr.lcdd -nto get a Geant4 prompt, i.e. a Geant4 interface with the geometry loaded; use commands like /vis/open OGL ... etc. to visualise the geometry.
From Mokka, one can visualise the DB geometry via Geant4 as above.
To visualise a HEPREP file use jas3. With the SLIC setup described above, one can see the GUI by doing:
java -jar GeomConverter-2.4-bin.jar |