Closed saraheno closed 1 year ago
How does one tell that photons have left the media?
Visually, via the interactive display when running an event. In this attachment, you can see one coming out at the bottom.
Can you list the geant4 commands you are using to enable the tracks etc.?
do you mean these ones: https://github.com/saraheno/SingleDualCrystal/blob/main/compact/vis.mac
Yes, those were the commands I was looking for. I can see the same escaping photons.
I have no experience with optical surfaces. So apart from saying I see the same thing, I don't know any further. I did notice though that your values for the reflectivity values do not seem to cover the energy of the optical photons printed out when running your simulation. Though extending the range didn't make the escaping stop either.
So should I maybe contact the GEANT4 team? Can I add you in, as they may be reluctant to help us with it since it is attached via dd4hep?
Hi Hans, I made the gdml file following Andre's instructions. I see the surface in two lines in the file:
and
<bordersurface name="/world/DRCrystal#HallCrys" surfaceproperty="/world/DRCrystal#mirrorSurface">
so I think that the surface is in there? And yet photons are escaping the crystal? Is this something you can help with?
Best Sarah Eno
@MarkusFrankATcernch @hanswenzel I want to make sure I understand where we are on this. Is it:
Is this summary correct? Do both of you agree with this summary?
@saraheno
@hanswenzel How does one check with Geant4 the validity of GDML ? If the file below is syntactically correct, I could submit the fix to the ROOT team...
actually I am using https://github.com/hanswenzel/CaTS to visualize geometries input in form of gdml. It comes with quite a few examples in the gdml directory.
One extension to the gdml file that I make use of is that you can apply visual attributes (colors/transparency) to volumes. I find it helps to debug geometries. Also it gives you access to the geometry tools available in Geant4 (e.g. overlap check) and verifies that the geometry is valid. (Usually it will just crash when things are wrong.) Give it a try and and let me know how it goes. Another quick check can be done with editors (emacs) and IDE's (netbeans, visual code) that have a xml mode each of them will high lite xml syntax errors.
So I fixed this by changing the optical surface from opticalsurface name="/world/DRCrystal#mirrorSurface" finish="polished" model="glisur" type="dielectric_dielectric"
to opticalsurface name="/world/DRCrystal#mirrorSurface" finish="polished" model="glisur" type="dielectric_metal"
I guess even though both my volumes were technically dielectrics, this is what is needed for perfect reflection.
Hi, I am trying to now use the optical surfaces in my code. However, it does not seem to be working. I tried to put in a perfect mirror surface at: https://github.com/saraheno/SingleDualCrystal/blob/d8edfe896acbea941322f6fb97207bb142d8faa4/compact/DRJunk.xml#L212
This is used in the geometry at https://github.com/saraheno/SingleDualCrystal/blob/d8edfe896acbea941322f6fb97207bb142d8faa4/src/DRCrystal_geo.cpp#L213
but when I try running using
ddsim --compactFile=./DRJunk.xml --runType=vis -G --steeringFile junkst.py --outputFile=testSCEPCAL.root --part.userParticleHandler='' -G --gun.position="0.,30.,0." --gun.direction "0 -1 0" --gun.energy "1*GeV" --gun.particle="mu-"
photons are still escaping the media. Is the optical surface at the wrong place? do I need to put it in between the layers and the tower, and not the tower and the environment? or is that surface not really a mirror?
thank you, Sarah Eno