Geometry validation

Once the desired geometry is implemented in DD4hep, one need a way to compare it with the existing descriptions from Mokka or GeomConverter. This wiki describes several options for doing this. Lots of thanks to Andrei Gheață and Nikiforos Nikiforou for demonstrating how everything works.

Visual validation

First step is of course visual validation.To compare by eye an existing geometry with the newly implemented geometry in DD4hep, one should use the visualisation tools described in the VisuDet wiki.

Checking overlaps

Let's say we start with the examples/CLICSiD geometry and we remove everything except the ECal Barrel and EndCap components.

Running ./geoDisplay compact/ECal.xml as described here, we load this geometry in memory and display it using the TGeo class from ROOT:


To check overlaps or extrusions, from ROOT prompt run

root [0]  gGeoManager->CheckOverlaps(0.01);
where the precision is given in cm. This will report any overlaps/extrusions:
Info in <TGeoNodeMatrix::CheckOverlaps>: Number of illegal overlaps/extrusions : 31
To visualise the overlaps/extrusions, navigate in the ROOT TBrowser to worldIllegal overlaps and you will be able to see something like this:


The offending subvolumes are highlighted in red.

Shooting particles with Geant4/SLIC

One can shoot particles using SLIC MC, and save output to a slcio file, then use anajob or dumpevent to compare hit positions.

To do this, setup ilcsoft to get access to SLIC and the LCIO libraries (for later processing of slcio files). Then create a file, e.g. particleGun.mac, containing something like this:

/generator/select gps
/gps/pos/type Point
/gps/pos/centre 0. 0. 0.
/gps/ang/type iso
/gps/ang/mintheta 90 deg
/gps/ang/maxtheta 90 deg
/gps/ang/minphi 10 deg
/gps/ang/maxphi 10 deg
/gps/ene/type Mono
/gps/ene/mono 99.8944 GeV
/gps/ene/gradient 0
/gps/ene/intercept 1
/gps/particle mu-
/random/seed 123456789
/run/beamOn 1 

Run SLIC, loading the geometry and running this macro:

slic -g geometry.lcdd -m particleGun.mac

This will create a file named outfile.slcio. Now run:

anajob outfile.slcio
to see hit counts, or
dumpevent outfile.slcio 1
or use (attached, modify at will) to print various hit parameters.

Stress tests

If you don't have that already, then install your own version of ROOT, so that you can customise it. Then go to $ROOTSYS/test and edit ...

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng ECal1.png r1 manage 17.7 K 2014-06-19 - 14:00 DanProtopopescu ECal visualised in geoDisplay
Texttxt r1 manage 1.3 K 2014-06-16 - 14:24 DanProtopopescu Script used to extract hit positions from slcio file
PNGpng extrusion.png r1 manage 32.2 K 2014-06-19 - 14:01 DanProtopopescu Extrusion detected by CheckOverlaps()
Edit | Attach | Print version | History: r12 | r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 2014-06-19 - DanProtopopescu
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback