Open asalzburger opened 1 year ago
A plot where the FLUKA plot is from the cylinder that Mika uploaded (cylExampl.txt).
Geant4 in orange and FLUKA in blue.
A plot where the FLUKA plot is the converted Geant4 geometry.
Geant4 in orange and FLUKA in blue.
I'm checking if I can find anything that could be causing the strange results.
Cool stuff though. I am confident we find the problem.
Me and Mika had a look at the FLUKA input files generated by pyg4ometry last Friday. The strange results were caused by an error in the definition of the silicon tube and its surroundings. I will check if there is something wrong with the way I defined the geometry in pyg4ometry that could be confusing the converter.
It seems like I just made a mistake somewhere in my code. After I looked through the code and automated the whole conversion and comparison process the converted Geant4 output values are now exactly the same as in the output from Mika's premade example. So the conversion works.
That is excellent, can you expand this to a multi layered cylinder of different materials at next?
Yes. Any wishes for the materials? And should the silicon be the the outermost or innermost material or is it irrelevant?
Multiple cylinders and multiple layers implemented. Everything seems normal so far.
Fantastic - does the loop to fluka still work?
Yes, the loop still works. One thing I noticed is that when the number of layers is increased to over 6 the graphs start to diverge. Should they still be the same? This only seems to happen when the number of layers is increased. The number of cylinders does not affect this.
1 layer
6 layers
8 layers
16 layers
Interesting, can it be that the cylinders intersect if they are too many?
Maybe. FLUKA's graphical interface Flair gives warnings that the cylinders are touching each other. Mika mentioned something about that shapes should not be set to start exactly where another shape ends in FLUKA so I can try adding 0.1 between the cylinders and post an update here.
Good idea, please keep a thin separation between the cylinders.
The warnings about that the cylinders are touching are gone after I added a small gap between them, but the divergence still remains. There are still some warnings about that the surrounding space is touching the edges of the cylinders (in FLUKA) so I can try to see if I can make some changes so that all the warnings disappear.
Could it be that one of the materials is not recognized?
Fixing the warnings about the polygons touching each other didn't help, so there doesn't seem to be any problem in the conversion process. I tried fixing the warnings manually to see if it would have any effect, but the results were the same.
It could be something with the materials in the ACTS material recording. When I launch it the beginning it gives warnings about that the materials are referenced before they are declared.
G4GDML: Reading 'silicon_cylinder.gdml'... G4GDML: VALIDATION ERROR! ID attribute 'G4_U' is referenced but was never declared at line: 73 G4GDML: VALIDATION ERROR! ID attribute 'G4_Ag' is referenced but was never declared at line: 73 G4GDML: VALIDATION ERROR! ID attribute 'G4_Au' is referenced but was never declared at line: 73 G4GDML: VALIDATION ERROR! ID attribute 'G4_Si' is referenced but was never declared at line: 73 G4GDML: VALIDATION ERROR! ID attribute 'G4_Galactic' is referenced but was never declared at line: 73 G4GDML: Reading definitions... G4GDML: Reading materials... G4GDML: Reading solids... G4GDML: Reading structure... G4GDML: Reading setup... G4GDML: Reading 'silicon_cylinder.gdml' done!
Is there aything I can do about this?
You could in fact do the cross check by hand: the radiation lengths of materials can be obtained from tables, e.g the NIST database. Together with the thickness of the cylinders you can calculate it by hand - the shape comes from the incident angle.
In the last task "Introduce binning in z/phi as different cylinder (segments)", what is meant by "binning"? I assume the task is just about checking that it is possible to create segments, but I wanted to check this detail.
Exactly, basically, with different layers for different material sand segments in z, phi, we can adjust the granularity of the description accordingly.
Validation:
1 [mm] / X0 [mm]
n
layers of Silicon of each 1 mm thickness at normal incident, the amount of material you see is multiplied by n
Cross-check:
n
Next step afterwards:
phi
and z
The Geant4 material recordings seem to scale correctly. At higher number of layers the scaling factor seems to become a bit smaller, but it still looks alright. These results were for one material (silicon) with increased layers, but the results also scaled correctly with more materials.
Geant4 1 layer
Geant4 2 layers
Geant4 6 layers
Geant4 16 layers
Geant4 32 layers
In the FLUKA simulations something seems to go wrong with 6+ layers. The results scale correctly for up to 5 layers, but after that the results are just the same as for 5 layers.
FLUKA 1 layer
FLUKA 2 layers
FLUKA 2 layers
FLUKA 4 layers
FLUKA 5 layers
FLUKA 6 layers
FLUKA 16 layers
FLUKA 32 layers
Here are also the results from when 4 different materials (silicon, lithium, aluminium and titanium) were used for the Geant4 material recordings.
Geant4 4 layers 4 materials
Geant4 8 layers 4 materials
Geant4 12 layers 4 materials
Geant4 16 layers 4 materials
Geant4 20 layers 4 materials
Is the code/produced files somewhere that I can look at it? I would like to see if there's anything odd with the Fluka conversion.
In particular, I would like to see the cylinder generation in python, to see if our envelope volume is big enough.
Also, just to make sure we have checked Mika's concern: if you make n cylinders, can you - as a cross-check - make the additional cylinders at decreasing radius and not increasing ones?
Hey @H4m5t3r - looking through your code I see that the FLUKA conversion always uses the GDML file at input - did you try to convert to FLUKA on the fly when you create the Geant4 geometry? Probably the file conversion is the problem for the 6 layer cutoff?
Did you check this?
Use the same cylinder source and create
You can upload your results here.
Expand to multi-layer cylinder (and binning)