Problem 1022 - Relocation problem upon photon reflection from a volume built with G4IntersectionSolid with either sphere or ellipsoid
Summary: Relocation problem upon photon reflection from a volume built with G4Intersec...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: other
Hardware: All All
: P4 normal
Assignee: tatiana.nikitina
URL:
Depends on:
Blocks:
 
Reported: 2008-08-28 03:13 CEST by gum
Modified: 2009-08-03 11:26 CEST (History)
2 users (show)

See Also:


Attachments
Tar File of Example (84.53 KB, application/x-compress)
2008-08-28 03:13 CEST, gum
Details

Note You need to log in before you can comment on or make changes to this problem.
Description gum 2008-08-28 03:13:02 CEST
Created attachment 29 [details]
Tar File of Example

As reported by Whitney in:

http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/geometry/684.html

Whitney builds an elliptical mirror:

 G4Ellipsoid * ellipsoidMirrorOutside = new G4Ellipsoid("farmirror Ellipsoid outside",
       farToroidalAxisRadius+farToroidalTubeRadius+mirrorThickness ,
       farToroidalTubeRadius+mirrorThickness,
       farToroidalAxisRadius+ farToroidalTubeRadius+mirrorThickness,
       5*cm,
       farToroidalAxisRadius+ farToroidalTubeRadius+mirrorThickness );

 G4Ellipsoid * ellipsoidMirrorInside = new G4Ellipsoid("farmirror Ellipsoid inside",
       farToroidalAxisRadius+farToroidalTubeRadius,         farToroidalTubeRadius,
       farToroidalAxisRadius+farToroidalTubeRadius);

G4SubtractionSolid * shell  = new G4SubtractionSolid("Outside - Inside Ellipsoid", ellipsoidMirrorOutside ,ellipsoidMirrorInside);

 G4Box* farMirrorBox2 = new G4Box("nearMirrorBox", xFarMirrorBox/2, yFarMirrorBox/2, (farToroidalAxisRadius)/2);

G4IntersectionSolid * farMirrorGlassElliptical = new G4IntersectionSolid("3mm glass elliptical mirror", farMirrorBox2, shell,0,G4ThreeVector(0,0,-farToroidalAxisRadius-farToroidalTubeRadius));

 G4LogicalVolume * mirror_log = new G4LogicalVolume(farMirrorGlassElliptical, Glass,"sphere subtracted",0,0,0);
 G4VPhysicalVolume * mirror_phys = new G4PVPlacement(0,G4ThreeVector(0,0,0), mirror_log , "toroid phys",  expHall_log, false,0);

Now, when he launches an optical photon at this mirror:

*********************************************************************************************************
* G4Track Information:   Particle = opticalphoton,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
  0      0 fm      0 fm     -2 m       3 eV      0 eV      0 fm      0 fm        World    initStep
Photon at Boundary!
Old Momentum Direction: (-0.0011909028,0.0030247129,0.99999472)
Old Polarization:       (-0.96734311,0.25346325,-0.0019186754)
New Momentum Direction: (0.0030773681,-0.015315891,-0.99987797)
New Polarization:       (0.96733257,-0.25341795,0.006858997)
*** SpikeReflection ***
  1  -2.38 mm   6.05 mm  -30.3 um      3 eV      0 eV      2 m       2 m         World  Transportation

everything fine till here, we have reflection off the mirror, just where we want it, but now:

Photon at Boundary!
Old Momentum Direction: (0.0030773681,-0.015315891,-0.99987797)
Old Polarization:       (0.96733257,-0.25341795,0.006858997)
New Momentum Direction: (0.0030773681,-0.015315891,-0.99987797)
New Polarization:       (0.79437319,0.6073913,-0.006858997)
*** FresnelRefraction ***
  2  -1.98 mm   4.07 mm  -12.9 cm      3 eV      0 eV   12.9 cm   2.13 m    toroid phys  Transportation
                                                                                                                     *********
                                                                                                                THE PROBLEM
it should be 'World".

Since the photon finds itself inside 'toroid phys' it finds the extend (farMirrorBox2) and thus another boundary of it going the opposite direction.

He gets the same problem changing to G4Sphere; i.e. to a spherical mirror.

The problem is an incorrect reallocation after reflection of mirrors constructed this way. Can this G4 bug be fixed? Can he construct an ellipsoid mirror a different way? 

=============================================

Please, take a careful look at my posting:

http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/684/1/1/1/1/1.html

An elliptical mirror is built by first doing G4SubtractionSolid and then G4IntersectionSolid to cut out only a rectangular piece. The problem is that a photon comes in, reflects off the mirror, but the reflection 'reallocates' the photon to be inside 'toroid phys' (the intersection volume) when it should be in the world.

Please, take a look at the photo:

http://astro.temple.edu/~whit/mirror/ellipticalmirrorWithIntersection.jpg

After reflection photons stop because they 'see the box boundary' when the box is only used to 'cut out' (intersect) the desired part of the 'shell' (elliptical mirror).

I have attached the tar-file of the directory I used to verify the user's problem. If you install and run the example, you'll find what's the problem with the tracking. I would have expected that intersecting a shell (spherical or elliptical - doesn't matter) with a box would produce a shell with rectangular edges and that's it for the extend of 'farMirrorGlassElliptical', but that's apparently not the case because, after reflection, the photon encounters the side of farMirrorBox2.
Comment 1 tatiana.nikitina 2008-09-02 11:15:14 CEST
 Dear Peter,
 I will investigate this problem starting with Spherical Mirrors.

 Tatiana
Comment 2 tatiana.nikitina 2008-09-03 16:40:04 CEST
Dear Peter,

The problem with the mirror, constructed using G4Sphere, was fixed already in the
last reference tag '4.9.1.ref07'.
Most likely the similar issue is valid for G4Ellipsoid. 
This case is under investigation.

Best Regards,
Tatiana
Comment 3 tatiana.nikitina 2009-08-03 11:26:13 CEST
Dear Peter,

 The problem with G4Ellipsoid is solved, the fixes are included in the tag "geom-specific-V09-02-04".

 Tatiana Nikitina