PS: yesterday , I want to know the Proton Flow intensity. So I write a algorithm to get it. First, I create a hist TH3D nd = new TH3D(“nd”, “Neutron Distribution”, 200, -1000, 1000, 200, -1000, 1000, 550, -1000, 4500);
the volume is 1cm1cm*1cm
When I get the (x,y,z) of particle (pre and post) So I build a vector to check whether the particle is in this volume. detail algorithm is here.(I check this algorithm the result is ok when I use fluka to do the same thing)(if you can help me find some bugs thank you very much) main.cc (11.5 KB)
I want to know whether is a easier way to get the same things.
And geat4 may only give the PreStepPoint,PostStepPoint
How do we build the energy distribution or some other distribution.
I want the the flux of protons through your PMMA. In Stepping action I use PreStepPoint and PostStepPoint to get these information. But if one step PrePosition is (0mm,0mm,0mm) to PostPosition(10mm,0mm,0mm) When I draw a 3D-Hist , the length of Volume is 1mm1mm1mm , I need to let the count +1 at (0,0,0)(1,0,0),(2,0,0),(3,0,0)to (10,0,0)
If another way to get the same result. Thanks
The Proton Distribution is similar. Suppose I want to know the Proton Energy Distribution in 101010mm PMMA (Use 10MeV proton ) (the length of Volume is 1mm1mm1mm) So I create a TH3D(“pd”,“proton distribution”,10,0,10,10,0,10,10,0,10) . If I get the energy deposited in one step , how to do it to get the proton distribution.
The generic distribution of particles is a function of 6 parameters (3 spatial and 3 momentum). I feel you wanted something else. Could you start not from what does not work but from where you want to be?
My mistake. I want to get the energy dose in the detector like example B1
My detector is 101010 However I need 111 region dose
other people say I can construct a 1000 detectors to compition the whole detector
Is any other way to achive this goal ?
this is I want to know.
When I only use 101010 detector to simulate。 The steppingAction give me the PrePosition and the PostPosition may be have more than 1mm So I can’t use the position information to calculate the dose.
If I understand correctly you want to map energy deposition in a 10x10x10 cm detector. However, often times when energy is deposited along a track in a single volume it is done in a single step, and it tells you the total energy deposited along the track. But you want to know the where the energy was deposited along the track in 1 mm segments.
I believe there may be a way to look at along track actions, but you may have a better time using parameterized volumes and checking the edep in each one.
Thank you
and “However, often times when energy is deposited along a track in a single volume it is done in a single step, and it tells you the total energy deposited along the track.” give a nice answer