Difference: VisuDet (1 vs. 5)

Revision 52014-06-24 - DanProtopopescu

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Visualising a detector geometry

Revision 42014-06-24 - DanProtopopescu

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

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:
<
<
  • GDML (Geant4, Root)
>
>
  • GDML (Geant4, ROOT)
 
  • LCDD (GeomConverter) - LCDD is GDML augmented by sensitive detector info including cell id specs.
  • HEPREP
  • XML - all of the above are XML formats
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 white
which, with this geometry, will display something like this:

slic-view.png

  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:
>
>
META FILEATTACHMENT attachment="slic-view.png" attr="" comment="SLIC/Geant4 view of the clic_sid_cdr geometry" date="1403618263" name="slic-view.png" path="slic-view.png" size="43781" user="DanProtopopescu" version="1"

Revision 32014-06-19 - DanProtopopescu

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

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

Revision 22014-06-18 - DanProtopopescu

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

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:

Revision 12014-06-16 - DanProtopopescu

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Visualising a detector geometry

In 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 formats

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.

  • GDML (Geant4, Root)
  • LCDD (GeomConverter) - LCDD is GDML augmented by sensitive detector info including cell id specs.
  • HEPREP
  • XML - all of the above are XML formats

Format conversions

How to create the LCDD file:

From GeomConverter - start with GeomConverter's compact.xml, use the java converter to produce the LCDD file:

cd /afs/cern.ch/eng/clic/software/GeomConverter/GeomConverter-2_4/target
Convert 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.lcdd
for example to load the geometry in memory, then
slic -G clic-sid_cdr.lcdd
to dump the geometry. This allows to see how SLIC loads the geometry, basically debugging SLIC as well. ALERT! 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/DumpGDML 
By 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.

ALERT! Beware of bug related to VACUUM material (delete the VACUUM and dummy entries by hand). One can also create a Gear file etc.

Visualisation

To visualise a GDML file in Root: open Root, then

TGeoManager::Import(“myclic.gdml”);
gGeoManager->GetTopVolume()->Draw(“ogl”); 
where ogl selects the OpenGL engine.

From SLIC, do

slic -g clic-sid_cdr.lcdd -n
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.

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
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback