Closed danieljeans closed 1 month ago
Hi @danieljeans
thank you for reporting the error. In addition to materialScan
tool, there is another one called g4MaterialScan
, it can be used as follows:
g4MaterialScan -c MDI_standalone_o1_v01.xml -p "0,0,0" -d "1,0,0"
...
Gun INFO Particle [0] geantino Mom:20.000 GeV vertex:( 0.000 0.000 0.000)[mm] direction:( 1.000 0.000 0.000)
MaterialScan WARN Starting tracking action for track ID=1
+--------------------------------------------------------------------------------------------------------------------------------------------------
+ Material scan between: x_0 = ( 0.00, 0.00, 0.00) [cm] and x_1 = (2500.00, 0.00, 0.00) [cm] TrackID:1:
+--------------------------------------------------------------------------------------------------------------------------------------------------
| \ Material Atomic Radiation Interaction Path Integrated Integrated Material
| Num. \ Name Number/Z Mass/A Density Length Length Thickness Length X0 Lambda Endpoint
| Layer \ [g/mole] [g/cm3] [cm] [cm] [cm] [cm] [cm] [cm] ( cm, cm, cm)
+--------------------------------------------------------------------------------------------------------------------------------------------------
| 1 Air 7 14.784 0.0012 30528.8402 71282.7920 0.999 1.00 0.000033 0.000014 ( 1.00, 0.00, 0.00)
| 2 Au 79 196.967 19.3200 0.3344 10.5404 0.001 1.00 0.001528 0.000061 ( 1.00, 0.00, 0.00)
| 3 AlBeMet162 7 15.841 2.1000 18.7945 39.2502 0.045 1.04 0.003922 0.001208 ( 1.04, 0.00, 0.00)
| 4 LiquidNDecane 5 10.296 0.7300 61.5867 91.4187 0.087 1.13 0.005341 0.002163 ( 1.13, 0.00, 0.00)
| 5 Air 7 14.784 0.0012 30528.8402 71282.7920 0.003 1.14 0.005341 0.002164 ( 1.14, 0.00, 0.00)
| 6 AlBeMet162 7 15.841 2.1000 18.7945 39.2502 0.033 1.17 0.007070 0.002992 ( 1.17, 0.00, 0.00)
| 7 Air 7 14.784 0.0012 30528.8402 71282.7920 2498.832 2500.00 0.088922 0.038047 (2500.00, 0.00, 0.00)
Are these numbers more sensible? Maybe @aciarma can comment on this :)
By the way, there is an error reported by Geant4, do you know if this can cause problems to geantinos?
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomSolids1001
issued by : G4TessellatedSolid::SetSolidClosed()
Defects in solid: "Componente1"_shape_0xdc263d0 - some facets have wrong orientation!
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomSolids1001
issued by : G4TessellatedSolid::SetSolidClosed()
Defects in solid: "Componente1"_shape_0xe9e3710 - some facets have wrong orientation!
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Thanks @atolosadelgado
the results from g4MaterialScan look reasonable to me.
It seems like the material description in g4 is fine, but that something is lost in translation when we look via the DDRec/MaterialManager ?
Regarding the "some facets have wrong orientation!" warning, I have no idea where this comes from (maybe a question for @aciarma ?) , or if this can cause any problems.
So.....I did some research. The DDRec MaterialManager and hence the corresponding MaterialScan use TGeo tracking through volumes. Tracking in TGeo is not implemented for tessellated shapes as they result from CAD shapes. Though TGeo tracking is used in the material scanner.... In TGeo tessellated surfaces behave like their bounding box. Hence they have no real shape and for this reason you only see a "box". This is my understanding. TGeo tracking will only be implemented once TGeo moves to VecGeom. For this reason the G4 material scan works and the TGeo material scan not.
I guess we can close this issue. Maybe we have to implement some warning if the traversed volume has a tessellated shape.
Thanks for pinpointing the cause. Adding a warning is an excellent idea in my opinion, and I suggest keeping the issue open until this is done
VecGeom tessellated navigation does not work properly (I reported that some time ago) but it looks to me very difficult to fix
A warning was added that covers this case.
Check duplicate issues.
Goal
list materials along a line in detector model which including CAD imports, using the materialScan utility.
Operating System and Version
ubuntu22
compiler
gcc11.4.0
ROOT Version
6.32.04
DD4hep Version
/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh -r 2024-09-04
Reproducer
Using the model defined in https://github.com/aciarma/k4geo/tree/commonMDI/FCCee/MDI/compact/MDI_o1_v01/MDI_standalone_o1_v01.xml which includes a beampipe from a CAD geometry. (n.b. You need to download the stl geometry files from https://fccsw.web.cern.ch/fccsw/filesForSimDigiReco/MDI/MDI_o1_v01/ )
For simplicity I commented out all detector components except
<include ref="Beampipe_CADimport_o1_v02.xml"/>
from the file MDI_standalone_o1_v01.xmlfirst I scan the geometry using a geantino, using ddsim:
I see something reasonable: a beampipe made of various layers, with inner radius ~10mm:
Then I try to run materialScan on the same model, listing material between 0,0,0 and 10,0,0 (cm)
materialScan MDI_standalone_o1_v01.xml 0 0 0 10 0 0
which shows very different material to what is expected: essentially a block of copper. Also the path lengths don't seem to be consistent (don't sum to 10cm)?
As far as I can see, materialScan uses DDRec/MaterialScan, and then further on DDRec/MaterialManager...
Any suggestions? thanks!
Additional context
No response