| Summary: | Tracking problem with policapillary tubes and tori | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | ayut |
| Component: | processes/transportation | Assignee: | John Apostolakis <John.Apostolakis> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | ayut, Gabriele.Cosmo, tatiana.nikitina |
| Priority: | P2 | ||
| Version: | 8.0 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
The problem looks like a bug in the inplementation of boundary process. Sorry, I meant to add a comment. The central problem here is why does the G4Navigator not do a zero length step when the track is at the boundary and has undergone a reflection; i.e. reversed the photon momentum and the momentum is pointing back at the surface. I think, only John is expert enough to investigate this. Some comments after Geant 4.8.1. release. 1. The tracking problem in policapillary tube was resolved in this release. I have tested my geometry with different gamma incidence angles and I have not found any problems with gamma reflections. 2. The problem still remains for tori based geometry. I have tried to simplify this geometry and it has appeared that the problem is observed even for single torus. The navigator does not do a zero length step approximately in 5% of cases. For testing I run the program with: /geometry/navigator/verbose 4 /event/verbose 4 /tracking/verbose 4 Unfortunately I have not understood the message of the navigator. The log-files with various types of gamma backscattering is here: Wrong backscattering: http://hea.iki.rssi.ru/~ayut/geant/bcscatt_wrong.log Normal backscattering: http://hea.iki.rssi.ru/~ayut/geant/bcscatt_ok.log Strange case: http://hea.iki.rssi.ru/~ayut/geant/bcscatt_strange.log The source code of the program can be taken here: http://hea.iki.rssi.ru/~ayut/geant/glass1_4bugrep.tgz Kind regards, Alexey Tkachenko I am trying to understand whether the output provided sheds any light on the state of the navigator. Many thanks for the log and source files. The problem is no longer reproducible in the most recent versions. If still persisting, please open a new problem report. |
Dear all. Our group is developing an application to simulate transportation of gamma rays across polycapillary X-ray optics. We are currently using G4 v.8.0 on Debian platform with gcc 3.3.5. We are using G4Tubs for LeadGlass fibers and filling it by dense-packed G4Tubs channels of Air. The diameter of fiber is 1 mm. The diameter of channels is 20 micron. The distance between two channels is about 100 nm. The fiber and channels have the same length. The sample of our geometry you may see at the end of this report. We are shooting gamma to these channels at a small incident angle (~1 arc. min). For reflection of gamma we are using the our own GammaBoudaryProcess based on G4OpBoundaryProcess. In our process we are changing the momentum of reflected gamma at the boundary between Air and LeadGlass. The reflection probability is calculated from the atomic scattering factors f1 and f2. For testing we force gamma to backscatter and we have encountered the following tracking problem. For central channels our reflection is working properly and the momentum of the gamma is reversed in our GammaBoudaryProcess, the Navigator does a zero length step from LeadGlass to Air and then the gamma returns to the Air channel. But for non-central channel in some geometrical configurations the Navigator does not do a zero length step but continues in the LeadGlass fiber where the gamma is quickly absorbed by photoelectric effect. For testing I run our program with /tracking/verbose/ level set to 4. The detailed tracking information you may see below. The Air channels are not overlapping to each other. I activated the check in G4PVPlacement and did not see any overlaps. Then I tried to reduce the radius of my channels to 0.009 mm and set the distance between channels to 0.0021 mm. The reflection is not working anyway. It is substantial that this tracking error may be observed only for complicate geometry with rather big number of channels. If I take only one testing channel in the fiber the reflection is working properly. For the central channel the reflection is working properly for any configuration. It should be noted that we see this problem both for G4Tubs and for G4Torus based geometry. With kind regards, Alexey Tkachenko ========================================================== ========================================================== Detailed tracking information ========================================================== The distance between gun and the top of the channel is 0.1 mm. The gun is declined at the angle 1 arc.min. to the Z axis in the XZ plane. The initial position of gamma is: (0.2211,0,700.1) The initial Momentum Direct of gamma is: (0.000290888204563424,0,-0.9999999576920253) The position of center of testing channel is x=0.2211 mm; y=0.0. The channel radius is 0.01 mm. Here the "Fiber_holes" is a air channel and the "Klens_fiber" is a leadglass fiber. The momentum is really reversed after step 2 and the gamma position coincides with position of boundary. But the Navigator does not make the zero length step at the boundary on the step 3. ********************************************************************************************************* * G4Track Information: Particle = gamma, Track ID = 1, Parent ID = 0 ********************************************************************************************************* Step# X Y Z KineE dEStep StepLeng TrakLeng Volume Process 0 221 mum 0 fm 70 cm 20 keV 0 eV 0 fm 0 fm World initStep **PostStepDoIt (after all invocations): ++List of invoked processes 1) Transportation 2) GammaBoundary 3) phot (Forced) ++G4Step Information Address of G4Track : 0x84e4c70 Step Length (mm) : 0.1000000042308204 Energy Deposit (MeV) : 0 ----------------------------------------------------------------------- StepPoint Information PreStep PostStep ----------------------------------------------------------------------- Position - x (mm) : 0.2211 0.221129088821687 Position - y (mm) : 0 0 Position - z (mm) : 700.1 700 Global Time (ns) : 00.0003335641093106497 Local Time (ns) : 00.0003335641093106497 Proper Time (ns) : 0 0 Momentum Direct - x : 0.00029088820456342460.0002908882045634246 Momentum Direct - y : 0 0 Momentum Direct - z : -0.9999999576920253 -0.9999999576920253 Momentum - x (MeV/c): 5.817764091268492e-065.817764091268492e-06 Momentum - y (MeV/c): 0 0 Momentum - z (MeV/c): -0.01999999915384051-0.01999999915384051 Total Energy (MeV) : 0.02 0.02 Kinetic Energy (MeV): 0.02 0.02 Velocity (mm/ns) : 299.792458 299.792458 Volume Name : World Fiber_holes Safety (mm) : 0 0 Polarization - x : 0 0 Polarization - y : 0 0 Polarization - Z : 0 0 Weight : 1 1 Step Status : Undefined Geom Limit Process defined Step: Undefined Transportation ----------------------------------------------------------------------- #Step# X Y Z KineE dEStep StepLeng TrakLeng Volume Process 1 221 mum 0 fm 70 cm 20 keV 0 eV 100 mum 100 mum World Transportation **PostStepDoIt (after all invocations): ++List of invoked processes 1) Transportation 2) GammaBoundary 3) phot (Forced) ++G4Step Information Address of G4Track : 0x84e4c70 Step Length (mm) : 34.27746818554761 Energy Deposit (MeV) : 0 ----------------------------------------------------------------------- StepPoint Information PreStep PostStep ----------------------------------------------------------------------- Position - x (mm) : 0.221129088821687 0.2310999999991609 Position - y (mm) : 0 0 Position - z (mm) : 700 665.7225332646626 Global Time (ns) : 0.0003335641093106497 0.114670890719267 Local Time (ns) : 0.0003335641093106497 0.114670890719267 Proper Time (ns) : 0 0 Momentum Direct - x : 0.0002908882045634246-0.0002908882045634246 Momentum Direct - y : 0 -0 Momentum Direct - z : -0.9999999576920253 0.9999999576920253 Momentum - x (MeV/c): 5.817764091268492e-06-5.817764091268492e-06 Momentum - y (MeV/c): 0 -0 Momentum - z (MeV/c): -0.01999999915384051 0.01999999915384051 Total Energy (MeV) : 0.02 0.02 Kinetic Energy (MeV): 0.02 0.02 Velocity (mm/ns) : 299.792458 299.792458 Volume Name : Fiber_holes Klens_fiber Safety (mm) : 0 0 Polarization - x : 0 -0 Polarization - y : 0 -0 Polarization - Z : 0 -0 Weight : 1 1 Step Status : Geom Limit Geom Limit Process defined Step: Transportation Transportation ----------------------------------------------------------------------- #Step# X Y Z KineE dEStep StepLeng TrakLeng Volume Process 2 231 mum 0 fm 66.6 cm 20 keV 0 eV 3.43 cm 3.44 cm Fiber_holes Transportation **PostStepDoIt (after all invocations): ++List of invoked processes 1) Transportation 2) GammaBoundary 3) phot (Forced) ++G4Step Information Address of G4Track : 0x84e4c70 Step Length (mm) : 0.005773263875793082 Energy Deposit (MeV) : 0.015861 ----------------------------------------------------------------------- StepPoint Information PreStep PostStep ----------------------------------------------------------------------- Position - x (mm) : 0.2310999999991609 0.2310983206247976 Position - y (mm) : 0 0 Position - z (mm) : 665.7225332646626 665.7283065282942 Global Time (ns) : 0.114670890719267 0.1146901482546777 Local Time (ns) : 0.114670890719267 0.1146901482546777 Proper Time (ns) : 0 0 Momentum Direct - x : -0.0002908882045634246-0.0002908882045634246 Momentum Direct - y : -0 -0 Momentum Direct - z : 0.9999999576920253 0.9999999576920253 Momentum - x (MeV/c): -5.817764091268492e-06 -0 Momentum - y (MeV/c): -0 -0 Momentum - z (MeV/c): 0.01999999915384051 0 Total Energy (MeV) : 0.02 0 Kinetic Energy (MeV): 0.02 0 Velocity (mm/ns) : 299.792458 299.792458 Volume Name : Klens_fiber Klens_fiber Safety (mm) : 00.0001016793752024268 Polarization - x : -0 0 Polarization - y : -0 0 Polarization - Z : -0 0 Weight : 1 1 Step Status : Geom Limit PostStep Proc Process defined Step: Transportation phot ----------------------------------------------------------------------- #Step# X Y Z KineE dEStep StepLeng TrakLeng Volume Process 3 231 mum 0 fm 66.6 cm 0 eV 15.9 keV 5.77 mum 3.44 cm Klens_fiber phot Track (trackID 1, parentID 0) is processed with stopping code 2 A new track 0x84e4d18 (trackID 2, parentID 1) is passed to G4StackManager. ### pop requested out of 1 stacked tracks. Selected G4StackedTrack : 0x854af48 with G4Track 0x84e4d18 (trackID 2, parentID 1) Track 0x84e4d18 (trackID 2, parentID 1) is passed to G4TrackingManager. ---------------------------------------------------------------------------------------------- ========================================================== ========================================================== For further testing I sent the gamma along the normal at the boundary of channel after reflection (step 2). But the Navigator did not find my channel again and gamma is absorbed. ******************************************************************************* ******************************************************************************* **PostStepDoIt (after all invocations): ++List of invoked processes 1) Transportation 2) GammaBoundary 3) phot (Forced) ++G4Step Information Address of G4Track : 0x84e4c30 Step Length (mm) : 34.27746818554761 Energy Deposit (MeV) : 0 ----------------------------------------------------------------------- StepPoint Information PreStep PostStep ----------------------------------------------------------------------- Position - x (mm) : 0.221129088821687 0.2310999999991609 Position - y (mm) : 0 0 Position - z (mm) : 700 665.7225332646626 Global Time (ns) : 0.0003335641093106497 0.114670890719267 Local Time (ns) : 0.0003335641093106497 0.114670890719267 Proper Time (ns) : 0 0 Momentum Direct - x : 0.0002908882045634246 -1 Momentum Direct - y : 0 -0 Momentum Direct - z : -0.9999999576920253 -0 Momentum - x (MeV/c): 5.817764091268492e-06 -0.02 Momentum - y (MeV/c): 0 -0 Momentum - z (MeV/c): -0.01999999915384051 -0 Total Energy (MeV) : 0.02 0.02 Kinetic Energy (MeV): 0.02 0.02 Velocity (mm/ns) : 299.792458 299.792458 Volume Name : Fiber_holes Klens_fiber Safety (mm) : 0 0 Polarization - x : 0 -1 Polarization - y : 0 -0 Polarization - Z : 0 -0 Weight : 1 1 Step Status : Geom Limit Geom Limit Process defined Step: Transportation Transportation ----------------------------------------------------------------------- #Step# X Y Z KineE dEStep StepLeng TrakLeng Volume Process 2 231 mum 0 fm 66.6 cm 20 keV 0 eV 3.43 cm 3.44 cm Fiber_holes Transportation **PostStepDoIt (after all invocations): ++List of invoked processes 1) Transportation 2) GammaBoundary 3) phot (Forced) ++G4Step Information Address of G4Track : 0x84e4c30 Step Length (mm) : 0.005773263875793082 Energy Deposit (MeV) : 0.015861 ----------------------------------------------------------------------- StepPoint Information PreStep PostStep ----------------------------------------------------------------------- Position - x (mm) : 0.2310999999991609 0.2253267361233678 Position - y (mm) : 0 0 Position - z (mm) : 665.7225332646626 665.7225332646626 Global Time (ns) : 0.114670890719267 0.1146901482546777 Local Time (ns) : 0.114670890719267 0.1146901482546777 Proper Time (ns) : 0 0 Momentum Direct - x : -1 -1 Momentum Direct - y : -0 -0 Momentum Direct - z : -0 -0 Momentum - x (MeV/c): -0.02 -0 Momentum - y (MeV/c): -0 -0 Momentum - z (MeV/c): -0 -0 Total Energy (MeV) : 0.02 0 Kinetic Energy (MeV): 0.02 0 Velocity (mm/ns) : 299.792458 299.792458 Volume Name : Klens_fiber Klens_fiber Safety (mm) : 00.002554458450100438 Polarization - x : -1 -2 Polarization - y : -0 0 Polarization - Z : -0 0 Weight : 1 1 Step Status : Geom Limit PostStep Proc Process defined Step: Transportation phot ----------------------------------------------------------------------- #Step# X Y Z KineE dEStep StepLeng TrakLeng Volume Process 3 225 mum 0 fm 66.6 cm 0 eV 15.9 keV 5.77 mum 3.44 cm Klens_fiber phot ---------------------------------------------------------------------------------------------- ========================================================== ========================================================== Sample of polycapillary tubs geometry ========================================================== const G4int n_Holes_max = 1000000; G4double Klens_L = 300.*mm; G4double Klens_hole_r = 0.01*mm; G4double Klens_hole_dr = 0.0201*mm; G4double Klens_fiber_r = 0.5*mm; G4double Klens_fiber_wall = 0.01*mm; // ----- Holes positions ----- G4int n_Holes_level, ih, jh, hole_num; G4double pos_hole_dh, pos_hole_R, pos_hole_angle, pos_hole_dang, pos_hole_dist; G4double dpos_hole_Rtor, dpos_hole_z; G4bool next_Holes_level = true; Holes_dRtor[0] = 0.0; Holes_dZ[0] = 0.0; n_Holes_level = 1; hole_num = 1; while (next_Holes_level) { next_Holes_level = false; pos_hole_R = Klens_hole_dr*n_Holes_level; for (ih=1; ih<=n_Holes_level; ih++) { pos_hole_dh = Klens_hole_dr*(ih-1); pos_hole_dist = std::sqrt(pos_hole_R*pos_hole_R + pos_hole_dh*pos_hole_dh - pos_hole_R*pos_hole_dh); pos_hole_dang = std::asin(std::sin(60.0*deg) * pos_hole_dh / pos_hole_dist); if ((pos_hole_dist+Klens_hole_r) < (Klens_fiber_r-Klens_fiber_wall)) { next_Holes_level = true; for (jh=0; jh<6; jh++) { pos_hole_angle = jh*60.0*deg + pos_hole_dang; dpos_hole_Rtor = std::cos(pos_hole_angle)*pos_hole_dist; dpos_hole_z = std::sin(pos_hole_angle)*pos_hole_dist; Holes_dRtor[hole_num] = dpos_hole_Rtor; Holes_dZ[hole_num] = dpos_hole_z; hole_num++; } } } n_Holes_level++; } NbOfHoles = hole_num; // ----- Center fiber (G4Tubs) ----- Klens_center_fiber = new G4Tubs("Fiber",0.0*mm,Klens_fiber_r,Klens_L/2.0,0.0*deg,360.0*deg); Klens_fiber_log = new G4LogicalVolume(Klens_center_fiber, LeadGlass,"Fiber_log",0,0,0); Klens_fiber_phys = new G4PVPlacement( 0,G4ThreeVector(0.0*mm,0.0*mm,700.0*mm-Klens_L/2.0), Klens_fiber_log,"Klens_fiber",World_log,false,1,false); // ----- Initial hole ----- Klens_tubs_hole = new G4Tubs("Hole",0.0*mm,Klens_hole_r,Klens_L/2.0,0.*deg,360.0*deg); Klens_hole_log = new G4LogicalVolume(Klens_tubs_hole, Air,"Hole_log",0,0,0); G4double nh=0; for (hole_num = 0; hole_num < NbOfHoles; hole_num++) { nh++; Klens_hole_phys = new G4PVPlacement( 0,G4ThreeVector(Holes_dRtor[hole_num],Holes_dZ[hole_num],0.0), Klens_hole_log,"Fiber_holes",Klens_fiber_log, false,nh,false); } ========================================================== ==========================================================