Hello I simulated a e+ beam 45GeV hitting 2 circualr targets having diameter 1.5 cm, thickness 3mm and distance between them 2cm.
I’m interested to stud the released energy from e+ in the 2 targets. In this post Target temperature - #16@mkelsey some weeks ago proposed me to add the scoring mesh or to store in the ROOT file the hit points in my 2 targets (called Envelope and Envelope2) so to get Root plots of releases energy vs hit points. Given that I have the steppingaction in my simulation, I did the second one. Anyway, my supervisor asked me to add the scoring mesh, so
In exampleB1.cc I addes
a. #include “G4ScoringManager.hh”
b. G4ScoringManager* scoringManager = G4ScoringManager::GetScoringManager();
as you can see in the following printscreen
Notice that I wrote /score/mesh/cylinderSize 0 cm. 0.75 cm 0.15 cm 0. 6.28 because I have 2 circular targets having diameter 1.5 cm, thickness 3mm and distaince between them 2cm; i.e. I wrote the numbers following the way to define the G4Tubs
The error tells you that you make a mistake in the parameters of /score/mesh/cylinderSize (“parameter out of range R>0”).
Have a more careful look at the RE03 example (in particular at run4.mac which contains a cylindrical mesh) and do not guess the parameters. You can also check it in the GUI of your example, the help tree contains all the commands with guidance.
Also, pay attention to little details like cm., the dot at the end would prompt the next error (if it wasn’t for the 0 in front).
Thank you @anna I read the run4.mac of the RE03 example, so given that my tartgets have diameter 1.5cm and thickness 0.3 cm, I guess I must write
/score/mesh/cylinderSize 0.75 0.15 cm
Moreover, given that my second target is placed in 0., 0., 2.3cm I guess that I must write (for the second target) /score/mesh/translate/xyz 0. 0. 2.3 cm
I don’t get any plots about the released energy in my two targets (that is what my supervisor wants )…
please @anna or @mkelsey , can you check what I’m getting wrong? Moreover, I would like to know if it’s possible to save the plots of scoring mesh in my Root file (when I will be able to get them)
For (1), it looks like you’re defining the same filters twice, in the blocks for the two separate meshes. Check the documentation to see if that’s necessary.
For (2), are you sure you’re running in the correct directory? At your terminal prompt, what does
ls drawCylinderSlice.mac
report back? Do you have a /control/macroPath command in your macros?
If I understand right, it says that eMinusFilter is overwitten by muMinusFilter and ePlusFilter by muPlusFilters, but I setted e+/- and mu+/- filters because I want both energies released by e+/- and mu+/-.
Yes, I’m running in the correct directory!
This is my B1 directory in wich I’ve both run1.mac and drawCylinderSlice.mac and this is the run command
Yes, I see. Screen shots are very hard to read; sorry.
The ls command is how you get a directory listing in Linux. If you’re on Windows, use whatever comman is appropriate. Is the file you’re expecting to see in your current working directory when you are running?
You should need a /control/macroPath to find file in your current working directorly.
What documentation are you reading to try to solve these problems for yourself? Can you provide links to the documentation you have used? That would help the Geant4 developers to improve the documentation.
Once again, I suggest to have a look at the error that is printed, it is vital to understanding what is wrong. What you point with an arrow says “Illegal parameter”, not a wrong command. It’s what you pass to it that poses a problem. Did you try to pass the path in a different way? E.g. a relative path? I have no clue how it should work on windows, maybe c:/B1/ would, that’s what was the output of your previous search.
@anna thank you I’m going to open a thread in that category!
Anyway, I get the same error even if I try to run on the laboratory machine (it isn’t a windows machine)! Following your help I use Geant in this way using cvmfs.
It’s not clear what you have inside your macro. Do you execute vis.mac from run1.mac? vis.mac contains all the necessary UI commands to run the visualization.
It’s executed from init_vis.mac if you want to know how to execute it. But you do not need it, however you need parts of it that initialize visualization. Have a look inside, it is heavily documented.
Hi @anna my supervisor just said me that I can do the scoring mesh saving the results into a ASCII files instead of the visualization method…is there an example to do the scoring mesh saving results into a ASCII file?
I looked again at this very long thread. We all try to help you, but, as Anna said, you have to look at the output and fix things. For example, the scoring manager is telling you there is no vis system. This is probably because you /vis/disable (why did you do that?).
(a) You have to write the numbers as required by the command. Look at the command guidance help /score/mesh/cylinderSize
It may or may not be the same as the way to define G4Tubs.
(b) There is an obvious mistake in your line. There should not be a dot after cm.
The scoring manager allows you to dump the results of scoring to a file. There are several commands. Use help /score or ls /score.