SSD geom : checking overlaps with ROOT

doc :
  1. from : ROOT geometry package
  2. TGeoChecker
a) TGeoChecker has also a method RandomPoints, that are generated in the bounding box of the drawn volume.
y2014a reports several overlaps for SSD (currently SisdGeo7.xml) 

With a .root geometry file (1st line is to use ROOT GL viewer)
root [2] dyson->GetVolume("SFMO")->Draw("ogl")
root [3] dyson->GetVolume("SFSM")->RandomPoints()
Random box : 3.900000, 2.500000, 50.950001
Start... 1000000 points
10 percent
(...)
100 percent
Number of visible points : 70909
efficiency : 0.070909
---Daughters of SFSM made invisible.
---Make them visible with : gGeoManager->GetTopVolume()->VisibleDaughters();
root [4] dyson->GetVolume("SFSM")->VisibleDaughters()

 
b) TGeoChecker has also some [funny] lego plots to show the radiation length of a TGeoVolume, in spherical coordinates ...
<include plots>

c) Some other [random] commands of TGeoChecker :

1- checking the overlaps with precision =0.1 (here precision is in cm) and then print them :
root [25] dyson->CheckOverlaps(0.1,"d")
Info in <TGeoNodeMatrix::CheckOverlaps>: Checking overlaps for HALL and daughters within 0.1
Check overlaps:      [==========]  281835 [100.00 %]   TIME 00:00:05             
Info in <TGeoNodeMatrix::CheckOverlaps>: Number of illegal overlaps/extrusions : 161
root [26] dyson->PrintOverlaps()
=== Overlaps for dyson ===
2- a bit more useful : overlaps for a given volume :
--> get overlaps for a given  volume
--> then print them
root [34] dyson->GetVolume("PSUP")->CheckOverlaps(0.1,"d")

Info in <TGeoVolume::CheckOverlaps>: Number of illegal overlaps/extrusions for volume PSUP: 14
root [35] dyson->PrintOverlaps()
=== Overlaps for dyson ===
 = Overlap ov000: PSUP extruded by: PSUP/PSCL_1 ovlp=20.75
 = Overlap ov001: PSUP extruded by: PSUP/PSCK_1 ovlp=20.75
 = Overlap ov002: PSUP extruded by: PSUP/PSCK_2 ovlp=20.75
 = Overlap ov003: PSUP extruded by: PSUP/PSDE_4 ovlp=0.104253
 = Overlap ov004: PSUP/PSCC_1 overlapping PSUP/PSHI_1 ovlp=0.584583
 = Overlap ov005: PSUP/PSHG_1 overlapping PSUP/PSHU_1 ovlp=0.434491
 = Overlap ov006: PSUP/PSCC_1 overlapping PSUP/PSHI_2 ovlp=0.288124
 = Overlap ov007: PSUP/PSAD_1 overlapping PSUP/PSAF_1 ovlp=0.225862
 = Overlap ov008: PSUP/PSHI_2 overlapping PSUP/PSMD_1 ovlp=0.18
 = Overlap ov009: PSUP/PSHP_1 overlapping PSUP/PSDA_3 ovlp=0.124299
 = Overlap ov010: PSUP/PSCR_1 overlapping PSUP/PSCW_1 ovlp=0.109863
 = Overlap ov011: PSUP/PSCR_2 overlapping PSUP/PSCW_2 ovlp=0.10986
 = Overlap ov012: PSUP/PSHE_1 overlapping PSUP/PSHU_1 ovlp=0.109512
 = Overlap ov013: PSUP/PSCM_5 overlapping PSUP/PSCR_1 ovlp=0.108419
(useful because can be implemented easily in a macro and loop over the volumes of a given detector)


update : 09/03
it looks like option s prints all the overlaps :
root [4] dyson->GetVolume("SFDM")->CheckOverlaps(0.0001,"sd")
Info in <TGeoChecker::CheckOverlapsBySampling>: #Found 15 overlaps adding-up to 35.3458 +/- 0.195901 [cm3] for daughters of SFD
Info in <TGeoVolume::CheckOverlaps>: Number of illegal overlaps/extrusions for volume SFDM: 15
root [5] dyson->PrintOverlaps()
=== Overlaps for dyson ===
 = Overlap ov000: Volume SFDM: node SFSW_15 overlapping SFSW_16 ovlp=0.149998
 = Overlap ov001: Volume SFDM: node SFSW_3 overlapping SFSW_4 ovlp=0.149995
 = Overlap ov002: Volume SFDM: node SFSW_13 overlapping SFSW_14 ovlp=0.149981
 = Overlap ov003: Volume SFDM: node SFSW_7 overlapping SFSW_8 ovlp=0.149979
 = Overlap ov004: Volume SFDM: node SFSW_12 overlapping SFSW_13 ovlp=0.149966
 = Overlap ov005: Volume SFDM: node SFSW_14 overlapping SFSW_15 ovlp=0.149963
 = Overlap ov006: Volume SFDM: node SFSW_1 overlapping SFSW_2 ovlp=0.14996
 = Overlap ov007: Volume SFDM: node SFSW_4 overlapping SFSW_5 ovlp=0.14989
 = Overlap ov008: Volume SFDM: node SFSW_6 overlapping SFSW_7 ovlp=0.149875
 = Overlap ov009: Volume SFDM: node SFSW_10 overlapping SFSW_11 ovlp=0.149869
 = Overlap ov010: Volume SFDM: node SFSW_11 overlapping SFSW_12 ovlp=0.149869
 = Overlap ov011: Volume SFDM: node SFSW_5 overlapping SFSW_6 ovlp=0.149828
 = Overlap ov012: Volume SFDM: node SFSW_2 overlapping SFSW_3 ovlp=0.149825
 = Overlap ov013: Volume SFDM: node SFSW_9 overlapping SFSW_10 ovlp=0.149783
 = Overlap ov014: Volume SFDM: node SFSW_8 overlapping SFSW_9 ovlp=0.149724

where option d only shows overlaps for the 1st and last wafers :
root [6] dyson->GetVolume("SFDM")->CheckOverlaps(0.0001,"d")
Info in <TGeoVolume::CheckOverlaps>: Number of illegal overlaps/extrusions for volume SFDM: 
root [7] dyson->PrintOverlaps()
=== Overlaps for dyson ===
 = Overlap ov000: SFDM extruded by: SFDM/SFSW_1 ovlp=0.075
 = Overlap ov001: SFDM extruded by: SFDM/SFSW_16 ovlp=0.075
So it seems there are 2 type of errors :
  1. overlap between wafers inside the SFDM volume : wafer 1-->2, wafer 2-->3
  2. overlap over wafer 1 (SFSW_1) with the mother volume (SFDM, same for wafer_16