Forum: Processes Involving Optical Photons Not Logged In (login)
Show subscribers

This forum deals with optical photon processes, including scintillation and Cerenkov radiation, and their applications.

The email gateway for this forum is: opticalphotons-g4hn@slac.stanford.edu


Inline Depth:
 0 0
 1 1
Add message: (add)

Question Scintillation rise time  by Martin Goettlich <Martin Goettlich>,   Oct 26, 12:53
Dear experts,

I use GEANT4 to simulate a scintillating crystal (LSO) which is read out by a photodetector. I'm interested in the spread of the arrival time distribution of the first photon in order to study the ultimate time resolution you may get. I understand that the most important figures here are the light yield and the decay constant of the scintillator. But according to 'Yiping Shao 2007 Phys. Med. Biol. 52 1103-1117 A new timing model for calculating the intrinsic timing resolution of a scintillator detector' the scintillation rise time becomes very important for the <1 ns regime. I didn't find a function to set this parameter in the material definition for my crystal. Is this crystal property implemented? If not how may I do it? Perhaps someone wants to post his material definition for LSO. If you don't know the answer to the question perhaps you may may point me to someone who can answer it.

Thank you very much and kind regards,

Martin Goettlich

Feedback Re: Scintillation rise time  by Gumplinger Peter <Gumplinger Peter>,   Nov 03, 16:35
Re: Question Scintillation rise time (Martin Goettlich)
Dear Martin,

> Is this crystal property implemented?

No, G4Scintillation only calculates an (exponential) 'time delay' and assumes an instantaneous rise time. And while the routine is set up to sample from a slow and a fast decay time simulataneously it doesn't account for a physical finite rise time. The code simply reads:

deltaTime = deltaTime - ScintillationTime * log( G4UniformRand() );

where deltaTime is first set to a random point/time along the step segment from where the scintillation photon is assumed to have originated.

> If not how may I do it?

I answer this with a question. How would you sample from a convolution of a finite rise-time with a finite decay time, e.g. a more realistic time distribution? If you know the code it takes to do that then the mechanism of introducing a rise-time in the material properties table is completely analogous to, for example, the "SLOWTIMECONSTANT". The G4MaterialPropertiesTable class is completely flexible in this. It simply associates a constant with a (any) character string. In your DetectorConstruction you assign the rise/decay time, for example:

G4MaterialPropertiesTable* myMPT = new G4MaterialPropertiesTable();

myMPT->AddConstProperty("SLOWTIMECONSTANT",10.*ns);

myMPT->AddConstProperty("RISETIMECONSTANT",0.5*ns);

and in G4Scintillation.cc (you need to modify the actual G4 source) you add code to retrieve this constant:

G4MaterialPropertiesTable* aMaterialPropertiesTable =

                                     aMaterial->GetMaterialPropertiesTable();

G4double ScintillationRiseTime = aMaterialPropertiesTable->

                                     GetConstProperty("RISETIMECONSTANT");

And you'd then have to replace the single line:

 ScintillationTime * log( G4UniformRand() );

with your more complicated sampling logic.

Let me know which approach to sampling from a more realistic time profile, with a rise and decay constant, you are taking. I am open to improvements of the G4 distribution.

Best regards, Peter

Question Simulate a clear optical fiber  by Simone Riggi <Simone Riggi>,   Oct 21, 07:28
Hi,

I'm trying to model a clear optical fiber (core+one cladding, NOT WLS). At the moment I'm just considering the fiber as two concentric tubes with two different refraction indexes attached (1.49 for core and 1.42 for cladding) and an absorption length spectrum (same for core and cladding).

Is this correct or is there a better way of modeling the clear fiber?

Another question concerns light propagation.

With the scheme described above, I can get total reflections only if the light directly strikes the core from the fiber end. In fact when photons hit the fiber from the lateral side, they first encounter the clad layer. They can propagate through refraction into the core but cannot give rise to internal reflections in the core. The fiber in this case cannot transport photons. This is simply explained with the Snell's law.

It is not totally clear to me if I have to expect a light confinement also in the case of photons hitting the fiber from the lateral side. If this is the case, what is the optical mechanism responsible for that? Rayleigh diffusion with fiber impurities?

Any help is very appreciated,

Cheers,

Simone

Feedback Re: Simulate a clear optical fiber  by Gumplinger Peter <Gumplinger Peter>,   Oct 21, 16:05
Re: Question Simulate a clear optical fiber (Simone Riggi)
Hi Simone,

> Is this correct or is there a better way of modeling the clear fiber?

Yes, this is correct and there is at present no 'better way' of modeling clad fibers. If the fiber were wrapped with a diffuse reflector you could use the unified surface model with the 'backpainted' option. In this case, the optical boundary process model internally calculates the extra photon tracking in the thin layer; not so if the thin layer is simply open to the environment and a second internal reflection occurs. So, I cannot offer you a speed up and the thin cladding has to be defined in the geometry explicitly.

> With the scheme described above, I can get total reflections only if the

> light directly strikes the core from the fiber end. In fact when photons

> hit the fiber from the lateral side, they first encounter the clad

> layer. They can propagate through refraction into the core but cannot

> give rise to internal reflections in the core. The fiber in this case

> cannot transport photons. This is simply explained with the Snell's law.

Yes, I agree for perfectly smooth cylindrical fibers.

> It is not totally clear to me if I have to expect a light confinement
> also in the case of photons hitting the fiber from the lateral side.

Well, you just explained it; no you should not expect it for the ideal case.

> If this is the case, what is the optical mechanism responsible for that?

> Rayleigh diffusion with fiber impurities?

Yes, the only possibility for a ray to be captured is by some process to change its direction. Rayleigh is one possibility (and you can see its effect if you did not include this process in your simulation and observed a change), or a rough surface would trap some photons - but then, a rough surface also allows photons once trapped to escape again. Visualization of what the rays do is one educational exercise.

Hope this helps, Peter

None GDML and Optical Photons  by Edward Alvarado <Edward Alvarado>,   Oct 09, 12:18
Hi,

 I have successfully imported, from a 3D modeling CAD, a complex geometry description and added optical properties to it within Geant4.

 I am currently having problems during optical simulations, when the volume in use is imported and described as a tessellated volume in a GDML file there are incorrect reflections at boundaries. What happens is that Optical Photons only bounce once correctly on the inner surface of a closed tube, on the second interaction with the border the photon always escape.

 To test problem I have made a simple test: I made the same geometry description in geant4 with G4Tube and with the CAD (and then imported into geant4). I get the expected results with only the G4Tube, the imported volume always has optical boundaries problem. To make the test simpler I am currently only using the optical boundary process, and defining refractive indexes into the material description.

I add an a image of typical optical event. Due the refractive indexes the ray should not escape in neither case. The first image is from the tessellated solid, and the second one is a G4Tube.

http://img53.imageshack.us/img53/8935/volumeimported.jpg
http://img183.imageshack.us/img183/8238/volumeg4tube.jpg

Just ask if more information is needed.
Thanks in advance for any help or advice.

Cheers,

Edward Alvarado,
SiLab UTFSM, Chile.
 
Question problems with optical surfaces  by moritz v. sivers <moritz v. sivers>,   Sep 16, 14:36
Hello everyone.

I'm having a few problems with my geant4 simulation. It is based on the example N06 and I'm simulating a cylindrical scintillator next to a small cylinder functioning as a light detector that are enclosed together in a reflective housing. the housing is also of cylindrical shape filled with air and put into the experimental hall, also filled with air. To specify the reflectivity of the housing I constructed a logical border surface of the dielectric-metal type between it and the experimental hall. However the simulation ignores this and photons are always reflected (Spike reflection when set to polished, Lobe reflection when set to ground) even at a reflectivity of zero.

The second problem I have is that my light detector does not count hits. It is specified as a sensitive detector and the surface was constructed as a dielectric-metal logical skin surface, here the specified reflectivity and efficiency work, and running the simulation I can see that absorbed photons are specified as detected. However they are not counted as hits in my hits collection. Strangely, photons that are reflected from the light detector are counted as hits (with zero energy deposition).

Finally I've got another question whether it's possible to specify different properties for different parts of a surface although they are surrounded by the same volume, because I want to give only the top surface of my cylindrical scintillator a certain roughness, while the other sides remain polished. Currently I'm doing this by creating another cylinder on top of my scintillator and defining a logical border surface between those.

I have installed version 4.9.2 with Patch01.

This is my DetectorConstruction class (sorry I couldn't attach the file properly)

#include "ExN06DetectorConstruction.hh"
#include "LenaPMTSD.hh" //
#include "G4SDManager.hh" //
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4RotationMatrix.hh"
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4PVPlacement.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4Tubs.hh"

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

ExN06DetectorConstruction::ExN06DetectorConstruction()
{
  expHall_x = expHall_y = expHall_z = 0.15*m;

}

// ....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

  ExN06DetectorConstruction::~ExN06DetectorConstruction(){;}

// ....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

  G4VPhysicalVolume* ExN06DetectorConstruction::Construct()
{

// ------------- Materials -------------

  G4double a, z, density;
  G4int nelements, natoms;

// Air 
// 
  G4Element* N = new G4Element("Nitrogen", "N", z=7 , a=14.01*g/mole);
  G4Element* O = new G4Element("Oxygen"  , "O", z=8 , a=16.00*g/mole);

  G4Material* Air = new G4Material("Air", density=1.29*mg/cm3, nelements=2);
  Air->AddElement(N, 70.*perCent);
  Air->AddElement(O, 30.*perCent);

// CaWO 
//
  G4Element* Ca = new G4Element("Calcium", "Ca", z=20, a=40.078*g/mole);
  G4Element* W = new G4Element("Tungsten", "W", z=74, a=183.84*g/mole);

  G4Material* CaWO = new G4Material("CaWO", density=6.06*g/cm3, nelements=3);
  CaWO->AddElement(Ca, natoms=1);
  CaWO->AddElement(W, natoms=1);
  CaWO->AddElement(O, natoms=4);

// Vacuum 
//
  G4Material* Vacuum = new G4Material("Vacuum", density=1.e-17*g/cm3, nelements=2);
  Vacuum->AddElement(N, 70.*perCent);
  Vacuum->AddElement(O, 30.*perCent);

// Al2O3 
//
  G4Element* Al = new G4Element("Aluminium", "Al", z=13 , a=26.982*g/mole);

  G4Material* Al2O3 = new G4Material("Al2O3", density=4.03*g/cm3, nelements=2);
  Al2O3->AddElement(Al, natoms=2);
  Al2O3->AddElement(O, natoms=3);

// VM2000 (Polyethylen) //

  G4Element* C = new G4Element("Carbon", "C", z=6 , a=12.011*g/mole);
  G4Element* H = new G4Element("Hydrogen", "H", z=1 , a=1.008*g/mole);

  G4Material* VM2000 = new G4Material("VM2000", density=0.9*g/cm3, nelements=2);
  VM2000->AddElement(C, natoms=2);
  VM2000->AddElement(H, natoms=4);

//
// ------------ Generate & Add Material Properties Table ------------
//
  const G4int nEntries = 32;

  G4double PhotonEnergy[nEntries] =
            { 2.034*eV, 2.068*eV, 2.103*eV, 2.139*eV,
              2.177*eV, 2.216*eV, 2.256*eV, 2.298*eV,
              2.341*eV, 2.386*eV, 2.433*eV, 2.481*eV,
              2.532*eV, 2.585*eV, 2.640*eV, 2.697*eV,
              2.757*eV, 2.820*eV, 2.885*eV, 2.954*eV,
              3.026*eV, 3.102*eV, 3.181*eV, 3.265*eV,
              3.353*eV, 3.446*eV, 3.545*eV, 3.649*eV,
              3.760*eV, 3.877*eV, 4.002*eV, 4.136*eV };

// CaWO 
//	      
  G4double RefractiveIndex1[nEntries] =
             { 1.92, 1.92, 1.92, 1.92,
	       1.92, 1.92, 1.92, 1.92,  
	       1.93, 1.93, 1.93, 1.93	, 
	       1.94, 1.94, 1.94, 1.94, 
	       1.95, 1.95, 1.95, 1.95,
               1.96, 1.96, 1.96, 1.96,  
	       1.97, 1.97, 1.97, 1.98, 
               1.99, 1.99, 1.99, 1.99};

  G4double Absorption1[nEntries] =
           {3.448*m,  4.082*m,  6.329*m,  9.174*m, 12.346*m, 13.889*m, //
           15.152*m, 17.241*m, 18.868*m, 20.000*m, 26.316*m, 35.714*m,
           45.455*m, 47.619*m, 52.632*m, 52.632*m, 55.556*m, 52.632*m,
           52.632*m, 47.619*m, 45.455*m, 41.667*m, 37.037*m, 33.333*m,
           30.000*m, 28.500*m, 27.000*m, 24.500*m, 22.000*m, 19.500*m,
           17.500*m, 14.500*m };

  G4double ScintilFast[nEntries] =
            { 0.01, 0.05, 0.10, 0.15, 
	      0.20, 0.25, 0.30, 0.35, 
	      0.40, 0.45, 0.50, 0.55, 
	      0.60, 0.65, 0.70, 0.75, 
	      0.80, 0.90, 0.99, 1.00, 
	      0.99, 0.90, 0.80, 0.70, 
	      0.60, 0.50, 0.40, 0.30,
              0.20, 0.10, 0.10, 0.01 };
  G4double ScintilSlow[nEntries] =
             { 0.01, 0.05, 0.10, 0.15, 
	      0.20, 0.25, 0.30, 0.35, 
	      0.40, 0.45, 0.50, 0.55, 
	      0.60, 0.65, 0.70, 0.75, 
	      0.80, 0.90, 0.99, 1.00, 
	      0.99, 0.90, 0.80, 0.70, 
	      0.60, 0.50, 0.40, 0.30,
              0.20, 0.10, 0.10, 0.01 };
  G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();
  myMPT1->AddProperty("RINDEX",       PhotonEnergy, RefractiveIndex1,nEntries);
  myMPT1->AddProperty("ABSLENGTH",    PhotonEnergy, Absorption1,     nEntries);
  myMPT1->AddProperty("FASTCOMPONENT",PhotonEnergy, ScintilFast,     nEntries);
  myMPT1->AddProperty("SLOWCOMPONENT",PhotonEnergy, ScintilSlow,     nEntries);

  myMPT1->AddConstProperty("SCINTILLATIONYIELD",15./MeV);
  myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
  myMPT1->AddConstProperty("FASTTIMECONSTANT", 1000.*ns);
  myMPT1->AddConstProperty("SLOWTIMECONSTANT",500000.*ns);
  myMPT1->AddConstProperty("YIELDRATIO",0.99);

  CaWO->SetMaterialPropertiesTable(myMPT1);

// Air 
//
  G4double RefractiveIndex2[nEntries] =
            { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00 };

  G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
  myMPT2->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex2, nEntries);

  Air->SetMaterialPropertiesTable(myMPT2);

// Vacuum 
//
  G4double RefractiveIndex3[nEntries] =
            { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
              1.00, 1.00, 1.00, 1.00 };

  G4MaterialPropertiesTable* myMPT3 = new G4MaterialPropertiesTable();
  myMPT3->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex3, nEntries);

  Vacuum->SetMaterialPropertiesTable(myMPT3);

//VM2000  
//
 G4double RefractiveIndex4[nEntries] =
            { 1.5, 1.52,  1.53, 1.54,  1.55,
              1.5,  1.6, 1.6,  1.6, 1.6,
              1.6, 1.61, 1.6,   1.63, 1.66,
              1.66, 1.66, 1.66, 1.66, 1.67,
              1.68, 1.68,  1.68, 1.68,  1.69,
              1.69, 1.69,  1.69, 1.70,  1.70,
              1.71,   1.71};

  G4MaterialPropertiesTable* myMPT4 = new G4MaterialPropertiesTable();
  myMPT4->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex4, nEntries);

  VM2000->SetMaterialPropertiesTable(myMPT4);

// Al2O3 
//
  G4double RefractiveIndex5[nEntries] =
            { 1.77, 1.77, 1.77, 1.77, 
	      1.77, 1.77, 1.77, 1.77, 
	      1.78, 1.78, 1.78, 1.78, 
	      1.78, 1.78, 1.78, 1.78, 
	      1.78, 1.78, 1.78, 1.78, 
	      1.79, 1.79, 1.79, 1.79, 
	      1.80, 1.80, 1.80, 1.80,
              1.81, 1.81, 1.81, 1.81 };

   G4double Absorption5[nEntries] =
           {3.448*m,  4.082*m,  6.329*m,  9.174*m, 12.346*m, 13.889*m, 
           15.152*m, 17.241*m, 18.868*m, 20.000*m, 26.316*m, 35.714*m,
           45.455*m, 47.619*m, 52.632*m, 52.632*m, 55.556*m, 52.632*m,
           52.632*m, 47.619*m, 45.455*m, 41.667*m, 37.037*m, 33.333*m,
           30.000*m, 28.500*m, 27.000*m, 24.500*m, 22.000*m, 19.500*m,
           17.500*m, 14.500*m };

  G4MaterialPropertiesTable* myMPT5 = new G4MaterialPropertiesTable();
  myMPT5->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex5, nEntries);
  myMPT5->AddProperty("ABSLENGTH",    PhotonEnergy, Absorption5,     nEntries);

  Vacuum->SetMaterialPropertiesTable(myMPT5);

// ------------- Volumes --------------

// The experimental Hall //

  G4Box* expHall_box = new G4Box("World",expHall_x,expHall_y,expHall_z);

  G4LogicalVolume* expHall_log
    = new G4LogicalVolume(expHall_box,Air,"World",0,0,0);

  G4VPhysicalVolume* expHall_phys
    = new G4PVPlacement(0,G4ThreeVector(),expHall_log,"World",0,false,0);

// reflective housing //

    G4double innerRadiusCC = 0.*cm;
    G4double outerRadiusCC = 5.*cm;
    G4double hightCC = 6.*cm;
    G4double startAngleCC = 0.*deg;
    G4double spanningAngleCC = 360.*deg;

  G4Tubs* reflHousing_tubs = new G4Tubs("Housing",
 		        innerRadiusCC,
			outerRadiusCC,
			hightCC,
			startAngleCC,
			spanningAngleCC);

  G4LogicalVolume* reflHousing_log
    = new G4LogicalVolume(reflHousing_tubs,Air,"Housing",0,0,0);

  G4VPhysicalVolume* reflHousing_phys =
      new G4PVPlacement(0,G4ThreeVector(),reflHousing_log,"Housing",
                        expHall_log,false,0);

// scintillating crystal //

    G4double innerRadius = 0.*cm;
    G4double outerRadius = 4.*cm;
    G4double hight = 4.*cm;
    G4double startAngle = 0.*deg;
    G4double spanningAngle = 360.*deg;

    G4Tubs* crystal_tubs = new G4Tubs("Crystal", 
                                       innerRadius,
    				       outerRadius,
				       hight,
				       startAngle,
					spanningAngle);

    G4LogicalVolume* crystal_log
      = new G4LogicalVolume(crystal_tubs,CaWO,"Crystal",0,0,0);

    G4VPhysicalVolume* crystal_phys
      = new G4PVPlacement(0,G4ThreeVector(),crystal_log,"Crystal",
                        reflHousing_log,false,0);

// the light detector //

   G4double innerRadiusLd = 0.*cm;
   G4double outerRadiusLd = 4.*cm;
   G4double hightLd = 0.025*cm;
   G4double startAngleLd = 0.*deg;
   G4double spanningAngleLd = 360.*deg;

   G4Tubs* light_detector_tubs =
	new G4Tubs("light_detector", 
		    innerRadiusLd,
	 	    outerRadiusLd,
		    hightLd,
		    startAngleLd,
		    spanningAngleLd);

  light_detector_log =
	new G4LogicalVolume(light_detector_tubs,Al2O3,"light_detector",0,0,0);

  G4VPhysicalVolume* light_detector_phys =
    	 new G4PVPlacement(0,G4ThreeVector(0*cm,0*cm,-4.5*cm),light_detector_log,"light_detector",
                        reflHousing_log,false,0);

// rough side of crystal //

   G4double innerRadiusrS = 0.*cm;
   G4double outerRadiusrS = 4.*cm;
   G4double hightrS = 0.1*cm;
   G4double startAnglerS = 0.*deg;
   G4double spanningAnglerS = 360.*deg;

   G4Tubs* roughSide_tubs =
	new G4Tubs("rough_Side", 
		    innerRadiusrS,
	 	    outerRadiusrS,
		    hightrS,
		    startAnglerS,
		    spanningAnglerS);

  G4LogicalVolume* roughSide_log =
	new G4LogicalVolume(roughSide_tubs,Air,"rough_Side",0,0,0);

  G4VPhysicalVolume* roughSide_phys =
    	 new G4PVPlacement(0,G4ThreeVector(0*cm,0*cm,-4.1*cm),roughSide_log,"roughSide",
                        reflHousing_log,false,0);

//	------------- Surfaces --------------
//
// crystal rough surface  
//
  G4OpticalSurface* OpCrystalSurface = new G4OpticalSurface("CrystalSurface");
  OpCrystalSurface->SetType(dielectric_dielectric);
  OpCrystalSurface->SetFinish(ground);
  OpCrystalSurface->SetModel(glisur);
  OpCrystalSurface->SetPolish(0.1);

  G4LogicalBorderSurface* CrystalSurface = 
                                 new G4LogicalBorderSurface("CrystalSurface",
                                 crystal_phys,roughSide_phys,OpCrystalSurface);

// housing surface  
//
  G4OpticalSurface* OpHousingSurface = new G4OpticalSurface("HousingSurface",glisur,polished,dielectric_metal);

  G4LogicalBorderSurface* HousingSurface = 
	  new G4LogicalBorderSurface("HousingSurface", reflHousing_phys,expHall_phys,OpHousingSurface);

// light detector surface //

  G4OpticalSurface* OpDetectorSurface= new G4OpticalSurface("DetectorSurface",glisur,polished,dielectric_metal);

	  G4LogicalSkinSurface* DetectorSurface = new G4LogicalSkinSurface("DetectorSurface",light_detector_log,OpDetectorSurface);

// -----------Generate & Add Material Properties Table attached to the optical surfaces---------
//
  const G4int num = 2;
  G4double Ephoton[num] = {2.034*eV, 4.136*eV};

// housing surface 
//
  G4double ReflectivityRHS[num] = {0.0, 0.0};

  G4MaterialPropertiesTable* myST2 = new G4MaterialPropertiesTable();

  myST2->AddProperty("REFLECTIVTY", Ephoton, ReflectivityRHS, num);

  OpHousingSurface->SetMaterialPropertiesTable(myST2);

// light detector surface //

  G4double ReflectivityLD[num] = {.08, .08};
  G4double EfficiencyLD[num]   = {1.0, 1.0};

  G4MaterialPropertiesTable *myST3 = new G4MaterialPropertiesTable();

  myST3->AddProperty("REFLECTIVITY", Ephoton, ReflectivityLD, num);
  myST3->AddProperty("EFFICIENCY",   Ephoton, EfficiencyLD,   num);

  OpDetectorSurface->SetMaterialPropertiesTable(myST3);

// sensitive detector //

  G4SDManager* SDman = G4SDManager::GetSDMpointer();

    G4String PMTSDname = "light_detector_sd";
    LenaPMTSD* aPMTSD = new LenaPMTSD( PMTSDname);
    aPMTSD->SetType(0);
    SDman->AddNewDetector( aPMTSD );

// always return the physical World 
  return expHall_phys;
}

Feedback Re: problems with optical surfaces  by Gumplinger Peter <Gumplinger Peter>,   Sep 18, 16:07
Re: Question problems with optical surfaces (moritz v. sivers)
Hello Moritz,

I'll deal first with your second problem. A sensitive detector registers hits only for steps taken inside it. Therefore, if a photon is absorbed as it hits your light detector it'll never actually step inside it. Hence, no hits in the usual G4 sense. Please, see example/extended/optical/LXe to learn how to tally optical photons that hit a photon sensitive surface (LXeSteppingAction.cc). You basically have to trigger the (hit) counting in SteppingAction when the G4OpBoundaryProcess returns 'Detection'. Reflected photons do do a reallocation step inside your light detector and so you get the usual G4VHit. In summary, the sensitive volume concept of Geant4 is not suitable for use with optical photons.

At present, it is not possible to specify different optical properties for different sides of a volume's surface except by the 'trick' you have arrived at; a geometry volume construct redefinition whereby the sides are adjacent to different physical volumes.

It took me some time but I found your bug why the reflectivity is ignored for your housing wall:

myST2->AddProperty("REFLECTIVTY", Ephoton, ReflectivityRHS, num);

it should read "REFLECTIVITY"! (There is nothing I could do programming wise to prevent you from making this spelling mistake because the MaterialPropertiesTable is designed so the user can add any named property to the table he wishes to) The G4OpBoundaryProcess looks for the correctly named property "REFLECTIVITY" and if it is not found, the default is 1.

Regards, Peter

Ok Re: problems with optical surfaces  by moritz v. sivers <moritz v. sivers>,   Sep 23, 10:54
Re: Feedback Re: problems with optical surfaces (Gumplinger Peter)
Thanks for your help, it all worked out. Best regards Moritz

None the method to collect OpticalPhotons  by ylzhang <ylzhang>,   Aug 21, 06:47
I want collect the OpticalPhoton. So i write a "PMT" Volume beside BGO cristal Volume. I use two methods to calculate the OpticalPhotons which are "collected" by PMT. but the results are different. I donnot know why.

//The Code in SteppingAction
//The First one
//
G4VPhysicalVolume* volume1 
= aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
G4VPhysicalVolume* volume2
= aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume();
if ((volume1 == detector->GetBGO())&&(volume2 == detector->GetPMT()))
  {
    G4Track* aTrack = aStep->GetTrack();
    if(aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition())
      {
	if(aTrack->GetTrackID()>1)
	  {
	    stepInfo.highEnergySecondaryParticleNumber = 1;
	    aTrack->SetTrackStatus(fStopAndKill);
	  }
      }
  }

//
//the Second one
//
if(aTrack->GetTrackID()>1)
  {
    if( (detector->GetCalorimeter() == aTrack->GetVolume()) && ( detector->GetBottom() == aTrack->GetNextVolume() ) )
      {
	if ( aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition() )

	  {
	    aTrack->SetTrackStatus(fStopAndKill);
	    stepInfo.highEnergySecondaryParticleNumber = 1;

	  }
      }
  }

Feedback Re: the method to collect OpticalPhotons  by Gumplinger Peter <Gumplinger Peter>,   Aug 21, 12:29
Re: None the method to collect OpticalPhotons (ylzhang)
Are you sure that:

detector->GetBGO() and detector->GetCalorimeter() return the same volume

also that:

detector->GetPMT() and detector->GetBottom() return the same volume

I also don't know the reason for:

aTrack->GetTrackID()>1

BTW, you can get the physical volume from the StepPoints with GetPhysicalVolume(). No need to go via GetTouchableHandle() although there is nothing wrong if you do.

As for G4 tracking/stepping updates, I have no explanation for what you find. However, it should be very easy for you to debug this by using both codes in your SteppingAction and just print out the names of the volumes when one 'if' is entered while the other is not.

None Re: the method to collect OpticalPhotons  by ylzhang <ylzhang>,   Aug 23, 05:07
Re: Feedback Re: the method to collect OpticalPhotons (Gumplinger Peter)
I find the answer. thank you very much~

Feedback Re: the method to collect OpticalPhotons  by Gumplinger Peter <Gumplinger Peter>,   Aug 25, 12:26
Re: None Re: the method to collect OpticalPhotons (ylzhang)
Can you please tell us, the forum community that is, what the problem was; that it had to do with your code and not with Geant4 and that your code now enters both of your if-statements in tandem as I would expect. Thanks, Peter

More Re: the method to collect OpticalPhotons  by Gumplinger Peter <Gumplinger Peter>,   Aug 27, 10:45
Re: Feedback Re: the method to collect OpticalPhotons (Gumplinger Peter)
The user confirms that the problem had to do with user-code and not with Geant4 and that the corrected code now enters both of the if-statements in tandem as one would expect.

None Re: the method to collect OpticalPhotons  by ylzhang <ylzhang>,   Aug 22, 00:37
Re: Feedback Re: the method to collect OpticalPhotons (Gumplinger Peter)
1. Are you sure that: detector->GetBGO() and detector->GetCalorimeter() return the same volume

also that:

detector->GetPMT() and detector->GetBottom() return the same volume 
//
Yes, I am sure. GetBGO() and GetCalorimeter() return the same Volume :BGO.
                GetPMT() and GetBottom() return the same Volume: PMT.

2.

I also don't know the reason for:

aTrack->GetTrackID()>1 // This sentence maybe donnot needed. i only want to judge the particle is secondary particle.

// I want to know the two methods are right? What's the different of the two methods? How to judge the OpticalPhoton whether collected by PMT usually?

None Unsure why my detection isn't working?  by <jdswado@gatech.edu>,   Aug 10, 12:36
Could anyone give me some ideas here I've tried to set up a volume to act as an optical photon detector but I'm getting no detection events. Essentially what I've done is below but I tried to edit out the irrelevant stuff and so may have missed a parenthesis or something like that.

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////// Definition of Optical Surface of Detector ////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

const G4int num = 2; G4double EPhoton[num] = {3.2627*eV, 1.6531*eV};

G4OpticalSurface* photocath_opsurf=
     new G4OpticalSurface("photocath_opsurf",glisur,polished,
                           dielectric_metal);

  G4double photocath_EFF[num]=
                              {1.0, 1.0}; 

  G4double photocath_REFLECT[num] =
                              {0.,0.};

 G4MaterialPropertiesTable* Surface_Glass_MPT = new G4MaterialPropertiesTable();
Surface_Glass_MPT->AddProperty("REFLECTIVITY",EPhoton,photocath_REFLECT,num);
Surface_Glass_MPT->AddProperty("EFFICIENCY",EPhoton,photocath_EFF,num);                                                 
photocath_opsurf->SetMaterialPropertiesTable(Surface_Glass_MPT);
new G4LogicalSkinSurface("PMTSurface",logicDetector,photocath_opsurf);

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////// Counting the # of Detection Events in Stepping Action //////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

if(theTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition())
{
  G4OpBoundaryProcessStatus boundaryStatus=Undefined;
  static G4OpBoundaryProcess* boundary=NULL;

  //find the boundary process only once
  if(!boundary){
    G4ProcessManager* pm 
      = theTrack->GetDefinition()->GetProcessManager();
    G4int nprocesses = pm->GetProcessListLength();
    G4ProcessVector* pv = pm->GetProcessList();
    G4int f;
    for( f=0;f<nprocesses;f++){
      if((*pv)[f]->GetProcessName()=="OpBoundary"){
	boundary = (G4OpBoundaryProcess*)(*pv)[f];
	break;
	  }
	}
  }

  boundaryStatus=boundary->GetStatus();

switch(boundaryStatus){
case Detection:
	G4cout << "Detection" << G4endl;
	eventAction->addDetect(1);
	break;
default:
       break;
}

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////// EventAction.hh //////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

class ExN01EventAction : public G4UserEventAction { public: void addDetect(G4int i) {TotalDetect += i;};

private: G4int TotalDetect;

};

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////// EventAction.cc //////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

void EventAction::BeginOFEventAction(const G4Event* evt)
{
   G4int evtNb = evt->GetEventID();
   TotalDetect = 0;
}

void EventAction::EndofEventAction(const G4Event* evt) { runAct->fillPerEvent(TotalDetect); }

///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

So I print out how many detection events are registered but none ever show up. I don't think this is a probably with my counting method because I can get counts on all the other boundary processes. So I think that for some reason my volume is not detecting opticals.

Any help would be great. Thanks, Jason

Question How to turn off scintillation and Cerenkov?  by Kareem Kazkaz <Kareem Kazkaz>,   Jul 28, 15:02
Hello everyone.

I am trying to turn the Scintillation and Cerenkov processes off via messengers, so that I do not have to recompile my simulation. The physics list itself uses both Scintillation and Cerenkov processes. I use the following bit of code:

// Turn the optical processes on or off
G4cout << "useOpticalProcesses = " << useOpticalProcesses << G4endl;
if( useOpticalProcesses ) {
    UI->ApplyCommand( "/process/activate Scintillation" );
    UI->ApplyCommand( "/process/activate Cerenkov" );
} else {
    UI->ApplyCommand( "/process/inactivate Scintillation" );
    UI->ApplyCommand( "/process/inactivate Cerenkov" );
}
// Finally, run the beamOn command
stringstream command;
command << "/run/beamOn " << numEvents;
UI->ApplyCommand( command.str() );

When I run this simulation, if useOpticalProcesses is set to false, I get the error message "G4ProcessTable::Insert : arguments are 0 pointer" repeated many, many times. The simulation then quits in a bus error.

I have tried commenting out this code and entering the "/process/inactivate" lines by hand, with the same result. Any ideas what might be causing GEANT4 to crash like this?

Feedback Re: How to turn off scintillation and Cerenkov?  by Gumplinger Peter <Gumplinger Peter>,   Jul 28, 16:19
Re: Question How to turn off scintillation and Cerenkov? (Kareem Kazkaz)
http://www-geant4.kek.jp/lxr/source//processes/management/src/G4ProcessTable.cc#L165

It looks like you are either inactivating a process which does not yet exist, or the process manager of the particle to which you want to attach the process, or more likely the particle itself, does not yet exist.

It cannot be because you didn't yet initialize the RunManager, for if that was the problem you'd get:

***** Illegal application state </process/inactivate Scintillation> *****

***** Batch is interupted!! *****

I just checked that if the process wasn't attached to the particle or didn't exist you'd get:

 illegal process (or type) name

so I suspect there is something wrong with your particle definitions.

The exampleN06 works when you add:

UI->ApplyCommand( "/process/inactivate Scintillation" );

in exampleN06.cc after UI has been defined and after runManager->Initialize();

None Re: How to turn off scintillation and Cerenkov?  by Kareem Kazkaz <Kareem Kazkaz>,   Jul 29, 12:58
Re: Feedback Re: How to turn off scintillation and Cerenkov? (Gumplinger Peter)
Hi Peter. Thanks for the response.

This code is indeed called after the run manager has been initialized. And unfortunately, as far as the particle construction goes, I'm using the methods from GEANT4:

G4BosonConstructor pBoConstructor;
pBoConstructor.ConstructParticle();
 
G4LeptonConstructor pLConstructor;
pLConstructor.ConstructParticle();
 
G4MesonConstructor pMConstructor;
pMConstructor.ConstructParticle();
 
G4BaryonConstructor pBaConstructor;
pBaConstructor.ConstructParticle();
 
G4IonConstructor pIConstructor;
pIConstructor.ConstructParticle();
 
G4ShortLivedConstructor pSConstructor;
pSConstructor.ConstructParticle();

If there's a problem with the particle construction, I assume it would be found deeper down it the GEANT4 code than in the simulation I have.

I set the "/process/verbose 3" in the macro file, and I modified my code by adding a "/run/physicsModified" messenger command:

// Turn the optical processes on or off
G4cout << "useOpticalProcesses = " << useOpticalProcesses << G4endl;
if( useOpticalProcesses ) {
    UI->ApplyCommand( "/process/activate Scintillation" );
    UI->ApplyCommand( "/process/activate Cerenkov" );
    UI->ApplyCommand( "/run/physicsModified" );
} else {
    UI->ApplyCommand( "/process/inactivate Scintillation" );
    UI->ApplyCommand( "/process/inactivate Cerenkov" );
    UI->ApplyCommand( "/run/physicsModified" );
}
 
// Finally, run the beamOn command
stringstream command;
command << "/run/beamOn " << numEvents;
UI->ApplyCommand( command.str() );

Here's the (beginning of) the output after the simulation has started:

### Run 0 start.
G4ProcessTable::Insert : arguments are 0 pointer
G4ProcessTable::Insert Process[RadioactiveDecay] Particle[GenericIon]
This Process Manager is registered !!
G4ProcessTable::Insert Process[RadioactiveDecay] Particle[GenericIon]
G4ProcessTable::Insert : arguments are 0 pointer
G4ProcessTable::Insert Process[hLowEIoni] Particle[GenericIon]
This Process Manager is registered !!
G4ProcessTable::Insert Process[msc] Particle[GenericIon]
This Process Manager is registered !!
G4ProcessTable::Insert Process[Transportation] Particle[GenericIon]
This Process Manager is registered !!
G4ProcessTable::Insert Process[Transportation] Particle[GenericIon]
G4ProcessTable::Insert Process[msc] Particle[GenericIon]
G4ProcessTable::Insert Process[hLowEIoni] Particle[GenericIon]
G4ProcessTable::Insert : arguments are 0 pointer
G4ProcessTable::Insert Process[RadioactiveDecay] Particle[GenericIon]
G4ProcessTable::Insert : arguments are 0 pointer
G4ProcessTable::Insert Process[LUXSimMinEkineCuts] Particle[GenericIon]
This Process Manager is registered !!

...and so on and so on and so on, for a bit over 3000 lines (see the attached file).

Do you have any other recommendations to hunt down what's going wrong? Is it starting to sound like a bug somewhere in the guts of GEANT4?

Kareem Attachment: http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/07/29/12.55-88865-ProcessVerboseOutput.txt

None Re: How to turn off scintillation and Cerenkov?  by Kareem Kazkaz <Kareem Kazkaz>,   Jul 29, 13:01
Re: None Re: How to turn off scintillation and Cerenkov? (Kareem Kazkaz)
I just realized that in the previously-attached file, these messages were only printed up when dealing with the GenericIon particle. Is there something strange going on in GenericIon and Cerenkov / Scintillation processes?

None Transmission of Optical Photons  by <jdswado@gatech.edu>,   Jul 02, 10:35
Hello everyone,

I'm having trouble getting my optical photons to pass from one volume to another, it seems as though they are always absorbed or reflected at volume boundaries, never transmitted. I've attempted to follow the examples given in ExN06 and LXe but I still don't have it working, if anyone could give me some advice, that'd be great. The scintillation crystal is wraped radially by some Aluminum Housing but each end is open to the air so I would think I should get some transmission of the light from the crystal through the air at these locations.

======================================================= My code from DetectorConstruction.cc =======================================================

#include "DetectorConstruction.hh"
#include "DetectorSD.hh"

#include "G4VUserPhysicsList.hh" 
#include "G4UserLimits.hh"
#include "G4SDManager.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "globals.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4Colour.hh"                             
#include "G4VisAttributes.hh"                   
#include "G4ios.hh"                             

DetectorConstruction::DetectorConstruction()
 :  experimentalHall_log(0), tracker_log(0), Wrap_log(0),
    AL_log(0), AL_phys(0), experimentalHall_phys(0),  
    tracker_phys(0), worldVisAtt(0), cylinderVisAtt(0), 
	HousingVisAtt(0), DetectorVisAtt(0), solidDetector(0),
	logicDetector(0), physiDetector(0)
{;}

DetectorConstruction::~DetectorConstruction() { }

G4VPhysicalVolume* DetectorConstruction::Construct() {

  //------------------------------------------------------ materials

// NaI Material Properties Table Stuff

	const G4int nEntries = 38;

  G4double PhotonEnergy[nEntries] =
            { 3.2627*eV, 3.1791*eV, 3.0996*eV, 3.024*eV, 2.952*eV,
              2.8833*eV, 2.8178*eV, 2.7552*eV, 2.6953*eV, 2.6379*eV,
              2.583*eV, 2.5303*eV, 2.48*eV, 2.431*eV, 2.3843*eV,
              2.3393*eV, 2.296*eV, 2.254*eV, 2.214*eV, 2.1751*eV,
              2.1376*eV, 2.1014*eV, 2.0664*eV, 2.0325*eV, 1.9997*eV,
              1.9678*eV, 1.9372*eV, 1.9074*eV, 1.8785*eV, 1.8505*eV,
              1.8233*eV, 1.7969*eV, 1.7712*eV, 1.7462*eV, 1.722*eV,
              1.6984*eV, 1.6754*eV, 1.6531*eV};

  G4double RefractiveIndex1[nEntries] =
            { 1.84208, 1.83556,  1.82965, 1.82427,  1.81936,
              1.81486, 1.81072,  1.80691, 1.80339,  1.80013,
              1.79711, 1.7943,  1.79168, 1.78923,  1.78695,
              1.78481, 1.7828,  1.78091, 1.77914,  1.77747,
              1.77589, 1.7744,  1.773, 1.77166,  1.7704,
              1.7692, 1.76807,  1.76699, 1.76596,  1.76498,
              1.76405, 1.76316, 1.76231, 1.7615, 1.76072,
              1.75998, 1.75927, 1.75859};

  G4double Absorption1[nEntries] =
            { 5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
              5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
              5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
              5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
              5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
              5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
              5.0*m, 5.0*m, 5.0*m, 5.0*m, 5.0*m,
			  5.0*m, 5.0*m, 5.0*m};

  G4double ScintilFast[nEntries] =
            { 0.081731856, 0.100158264, 0.108523626, 0.113045444, 0.11304544,
              0.104001809, 0.08907981, 0.077436129, 0.058783631, 0.045218178,
              0.03572236, 0.027130907, 0.019443816, 0.013000226, 0.009156681,
              0.004521818, 0.0, 0.0, 0.0, 0.0,
              0.0, 0.0, 0.0, 0.0, 0.0,
              0.0, 0.0, 0.0, 0.0, 0.0,
              0.0, 0.0, 0.0, 0.0, 0.0,
              0.0, 0.0, 0.0};

  G4double scattering[nEntries] =
            {0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
			 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
			 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
			 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5};

  G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();
  myMPT1->AddProperty("RINDEX",       PhotonEnergy, RefractiveIndex1,nEntries);
  myMPT1->AddProperty("ABSLENGTH",    PhotonEnergy, Absorption1,     nEntries);
  myMPT1->AddProperty("FASTCOMPONENT",PhotonEnergy, ScintilFast,     nEntries);
  myMPT1->AddProperty("RAYLEIGH",     PhotonEnergy, scattering,      nEntries);

  myMPT1->AddConstProperty("SCINTILLATIONYIELD",200./MeV);// Normally 3800/MeV 
  myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
  myMPT1->AddConstProperty("FASTTIMECONSTANT", 1.*ns);

// Air Material Properties Table Stuff

  G4double RefractiveIndex2[nEntries] =
            { 1.00028393, 1.00028332, 1.00028276, 1.00028225, 1.00028177, 1.00028133, 1.00028091,
              1.00028053, 1.00028018, 1.00027985, 1.00027954, 1.00027925, 1.00027897, 1.00027872,
              1.00027848, 1.00027825, 1.00027804, 1.00027784, 1.00027765, 1.00027747, 1.0002773,
              1.00027714, 1.00027698, 1.00027684, 1.0002767, 1.00027657, 1.00027644, 1.00027632,
              1.00027621, 1.0002761, 1.000276, 1.0002759, 1.0002758, 1.00027571, 1.00027563, 
			  1.00027554, 1.00027546, 1.00027539};

    G4double Absorption2[nEntries] =
            { 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
              10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
              10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
              10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
              10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
              10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
              10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m, 10000.0*m,
			  10000.0*m, 10000.0*m, 10000.0*m};

  G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
  myMPT2->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex2, nEntries);
  myMPT2->AddProperty("ABSLENGTH", PhotonEnergy, Absorption2, nEntries);

// Aluminum Material Properties Table Stuff

    G4double RealRefractive[nEntries] =
            { 0.444, 0.467, 0.49, 0.5156, 0.5412, 0.5668, 0.5924,
              0.618, 0.6482, 0.6784, 0.7086, 0.7388, 0.769, 0.8068,
              0.8446, 0.8824, 0.9202, 0.958, 1.0064, 1.0548, 1.1032,
              1.1516, 1.2, 1.263, 1.326, 1.389, 1.452, 1.515,
              1.578, 1.641, 1.704, 1.767, 1.83, 1.927, 2.024,
	          2.121, 2.218, 2.315};

	G4double ImaginaryRefractive[nEntries] =
	        {-4.612, -4.736, -4.86, -4.982, -5.104, -5.226, -5.348,
			 -5.47, -5.592, -5.714, -5.836, -5.958, -6.08, -6.202,
			 -6.324, -6.446, -6.568, -6.69, -6.804, -6.918, -7.032,
			 -7.146, -7.26, -7.365, -7.47, -7.575, -7.68, -7.785,
			 -7.89, -7.995, -8.1, -8.205, -8.31, -8.324, -8.338,
			 -8.352, -8.366, -8.38};

  G4MaterialPropertiesTable* myMPT3 = new G4MaterialPropertiesTable();
  myMPT3->AddProperty("REALRINDEX", PhotonEnergy, RealRefractive, nEntries);
  myMPT3->AddProperty("IMAGINARYRINDEX", PhotonEnergy, ImaginaryRefractive, nEntries);

// Plastic Material Properties Table Stuff
  G4double RefractiveIndex4[nEntries] =
            { 1.6117, 1.6117, 1.6117, 1.6117, 1.6117, 1.6117, 1.6117,
              1.60717, 1.60465, 1.60246, 1.60051, 1.59872, 1.59703, 1.59544,
              1.5939, 1.591, 1.58962, 1.5883, 1.58702, 1.5858, 1.58462,
              1.5835, 1.58244, 1.58142, 1.58046, 1.57955, 1.57869, 1.57788,
              1.57711, 1.57639, 1.57572, 1.57508, 1.57449, 1.57393, 1.5734,
              1.57291, 1.57245};  ////////

  G4MaterialPropertiesTable* myMPT4 = new G4MaterialPropertiesTable();
  myMPT4->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex4, nEntries);

 G4double z;
 G4double a;
 G4double density;
  //Air
  G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
  G4Element* O = new G4Element("Oxygen"  , "O", z=8., a= 16.00*g/mole);

  G4Material* Air = new G4Material("Air", density= 0.00129*g/cm3, 2); //Density should be 0.00129*g/cm3 for air
  Air->AddElement(N,0.7);
  Air->AddElement(O,0.3);
  //Air->SetMaterialPropertiesTable(myMPT2);

  //Glass 74% Silica SiO2, 14% Sodium Oxide Na2O 12% Calcium Oxide CaO
  G4Element* Si =
  new G4Element("Tin", "Si", z= 14., a= 28.0855*g/mole);
  G4Element* Na =
  new G4Element("Sodium", "Na", z= 11., a= 22.989769*g/mole);
  G4Element* Ca=
  new G4Element("Calcium", "Ca", z= 20., a= 40.078*g/mole);

  G4Material* Glass = new G4Material("Glass", density= 2.53*g/cm3, 4);
  Glass->AddElement(Na,0.09);
  Glass->AddElement(Si,0.25);
  Glass->AddElement(O,0.6);
  Glass->AddElement(Ca,0.06);

  //NaI(Tl) Detector Material

  G4Element* I =
  new G4Element("Iodine", "I", z= 53., a= 126.9*g/mole);
  G4Element* Tl=
  new G4Element("Thallium", "Tl", z= 81., a=204.3833*g/mole);

  G4Material* NaI = new G4Material("NaI", density= 3.7*g/cm3, 3); // Density should be 3.7*g/cm3
  NaI->AddElement(Na,0.495);
  NaI->AddElement(I,0.495);
  NaI->AddElement(Tl,0.01);
  NaI->SetMaterialPropertiesTable(myMPT1);

  // Plastic (PC) for the Shim and Wrap Material

  G4Element* Cl=
  new G4Element("Chlorine", "Cl", z= 17., a=35.453*g/mole);
  G4Element* C=
  new G4Element("Carbon", "C", z= 6., a=12.011*g/mole);
  G4Element* H=
  new G4Element("Hydrogen", "H", z= 1., a=1.00794*g/mole);

  G4Material* Plastic = new G4Material("Plastic", 1.39*g/cm3,3);
  Plastic->AddElement(Cl,0.167);
  Plastic->AddElement(C, 0.333);
  Plastic->AddElement(H, 0.5);
  Plastic->SetMaterialPropertiesTable(myMPT4);

  G4Material* Ar = 
  new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3); /
  G4Material* Al = 
  new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3);
  Al->SetMaterialPropertiesTable(myMPT3);

  G4Material* Pb = 
  new G4Material("Lead", z= 82., a= 207.19*g/mole, density= 11.35*g/cm3);

  //------------------------------------------------------ volumes

  //------------------------------ experimental hall (world volume)
  //------------------------------ beam line along x axis

  G4double expHall_x = 3.1*m;  // was 3
  G4double expHall_y = 3.1*m;  // was 1
  G4double expHall_z = 3.1*m;  // was 1
  G4Box* experimentalHall_box
    = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
  experimentalHall_log = new G4LogicalVolume(experimentalHall_box,
                                             Air,"expHall_log",0,0,0);  //material = Air

  G4double maxStep = 0.05*cm;
  experimentalHall_log->SetUserLimits(new G4UserLimits(maxStep));

  experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
                                      experimentalHall_log,"expHall",0,false,0);

  //------------------------------ a tracker tube

  G4double innerRadiusOfTheTube = 0.*cm;          
  G4double outerRadiusOfTheTube = 2.54*cm;        
  G4double hightOfTheTube = 2.54*cm; 
  G4double startAngleOfTheTube = 0.*deg;
  G4double spanningAngleOfTheTube = 360.*deg;
  G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube,
                                    outerRadiusOfTheTube,hightOfTheTube,
                                    startAngleOfTheTube,spanningAngleOfTheTube);

  tracker_log = new G4LogicalVolume(tracker_tube,NaI,"tracker_log",0,0,0);   //material = NaI
  G4double trackerPos_x = 0.*m;            
  G4double trackerPos_y = 0.*m;
  G4double trackerPos_z = 0.*m;

  tracker_phys = new G4PVPlacement(0,
             G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z),
             tracker_log,"tracker",experimentalHall_log,false,0);

  //------------------------------- Shim and Wrap

  G4double innerRadiusOfTheWrap = 2.54*cm;
 G4double outerRadiusOfTheWrap = 2.76352*cm;
 G4double hightofTheWrap = 2.54*cm; // was 5.08, dividing by half because I think this is like an extent.
 G4double startAngleOfTheWrap = 0.*deg;
 G4double spanningAngleOfTheWrap = 360.*deg;
 G4Tubs* Wrap_tube = new G4Tubs("Wrap_tube", innerRadiusOfTheWrap,
	                             outerRadiusOfTheWrap, hightofTheWrap,
								 startAngleOfTheWrap,spanningAngleOfTheWrap);
 Wrap_log = new G4LogicalVolume(Wrap_tube,Plastic,"Wrap_log",0,0,0); 
 G4double WrapPos_x = 0.*m;
 G4double WrapPos_y = 0.*m;
 G4double WrapPos_z = 0.*m;

 Wrap_phys = new G4PVPlacement(0,
	        G4ThreeVector(WrapPos_x,WrapPos_y,WrapPos_z),
			Wrap_log,"Wrap",experimentalHall_log,false,0);

 //----------------------------------Aluminum Housing
 G4double innerRadiusofAL = 2.76352*cm;
 G4double outerRadiusofAL = 2.81432*cm;
 G4double hightofAL = 2.54*cm;  
 G4double startAngleofAL = 0.*deg;
 G4double spanningAngleOfAL = 360.*deg;
 G4Tubs* AL_tube = new G4Tubs("AL_tube", innerRadiusofAL,
	                          outerRadiusofAL, hightofAL,
							  startAngleofAL, spanningAngleOfAL);
 AL_log = new G4LogicalVolume(AL_tube,Al,"AL_log",0,0,0);  //material = Al
 G4double ALPos_x = 0.*m;
 G4double ALPos_y = 0.*m;
 G4double ALPos_z = 0.*m;

 AL_phys = new G4PVPlacement(0,G4ThreeVector(ALPos_x,ALPos_y,ALPos_z),
	                         AL_log,"AL",experimentalHall_log,false,0);

 //--------------------------------------Glass

G4double innerRadiusofGlass = 0.*cm; G4double outerRadiusofGlass = 2.54*cm; G4double hightofGlass = 0.3175*cm; G4double startAngleofGlass = 0.*deg; G4double spanningAngleofGlass = 360.*deg;

solidDetector = new G4Tubs("Detector", innerRadiusofGlass, outerRadiusofGlass, hightofGlass, 
						    startAngleofGlass, spanningAngleofGlass);
logicDetector = new G4LogicalVolume(solidDetector,Glass,"logicDetector",0,0,0); //material = Glass
G4double GlassPos_x = 0.*m;
G4double GlassPos_y = 0.*m;
G4double GlassPos_z = -.029845*m; // was -3.6195

physiDetector = new G4PVPlacement(0,G4ThreeVector(GlassPos_x,GlassPos_y,GlassPos_z),
							   logicDetector,"Detector",experimentalHall_log,false,0);

G4SDManager* SDman = G4SDManager::GetSDMpointer(); G4String DetectorSDname = "ExN01/DetectorSD"; ExN01DetectorSD* aDetectorSD = new ExN01DetectorSD( DetectorSDname ); SDman->AddNewDetector( aDetectorSD ); logicDetector->SetSensitiveDetector( aDetectorSD );

 //-------------------------Surfaces-----------------------------
  //SodiumIodide Crystal
  //
  G4OpticalSurface* OpCrystalSurface = new G4OpticalSurface("CrystalSurface");
  OpCrystalSurface->SetType(dielectric_dielectric);
  OpCrystalSurface->SetFinish(ground);
  OpCrystalSurface->SetModel(unified);

  G4LogicalBorderSurface* CrystalSurface = 
	                               new G4LogicalBorderSurface("CrystalSurface",
								   tracker_phys,experimentalHall_phys,OpCrystalSurface);
  //Air
  //
  G4OpticalSurface* OpAirSurface = new G4OpticalSurface("AirSurface");
  OpAirSurface->SetType(dielectric_dielectric);
  OpAirSurface->SetFinish(polished);
  OpAirSurface->SetModel(glisur);

  G4LogicalSkinSurface* AirSurface=
	  new G4LogicalSkinSurface("AirSurface", experimentalHall_log, OpAirSurface);

  const G4int num = 2;
  G4double Ephoton[num] = {2.038*eV, 4.144*eV};

  //OpticalCrystalSurface 
  G4double RefractiveIndex[num] = {1.35, 1.40};
  G4double SpecularLobe[num]    = {0.3, 0.3};
  G4double SpecularSpike[num]   = {0.2, 0.2};
  G4double Backscatter[num]     = {0.2, 0.2};

  G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();

  myST1->AddProperty("RINDEX",                Ephoton, RefractiveIndex, num);
  myST1->AddProperty("SPECULARLOBECONSTANT",  Ephoton, SpecularLobe,    num);
  myST1->AddProperty("SPECULARSPIKECONSTANT", Ephoton, SpecularSpike,   num);
  myST1->AddProperty("BACKSCATTERCONSTANT",   Ephoton, Backscatter,     num);

  OpCrystalSurface->SetMaterialPropertiesTable(myST1);

  //OpticalAirSurface
  G4double Reflectivity[num] = {0.3, 0.5};
  G4double Efficiency[num]   = {0.8, 1.0};

  G4MaterialPropertiesTable *myST2 = new G4MaterialPropertiesTable();

  myST2->AddProperty("REFLECTIVITY", Ephoton, Reflectivity, num);
  myST2->AddProperty("EFFICIENCY",   Ephoton, Efficiency,   num);

  OpAirSurface->SetMaterialPropertiesTable(myST2);

  //------------------------------------------------------------------

worldVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0)); worldVisAtt->SetVisibility(false); experimentalHall_log->SetVisAttributes(worldVisAtt);

cylinderVisAtt = new G4VisAttributes(G4Colour(0.0,1.0,0.0)); tracker_log->SetVisAttributes(cylinderVisAtt);

WrapVisAtt = new G4VisAttributes(G4Colour(0.0,0.0,1.0)); Wrap_log->SetVisAttributes(WrapVisAtt);

HousingVisAtt = new G4VisAttributes(G4Colour(0.5,0.5,0.0)); AL_log->SetVisAttributes(HousingVisAtt);

DetectorVisAtt = new G4VisAttributes(G4Colour(0.0,0.5,0.5)); logicDetector->SetVisAttributes(DetectorVisAtt);

  return experimentalHall_phys;
}

Feedback Re: Transmission of Optical Photons  by Gumplinger Peter <Gumplinger Peter>,   Jul 02, 17:04
Re: None Transmission of Optical Photons
There are several things not right with this code. I suggest you reduce your geometry at first to just one volume (tracker_phys) and then add your plastic shell, Al housing, one at a time. You should also define the corresponding surfaces as you build up your geometry in these steps.

For one, you give the experimentalHall_log a G4LogicalSkinSurface. This cannot work because there is no 'outside' to your world (experimentalHall_log) and I don't think you intended to do this (have photons bounce around inside your world).

Also, yes, the material "Air" has no index of refraction. Moreover, there is something wrong with how you built your geometry. It seems to me, a thin glass disk is placed in experimentalHall where there already is the tracker_phys. This produces an volume overlap not allowed in G4.

Feedback Re: Transmission of Optical Photons  by <jdswado@gatech.edu>,   Jul 16, 08:16
Re: Feedback Re: Transmission of Optical Photons (Gumplinger Peter)
Benton and Peter,

Thank you both for your helpful suggestions, I've tried to implement them and here's what I've discovered so far.

As per Benton's suggestion I've put in some code to see what's going on at my volume boundaries and had the program keep a running tally of the different options.

Number of optical photons created: 320

Boundary Event:                    # Of Occurances
Absorption                              0
Fresnel Reflection                      5
Fresnel Refraction                      323
Detection                               0 (Not surprising, no detector defined)
No Refractive Index                     265
        Of these,
              PreVolume expHall, PostVolume Detector: 22
              PreVolume Wrap,    PostVolume tracker: 242
              PreVolume WrapCap, PostVolume ALRing:  1
Total Internal Reflection               81
Spike Reflection                        27
Lambertion Reflection                   27
Lobe Reflection                         39
Back Scattered                          29
Not A Boundary                           0
Same Material                            1
Step Too Small                          208
        Of these,
              PreVolume expHall, PostVolume Detector: 122
              PreVolume Wrap, PostVolume Tracker;      85
        Also note that when StepTooSmall occured I called the GetStepLength()
        function to see what the step size was and on each of these occurances
        it came up to be 0 cm. I'm not sure the significance of this.

I'm confused as to why I'd have the No Refractive Index occurring so much, it looks to me as if every material has has the correct number of indexes defined. Could this be related to the step too small issue? I am in the process of trying different step sizes, so far no difference.

I thought perhaps there was some kind of geometry overlap going on so after some work I got DAWN and DAVID installed and figured out how to work them. According to DAVID the .prim file produced by the run shows no overlapping of boundaries.

DAVID Output:

Reading file: g4_00.prim Data reading completed

*** 7 primitives ***

Investigating intersections of surfaces Intersection investigation completed

--------------------------------------------------------- !!! Number of intersected volumes : 0 !!! !!! Congratulations ! \(^o^)/ !!! ---------------------------------------------------------

File g4david.prim is generated

I am currently running through Peter's suggestion of looking at the optics starting from only 1 boundary and adding on each one at a time but I thought I'd post this and see if it provided any insight into my problem. I'm not an optics person, as is probably evident, and most of the significance of this boundary output eludes me.

Many Thanks! Jason

Feedback Re: Transmission of Optical Photons  by Gumplinger Peter <Gumplinger Peter>,   Jul 16, 13:31
Re: Feedback Re: Transmission of Optical Photons
> Step Too Small 208

> Of these,

> PreVolume expHall, PostVolume Detector: 122

> PreVolume Wrap, PostVolume Tracker; 85

> Also note that when StepTooSmall occured I called the GetStepLength()

> function to see what the step size was and on each of these occurances

> it came up to be 0 cm. I'm not sure the significance of this.

A zero step lentgh step is a 'relocation step' upon reflection; e.g. the following navigation step after G4OpBoundaryProcess has decided on a reflection will be such a relocation step.

> No Refractive Index 265

This happens when medium 1 and/or medium 2 has no MaterialPropertiesTable, or that table has no Index of Refraction; you have a 'backpainted' surface with no index for the gap.

Apparently, the volumes involved are: expHall, Detector, Wrap, tracker, WrapCap and ALRing. I suspect that some of these volumes should be 'metals' (or paints) but you have not defined their surface as dielectric_metal.

You should find out when this happened:

Same Material 1

Do you have two volumes touch each other with the same material?

None Re: Transmission of Optical Photons  by <jdswado@gatech.edu>,   Jul 24, 09:21
Re: Feedback Re: Transmission of Optical Photons (Gumplinger Peter)
Hello again,

So I found an interesting thing. The "No Refractive Index" problem comes up only when one of the materials involved is my material "Aluminum". Currently my materials property table for aluminum looks like this:

// Aluminum Material Properties Table Stuff

    G4double RealRefractive[nEntries] =
            { 0.444,  0.467,  0.49,   0.5156, 0.5412, 0.5668, 0.5924,
              0.618,  0.6482, 0.6784, 0.7086, 0.7388, 0.769,  0.8068,
              0.8446, 0.8824, 0.9202, 0.958,  1.0064, 1.0548, 1.1032,
              1.1516, 1.2,    1.263,  1.326,  1.389,  1.452,  1.515,
              1.578,  1.641,  1.704,  1.767,  1.83,   1.927,  2.024,
	          2.121,  2.218,  2.315};

    G4double ImaginaryRefractive[nEntries] =
	    {-4.612, -4.736, -4.86,  -4.982, -5.104,  -5.226, -5.348,
	     -5.47,  -5.592, -5.714, -5.836, -5.958,  -6.08,  -6.202,
	     -6.324, -6.446, -6.568, -6.69,  -6.804,  -6.918, -7.032,
	     -7.146, -7.26,  -7.365, -7.47,  -7.575,  -7.68,  -7.785,
	     -7.89,  -7.995, -8.1,   -8.205, -8.31,   -8.324, -8.338,
	     -8.352, -8.366, -8.38}; 

	G4double ALAbsorption[nEntries] =      
	        {0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm,
                 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm,
                 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm,
                 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm,
                 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm, 0.1*mm,
                 0.1*mm, 0.1*mm, 0.1*mm};

  G4MaterialPropertiesTable* myMPT3 = new G4MaterialPropertiesTable();
  myMPT3->AddProperty("REALRINDEX", PhotonEnergy, RealRefractive, nEntries);
myMPT3->AddProperty("IMAGINARYRINDEX",PhotonEnergy,ImaginaryRefractive,nEntries);
  myMPT3->AddProperty("ABSLENGTH", PhotonEnergy, ALAbsorption,nEntries);

////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

As I said, using this I get a great deal of "No Refractive Index". However, if I remove the IMAGINARYRINDEX and replace REALRINDEX with RINDEX, the program runs with no instances of "No Refractive Index". Any idea why this could be?

Also note that I have a surface defined from the aluminum but it currently doesn't seem to be affecting anything at all.

Aluminum surface definition:

G4OpticalSurface* OpALSurface = new G4OpticalSurface("ALSurface");
  OpALSurface->SetType(dielectric_metal);// should be dielectric_metal
  OpALSurface->SetFinish(polished);
  OpALSurface->SetModel(glisur);
  G4double ALRIndex[nEntries]=            
            { 0.444,  0.467,  0.49,   0.5156, 0.5412, 0.5668, 0.5924,
              0.618,  0.6482, 0.6784, 0.7086, 0.7388, 0.769,  0.8068,
              0.8446, 0.8824, 0.9202, 0.958,  1.0064, 1.0548, 1.1032,
              1.1516, 1.2,    1.263,  1.326,  1.389,  1.452,  1.515,
              1.578,  1.641,  1.704,  1.767,  1.83,   1.927,  2.024,
	      2.121,  2.218,  2.315}; 

G4double ALImgRIndex[nEntries]= 	       
            {-4.612, -4.736, -4.86,  -4.982, -5.104,  -5.226, -5.348,
	     -5.47,  -5.592, -5.714, -5.836, -5.958,  -6.08,  -6.202,
	     -6.324, -6.446, -6.568, -6.69,  -6.804,  -6.918, -7.032,
	     -7.146, -7.26,  -7.365, -7.47,  -7.575,  -7.68,  -7.785,
	     -7.89,  -7.995, -8.1,   -8.205, -8.31,   -8.324, -8.338,
	     -8.352, -8.366, -8.38};  

 G4MaterialPropertiesTable* myST_AL = new G4MaterialPropertiesTable();

  myST3->AddProperty("REALRINDEX", PhotonEnergy, ALRIndex, nEntries);  
  myST3->AddProperty("IMAGINARYRINDEX", PhotonEnergy, ALImgRIndex, nEntries);  

  OpCrystalSurfaceTwo->SetMaterialPropertiesTable(myST3);
  G4LogicalBorderSurface* ALSurface =new G4LogicalBorderSurface
("TubeTwoSurface",TubeTwo_phys,experimentalHall_phys,OpCrystalSurfaceTwo);

Have I implemented the imaginary R Index incorrectly?

Thanks!

Feedback Re: Transmission of Optical Photons  by Gumplinger Peter <Gumplinger Peter>,   Jul 24, 18:07
Re: None Re: Transmission of Optical Photons
you seem to have two G4OpSurfaces and you get them confused:

G4OpticalSurface* OpALSurface = new G4OpticalSurface("ALSurface");

OpALSurface->SetType(dielectric_metal);// should be dielectric_metal

OpALSurface->SetFinish(polished);

OpALSurface->SetModel(glisur);

etc.

and

  OpCrystalSurfaceTwo->SetMaterialPropertiesTable(myST3);

  G4LogicalBorderSurface* ALSurface =new G4LogicalBorderSurface
("TubeTwoSurface",TubeTwo_phys,experimentalHall_phys,OpCrystalSurfaceTwo);

You only need ONE and you don't have to specify a ALAbsorption. Optical photons in G4 do not at all penetrate metal:

 G4LogicalBorderSurface* ALSurface =new G4LogicalBorderSurface
("TubeTwoSurface",TubeTwo_phys,experimentalHall_phys,OpAlSurface);

Feedback Re: Transmission of Optical Photons  by Benton Pahlka <Benton Pahlka>,   Jul 02, 11:06
Re: None Transmission of Optical Photons
Hi,

It looks like your OpAirSurface doesn't have a refractive index...although I might have missed it.

In any case, you can test for no refractive index when you get the boundary status. (I have this in my SteppingAction)

With this code you need to define boundaryStatus first!

  G4ParticleDefinition* particleType;
  particleType = aStep->GetTrack()->GetDefinition();
  if( particleType == G4OpticalPhoton::OpticalPhotonDefinition() ){
    // query the boundary status
    boundaryStatus = boundary->GetStatus();

    if(aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary){
      switch(boundaryStatus){
      case Detection: 
      case Undefined: G4cout << "Undefined Boundary Process!" << G4endl;
	break;
      case NoRINDEX: G4cout << "NoRINDEX!" << G4endl;
        break;
  }

Let me know if you don't have something similar in your SteppingAction.

It might also be good to find out where the photons are being absorbed.

Cheers,

Benton

Question Optical Surfaces and Sigma_Alpha  by Wolfgang Lukas <Wolfgang Lukas>,   Jun 23, 06:25
Hello everyone,

I am simulating a scintillation detector setup with a 662 keV gamma source, a plastic scintillator, a photomultiplier tube and a coupling piece. My aim is to find suitable modifications for the setup (geometry, materials) in order to increase the number of optical photons hitting the PMT cathode.

To make sure I am doing things correctly, I'd like to ask you a few questions:

1) EM model for optical photons:

If I only have energies up to 662 keV (gamma) and mostly optical photon physics, which EM model should I use? LowEnergy, Penelope, Livermore, or StandardEM?

2) optical surfaces:

I wrap my plastic scintillator in various materials (e.g. Teflon, Aluminum foil) and/or apply diffuse paint. The scintillator surface itself is polished. Previously I used to define a physical air gap between scintillator and wrapping materials. Now I eliminated the gap and switched to the "...backpainted" and "...frontpainted" options for optical surfaces. Do I apply these correctly?

... Teflon wrap = polishedbackpainted

... Diffuse paint = groundfrontpainted

... Alu wrap = polishedbackpainted (with prob_ss = 1.0 for spike reflections at the aluminum surface - this should hopefully work just like a polished dielectric-metal surface with an air gap?)

3) sigma_alpha values:

Can you recommend any "typical values" of sigma_alpha for diffuse paint and Teflon?

Many, many thanks in advance!

Best regards, Wolfgang

Feedback Re: Optical Surfaces and Sigma_Alpha  by Gumplinger Peter <Gumplinger Peter>,   Jun 23, 13:15
Re: Question Optical Surfaces and Sigma_Alpha (Wolfgang Lukas)
The way I understand your problem domain, your aim is to find relative detection efficiencies. The absolute detection efficiency not only depends on energy deposition and hence the underlying EM processes, but also on more empirical and less known parameters such as reflectivities, bulk absorption etc. Therefore, I don't think you need to worry too much about the EM processes. That said, the StandardEM should just work fine for you, though you may want to compare with LowEnergy, Penelope, Livermore and/or consult experts monitoring the EM Forum.

> Teflon wrap = polishedbackpainted

> Diffuse paint = groundfrontpainted

Yes.

> Alu wrap = polishedbackpainted (with prob_ss = 1.0 for spike

> reflections at the aluminum surface - this should hopefully work just

> like a polished dielectric-metal surface with an air gap?)

Careful, the prob_ss etc. parameters correspond to the interface between the scincillator and the (implied) gap of the 'backpainted' option, not to the reflector behind the gap. This reflector is in the present implementation always assumed to be a Lambertian reflector. If this is not what you want, then I am afraid, you'll need to explicitly implement the gap in geometry and the dielectric_metal surface with the reflector as "polished" (in addition to the dielectric_dielectic interace between scint and gap also "polished").

> Can you recommend any "typical values" of sigma_alpha for diffuse paint

> and Teflon?

Use 100% 'specular lobe' and sigma_alpha of the order of 10deg for diffuse and order 1-2deg for Teflon (but those are not very educated suggestions!).

Question Re: Optical Surfaces and Sigma_Alpha  by Wolfgang Lukas <Wolfgang Lukas>,   Jul 01, 03:48
Re: Feedback Re: Optical Surfaces and Sigma_Alpha (Gumplinger Peter)
Dear Peter,

thank you very much for your prompt and detailed answer!

> Careful, the prob_ss etc. parameters correspond to the interface between
> the scincillator and the (implied) gap of the 'backpainted' option, not
> to the reflector behind the gap. This reflector is in the present
> implementation always assumed to be a Lambertian reflector. If this is
> not what you want, then I am afraid, you'll need to explicitly implement
> the gap in geometry and the dielectric_metal surface with the reflector
> as "polished" (in addition to the dielectric_dielectic interace between
> scint and gap also "polished").

Thank you! - I really want to understand the implementation of the whole optical boundary process correctly, so may I ask some further questions:

a) is there a practical difference between "polishedbackpainted" and "groundbackpainted" with "prob_ss = 1.0"?

b) ... and "groundbackpainted" with "prob_sl = 1.0" + "sigma_alpha = 0.0"? (I just found out: this should be treated exactly as the case above)

c) is there a practical difference between "dielectric_metal" + "polished" and "polishedfrontpainted"?

d) I am biasing my scintillation yield down from 9200 to 92 photons/MeV and weight my results to save CPU time. Is that too much? It looks good to me, though.

> Use 100% 'specular lobe' and sigma_alpha of the order of 10deg for
> diffuse and order 1-2deg for Teflon (but those are not very educated
> suggestions!).

Thank you very much, these suggestions shall be educated enough for my purpose! :-)

However, that will only make sense if I define a physical air gap and set the "specular lobe" & "sigma_alpha" for the back surface, right? Because with a "painted" surface it would affect the front interface (scintillator-gap) ...

I also realised that last December similar questions were raised in this forum by Estela Suarez. I will do some tests and hope to solve some of them. Especially the comparisons between models with/without the air gap (CPU time and detection efficiency) shall be interesting.

Many thanks, Wolfgang

Feedback Re: Optical Surfaces and Sigma_Alpha  by Gumplinger Peter <Gumplinger Peter>,   Jul 02, 17:30
Re: Question Re: Optical Surfaces and Sigma_Alpha (Wolfgang Lukas)
> a) is there a practical difference between "polishedbackpainted" and

> "groundbackpainted" with "prob_ss = 1.0"?

no, prob_ss = 1.0 turns 'ground' into 'polished'

> b) ... and "groundbackpainted" with "prob_sl = 1.0" + "sigma_alpha =

> 0.0"? (I just found out: this should be treated exactly as the case

> above)

again, no, sigma_alpha = 0 turns 'ground' into 'polished'

> c) is there a practical difference between "dielectric_metal" +

> "polished" and "polishedfrontpainted"?

no

> d) I am biasing my scintillation yield down from 9200 to 92 photons/MeV

> and weight my results to save CPU time. Is that too much? It looks good

> to me, though.

this question is for you to decide; it'll depend on the statistics you require to maybe see subtleties

> However, that will only make sense if I define a physical air gap and

> set the "specular lobe" & "sigma_alpha" for the back surface, right?

yes

> Because with a "painted" surface it would affect the front interface

> (scintillator-gap) ...

with the "painted" option the reflector is always Lambertian either as a backup to a gap or directly on the scintillator.

Idea Re: Optical Surfaces and Sigma_Alpha  by Wolfgang Lukas <Wolfgang Lukas>,   Sep 22, 04:36
Re: Feedback Re: Optical Surfaces and Sigma_Alpha (Gumplinger Peter)
Very late update: I switched my geometry from "painted" surfaces to a physical air gap between scintillator pieces and wrapping materials. This requires greater diligence with the geometry (lots of boolean solids). For the sake of simplicity I defined all surfaces of wrapping materials as "dielectric_metal" (no hassle with refractive indices), and set the diffuse reflectors to "unified + ground" with appropriate sigma_alpha values.

With both "techniques" the detection efficiency remains quite constant for my particular setup. Using the "many volumes" approach instead of "...painted surfaces", the CPU time increases by approx. 50%, which is apparently due to an increase in "Transportation" processes also by approx. 50%.

The good thing is that I can switch between materials and adjust their reflective behaviour more easily, e.g. for a painted scintillator I simply fill the air gap with paint; or I can create air gap daughter volumes for different reflective behaviour on specific parts of the scintillator surface.

I hope this approach makes sense. It may be less elegant, but seems to be quite convenient so far.

Best regards, Wolfgang

Feedback Re: Optical Surfaces and Sigma_Alpha  by Benton Pahlka <Benton Pahlka>,   Jul 01, 08:03
Re: Question Re: Optical Surfaces and Sigma_Alpha (Wolfgang Lukas)
Hello,

Just my two cents:

I nearly always implement a physical gap between scintillators and wrappings and do not use the BACKPAINTED option (unless I'm dealing with liquid scintillators, which do not have gaps).

I do this because one will nearly always have gaps between scintillators and wrappings unless one decides to put some optical grease between them. In this case, I allow myself the option to put the grease in.

More importantly, I've found that for large scintillators (and *especially* long, thin bar geometries) the size of the gap plays a large role in the number of photons one collects due to total internal reflection.

Best regards,

Benton

Feedback Re: Optical Surfaces and Sigma_Alpha  by Gumplinger Peter <Gumplinger Peter>,   Jul 02, 17:36
Re: Feedback Re: Optical Surfaces and Sigma_Alpha (Benton Pahlka)
Dear Benton,

Thanks for helping answer some of the questions on this forum.

> More importantly, I've found that for large scintillators (and *especially*

> long, thin bar geometries) the size of the gap plays a large role in the number

> of photons one collects due to total internal reflection.

I would think that the thickness of the gap only matters if the back reflector is not Lambertian. For a Lambertian reflector the actual thickness of the gap should not matter - well, that at least is the working assumption of the whole 'backpainted' logic.

Regards, Peter

Feedback Re: Optical Surfaces and Sigma_Alpha  by Benton Pahlka <Benton Pahlka>,   Jul 03, 07:48
Re: Feedback Re: Optical Surfaces and Sigma_Alpha (Gumplinger Peter)
Hi Peter,

Thanks for the clarification. (my two cents again) For "bar" geometries (length >> cross-sectional area) one would prefer to have photons traveling towards a detector to continue to do so. This can be accomplished by total internal reflection with the addition of a specular reflector and a gap between them.

The fewer interactions one has with the specular reflector the better, if you assume < 100% reflectivity which will nearly always be the case (at least with aluminized mylar).

So, yes, for a Lambertian reflector the size of the gap doesn't matter since the photons will in general be reflected diffusely.

Cheers,

Benton

None 2 problems that may be related  by <jdswado@gatech.edu>,   Jun 04, 12:09
Hello all,

First I apologize that only half of this entry deals with "processes involving optical photons" the other half deals with Compton Scattering but I wasn't sure what category to put this in since it had some overlap.

I have two problems in my application that I believe are quite possibly related but I'm not sure what the cause is. I've isolated the problems as best I could and the relevant code is shown below with notes about what crashes it commented next to the offending parts in CAPS. The problems occur in the initialization of G4double Absorption1[], in the definition of the density of air, and in the inclusion of the compton scattering process.

In Detector Construction.cc-------------------------------------------

G4double PhotonEnergy[nEntries] =
            { 3.2627*eV, 3.1791*eV, 3.0996*eV, 3.024*eV, 2.952*eV,
              2.8833*eV, 2.8178*eV, 2.7552*eV, 2.6953*eV, 2.6379*eV,
              2.583*eV, 2.5303*eV, 2.48*eV, 2.431*eV, 2.3843*eV,
              2.3393*eV, 2.296*eV, 2.254*eV, 2.214*eV, 2.1751*eV,
              2.1376*eV, 2.1014*eV, 2.0664*eV, 2.0325*eV, 1.9997*eV,
              1.9678*eV, 1.9372*eV, 1.9074*eV, 1.8785*eV, 1.8505*eV,
              1.8233*eV, 1.7969*eV, 1.7712*eV, 1.7462*eV, 1.722*eV,
              1.6984*eV, 1.6754*eV, 1.6531*eV};

G4double Absorption1[nEntries] =
            { 0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== IF ANY OF THESE NUMBERS
              0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== ARE ANYTHING OTHER THAN
              0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== ZERO, THE APPLICATION 
              0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== COMPILES WITHOUT ERROR
              0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== BUT CRASHES WHEN RUN
              0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== 
              0.0*m, 0.0*m, 0.0*m, 0.0*m, 0.0*m, // <== 
	      0.0*m, 0.0*m, 0.0*m};

G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();
  myMPT1->AddProperty("RINDEX",       PhotonEnergy, RefractiveIndex1,nEntries);
  myMPT1->AddProperty("ABSLENGTH",    PhotonEnergy, Absorption1,     nEntries);
  myMPT1->AddProperty("FASTCOMPONENT",PhotonEnergy, ScintilFast,     nEntries);
  myMPT1->AddProperty("RAYLEIGH",     PhotonEnergy, scattering,      nEntries);

  myMPT1->AddConstProperty("SCINTILLATIONYIELD",38000./MeV);
  myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
  myMPT1->AddConstProperty("FASTTIMECONSTANT", 1.*ns);

  G4Material* NaI = new G4Material("NaI", density= 3.7*g/cm3, 3); 
  NaI->AddElement(Na,0.495);
  NaI->AddElement(I,0.495);
  NaI->AddElement(Tl,0.01);
  NaI->SetMaterialPropertiesTable(myMPT1);

  G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
  G4Element* O = new G4Element("Oxygen"  , "O", z=8., a= 16.00*g/mole);

  G4Material* Air = new G4Material("Air", density= 0.00129*g/cm3, 2); 

  // IF THE DENSITY OF AIR IS KEPT AT THIS VALUE, OR ANOTHER VALUE OF COMPARABLE
  // MAGNITUDE, THE APPLICATION CRASHES. IF THIS DENSITY IS RAISED TO SOMETHING
  // ON THE ORDER OF APPROX. 1 g/cm3 OR SO, THE APPLICATION RUNS FINE.  

  Air->AddElement(N,0.7);
  Air->AddElement(O,0.3);

------------------------------------------------------------------------- -------------------------------------------------------------------------

In PhysicsList.cc

#include "G4ComptonScattering.hh"

void ExN01PhysicsList::ConstructEM()
{
  theParticleIterator->reset();
  while( (*theParticleIterator)() ){
    G4ParticleDefinition* particle = theParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();
    G4String particleName = particle->GetParticleName();

    if (particleName == "gamma") {
      // gamma         
      pmanager->AddDiscreteProcess(new G4ComptonScattering);

  // IF THE ABOVE LINE IS COMMENTED OUT, THE APPLICATION WILL RUN WITHOUT ERROR
  // IF COMPTON SCATTERING IS LIFT IN, THE PROGRAM WILL CRASH.

------------------------------------------------------------------------------ ------------------------------------------------------------------------------

Why giving non-zero values to the bulk absorption coefficient should crash the application is beyond me but since the program runs correctly if compton scattering is left out or if the density of air is raised significantly, I believe there is some issue occurring with compton scatter events in low density materials.

So does anyone have any idea about what might be causing these problems? I've gone over the code several times and compared my code to LXe and exampleN06. Is there something small I'm missing? Perhaps it is a bigger problem with my data libraries?

Any suggestion is greatly appreciated!

Note Updated, one problem resolved.  by <jdswado@gatech.edu>,   Jun 11, 12:37
Re: None 2 problems that may be related
It seems that the crashes resulting from Compton scattering in air were the result of a stray gamma from a Compton event reaching the boundary of the mother volume.

Warning Re: Updated, one problem resolved.  by Gumplinger Peter <Gumplinger Peter>,   Jun 16, 16:23
Re: Note Updated, one problem resolved.
My guess is that you have this line somewhere in your code:

aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();

The trap is that the pointer:

aStep->GetPostStepPoint()->GetPhysicalVolume()

is NULL when the/any track exists the world-volume. You cannot use it to get the name of the volume "beyond the world" unless you protect the code as in:

if (aStep->GetPostStepPoint()->GetPhysicalVolume()) {
  fVolumeName = aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
}

None Polarized optical photons reflection problem  by Alberto Mengarelli <Alberto Mengarelli>,   Jun 04, 02:00
 Hello,
 in my code i defined a surface with properties of dielectric metal reflection as
 you can see...

 G4MaterialPropertiesTable* mpt = new G4MaterialPropertiesTable();

  mpt->AddProperty("REALRINDEX"     , KeyPhotonEnergy, RealindexAlu     , KeyWaveLengthNum);
  mpt->AddProperty("IMAGINARYRINDEX", KeyPhotonEnergy, ImaginaryindexAlu, KeyWaveLengthNum);

  TubeOpSurface = new G4OpticalSurface("Tube Optical Surface");

  TubeOpSurface->SetType  (dielectric_metal);
  TubeOpSurface->SetFinish(ground);
  TubeOpSurface->SetModel (glisur);
  TubeOpSurface->SetPolish(TubePolish);

  TubeOpSurface->SetMaterialPropertiesTable(mpt);
}

 I'm using particle gun with e beam of polarized optical photon to see the 
 output  of the function GetReflectivity().
 The problem is: if i set polarization TE (E_1parl=0, E1_perp=1) or TM  
 (E_1parl=1, E1_perp=0) the code run in other cases when i've a certain degree 
 of the two polarization together the code stops after processing few events.
 Could anyone tell me why?

 thanks,
         Alberto

Warning Re: Polarized optical photons reflection problem  by Gumplinger Peter <Gumplinger Peter>,   Jun 24, 14:50
Re: None Polarized optical photons reflection problem (Alberto Mengarelli)
This problem has been fixed with tag op-V09-02-01. Unfortunately, at present, this is publicly available only if you download 4.9.3beta. However, the corrected files are attached here.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/06/24/14.48-47221-G4OpBoundaryProcess.hh
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/06/24/14.48-33071-G4OpBoundaryProcess.cc

Question G4Paraboloid Reflection  by Greg Damhorst <Greg Damhorst>,   Jun 01, 09:12
Hello,

I'm trying to model an acrylic lightguide in Geant 4 (v 9.1). One section of this lightguide is a winston cone (http://scienceworld.wolfram.com/physics/WinstonCone.html), which I am trying to model using the G4Paraboloid class.

As shown in the attached visualization, internal reflection off the surface of this paraboloid doesn't appear to be behaving properly. Has anyone experienced this before? Any ideas how we might correct it?

Thanks,

Greg Damhorst

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/06/01/09.11-94197-badwinstonexample.eps

Feedback Re: G4Paraboloid Reflection  by Gumplinger Peter <Gumplinger Peter>,   Jun 04, 11:53
Re: Question G4Paraboloid Reflection (Greg Damhorst)
Dear User,

Thanks for reporting the problem. This bug (with the surface normal in G4Paraboloid) has been fixed with the introduction of patch01 of Geant4 9.2.

Best Regards, Peter Gumplinger

None How to disnable Cerenkov Effect in a specified material/volume  by Dvorak <Dvorak>,   21 Jun, 2003

but How can I tell the program to make these vectors? just in one array of 9.999eV,0.0,10 eV,1.0,10.001eV,0.0,10.999eV,0.0 or call the AddProperty("RINDEX",{9.999, 10}) for several times.

#NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

#( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

#i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Gumplinger Peter <Gumplinger Peter>,   26 Jul, 2002

AddProperty (in G4MaterialPropertiesTable.cc#129) instantiates a G4MaterialPropertyVector(PhotonMomenta,PropertyValues,NumEntries). The 'vector' has to have at least 2 entries. The implementation is more general than the case whereby a scintillator has zero line width emission lines. You can specify a whole continuous spectrum over a range of photon momenta. For practical purpuses this should not be a problem for you as you can make the emission line as narrow as you like.

NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

SetResolutionScale method has nothing to do with the optical photon momentum spectrum. It rather specifies the intensity smearing for a given energy loss in the scintillator; i.e. the number of photons generated.

G4int NumPhotons = (G4int) MeanNumPhotons +
      int( ResolutionScale * G4RandGauss::shoot(0.0,sqrt(MeanNumPhotons)));

It is the 'extra' smearing which multiplies the statistical one in NumPhotons.

None How to disnable Cerenkov Effect in a specified material/volume  by Dvorak <Dvorak>,   21 Jun, 2003
Re: Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton) (Gumplinger Peter)

but How can I tell the program to make these vectors? just in one array of 9.999eV,0.0,10 eV,1.0,10.001eV,0.0,10.999eV,0.0 or call the AddProperty("RINDEX",{9.999, 10}) for several times.

#NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

#( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

#i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

None Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Jacek M. Holeczek <holeczek@us.edu.pl>,   26 Jul, 2002
Hi,
Thanks for your reply.

> myMat->AddProperty("SCINTILLATION", PP, SCINTILLATION, NUM2);
> 
> , i.e. PPCKOV and PP, can be different in value and size, but NUM has to
> be at least 2! You can make your scintillation line as narrow as you
> like, but the width cannot be zero.

Maybe I do not understand you correctly here.
I have a SINGLE scintillation line, but I MUST say to geant4 that
I have (at least) 2 scintillation lines ?
Moreover, what does the "number" of scintillation lines have to do
with their "width" ? As far as I understand the description, the
"width" of ALL lines is NOT set by any "Property", but it is set by
the "SetResolutionScale" method of the "G4Scintillation" class (one
single value valid for all scintillation lines).

Best regards,
Jacek.
Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Gumplinger Peter <Gumplinger Peter>,   26 Jul, 2002
Re: None Re: Cerenkov + Scintillation (+ OpticalPhoton) (Jacek M. Holeczek)

AddProperty (in G4MaterialPropertiesTable.cc#129) instantiates a G4MaterialPropertyVector(PhotonMomenta,PropertyValues,NumEntries). The 'vector' has to have at least 2 entries. The implementation is more general than the case whereby a scintillator has zero line width emission lines. You can specify a whole continuous spectrum over a range of photon momenta. For practical purpuses this should not be a problem for you as you can make the emission line as narrow as you like.

NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

SetResolutionScale method has nothing to do with the optical photon momentum spectrum. It rather specifies the intensity smearing for a given energy loss in the scintillator; i.e. the number of photons generated.

G4int NumPhotons = (G4int) MeanNumPhotons +
      int( ResolutionScale * G4RandGauss::shoot(0.0,sqrt(MeanNumPhotons)));

It is the 'extra' smearing which multiplies the statistical one in NumPhotons.

None How to disnable Cerenkov Effect in a specified material/volume  by Dvorak <Dvorak>,   21 Jun, 2003
Re: Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton) (Gumplinger Peter)

but How can I tell the program to make these vectors? just in one array of 9.999eV,0.0,10 eV,1.0,10.001eV,0.0,10.999eV,0.0 or call the AddProperty("RINDEX",{9.999, 10}) for several times.

#NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

#( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

#i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Gumplinger Peter <Gumplinger Peter>,   25 Jul, 2002

Hi Jacek,

You are talking about a material in which you want to simulate both Cerenkov radiation and scintillation. I assume that you know the index of refraction of this material at all relevant wavelength; i.e. from 2eV to 10eV, and that the material is dispersive.

You have to specify n for all optical wavelengths you want to propagate. The Cerenkov process will now generate photons between p_min and p_max were the lower limitation for the momentum follows from:

n(p_min) = 1/beta

and p_max is 10eV.

If you know that your optical detection device is not sensitive to wavelength >4eV, then I suggest adding a UserSteppingAction (or a UserStackingAction) which immediately discards an optical photon above 4eV but below 10eV.

The arrays you give in the calls:

myMat->AddProperty("RINDEX", PPCKOV, RINDEX, NUM1);

and

myMat->AddProperty("SCINTILLATION", PP, SCINTILLATION, NUM2);

, i.e. PPCKOV and PP, can be different in value and size, but NUM has to be at least 2! You can make your scintillation line as narrow as you like, but the width cannot be zero.

G4double SCINTILLATION = 1.0; // does this mean 100 percent ???

'1.0' is a relative strength. The absolute value can be anything. Important is that the values at different momenta are relative to each other. So, for example, the same value (a choice is 1.0) over the whole spectrum simply means that the emission probability of a photon in that range is flat.

How can the Geant4 know what is the RINDEX and ABSORPTION at 10eV ?

Well, it doesn't unless you provide it.

If you are not interested in certain wavelengths of Cherenkov photons, for your own reasons, then you can discard them in the aforementioned UserActions at little performance penalty.

Regards, Peter

None Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Jacek M. Holeczek <holeczek@us.edu.pl>,   26 Jul, 2002
Re: Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton) (Gumplinger Peter)
Hi,
Thanks for your reply.

> myMat->AddProperty("SCINTILLATION", PP, SCINTILLATION, NUM2);
> 
> , i.e. PPCKOV and PP, can be different in value and size, but NUM has to
> be at least 2! You can make your scintillation line as narrow as you
> like, but the width cannot be zero.

Maybe I do not understand you correctly here.
I have a SINGLE scintillation line, but I MUST say to geant4 that
I have (at least) 2 scintillation lines ?
Moreover, what does the "number" of scintillation lines have to do
with their "width" ? As far as I understand the description, the
"width" of ALL lines is NOT set by any "Property", but it is set by
the "SetResolutionScale" method of the "G4Scintillation" class (one
single value valid for all scintillation lines).

Best regards,
Jacek.
Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Gumplinger Peter <Gumplinger Peter>,   26 Jul, 2002
Re: None Re: Cerenkov + Scintillation (+ OpticalPhoton) (Jacek M. Holeczek)

AddProperty (in G4MaterialPropertiesTable.cc#129) instantiates a G4MaterialPropertyVector(PhotonMomenta,PropertyValues,NumEntries). The 'vector' has to have at least 2 entries. The implementation is more general than the case whereby a scintillator has zero line width emission lines. You can specify a whole continuous spectrum over a range of photon momenta. For practical purpuses this should not be a problem for you as you can make the emission line as narrow as you like.

NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

SetResolutionScale method has nothing to do with the optical photon momentum spectrum. It rather specifies the intensity smearing for a given energy loss in the scintillator; i.e. the number of photons generated.

G4int NumPhotons = (G4int) MeanNumPhotons +
      int( ResolutionScale * G4RandGauss::shoot(0.0,sqrt(MeanNumPhotons)));

It is the 'extra' smearing which multiplies the statistical one in NumPhotons.

None How to disnable Cerenkov Effect in a specified material/volume  by Dvorak <Dvorak>,   21 Jun, 2003
Re: Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton) (Gumplinger Peter)

but How can I tell the program to make these vectors? just in one array of 9.999eV,0.0,10 eV,1.0,10.001eV,0.0,10.999eV,0.0 or call the AddProperty("RINDEX",{9.999, 10}) for several times.

#NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

#( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

#i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

Question Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Jacek M. Holeczek <holeczek@us.edu.pl>,   15 Jul, 2002
Hi,
I am trying to describe the properties of my material so that it
includes the Cerenkov and Scintillation production (+ all OpticalPhoton
interactions).

Assume I have known (analytical) functions for the material :
	RINDEX(EnOp) = rndx(EnOp)
	ABSORPTION(EnOp) = absrp(EnOp)

I am interested in the following :
	Cerenkov production in range 2eV to 4eV +
	Scintillation production at 10eV (just one "line")
Is it possible to have it this way ?
I was thinking about something like this :
	// describe the Cerenkov in range 2eV to 4eV
	const G4int NUMENTRIES = 32;
	G4double PPCKOV[NUMENTRIES] = { 2.*eV, ..., 4.*eV };
	G4double RINDEX[NUMENTRIES] = { ... rndx(EnOp) ... };
	G4double ABSORPTION[NUMENTRIES] = { ... absrp(EnOp) ... };
	G4MaterialPropertiesTable *myMat = new G4MaterialPropertiesTable();
	myMat->AddProperty("RINDEX", PPCKOV, RINDEX, NUMENTRIES);
	myMat->AddProperty("ABSLENGTH",PPCKOV, ABSORPTION, NUMENTRIES);
	// describe the Scintillation at 10eV
	G4double PP = 10.*eV
	G4double SCINTILLATION = 1.0; // does this mean 100 percent ???
	myMat->AddProperty("SCINTILLATION", &PP, &SCINTILLATION, 1);
How can the Geant4 know what is the RINDEX and ABSORPTION at 10eV ?
If I "redefine" the RINDEX and ABSLENGTH properties just at the energy
of 10eV, they will be lost for the Cerenkov in range 2eV to 4eV.

Another, related question is : assume I am interested in the following :
	Cerenkov production in range 2eV to 4eV +
	Cerenkov production in range 9eV to 11eV +
	Scintillation production at 10eV (just one "line")
(note the "gap" in Cerenkov energies between 4eV and 9eV)
Is it possible to have it this way ?
How should I define all the "properties" in this case ?

Thanks in advance,
Best regards,
Jacek.
Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Gumplinger Peter <Gumplinger Peter>,   25 Jul, 2002
Re: Question Cerenkov + Scintillation (+ OpticalPhoton) (Jacek M. Holeczek)

Hi Jacek,

You are talking about a material in which you want to simulate both Cerenkov radiation and scintillation. I assume that you know the index of refraction of this material at all relevant wavelength; i.e. from 2eV to 10eV, and that the material is dispersive.

You have to specify n for all optical wavelengths you want to propagate. The Cerenkov process will now generate photons between p_min and p_max were the lower limitation for the momentum follows from:

n(p_min) = 1/beta

and p_max is 10eV.

If you know that your optical detection device is not sensitive to wavelength >4eV, then I suggest adding a UserSteppingAction (or a UserStackingAction) which immediately discards an optical photon above 4eV but below 10eV.

The arrays you give in the calls:

myMat->AddProperty("RINDEX", PPCKOV, RINDEX, NUM1);

and

myMat->AddProperty("SCINTILLATION", PP, SCINTILLATION, NUM2);

, i.e. PPCKOV and PP, can be different in value and size, but NUM has to be at least 2! You can make your scintillation line as narrow as you like, but the width cannot be zero.

G4double SCINTILLATION = 1.0; // does this mean 100 percent ???

'1.0' is a relative strength. The absolute value can be anything. Important is that the values at different momenta are relative to each other. So, for example, the same value (a choice is 1.0) over the whole spectrum simply means that the emission probability of a photon in that range is flat.

How can the Geant4 know what is the RINDEX and ABSORPTION at 10eV ?

Well, it doesn't unless you provide it.

If you are not interested in certain wavelengths of Cherenkov photons, for your own reasons, then you can discard them in the aforementioned UserActions at little performance penalty.

Regards, Peter

None Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Jacek M. Holeczek <holeczek@us.edu.pl>,   26 Jul, 2002
Re: Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton) (Gumplinger Peter)
Hi,
Thanks for your reply.

> myMat->AddProperty("SCINTILLATION", PP, SCINTILLATION, NUM2);
> 
> , i.e. PPCKOV and PP, can be different in value and size, but NUM has to
> be at least 2! You can make your scintillation line as narrow as you
> like, but the width cannot be zero.

Maybe I do not understand you correctly here.
I have a SINGLE scintillation line, but I MUST say to geant4 that
I have (at least) 2 scintillation lines ?
Moreover, what does the "number" of scintillation lines have to do
with their "width" ? As far as I understand the description, the
"width" of ALL lines is NOT set by any "Property", but it is set by
the "SetResolutionScale" method of the "G4Scintillation" class (one
single value valid for all scintillation lines).

Best regards,
Jacek.
Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton)  Keywords: Cerenkov Scintillation OpticalPhoton
by Gumplinger Peter <Gumplinger Peter>,   26 Jul, 2002
Re: None Re: Cerenkov + Scintillation (+ OpticalPhoton) (Jacek M. Holeczek)

AddProperty (in G4MaterialPropertiesTable.cc#129) instantiates a G4MaterialPropertyVector(PhotonMomenta,PropertyValues,NumEntries). The 'vector' has to have at least 2 entries. The implementation is more general than the case whereby a scintillator has zero line width emission lines. You can specify a whole continuous spectrum over a range of photon momenta. For practical purpuses this should not be a problem for you as you can make the emission line as narrow as you like.

NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

SetResolutionScale method has nothing to do with the optical photon momentum spectrum. It rather specifies the intensity smearing for a given energy loss in the scintillator; i.e. the number of photons generated.

G4int NumPhotons = (G4int) MeanNumPhotons +
      int( ResolutionScale * G4RandGauss::shoot(0.0,sqrt(MeanNumPhotons)));

It is the 'extra' smearing which multiplies the statistical one in NumPhotons.

None How to disnable Cerenkov Effect in a specified material/volume  by Dvorak <Dvorak>,   21 Jun, 2003
Re: Feedback Re: Cerenkov + Scintillation (+ OpticalPhoton) (Gumplinger Peter)

but How can I tell the program to make these vectors? just in one array of 9.999eV,0.0,10 eV,1.0,10.001eV,0.0,10.999eV,0.0 or call the AddProperty("RINDEX",{9.999, 10}) for several times.

#NumEntries is not the number of emission lines, but rather the number of spectral points you specify. No line width is ever infinitesimal narrow anyway. So, for example, if you have narrow emission lines (with equal intensity, one at 10eV and another at 11eV, you could specify the following array pair:

#( 9.999eV,0.0) (10 eV,1.0) (10.001eV,0.0) (10.999eV,0.0) (11 eV,1.0) (11.001eV,0.0)

#i.e. you approximate your emission spectrum with narrow saw tooth lines. G4 does a numerical integration over this array and then samples the photon momentum in the usual way [see G4Scintillation::BuildThePhysicsTable() and the "Determine photon momentum" part of G4Scintillation:PostStepDoIt]

Ok Re: G4Scintillation: Wrong number of photons  Keywords: scintillation number photons
by Gumplinger Peter <Gumplinger Peter>,   18 Nov, 2002

I am pleased to say that we have a fix and that the next public version of GEANT4 will no longer suffer from this bug.

Feedback Re: G4Scintillation: Wrong number of photons  Keywords: scintillation number photons
by Gumplinger Peter <Gumplinger Peter>,   07 Nov, 2002

Dear Klaus,

We are aware of this problem for some time now and are working on a solution. It was also an item of discussion at the recent G4 workshop.

The problem is one of 'stepping manager' (G4SteppingManager2.cc) where for a 'killed' track in one PostStep action, another PostStep action is not called even when it is 'forced'. Unfortunately, fixing this code, which seems simple enough causes a whole set of new problems.

I welcome your posting because it adds more urgency to the issue. I sincerely hope that the next public release comes with a fix. In the meantime, you may want to do the following (excerpt from an email):

At the moment the only solution is changing all 'StopAndKill' assignments in all processes to 'StopButAlive'. This was found to cause only a tiny performance penalty. The 'break' statement in the InvokePostStepDoIt method cannot be removed because then the G4OpBoundary process would be called for an optical photon at the world-boundary, causing a crash because of an ill (incomplete) defined PostStepPoint in this case.

Regards, Peter Gumplinger

Ok Re: G4Scintillation: Wrong number of photons  Keywords: scintillation number photons
by Gumplinger Peter <Gumplinger Peter>,   18 Nov, 2002
Re: Feedback Re: G4Scintillation: Wrong number of photons (Gumplinger Peter)

I am pleased to say that we have a fix and that the next public version of GEANT4 will no longer suffer from this bug.

Question G4Scintillation: Wrong number of photons  Keywords: scintillation number photons
by Klaus Fiedler <Klaus.Fiedler@philips.com>,   07 Nov, 2002
Dear colleagues,

   the G4Scintillation process does not seem to produce the
number of photons expected from the energy deposit and the
scintillation yield (even with ResolutionScale = 0). At first
glance, it seems like local depositions (e.g. photo effect
without sec. e-) do not create scintillation light. Since
this problem has been known for some time (see DMXPhysicsList):
is there a bug fix planned, or does someone know a preliminary
patch?

Best, Klaus.


Setup: Geant4.4.1p01 on Redhat 7.2
Feedback Re: G4Scintillation: Wrong number of photons  Keywords: scintillation number photons
by Gumplinger Peter <Gumplinger Peter>,   07 Nov, 2002
Re: Question G4Scintillation: Wrong number of photons (Klaus Fiedler)

Dear Klaus,

We are aware of this problem for some time now and are working on a solution. It was also an item of discussion at the recent G4 workshop.

The problem is one of 'stepping manager' (G4SteppingManager2.cc) where for a 'killed' track in one PostStep action, another PostStep action is not called even when it is 'forced'. Unfortunately, fixing this code, which seems simple enough causes a whole set of new problems.

I welcome your posting because it adds more urgency to the issue. I sincerely hope that the next public release comes with a fix. In the meantime, you may want to do the following (excerpt from an email):

At the moment the only solution is changing all 'StopAndKill' assignments in all processes to 'StopButAlive'. This was found to cause only a tiny performance penalty. The 'break' statement in the InvokePostStepDoIt method cannot be removed because then the G4OpBoundary process would be called for an optical photon at the world-boundary, causing a crash because of an ill (incomplete) defined PostStepPoint in this case.

Regards, Peter Gumplinger

Ok Re: G4Scintillation: Wrong number of photons  Keywords: scintillation number photons
by Gumplinger Peter <Gumplinger Peter>,   18 Nov, 2002
Re: Feedback Re: G4Scintillation: Wrong number of photons (Gumplinger Peter)

I am pleased to say that we have a fix and that the next public version of GEANT4 will no longer suffer from this bug.

Feedback Re: downscaling of optical photons  Keywords: downscaling optical photons
by Gumplinger Peter <Gumplinger Peter>,   18 Nov, 2002

Hi Jacek,

Yes, you can cheat by reducing the scintillation yield but there is no equivalent user driven variable for the Cerenkov process.

Now, if you have access to the G4 source, you can clobber the return of the method 'GetAverageNumberOfPhotons' in method AlongStepDoIt of G4Cerenkov.cc.

What most people would really like to do, in the absence of any process which changes the wavelenght of the optical photon, is to apply the photo detector efficiency of their device when the wavelength of the photon is calculated in G4Scintillation and/or G4Cerenkov. Conceptually, this mixes the production of photons with the response of the detector. For this reason, code which would allow this has not been implemented at this stage of GEANT4.

Your request strengthens the argument that it should probably be allowed in a future release. It's a bit late now for the next release, but I shall bring it up in discussions with the G4 Technical Steering Board.

Regards, Peter

Question downscaling of optical photons  Keywords: downscaling optical photons
by Jacek M. Holeczek <holeczek@us.edu.pl>,   17 Nov, 2002
Hi,
My simulation produces tons of optical photons.
Basically, in two ways - Cerenkov and Scintillation.
I am looking for a way to "automatically" kill a certain percentage
of photons that are going to be produced.
Please note that I am talking about killing these photons BEFORE they
are created - I am NOT talking about killing them AFTER they already
exist. This can be done in G4UserStackingAction::ClassifyNewTrack, but
this is too late - the unnecessary time consumed is much too long.
I can cheat the Scintillation setting a lower yield, but I have not
found any way to do the same to Cerenkov.
Thanks in advance,
Jacek.
Feedback Re: downscaling of optical photons  Keywords: downscaling optical photons
by Gumplinger Peter <Gumplinger Peter>,   18 Nov, 2002
Re: Question downscaling of optical photons (Jacek M. Holeczek)

Hi Jacek,

Yes, you can cheat by reducing the scintillation yield but there is no equivalent user driven variable for the Cerenkov process.

Now, if you have access to the G4 source, you can clobber the return of the method 'GetAverageNumberOfPhotons' in method AlongStepDoIt of G4Cerenkov.cc.

What most people would really like to do, in the absence of any process which changes the wavelenght of the optical photon, is to apply the photo detector efficiency of their device when the wavelength of the photon is calculated in G4Scintillation and/or G4Cerenkov. Conceptually, this mixes the production of photons with the response of the detector. For this reason, code which would allow this has not been implemented at this stage of GEANT4.

Your request strengthens the argument that it should probably be allowed in a future release. It's a bit late now for the next release, but I shall bring it up in discussions with the G4 Technical Steering Board.

Regards, Peter

Feedback Re: Number of reflections of Opticalphotons  by Gumplinger Peter <Gumplinger Peter>,   06 Feb, 2003

The GEANT4 kernel does not keep track of the number of reflections an optical photon takes along its trajectory and until the user decides to tally it.

However, the G4OpBoundaryProcess has a public method called:

G4OpBoundaryProcessStatus::GetStatus

which returns the internal status of the process after the DoIt (process action). The possible status include:

enum G4OpBoundaryProcessStatus {  Undefined,
                                  FresnelRefraction, FresnelReflection,
                                  TotalInternalReflection,
                                  LambertianReflection, LobeReflection,
                                  SpikeReflection, BackScattering,
                                  Absorption, Detection };

It is therefore possible for the user to tally in his/her G4UserSteppingAction how many times for a given optical photon track a certain mechanism was used in the G4OpBoundaryProcess.

None Number of reflections of Opticalphotons  by Gonzalo RF <Gonzalo RF>,   06 Feb, 2003

Hello.

I am trying to simulated a Cerenkov detector. I have a tank with pure water a three photomultiplier.

When a muon cross the tank I detect the cerenkov light (opticalphotons) in the PMT's, and write in a ascii file the next information about opticalphoton:

	TIME(ns)  ENERGY(eV)  NUMBER_OF_REFLECTIONS

Time and energy is easy, but I don't have any idea how to write the number of reflections in the walls of the tank of the opticalphotons that arrive the PMT's

Can you help me?

Thank you.

Feedback Re: Number of reflections of Opticalphotons  by Gumplinger Peter <Gumplinger Peter>,   06 Feb, 2003
Re: None Number of reflections of Opticalphotons (Gonzalo RF)

The GEANT4 kernel does not keep track of the number of reflections an optical photon takes along its trajectory and until the user decides to tally it.

However, the G4OpBoundaryProcess has a public method called:

G4OpBoundaryProcessStatus::GetStatus

which returns the internal status of the process after the DoIt (process action). The possible status include:

enum G4OpBoundaryProcessStatus {  Undefined,
                                  FresnelRefraction, FresnelReflection,
                                  TotalInternalReflection,
                                  LambertianReflection, LobeReflection,
                                  SpikeReflection, BackScattering,
                                  Absorption, Detection };

It is therefore possible for the user to tally in his/her G4UserSteppingAction how many times for a given optical photon track a certain mechanism was used in the G4OpBoundaryProcess.

Feedback Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gumplinger Peter <Gumplinger Peter>,   17 Mar, 2004

The (final?) answer to this bug report has been a long time coming .... and it seems, the bug was not with the geometry and what normal is returned for a Polyhedra, but rather had to do with uninitialized class members in the G4OpBoundaryProcess. Thanks goes to Gabriele Cosmo for finding this. It came to light with the novice example N06 only when the air bubble was defined as a Polyhedra.

This has been corrected in CVS and should be fixed in the next public release.

More Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gabriele Cosmo <Gabriele Cosmo>,   14 Jul, 2003
Geant4 provides also an implementation of polyhedra/polycone as
"CSG-like" solids. The classes are G4Polyhedra/G4Polycone, located
in geometry/solids/specific.
Give it a try with G4Polyhedra and see if that works.

Cheers, Gabriele
Feedback Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gumplinger Peter <Gumplinger Peter>,   17 Mar, 2004
Re: More Re: Polyhedra and BorderSurface - a bug? (Gabriele Cosmo)

The (final?) answer to this bug report has been a long time coming .... and it seems, the bug was not with the geometry and what normal is returned for a Polyhedra, but rather had to do with uninitialized class members in the G4OpBoundaryProcess. Thanks goes to Gabriele Cosmo for finding this. It came to light with the novice example N06 only when the air bubble was defined as a Polyhedra.

This has been corrected in CVS and should be fixed in the next public release.

None Re: Polyhedra and BorderSurface - a bug?  by Gumplinger Peter <Gumplinger Peter>,   11 Jul, 2003

Sorry, I was on vacation to answer you sooner. Thank you for your feedback and posting to this forum.

I am afraid that I have never tried the G4OpBoundary process with anything but simple CSG volumes (as opposed to BREPS). Why a simple hexagon is a BREP in Geant4 is a mystery to me?

But why it doesn't work would require me to know where the looping happens (in G4OpBoundaryProcess?). - I don't know when I can attend to this bug report but I will certainly forward this problem to the geometry experts because I suspect the problem has to do with what normal is returned by the call to GetLocalExitNormal or GetLocalToGlobalTransform()

More Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gabriele Cosmo <Gabriele Cosmo>,   14 Jul, 2003
Re: None Re: Polyhedra and BorderSurface - a bug? (Gumplinger Peter)
Geant4 provides also an implementation of polyhedra/polycone as
"CSG-like" solids. The classes are G4Polyhedra/G4Polycone, located
in geometry/solids/specific.
Give it a try with G4Polyhedra and see if that works.

Cheers, Gabriele
Feedback Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gumplinger Peter <Gumplinger Peter>,   17 Mar, 2004
Re: More Re: Polyhedra and BorderSurface - a bug? (Gabriele Cosmo)

The (final?) answer to this bug report has been a long time coming .... and it seems, the bug was not with the geometry and what normal is returned for a Polyhedra, but rather had to do with uninitialized class members in the G4OpBoundaryProcess. Thanks goes to Gabriele Cosmo for finding this. It came to light with the novice example N06 only when the air bubble was defined as a Polyhedra.

This has been corrected in CVS and should be fixed in the next public release.

Warning Polyhedra and BorderSurface - a bug?  by Oleksiy <Oleksiy >,   01 Jul, 2003
Dear Experts,

I trying to implement optical surface for some hexagonal geometry.
But border_surface does not seem to be working for this geometry, or rather, 
I suspect, I am not implementing it corectly. 

I decided to check my hex implementation on N06, I just added another object:

//My hex Bubble
//*************************************

#define VECSIZE 2

G4int Sides = 6;
G4double Min_Len =0.*mm;  
G4double Max_Len = 15.*cm;
G4double LengthZ = 15.*cm;
G4double RMINVec[VECSIZE] = { Min_Len, Min_Len }; 
G4double RMAXVec[VECSIZE] = { Max_Len, Max_Len }; 
G4double Z_Values[VECSIZE] = { -LengthZ/2,LengthZ/2}; 

G4BREPSolidPolyhedra* solidConduit = new G4BREPSolidPolyhedra( "Conduit", 0., 2.*pi, Sides, VECSIZE, Z_Values[0], Z_Values, RMINVec, RMAXVec);
G4LogicalVolume*  logicConduit = new G4LogicalVolume(solidConduit,Air, "Conduit",0,0,0);  
G4VPhysicalVolume* physiConduit = new G4PVPlacement(0,0, logicConduit,"Conduit",waterTank_log,   false,0); 
//**********************************

Also, by analogy I specified optical surface:

//********************************
G4OpticalSurface* OpAirSurface2 = new G4OpticalSurface("AirSurface2");
OpAirSurface2->SetType(dielectric_dielectric);
OpAirSurface2->SetFinish(ground);
OpAirSurface2->SetModel(unified);
  
G4LogicalSkinSurface* AirSurface2 = 
	  new G4LogicalSkinSurface("AirSurface2", logicConduit, OpAirSurface2);


//********************************


but it seems to be freezing into some veeery long loop :(.

I could not find any working example with reflecting /or any surface/ 
for polyhedra geometries. I would greatly appreciate if you could point out to my error.

Thank you very much.

Oleksiy 

 
None Re: Polyhedra and BorderSurface - a bug?  by Gumplinger Peter <Gumplinger Peter>,   11 Jul, 2003
Re: Warning Polyhedra and BorderSurface - a bug? (Oleksiy )

Sorry, I was on vacation to answer you sooner. Thank you for your feedback and posting to this forum.

I am afraid that I have never tried the G4OpBoundary process with anything but simple CSG volumes (as opposed to BREPS). Why a simple hexagon is a BREP in Geant4 is a mystery to me?

But why it doesn't work would require me to know where the looping happens (in G4OpBoundaryProcess?). - I don't know when I can attend to this bug report but I will certainly forward this problem to the geometry experts because I suspect the problem has to do with what normal is returned by the call to GetLocalExitNormal or GetLocalToGlobalTransform()

More Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gabriele Cosmo <Gabriele Cosmo>,   14 Jul, 2003
Re: None Re: Polyhedra and BorderSurface - a bug? (Gumplinger Peter)
Geant4 provides also an implementation of polyhedra/polycone as
"CSG-like" solids. The classes are G4Polyhedra/G4Polycone, located
in geometry/solids/specific.
Give it a try with G4Polyhedra and see if that works.

Cheers, Gabriele
Feedback Re: Polyhedra and BorderSurface - a bug?  Keywords: polyhedra, optical surface
by Gumplinger Peter <Gumplinger Peter>,   17 Mar, 2004
Re: More Re: Polyhedra and BorderSurface - a bug? (Gabriele Cosmo)

The (final?) answer to this bug report has been a long time coming .... and it seems, the bug was not with the geometry and what normal is returned for a Polyhedra, but rather had to do with uninitialized class members in the G4OpBoundaryProcess. Thanks goes to Gabriele Cosmo for finding this. It came to light with the novice example N06 only when the air bubble was defined as a Polyhedra.

This has been corrected in CVS and should be fixed in the next public release.

Feedback Re: Bug in G4OpRayleigh constructor  by Gumplinger Peter <Gumplinger Peter>,   26 Apr, 2004

Hi Dmitry,

Thank you for your contribution to this Forum. I'll protect the code of G4OpRayleigh to check for the pointers: MaterialPropertiesTable and Rindex.

Moreover, I'll rewrite the BuildThePhysicsTable method to first look for aMaterialPropertiesTable and a property 'RAYLEIGH' for any material, including a material named "Water", and only if nothing has been defined by the user, define the Rayleigh scattering length for "Water" by calling the RayleighAttenuationLengthGenerator method.

At this point, many existing application may already rely on the above method being called by default from the G4OpRayleigh constructor, after the user simply defines 'Water' and its refractive index. I am hesitent, therefore, to require the user to set a private G4bool in G4OpRayleigh to invoke this feature.

In the next G4 release, if the user calls:

myMPT->AddProperty("RAYLEIGH",PhotonEnergy,RayleighAttenuationLength,nEntries);

in his/her DetectorConstruction (DefineMaterial) for any material, even for 'Water', this will not be overwritten.

Thanks again for your feedback,

Peter

Warning Bug in G4OpRayleigh constructor  by Dmitry Onoprienko <Dmitry Onoprienko>,   26 Apr, 2004
I don't know whether this is a bug or a feature, but whenever
you have a material named "Water" in your simulation, 
G4OpRayleigh constructor attempts to automatically compute
Rayleigh scattering length for 10-degrees water and assign it
to that material. Which causes the program to crash if "Water"
does not have a material table associated with it, or if the
material table does not have RINDEX property vector.

I don't think this is documented anywhere - I was surprised 
when the simulation suddenly started to give me a segmentation 
fault after I changed the material name from "water" to "Water".
I think the code should at least check for the existence of the
table before attempting to modify it - and warn the user before 
overwriting the properties he assigned to the material.
Feedback Re: Bug in G4OpRayleigh constructor  by Gumplinger Peter <Gumplinger Peter>,   26 Apr, 2004
Re: Warning Bug in G4OpRayleigh constructor (Dmitry Onoprienko)

Hi Dmitry,

Thank you for your contribution to this Forum. I'll protect the code of G4OpRayleigh to check for the pointers: MaterialPropertiesTable and Rindex.

Moreover, I'll rewrite the BuildThePhysicsTable method to first look for aMaterialPropertiesTable and a property 'RAYLEIGH' for any material, including a material named "Water", and only if nothing has been defined by the user, define the Rayleigh scattering length for "Water" by calling the RayleighAttenuationLengthGenerator method.

At this point, many existing application may already rely on the above method being called by default from the G4OpRayleigh constructor, after the user simply defines 'Water' and its refractive index. I am hesitent, therefore, to require the user to set a private G4bool in G4OpRayleigh to invoke this feature.

In the next G4 release, if the user calls:

myMPT->AddProperty("RAYLEIGH",PhotonEnergy,RayleighAttenuationLength,nEntries);

in his/her DetectorConstruction (DefineMaterial) for any material, even for 'Water', this will not be overwritten.

Thanks again for your feedback,

Peter

Feedback Re: Cherenkov photons energy distribution  Keywords: photons cherenkov energy range distribution rindex
by Gumplinger Peter <Gumplinger Peter>,   01 Sep, 2004

Please, refer to

http://wwwasd.web.cern.ch/wwwasd/geant4/G4UsersDocuments/UsersGuides/PhysicsReferenceManual/html/node18.html#SECTION012020000000000000000

in the Geant4 Physics Reference Manual and/or

J.D.Jackson, Classical Electrodynamics, John Wiley and Sons (1998)

The number of Cerenkov photons generated per unit step length is adjusted to the energy range in which the index of refraction is specified.

The spectral range of these Cerenkov photons is truncated to the energy range in which the Rindex is specified. However, the spectral shape in that truncated range is the same as it would be for a wider range.

To answer your questions:

Will we get correct number-of-photons/step and energy distributions (for the Emin-Emax range), or will these two will be incorrect?

You should get the correct number-of-photons/step and the correct energy distribution.

If you were to make a normalized plot of the Cerenkov energy spectrum that you get from the DoIt of G4Cerenkov, normalized in each case to the number of photons in your restricted energy range, the plots should be identical for both the more restricted and less restricted situation. To think of it, the two plots should already roughly have the same number of entries in it from Emin to Emax.

Question Cherenkov photons energy distribution  Keywords: photons cherenkov energy range distribution rindex
by Vlasios Vasileiou <Vlasios Vasileiou>,   01 Sep, 2004
In the G4Cerenkov process, I see that there aren't any Cherenkov photons
produced with energies outside the energy range used for specifying the
refraction index. 

This is logical.

What happens if the energy range of the specified refraction index, 
doesn't cover all of the allowed cherenkov energies?

Suppose in reality for a given particle&material we have cherenkov
photons from emin to emax. 

What happens if we try to simulate the same particle&material and the
rindex energy range (Emin-Emax) we specify doesn't cover all of emin-emax?

Will we get correct number-of-photons/step and energy distributions (for
the Emin-Emax range), or will these two will be incorrect?

My question is because I generate Cherenkov photons in water and my 
detectors have a specific energy range they are sensitive to. I used to
specify all the properties of water in this energy range. I have the 
impression that by restricting the available energy range the population
of cherenkov photons in my water isn't the one that would be in reality
(comparing in the detector-sensitive energy range always).

Thanks,
Vlasios Vasileiou


Feedback Re: Cherenkov photons energy distribution  Keywords: photons cherenkov energy range distribution rindex
by Gumplinger Peter <Gumplinger Peter>,   01 Sep, 2004
Re: Question Cherenkov photons energy distribution (Vlasios Vasileiou)

Please, refer to

http://wwwasd.web.cern.ch/wwwasd/geant4/G4UsersDocuments/UsersGuides/PhysicsReferenceManual/html/node18.html#SECTION012020000000000000000

in the Geant4 Physics Reference Manual and/or

J.D.Jackson, Classical Electrodynamics, John Wiley and Sons (1998)

The number of Cerenkov photons generated per unit step length is adjusted to the energy range in which the index of refraction is specified.

The spectral range of these Cerenkov photons is truncated to the energy range in which the Rindex is specified. However, the spectral shape in that truncated range is the same as it would be for a wider range.

To answer your questions:

Will we get correct number-of-photons/step and energy distributions (for the Emin-Emax range), or will these two will be incorrect?

You should get the correct number-of-photons/step and the correct energy distribution.

If you were to make a normalized plot of the Cerenkov energy spectrum that you get from the DoIt of G4Cerenkov, normalized in each case to the number of photons in your restricted energy range, the plots should be identical for both the more restricted and less restricted situation. To think of it, the two plots should already roughly have the same number of entries in it from Emin to Emax.

Feedback Re: optical surface efficiency  Keywords: optical, efficiency
by Gumplinger Peter <Gumplinger Peter>,   19 Nov, 2004

1) I've noticed that there are fluctations about the user specified efficiency value entered as an optical surface property. Specifically the efficiency appears NOT to be a simple multiplicative factor. I assume the fluctuations about this specified mean are Poisson in nature. Can this be confirmed as there is no documentation I have found that clarifies this?

No, the efficiency you specify should be the one used - just one simple random number for those photons which are not reflected. You should find that the number of photons 'detected' are e*(r-1), where r is the reflectivity you have specified and e is the detection efficiency you specify. However, there is one important caveat for rough surfaces, or rather, there WAS this caveat until G4 6.2 patch2 (what are you using?):

The value of the reflectivity you provide was for a 'single reflection' off the surface. What happens for very rough surfaces is that the photon, after being reflected from a micro-facet, whose normal happens to have a large angle with the nominal surface normal, still points (has a direction) out of your volume and hence within G4OpBoundaryProcess 'reinteracts' with the surface. The reflectivity is again applied and as a result, the rougher the surface the smaller the observed effective reflectivity. So, there was a correlation between roughness and observed reflection reflectivity and hence detection efficiency. - This correlation was fixed in the latest patch!

2) I understand that I can give the efficiency as a function of optical photon energy. Is the efficiency array treated as a histogram (constant mean between array entries) or is there interpolation between array values?

There is a simple linear interpolation between bin values as is the case for any G4MaterialPropertyVector (see G4MaterialPropertyVector:: GetProperty)

None optical surface efficiency  Keywords: optical, efficiency
by Matt Orr <orrm@uah.edu>,   19 Nov, 2004

I have two questions regarding optical photon detection at a surface:

1) I've noticed that there are fluctations about the user specified efficiency value entered as an optical surface property. Specifically the efficiency appears NOT to be a simple multiplicative factor. I assume the fluctuations about this specified mean are Poisson in nature. Can this be confirmed as there is no documentation I have found that clarifies this?

2) I understand that I can give the efficiency as a function of optical photon energy. Is the efficiency array treated as a histogram (constant mean between array entries) or is there interpolation between array values?

Any information regarding this is very much appreciated. Thanks.

- Matt Orr -

Feedback Re: optical surface efficiency  Keywords: optical, efficiency
by Gumplinger Peter <Gumplinger Peter>,   19 Nov, 2004
Re: None optical surface efficiency (Matt Orr)

1) I've noticed that there are fluctations about the user specified efficiency value entered as an optical surface property. Specifically the efficiency appears NOT to be a simple multiplicative factor. I assume the fluctuations about this specified mean are Poisson in nature. Can this be confirmed as there is no documentation I have found that clarifies this?

No, the efficiency you specify should be the one used - just one simple random number for those photons which are not reflected. You should find that the number of photons 'detected' are e*(r-1), where r is the reflectivity you have specified and e is the detection efficiency you specify. However, there is one important caveat for rough surfaces, or rather, there WAS this caveat until G4 6.2 patch2 (what are you using?):

The value of the reflectivity you provide was for a 'single reflection' off the surface. What happens for very rough surfaces is that the photon, after being reflected from a micro-facet, whose normal happens to have a large angle with the nominal surface normal, still points (has a direction) out of your volume and hence within G4OpBoundaryProcess 'reinteracts' with the surface. The reflectivity is again applied and as a result, the rougher the surface the smaller the observed effective reflectivity. So, there was a correlation between roughness and observed reflection reflectivity and hence detection efficiency. - This correlation was fixed in the latest patch!

2) I understand that I can give the efficiency as a function of optical photon energy. Is the efficiency array treated as a histogram (constant mean between array entries) or is there interpolation between array values?

There is a simple linear interpolation between bin values as is the case for any G4MaterialPropertyVector (see G4MaterialPropertyVector:: GetProperty)

Feedback Re: gamma polarisation  Keywords: gamma polarisation
by Gumplinger Peter <Gumplinger Peter>,   15 Feb, 2005

The mechanics of how to set the transverse polarization of any particle is shown in the method 'SetOptPhotonPolar' of ExN06PrimaryGeneratorAction.

As far as existing G4 processes go that depend on this polarization, besides the optical photon processes, however to the best of my knowledge, there is only G4LowEnergyPolarizedCompton.

Of course, you can always write your own process and add it to the process manager of a 'gamma'; like your version of, let's say: G4PolarizedPairProduction; if you know how to implement it (and if you do, please share it with G4 community).

More Re: gamma polarisation  Keywords: gamma polarisation
by scott <d.j.scott@dl.ac.uk>,   14 Feb, 2005

Thanks,

I'm not too sure if optical photons are what i need. I am interested in simulating polarised photons with energies of tens of MeV interacting, via pair production, compton sctattering etc etc, with a target - can i include these physics processes with an ~MeV polarised photon?

Feedback Re: gamma polarisation  Keywords: gamma polarisation
by Gumplinger Peter <Gumplinger Peter>,   15 Feb, 2005
Re: More Re: gamma polarisation (scott)

The mechanics of how to set the transverse polarization of any particle is shown in the method 'SetOptPhotonPolar' of ExN06PrimaryGeneratorAction.

As far as existing G4 processes go that depend on this polarization, besides the optical photon processes, however to the best of my knowledge, there is only G4LowEnergyPolarizedCompton.

Of course, you can always write your own process and add it to the process manager of a 'gamma'; like your version of, let's say: G4PolarizedPairProduction; if you know how to implement it (and if you do, please share it with G4 community).

None Re: gamma polarisation  Keywords: gamma polarisation
by michel maire <michel maire>,   11 Feb, 2005

User scott wrote:

>> Hi,
>> 
>> Can anyone tell me how i can define the polarisation of a beam of
>> gammas, please?
>> 
>> Thanks in advance....

 See examples/novice/N06/PrimaryGeneratorAction and optPhoton.mac
 See also examples/extended/optical/LXe/photon.mac

More Re: gamma polarisation  Keywords: gamma polarisation
by scott <d.j.scott@dl.ac.uk>,   14 Feb, 2005
Re: None Re: gamma polarisation (michel maire)

Thanks,

I'm not too sure if optical photons are what i need. I am interested in simulating polarised photons with energies of tens of MeV interacting, via pair production, compton sctattering etc etc, with a target - can i include these physics processes with an ~MeV polarised photon?

Feedback Re: gamma polarisation  Keywords: gamma polarisation
by Gumplinger Peter <Gumplinger Peter>,   15 Feb, 2005
Re: More Re: gamma polarisation (scott)

The mechanics of how to set the transverse polarization of any particle is shown in the method 'SetOptPhotonPolar' of ExN06PrimaryGeneratorAction.

As far as existing G4 processes go that depend on this polarization, besides the optical photon processes, however to the best of my knowledge, there is only G4LowEnergyPolarizedCompton.

Of course, you can always write your own process and add it to the process manager of a 'gamma'; like your version of, let's say: G4PolarizedPairProduction; if you know how to implement it (and if you do, please share it with G4 community).

Question gamma polarisation  Keywords: gamma polarisation
by scott <d.j.scott@dl.ac.uk>,   11 Feb, 2005

Hi,

Can anyone tell me how i can define the polarisation of a beam of gammas, please?

Thanks in advance....

None Re: gamma polarisation  Keywords: gamma polarisation
by michel maire <michel maire>,   11 Feb, 2005
Re: Question gamma polarisation (scott)

User scott wrote:

>> Hi,
>> 
>> Can anyone tell me how i can define the polarisation of a beam of
>> gammas, please?
>> 
>> Thanks in advance....

 See examples/novice/N06/PrimaryGeneratorAction and optPhoton.mac
 See also examples/extended/optical/LXe/photon.mac

More Re: gamma polarisation  Keywords: gamma polarisation
by scott <d.j.scott@dl.ac.uk>,   14 Feb, 2005
Re: None Re: gamma polarisation (michel maire)

Thanks,

I'm not too sure if optical photons are what i need. I am interested in simulating polarised photons with energies of tens of MeV interacting, via pair production, compton sctattering etc etc, with a target - can i include these physics processes with an ~MeV polarised photon?

Feedback Re: gamma polarisation  Keywords: gamma polarisation
by Gumplinger Peter <Gumplinger Peter>,   15 Feb, 2005
Re: More Re: gamma polarisation (scott)

The mechanics of how to set the transverse polarization of any particle is shown in the method 'SetOptPhotonPolar' of ExN06PrimaryGeneratorAction.

As far as existing G4 processes go that depend on this polarization, besides the optical photon processes, however to the best of my knowledge, there is only G4LowEnergyPolarizedCompton.

Of course, you can always write your own process and add it to the process manager of a 'gamma'; like your version of, let's say: G4PolarizedPairProduction; if you know how to implement it (and if you do, please share it with G4 community).

None Re: optical photons question  Keywords: optical photons
by Gumplinger Peter <Gumplinger Peter>,   09 Mar, 2005

Sorry for the confusion. The code (G4OpBoundaryProcess) is not written in a way that it'll check first if a property named REFLECTIVITY is defined with AddConstProperty before it looks for it as a wavelength dependent property.

The concept of constant properties was a later development. Optical properties were all originally assumed to be wavelength dependent. It is easy enough to define a property constant over the wavelength range of interest.

I shall have a look how this confusion can be avoided without a great penalty in performance. For now, and for the record, the following named properties are expected to be in the G4MaterialPropertiesTable as wavelength dependent (to be defined with AddProperty):

RINDEX ABSLENGTH REFLECTIVITY EFFICIENCY FASTCOMPONENT SLOWCOMPONENT WLSCOMPONENT WLSABSLENGTH

and these are constant properties (to be defined with AddConstProperty):

SCINTILLATIONYIELD RESOLUTIONSCALE FASTTIMECONSTANT SLOWTIMECONSTANT YIELDRATIO WLSTIMECONSTANT

(All of the properties needed to transport optical photons are expected to be wavelength dependent)

One of the central ideas behind the G4 project has been the ease with which the package can be extended to include new functionality. The hope was that at some point users will drive the development in communication with a core group of developers (Technical Forum). I'd be very happy to discuss how functionality available in LITRANI, for example, can be ported to G4 if there is a limitation.

Note optical photons question  Keywords: optical photons
by Philippe Després <Philippe Després>,   09 Mar, 2005

Hello,

I use the optical photons processes and I ran into something that, I think, could be improve. Actually, in a dielectric_metal surface, incorrect behavior happens if one gives the reflectivity or the efficiency of a surface through AddConstProperty instead of AddProperty. Maybe I missed something in the documentation, but it seems natural to use AddConstProperty if one wants the property to be independant of wavelength. As an example, change the line

photocath_mt->AddProperty("REFLECTIVITY",Ephoton,photocath_REFL,num);

by

photocath_mt->AddConstProperty("REFLECTIVITY",0.0);

in the extended/optical/LXe/src/LXeMainVolume.cc and see the results.

Otherwise, it seems like a considerable effort was made by François-Xavier Gentit to model optical photons http://gentit.home.cern.ch/gentit/litrani/

I wonder if GEANT4 could benefit from some parts of this work.

Philippe

None Re: optical photons question  Keywords: optical photons
by Gumplinger Peter <Gumplinger Peter>,   09 Mar, 2005
Re: Note optical photons question (Philippe Després)

Sorry for the confusion. The code (G4OpBoundaryProcess) is not written in a way that it'll check first if a property named REFLECTIVITY is defined with AddConstProperty before it looks for it as a wavelength dependent property.

The concept of constant properties was a later development. Optical properties were all originally assumed to be wavelength dependent. It is easy enough to define a property constant over the wavelength range of interest.

I shall have a look how this confusion can be avoided without a great penalty in performance. For now, and for the record, the following named properties are expected to be in the G4MaterialPropertiesTable as wavelength dependent (to be defined with AddProperty):

RINDEX ABSLENGTH REFLECTIVITY EFFICIENCY FASTCOMPONENT SLOWCOMPONENT WLSCOMPONENT WLSABSLENGTH

and these are constant properties (to be defined with AddConstProperty):

SCINTILLATIONYIELD RESOLUTIONSCALE FASTTIMECONSTANT SLOWTIMECONSTANT YIELDRATIO WLSTIMECONSTANT

(All of the properties needed to transport optical photons are expected to be wavelength dependent)

One of the central ideas behind the G4 project has been the ease with which the package can be extended to include new functionality. The hope was that at some point users will drive the development in communication with a core group of developers (Technical Forum). I'd be very happy to discuss how functionality available in LITRANI, for example, can be ported to G4 if there is a limitation.

Feedback Re: Aerojel Rayleigh Scattering  by Gumplinger Peter <Gumplinger Peter>,   16 May, 2005

It's a bit involved, but the material properties of various types of Aerojels are defined in:

examples/advanced/Rich

specifically:

/include/RichTbMaterialParameters.hh

and

/src/RichTbPhysicsList.cc

For more information, you may want to contact the authors:

Sajan Easo (Sajan.Easo@cern.ch) Patricia Mendez (Patricia.Mendez@cern.ch)

In general, the user needs to know the material constants of the materials in his/her simulation. The G4 collaboration is not, not yet anyway, in the business of providing and maintaining a materials data-base. In this case, you are lucky in that one advanced example also uses Aerojels.

None Aerojel Rayleigh Scattering  by Dvorak <Dvorak>,   15 May, 2005

Hello all,
    I'm trying to simulate aerojel for my project. How can I simulate the rayleigh scattering using geant 4?
    What are the constants to set in the materialpropertytable?
-Thank you
-Yushu

Feedback Re: Aerojel Rayleigh Scattering  by Gumplinger Peter <Gumplinger Peter>,   16 May, 2005
Re: None Aerojel Rayleigh Scattering (Dvorak)

It's a bit involved, but the material properties of various types of Aerojels are defined in:

examples/advanced/Rich

specifically:

/include/RichTbMaterialParameters.hh

and

/src/RichTbPhysicsList.cc

For more information, you may want to contact the authors:

Sajan Easo (Sajan.Easo@cern.ch) Patricia Mendez (Patricia.Mendez@cern.ch)

In general, the user needs to know the material constants of the materials in his/her simulation. The G4 collaboration is not, not yet anyway, in the business of providing and maintaining a materials data-base. In this case, you are lucky in that one advanced example also uses Aerojels.

None Re: how to get the scintillation emission time for optical photon??  by michel maire <michel maire>,   16 Jun, 2005

User Peter Gumplinger wrote:
>> More generally, how does one get the time of origin of any secondary?
>> 
 In G4Track there are 3 times :

     GetGlobalTime()  : since the beginning of event
     GetLocalTime()   : since the creation of current particle
     GetProperTime()  : the same, in the mass-at-rest system 

Feedback Re: how to get the scintillation emission time for optical photon??  by Gumplinger Peter <Gumplinger Peter>,   15 Jun, 2005

More generally, how does one get the time of origin of any secondary?

I don't know the answer, off hand, except to suggest that the user does so in the G4UserSteppingAction as may be described at:

http://geant4.slac.stanford.edu/Tips/

albeit in a different context. If those tips don't help, please feel free to pose your question on the 'Event and Track Management' Forum.

None Re: how to get the scintillation emission time for optical photon??  by michel maire <michel maire>,   16 Jun, 2005
Re: Feedback Re: how to get the scintillation emission time for optical photon?? (Gumplinger Peter)

User Peter Gumplinger wrote:
>> More generally, how does one get the time of origin of any secondary?
>> 
 In G4Track there are 3 times :

     GetGlobalTime()  : since the beginning of event
     GetLocalTime()   : since the creation of current particle
     GetProperTime()  : the same, in the mass-at-rest system 

None how to get the scintillation emission time for optical photon??  by chen <chen>,   13 Jun, 2005

A neutron enter scintillator and the optical photons are detected by PMT. How to get the scintillation emission time??

Feedback Re: how to get the scintillation emission time for optical photon??  by Gumplinger Peter <Gumplinger Peter>,   15 Jun, 2005
Re: None how to get the scintillation emission time for optical photon?? (chen)

More generally, how does one get the time of origin of any secondary?

I don't know the answer, off hand, except to suggest that the user does so in the G4UserSteppingAction as may be described at:

http://geant4.slac.stanford.edu/Tips/

albeit in a different context. If those tips don't help, please feel free to pose your question on the 'Event and Track Management' Forum.

None Re: how to get the scintillation emission time for optical photon??  by michel maire <michel maire>,   16 Jun, 2005
Re: Feedback Re: how to get the scintillation emission time for optical photon?? (Gumplinger Peter)

User Peter Gumplinger wrote:
>> More generally, how does one get the time of origin of any secondary?
>> 
 In G4Track there are 3 times :

     GetGlobalTime()  : since the beginning of event
     GetLocalTime()   : since the creation of current particle
     GetProperTime()  : the same, in the mass-at-rest system 

Feedback Re: How to know the yield factor for the scintillation process??  by Gumplinger Peter <Gumplinger Peter>,   15 Jun, 2005

// Called to set the scintillation photon yield factor, needed when

// the yield is different for different types of particles. This

// scales the yield obtained from the G4MaterialPropertiesTable.

The ScintillationYieldFactor, like any of the other input parameters for G4Scintillation, is material dependent, and in this case, also particle dependent. It's up to the user to "know" it, or make assumptions about it. What it specifies is how energy loss (de/dx) translates into scintillation photon yield for a given type of particle, different from what is specified in the photon yield. This may just be known empirically. If you don't know it at all, I suggest you first use the default (==> 1).

None How to know the yield factor for the scintillation process??  by chen <chen>,   14 Jun, 2005

how to know the yield factor for the scintillation process? I think it is very important for the producted number of phontons.

Feedback Re: How to know the yield factor for the scintillation process??  by Gumplinger Peter <Gumplinger Peter>,   15 Jun, 2005
Re: None How to know the yield factor for the scintillation process?? (chen)

// Called to set the scintillation photon yield factor, needed when

// the yield is different for different types of particles. This

// scales the yield obtained from the G4MaterialPropertiesTable.

The ScintillationYieldFactor, like any of the other input parameters for G4Scintillation, is material dependent, and in this case, also particle dependent. It's up to the user to "know" it, or make assumptions about it. What it specifies is how energy loss (de/dx) translates into scintillation photon yield for a given type of particle, different from what is specified in the photon yield. This may just be known empirically. If you don't know it at all, I suggest you first use the default (==> 1).

Feedback Re: What the parameters mean in material properties tables?  Keywords: optics photon
by Gumplinger Peter <Gumplinger Peter>,   08 Sep, 2005

  G4double LXe_Energy[LXe_NUMENTRIES]    = { 7.0*eV , 7.07*eV, 7.14*eV };

// they should be optics photon's energy, right?

right!

// another question, how about the emission spectrum is continuous?

  G4double LXe_SCINT[LXe_NUMENTRIES] = { 0.1, 1.0, 0.1 };

In this case, the emission spectrum IS continuous. The emission spectrum has a peak at 7.07eV and drops to 10% on either side within +-0.07eV. A linear interpolation is done between points of this triangular spectrum.

// what's these? Are they the relative light output or others?

Yes, relative light output.

  G4double LXe_RIND[LXe_NUMENTRIES]  = { 1.59 , 1.57, 1.54 };

//refractive index,right?

correct

  G4double LXe_ABSL[LXe_NUMENTRIES]  = { 35.*cm, 35.*cm, 35.*cm}; 

//absorbed length, just equal to attenuation length?

correct

  LXe_mt = new G4MaterialPropertiesTable();
  LXe_mt->AddProperty("FASTCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
  LXe_mt->AddProperty("SLOWCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);

//time component array.

  LXe_mt->AddProperty("RINDEX",LXe_Energy, LXe_RIND,  LXe_NUMENTRIES);

//refractive index array

 LXe_mt->AddProperty("ABSLENGTH",LXe_Energy, LXe_ABSL,  LXe_NUMENTRIES);

//absorbed lenght array.

all correct

LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);

//scintillation yield,just mean that produce 12000. photons per 1 MeV.

correct

  LXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);                      

//is it resolution scale? Can somebody tell me its definition.

This (and everything above) is explained (I'd hope - but let me know - if not) sufficiently in the documentation:

http://wwwasd.web.cern.ch/wwwasd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#5.2.5

and an intrinsic resolution, RESOLUTIONSCALE, which generally broadens the statistical distribution of generated photons. A wider intrinsic resolution is due to impurities which are typical for doped crystals like NaI(Tl) and CsI(Tl). On the other hand, the intrinsic resolution can also be narrower when the Fano factor plays a role. The actual number of emitted photons during a step fluctuates around the mean number of photons with a width given by ResolutionScale*sqrt(MeanNumberOfPhotons).

  LXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);          
  LXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);

//arise time and decay time,right?

No! You can specify two decay constants, one for the fast scintillation component and one for a slow component (rise-time is instant).

  LXe_mt->AddConstProperty("YIELDRATIO",1.0);   

//energy transfer efficiency?

The relative strength of the fast component as a fraction of total scintillation yield is given by the YIELDRATIO

  LXe->SetMaterialPropertiesTable(LXe_mt);

Question What the parameters mean in material properties tables?  Keywords: optics photon
by John Yellek <azeng78@163.com>,   07 Sep, 2005

hi,when I study the examples\extended\optical\LXe, I don't sure what the mean of these parameters below, can somebody tell me it is right?

  G4double LXe_Energy[LXe_NUMENTRIES]    = { 7.0*eV , 7.07*eV, 7.14*eV };
// they should be optics photon's energy, right?
// another question, how about the emission spectrum is continuous?
  G4double LXe_SCINT[LXe_NUMENTRIES] = { 0.1, 1.0, 0.1 };
// what's these? Are they the relative light output or others?
  G4double LXe_RIND[LXe_NUMENTRIES]  = { 1.59 , 1.57, 1.54 };
//refractive index,right?
  G4double LXe_ABSL[LXe_NUMENTRIES]  = { 35.*cm, 35.*cm, 35.*cm}; 
//absorbed length, just equal to attenuation length?
  LXe_mt = new G4MaterialPropertiesTable();
  LXe_mt->AddProperty("FASTCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
  LXe_mt->AddProperty("SLOWCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
//time component array.
  LXe_mt->AddProperty("RINDEX",LXe_Energy, LXe_RIND,  LXe_NUMENTRIES);
//refractive index array
 LXe_mt->AddProperty("ABSLENGTH",LXe_Energy, LXe_ABSL,  LXe_NUMENTRIES);
//absorbed lenght array.
LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV); 
//scintillation yield,just mean that produce 12000. photons per 1 MeV.
  LXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);			
//is it resolution scale?  Can somebody tell me its definition.
  LXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);		
  LXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);
//arise time and decay time,right?		
  LXe_mt->AddConstProperty("YIELDRATIO",1.0);	
//energy transfer efficiency?			
  LXe->SetMaterialPropertiesTable(LXe_mt);

Feedback Re: What the parameters mean in material properties tables?  Keywords: optics photon
by Gumplinger Peter <Gumplinger Peter>,   08 Sep, 2005
Re: Question What the parameters mean in material properties tables? (John Yellek)

  G4double LXe_Energy[LXe_NUMENTRIES]    = { 7.0*eV , 7.07*eV, 7.14*eV };

// they should be optics photon's energy, right?

right!

// another question, how about the emission spectrum is continuous?

  G4double LXe_SCINT[LXe_NUMENTRIES] = { 0.1, 1.0, 0.1 };

In this case, the emission spectrum IS continuous. The emission spectrum has a peak at 7.07eV and drops to 10% on either side within +-0.07eV. A linear interpolation is done between points of this triangular spectrum.

// what's these? Are they the relative light output or others?

Yes, relative light output.

  G4double LXe_RIND[LXe_NUMENTRIES]  = { 1.59 , 1.57, 1.54 };

//refractive index,right?

correct

  G4double LXe_ABSL[LXe_NUMENTRIES]  = { 35.*cm, 35.*cm, 35.*cm}; 

//absorbed length, just equal to attenuation length?

correct

  LXe_mt = new G4MaterialPropertiesTable();
  LXe_mt->AddProperty("FASTCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
  LXe_mt->AddProperty("SLOWCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);

//time component array.

  LXe_mt->AddProperty("RINDEX",LXe_Energy, LXe_RIND,  LXe_NUMENTRIES);

//refractive index array

 LXe_mt->AddProperty("ABSLENGTH",LXe_Energy, LXe_ABSL,  LXe_NUMENTRIES);

//absorbed lenght array.

all correct

LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);

//scintillation yield,just mean that produce 12000. photons per 1 MeV.

correct

  LXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);                      

//is it resolution scale? Can somebody tell me its definition.

This (and everything above) is explained (I'd hope - but let me know - if not) sufficiently in the documentation:

http://wwwasd.web.cern.ch/wwwasd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#5.2.5

and an intrinsic resolution, RESOLUTIONSCALE, which generally broadens the statistical distribution of generated photons. A wider intrinsic resolution is due to impurities which are typical for doped crystals like NaI(Tl) and CsI(Tl). On the other hand, the intrinsic resolution can also be narrower when the Fano factor plays a role. The actual number of emitted photons during a step fluctuates around the mean number of photons with a width given by ResolutionScale*sqrt(MeanNumberOfPhotons).

  LXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);          
  LXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);

//arise time and decay time,right?

No! You can specify two decay constants, one for the fast scintillation component and one for a slow component (rise-time is instant).

  LXe_mt->AddConstProperty("YIELDRATIO",1.0);   

//energy transfer efficiency?

The relative strength of the fast component as a fraction of total scintillation yield is given by the YIELDRATIO

  LXe->SetMaterialPropertiesTable(LXe_mt);

Feedback Re: How can I read out the position information about scintillation process?  by Gumplinger Peter <Gumplinger Peter>,   10 Sep, 2005

Hi

Although the G4ScintillationProcess inherits from G4VRestDiscreteProcess (for reasons I don't quite remember now - it should maybe more properly inherit from G4VRestContinuousProcess), the scintillation photons are emitted uniformly along the step. The code documents:

// This routine is called for each tracking step of a charged particle

// in a scintillator. A Poisson/Gauss-distributed number of photons is

// generated according to the scintillation yield formula, distributed

// evenly along the track segment and uniformly into 4pi.

What this means is that there is no such thing as the 'position of the scintillation process'. The origins are on a line between PreStepPoint and PostStepPoint.

You can get the origin of each and every scintillation photon with code such as the one exhibited in:

/examples/extended/optical/LXe/scr/LXeSteppingVerbose.cc:

        G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
                              fN2ndariesAlongStepDoIt +
                              fN2ndariesPostStepDoIt;

        for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
                        lp1<(*fSecondary).size(); lp1++){
          G4cout << "    : "
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
                 << std::setw(10)
                 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
          G4cout << G4endl;
        }

As you can see, this assumes that the secondaries of a step are stored in the fSecondary vector such that the optical photons come last. I don't know if this should be expected in all cases. Of course, you can ask for the ParticleName first and then, if 'opticalphoton' print its origin position.

Hope this helps, Peter

None How can I read out the position information about scintillation process?  by changchun <cs49@phy.duke.edu>,   09 Sep, 2005

Dear All,

I am working on the simulation of scintillation process. I want to know the position information about scintillation process, just like aStep->GetPreStepPoint()->GetPosition(). Is there such kind of information available? If there is, how can I read them out?

Thanks!

Changchun

Feedback Re: How can I read out the position information about scintillation process?  by Gumplinger Peter <Gumplinger Peter>,   10 Sep, 2005
Re: None How can I read out the position information about scintillation process? (changchun)

Hi

Although the G4ScintillationProcess inherits from G4VRestDiscreteProcess (for reasons I don't quite remember now - it should maybe more properly inherit from G4VRestContinuousProcess), the scintillation photons are emitted uniformly along the step. The code documents:

// This routine is called for each tracking step of a charged particle

// in a scintillator. A Poisson/Gauss-distributed number of photons is

// generated according to the scintillation yield formula, distributed

// evenly along the track segment and uniformly into 4pi.

What this means is that there is no such thing as the 'position of the scintillation process'. The origins are on a line between PreStepPoint and PostStepPoint.

You can get the origin of each and every scintillation photon with code such as the one exhibited in:

/examples/extended/optical/LXe/scr/LXeSteppingVerbose.cc:

        G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
                              fN2ndariesAlongStepDoIt +
                              fN2ndariesPostStepDoIt;

        for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
                        lp1<(*fSecondary).size(); lp1++){
          G4cout << "    : "
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
                 << std::setw(6)
                 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
                 << std::setw(10)
                 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
          G4cout << G4endl;
        }

As you can see, this assumes that the secondaries of a step are stored in the fSecondary vector such that the optical photons come last. I don't know if this should be expected in all cases. Of course, you can ask for the ParticleName first and then, if 'opticalphoton' print its origin position.

Hope this helps, Peter

Feedback Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Ben Loer <Ben Loer>,   07 Dec, 2005
Here is the output it gives me with verbose level set to 2. I am using Geant4.7 patch1.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6252,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    -18.1   -0.697    0.411    0.0129        0        0         0     p_strip initStep
    1    -17.9    -0.75    0.875    0.0127        0    0.523     0.523     p_strip compt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -17.9     -0.75     0.875  0.000286                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    2     11.9     4.17    -9.78    0.0126        0     32.1      32.6     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :      11.9      4.17     -9.78  4.57e-05                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
-----------------------------------------------------------
    *** Dump for solid - startstrip ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 20.5 mm
    half length Y: 5 mm
    half length Z: 125 mm
-----------------------------------------------------------
Position:

p.x() = 11.93047830246582 mm
p.y() = 4.169383963993893 mm
p.z() = -9.780518325305247 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Box::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
    3      nan      nan      nan    0.0121        0     3.61      36.2     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  3 ---------------
    :       nan       nan       nan  0.000481                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    4      nan      nan      nan    0.0121        0        0      36.2  OutOfWorld Transportation
More Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Gumplinger Peter <Gumplinger Peter>,   06 Dec, 2005

Ben,

Can you isolate the problem and provide the output of /tracking/verbose 1 (or higher) in order to identify at process level where exactly the problem (nan) starts manifesting.

What Geant4 version is being used? Similar problems were fixed in the past in the EM processes.

Feedback Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Ben Loer <Ben Loer>,   07 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Here is the output it gives me with verbose level set to 2. I am using Geant4.7 patch1.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6252,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    -18.1   -0.697    0.411    0.0129        0        0         0     p_strip initStep
    1    -17.9    -0.75    0.875    0.0127        0    0.523     0.523     p_strip compt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -17.9     -0.75     0.875  0.000286                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    2     11.9     4.17    -9.78    0.0126        0     32.1      32.6     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :      11.9      4.17     -9.78  4.57e-05                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
-----------------------------------------------------------
    *** Dump for solid - startstrip ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 20.5 mm
    half length Y: 5 mm
    half length Z: 125 mm
-----------------------------------------------------------
Position:

p.x() = 11.93047830246582 mm
p.y() = 4.169383963993893 mm
p.z() = -9.780518325305247 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Box::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
    3      nan      nan      nan    0.0121        0     3.61      36.2     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  3 ---------------
    :       nan       nan       nan  0.000481                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    4      nan      nan      nan    0.0121        0        0      36.2  OutOfWorld Transportation
None Re: Stuck on error with optical photons  Keywords: optical photon
by Ben Loer <Ben Loer>,   05 Dec, 2005
Thanks for the advice. In investigating further, I realized that the offending
particle is actually a bremsstrahlung gamma (I'm unfamiliar with the optical 
modeling, so I assumed that was the culprit).  The track stayed within the volume 
in which it originated for the duration of its flight, but that volume is a
G4SubtractionSolid, and it did pass within a few tenths of a mm of the notch in the solid.
(I have no idea if that is at all relevant.) 
I can control the problem by checking to make sure that direction is not nan
in the UserSteppingAction and resetting it, but there is obviously something that I'm still doing wrong.
More Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Gumplinger Peter <Gumplinger Peter>,   06 Dec, 2005
Re: None Re: Stuck on error with optical photons (Ben Loer)

Ben,

Can you isolate the problem and provide the output of /tracking/verbose 1 (or higher) in order to identify at process level where exactly the problem (nan) starts manifesting.

What Geant4 version is being used? Similar problems were fixed in the past in the EM processes.

Feedback Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Ben Loer <Ben Loer>,   07 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Here is the output it gives me with verbose level set to 2. I am using Geant4.7 patch1.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6252,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    -18.1   -0.697    0.411    0.0129        0        0         0     p_strip initStep
    1    -17.9    -0.75    0.875    0.0127        0    0.523     0.523     p_strip compt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -17.9     -0.75     0.875  0.000286                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    2     11.9     4.17    -9.78    0.0126        0     32.1      32.6     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :      11.9      4.17     -9.78  4.57e-05                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
-----------------------------------------------------------
    *** Dump for solid - startstrip ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 20.5 mm
    half length Y: 5 mm
    half length Z: 125 mm
-----------------------------------------------------------
Position:

p.x() = 11.93047830246582 mm
p.y() = 4.169383963993893 mm
p.z() = -9.780518325305247 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Box::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
    3      nan      nan      nan    0.0121        0     3.61      36.2     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  3 ---------------
    :       nan       nan       nan  0.000481                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    4      nan      nan      nan    0.0121        0        0      36.2  OutOfWorld Transportation
More Re: Stuck on error with optical photons  Keywords: optical photon
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2005

Ben,

On second thought, it could also be that the direction of a photon after the G4OpBoundaryProcess, i.e. after refraction or reflection becomes nan. In that case, the debug printout I just suggested won't help. It's possible that the normal to a surface is wacky. Any chance that you can isolate the event and the track and print its step history.

You can also check NewMomentum for nan in G4OpBoundaryProcess::DoIt just before:

        aParticleChange.ProposeMomentumDirection(NewMomentum);
        aParticleChange.ProposePolarization(NewPolarization);

Peter

None Re: Stuck on error with optical photons  Keywords: optical photon
by Ben Loer <Ben Loer>,   05 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Thanks for the advice. In investigating further, I realized that the offending
particle is actually a bremsstrahlung gamma (I'm unfamiliar with the optical 
modeling, so I assumed that was the culprit).  The track stayed within the volume 
in which it originated for the duration of its flight, but that volume is a
G4SubtractionSolid, and it did pass within a few tenths of a mm of the notch in the solid.
(I have no idea if that is at all relevant.) 
I can control the problem by checking to make sure that direction is not nan
in the UserSteppingAction and resetting it, but there is obviously something that I'm still doing wrong.
More Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Gumplinger Peter <Gumplinger Peter>,   06 Dec, 2005
Re: None Re: Stuck on error with optical photons (Ben Loer)

Ben,

Can you isolate the problem and provide the output of /tracking/verbose 1 (or higher) in order to identify at process level where exactly the problem (nan) starts manifesting.

What Geant4 version is being used? Similar problems were fixed in the past in the EM processes.

Feedback Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Ben Loer <Ben Loer>,   07 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Here is the output it gives me with verbose level set to 2. I am using Geant4.7 patch1.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6252,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    -18.1   -0.697    0.411    0.0129        0        0         0     p_strip initStep
    1    -17.9    -0.75    0.875    0.0127        0    0.523     0.523     p_strip compt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -17.9     -0.75     0.875  0.000286                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    2     11.9     4.17    -9.78    0.0126        0     32.1      32.6     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :      11.9      4.17     -9.78  4.57e-05                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
-----------------------------------------------------------
    *** Dump for solid - startstrip ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 20.5 mm
    half length Y: 5 mm
    half length Z: 125 mm
-----------------------------------------------------------
Position:

p.x() = 11.93047830246582 mm
p.y() = 4.169383963993893 mm
p.z() = -9.780518325305247 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Box::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
    3      nan      nan      nan    0.0121        0     3.61      36.2     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  3 ---------------
    :       nan       nan       nan  0.000481                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    4      nan      nan      nan    0.0121        0        0      36.2  OutOfWorld Transportation
Idea Re: Stuck on error with optical photons  Keywords: optical photon
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2005

Hi Ben,

To help us find out what's wrong, can you please put this code fragment into your UserSteppingAction:

G4Track* theTrack = theStep->GetTrack();
const G4DynamicParticle* aParticle = theTrack->GetDynamicParticle();
G4ThreeVector aMomentum = aParticle->GetMomentumDirection();
G4double vx = aMomentum.x();
G4int ix = isnan(vx);
if(ix != 0){
    G4cout << " PROBLEM! " << theTrack->GetCreatorProcess()->GetProcessName() <<
std::flush << G4endl;
}

I also suggest you isolate the event where this happens so we can reproduce the error by running just this one event.

Peter

More Re: Stuck on error with optical photons  Keywords: optical photon
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2005
Re: Idea Re: Stuck on error with optical photons (Gumplinger Peter)

Ben,

On second thought, it could also be that the direction of a photon after the G4OpBoundaryProcess, i.e. after refraction or reflection becomes nan. In that case, the debug printout I just suggested won't help. It's possible that the normal to a surface is wacky. Any chance that you can isolate the event and the track and print its step history.

You can also check NewMomentum for nan in G4OpBoundaryProcess::DoIt just before:

        aParticleChange.ProposeMomentumDirection(NewMomentum);
        aParticleChange.ProposePolarization(NewPolarization);

Peter

None Re: Stuck on error with optical photons  Keywords: optical photon
by Ben Loer <Ben Loer>,   05 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Thanks for the advice. In investigating further, I realized that the offending
particle is actually a bremsstrahlung gamma (I'm unfamiliar with the optical 
modeling, so I assumed that was the culprit).  The track stayed within the volume 
in which it originated for the duration of its flight, but that volume is a
G4SubtractionSolid, and it did pass within a few tenths of a mm of the notch in the solid.
(I have no idea if that is at all relevant.) 
I can control the problem by checking to make sure that direction is not nan
in the UserSteppingAction and resetting it, but there is obviously something that I'm still doing wrong.
More Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Gumplinger Peter <Gumplinger Peter>,   06 Dec, 2005
Re: None Re: Stuck on error with optical photons (Ben Loer)

Ben,

Can you isolate the problem and provide the output of /tracking/verbose 1 (or higher) in order to identify at process level where exactly the problem (nan) starts manifesting.

What Geant4 version is being used? Similar problems were fixed in the past in the EM processes.

Feedback Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Ben Loer <Ben Loer>,   07 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Here is the output it gives me with verbose level set to 2. I am using Geant4.7 patch1.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6252,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    -18.1   -0.697    0.411    0.0129        0        0         0     p_strip initStep
    1    -17.9    -0.75    0.875    0.0127        0    0.523     0.523     p_strip compt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -17.9     -0.75     0.875  0.000286                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    2     11.9     4.17    -9.78    0.0126        0     32.1      32.6     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :      11.9      4.17     -9.78  4.57e-05                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
-----------------------------------------------------------
    *** Dump for solid - startstrip ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 20.5 mm
    half length Y: 5 mm
    half length Z: 125 mm
-----------------------------------------------------------
Position:

p.x() = 11.93047830246582 mm
p.y() = 4.169383963993893 mm
p.z() = -9.780518325305247 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Box::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
    3      nan      nan      nan    0.0121        0     3.61      36.2     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  3 ---------------
    :       nan       nan       nan  0.000481                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    4      nan      nan      nan    0.0121        0        0      36.2  OutOfWorld Transportation
None Stuck on error with optical photons  Keywords: optical photon
by Ben Loer <Ben Loer>,   30 Nov, 2005
Hello, all! I'm trying to simulate a plastic scintillator with WLS fibers 
running through it.  What I've written so far works most of the time, but 
occasionally I encounter the following error:
"
Exiting from G4Scintillation::DoIt -- NumberOfSecondaries = 5345

-----------------------------------------------------------
    *** Dump for solid - s_core ***
    ===================================================
 Solid type: G4Tubs
 Parameters:
    inner radius : 0 mm
    outer radius : 0.4925 mm
    half length Z: 100 mm
    starting phi : 0 degrees
    delta phi    : 360 degrees
-----------------------------------------------------------
Position:

p.x() = -0.2305615475889624 mm
p.y() = -0.3432094879357805 mm
p.z() = 8.160033998032439 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Tubs::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
Segmentation fault (core dumped)
"

To the best of my knowledge, this error happens randomly, as I have not 
found a way to reproduce it. If anyone has any help or suggestions to offer, 
I'd really appreciate it.
Thanks!

Idea Re: Stuck on error with optical photons  Keywords: optical photon
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2005
Re: None Stuck on error with optical photons (Ben Loer)

Hi Ben,

To help us find out what's wrong, can you please put this code fragment into your UserSteppingAction:

G4Track* theTrack = theStep->GetTrack();
const G4DynamicParticle* aParticle = theTrack->GetDynamicParticle();
G4ThreeVector aMomentum = aParticle->GetMomentumDirection();
G4double vx = aMomentum.x();
G4int ix = isnan(vx);
if(ix != 0){
    G4cout << " PROBLEM! " << theTrack->GetCreatorProcess()->GetProcessName() <<
std::flush << G4endl;
}

I also suggest you isolate the event where this happens so we can reproduce the error by running just this one event.

Peter

More Re: Stuck on error with optical photons  Keywords: optical photon
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2005
Re: Idea Re: Stuck on error with optical photons (Gumplinger Peter)

Ben,

On second thought, it could also be that the direction of a photon after the G4OpBoundaryProcess, i.e. after refraction or reflection becomes nan. In that case, the debug printout I just suggested won't help. It's possible that the normal to a surface is wacky. Any chance that you can isolate the event and the track and print its step history.

You can also check NewMomentum for nan in G4OpBoundaryProcess::DoIt just before:

        aParticleChange.ProposeMomentumDirection(NewMomentum);
        aParticleChange.ProposePolarization(NewPolarization);

Peter

None Re: Stuck on error with optical photons  Keywords: optical photon
by Ben Loer <Ben Loer>,   05 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Thanks for the advice. In investigating further, I realized that the offending
particle is actually a bremsstrahlung gamma (I'm unfamiliar with the optical 
modeling, so I assumed that was the culprit).  The track stayed within the volume 
in which it originated for the duration of its flight, but that volume is a
G4SubtractionSolid, and it did pass within a few tenths of a mm of the notch in the solid.
(I have no idea if that is at all relevant.) 
I can control the problem by checking to make sure that direction is not nan
in the UserSteppingAction and resetting it, but there is obviously something that I'm still doing wrong.
More Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Gumplinger Peter <Gumplinger Peter>,   06 Dec, 2005
Re: None Re: Stuck on error with optical photons (Ben Loer)

Ben,

Can you isolate the problem and provide the output of /tracking/verbose 1 (or higher) in order to identify at process level where exactly the problem (nan) starts manifesting.

What Geant4 version is being used? Similar problems were fixed in the past in the EM processes.

Feedback Re: Stuck on error with optical photons  Keywords: nan momentum direction
by Ben Loer <Ben Loer>,   07 Dec, 2005
Re: More Re: Stuck on error with optical photons (Gumplinger Peter)
Here is the output it gives me with verbose level set to 2. I am using Geant4.7 patch1.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6252,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0    -18.1   -0.697    0.411    0.0129        0        0         0     p_strip initStep
    1    -17.9    -0.75    0.875    0.0127        0    0.523     0.523     p_strip compt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :     -17.9     -0.75     0.875  0.000286                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    2     11.9     4.17    -9.78    0.0126        0     32.1      32.6     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  2 ---------------
    :      11.9      4.17     -9.78  4.57e-05                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
-----------------------------------------------------------
    *** Dump for solid - startstrip ***
    ===================================================
 Solid type: G4Box
 Parameters:
    half length X: 20.5 mm
    half length Y: 5 mm
    half length Z: 125 mm
-----------------------------------------------------------
Position:

p.x() = 11.93047830246582 mm
p.y() = 4.169383963993893 mm
p.z() = -9.780518325305247 mm

Direction:

v.x() = nan
v.y() = nan
v.z() = nan

Proposed distance :

snxt = 9e+99 mm

G4VParticleChange::SetNumberOfSecondaries() Warning  theListOfSecondaries is not empty
*** G4Exception : Notification
      issued by : G4Box::DistanceToOut(p,v,..)
Undefined side for valid surface normal to solid.
*** This is just a warning message.
    3      nan      nan      nan    0.0121        0     3.61      36.2     p_strip polarCompt
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  3 ---------------
    :       nan       nan       nan  0.000481                 e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------
    4      nan      nan      nan    0.0121        0        0      36.2  OutOfWorld Transportation
Feedback Re: Bug in Wavelength Shifting (G4OpWLS) process ?  Keywords: Wavelength Shifting WLSTIMECONSTANT
by Gumplinger Peter <Gumplinger Peter>,   02 May, 2006

Thanks Apostolos,

for your comment. You could call it a bug, though, the option of a time delay in WLS was programmed more like a place holder for something to come or for the user to change as appropriate.

I'll take advice as to the time evolution of photon emission after absorption in WLS fibers. I agree, an exponential is probably a better approximation than a delta function; or is it, or is it something else? The process may involve some complicated exitation transfers between absorption and emission sites of the material.

If I don't hear opposition, I'll change it for the next release to an exponential.

Peter

Question Bug in Wavelength Shifting (G4OpWLS) process ?  Keywords: Wavelength Shifting WLSTIMECONSTANT
by Apostolos Tsirigotis <Apostolos Tsirigotis>,   02 May, 2006

I am developing a detector description for a scintillator detector with optical fibers to collect the optical photons produced. The Fibers are Wavelength Shifters, so I include the G4OpWLS optical process in the simulation. As described in the Application Developers Manual, the Constant Material Property "WLSTIMECONSTANT accounts for any time delay which may occur between absorption and re-emission of the photon". I suppose that this time constant is the time constant for the de-excitation of a fiber molecule after the absorption of the photon. If so, the time delay between absorption and re-emission of the photon should be exponentially distributed. But in fact, as implemented in the code (G4OpWLS::PostStepDoIt), this delay is a delta function :

---------------------------------------------

G4VParticleChange* G4OpWLS::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)

{

......

WLSTime = aMaterialPropertiesTable->GetConstProperty("WLSTIMECONSTANT");

.......

G4double aSecondaryTime = (pPostStepPoint->GetGlobalTime()) + WLSTime;

.......

G4Track* aSecondaryTrack = new G4Track(aWLSPhoton,aSecondaryTime,aSecondaryPosition);

.......

}

-----------------------------------------------

Is there a physics reason that this time delay is a delta function or is it a bug?

Thank you.

Feedback Re: Bug in Wavelength Shifting (G4OpWLS) process ?  Keywords: Wavelength Shifting WLSTIMECONSTANT
by Gumplinger Peter <Gumplinger Peter>,   02 May, 2006
Re: Question Bug in Wavelength Shifting (G4OpWLS) process ? (Apostolos Tsirigotis)

Thanks Apostolos,

for your comment. You could call it a bug, though, the option of a time delay in WLS was programmed more like a place holder for something to come or for the user to change as appropriate.

I'll take advice as to the time evolution of photon emission after absorption in WLS fibers. I agree, an exponential is probably a better approximation than a delta function; or is it, or is it something else? The process may involve some complicated exitation transfers between absorption and emission sites of the material.

If I don't hear opposition, I'll change it for the next release to an exponential.

Peter

None Re: Optical Reflectivity  by Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>,   03 Jul, 2006
On Fri, 30 Jun 2006, Peter Gumplinger wrote:

> *** Discussion title: Electromagnetic Processes
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/emprocess/509/1"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> The optical reflectivity of the scintillator surface is the probability
> of reflection (as opposed to absorption) at each and every bounce; i.e.
> encounter with the surface. The optical reflectivity is a material
> (surface) property which you need to know through other means.
> 
> Conversely, if you know the light yield, and for your geometry and PMT
> photo efficiency, the number of photo electrons at the PMT for 662keV
> gammas, you can tune the MC optical surface reflectivity until the MC
> gives you the same result.
> 
> Of course, with 100% reflectivity all produced photons (assuming you
> have no bulk absorption) will eventually arrive at your PMT no matter
> how many bounces.
> 

Hello,

I would suggest to set reflectivity to 100% and study the dendence of 
results on cut and/or other parameters. After optimization return to 
detailed simulation of optical photons.

VI

None Re: Optical Reflectivity  Keywords: Optical photons reflectivity in pixellated detector
by <wmenges@sandia.gov>,   30 Jun, 2006

Peter,

Thank you for the response. However, I am not sure about tuning of the MC optical surface reflectivity. Can you explain a little bit more about it. Those figures I quoted in my earlier message are counts detected at the PMT before using the quantum efficiency. Thank you for the help.

Wond

Feedback Re: Optical Reflectivity  Keywords: Optical photons reflectivity in pixellated detector
by Gumplinger Peter <Gumplinger Peter>,   30 Jun, 2006

The optical reflectivity of the scintillator surface is the probability of reflection (as opposed to absorption) at each and every bounce; i.e. encounter with the surface. The optical reflectivity is a material (surface) property which you need to know through other means.

Conversely, if you know the light yield, and for your geometry and PMT photo efficiency, the number of photo electrons at the PMT for 662keV gammas, you can tune the MC optical surface reflectivity until the MC gives you the same result.

Of course, with 100% reflectivity all produced photons (assuming you have no bulk absorption) will eventually arrive at your PMT no matter how many bounces.

None Re: Optical Reflectivity  by Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>,   03 Jul, 2006
Re: Feedback Re: Optical Reflectivity (Gumplinger Peter)
On Fri, 30 Jun 2006, Peter Gumplinger wrote:

> *** Discussion title: Electromagnetic Processes
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/emprocess/509/1"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> The optical reflectivity of the scintillator surface is the probability
> of reflection (as opposed to absorption) at each and every bounce; i.e.
> encounter with the surface. The optical reflectivity is a material
> (surface) property which you need to know through other means.
> 
> Conversely, if you know the light yield, and for your geometry and PMT
> photo efficiency, the number of photo electrons at the PMT for 662keV
> gammas, you can tune the MC optical surface reflectivity until the MC
> gives you the same result.
> 
> Of course, with 100% reflectivity all produced photons (assuming you
> have no bulk absorption) will eventually arrive at your PMT no matter
> how many bounces.
> 

Hello,

I would suggest to set reflectivity to 100% and study the dendence of 
results on cut and/or other parameters. After optimization return to 
detailed simulation of optical photons.

VI

None Re: Optical Reflectivity  Keywords: Optical photons reflectivity in pixellated detector
by <wmenges@sandia.gov>,   30 Jun, 2006
Re: Feedback Re: Optical Reflectivity (Gumplinger Peter)

Peter,

Thank you for the response. However, I am not sure about tuning of the MC optical surface reflectivity. Can you explain a little bit more about it. Those figures I quoted in my earlier message are counts detected at the PMT before using the quantum efficiency. Thank you for the help.

Wond

Question Optical Reflectivity  Keywords: Optical photons reflectivity in pixellated detector
by <wmenges@sandia.gov>,   30 Jun, 2006

Dear All,

I was trying to simulate the response of pixellated NaI to incident 662 keV gamma. With light yield of 38 photons/keV ee, I found that the photon count at the PMT strongly depends on the reflectivity of the surrounding material. As the detector is pixellated 2mmx2mm cross sectional area and length of 2 cm, there are quite significant multiple reflection events from the surrounding wall before the photons reach to the PMT located on one side. The light count I get from 97% reflectivity is like 50% of what is expected (0.97x38 photons/keV x 662keV) at 662 keV energy. When it is 99% reflectivity I get like 77%. If it is 100% then within the statistical limit of what is expected. Does the multiple bouncing result in the loss of counts? I mean increases the chance of photons getting into the surrounding wall and eventually absorbed. I appreciate any comment. Thank you.

Wond

Feedback Re: Optical Reflectivity  Keywords: Optical photons reflectivity in pixellated detector
by Gumplinger Peter <Gumplinger Peter>,   30 Jun, 2006
Re: Question Optical Reflectivity

The optical reflectivity of the scintillator surface is the probability of reflection (as opposed to absorption) at each and every bounce; i.e. encounter with the surface. The optical reflectivity is a material (surface) property which you need to know through other means.

Conversely, if you know the light yield, and for your geometry and PMT photo efficiency, the number of photo electrons at the PMT for 662keV gammas, you can tune the MC optical surface reflectivity until the MC gives you the same result.

Of course, with 100% reflectivity all produced photons (assuming you have no bulk absorption) will eventually arrive at your PMT no matter how many bounces.

None Re: Optical Reflectivity  by Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>,   03 Jul, 2006
Re: Feedback Re: Optical Reflectivity (Gumplinger Peter)
On Fri, 30 Jun 2006, Peter Gumplinger wrote:

> *** Discussion title: Electromagnetic Processes
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/emprocess/509/1"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> The optical reflectivity of the scintillator surface is the probability
> of reflection (as opposed to absorption) at each and every bounce; i.e.
> encounter with the surface. The optical reflectivity is a material
> (surface) property which you need to know through other means.
> 
> Conversely, if you know the light yield, and for your geometry and PMT
> photo efficiency, the number of photo electrons at the PMT for 662keV
> gammas, you can tune the MC optical surface reflectivity until the MC
> gives you the same result.
> 
> Of course, with 100% reflectivity all produced photons (assuming you
> have no bulk absorption) will eventually arrive at your PMT no matter
> how many bounces.
> 

Hello,

I would suggest to set reflectivity to 100% and study the dendence of 
results on cut and/or other parameters. After optimization return to 
detailed simulation of optical photons.

VI

None Re: Optical Reflectivity  Keywords: Optical photons reflectivity in pixellated detector
by <wmenges@sandia.gov>,   30 Jun, 2006
Re: Feedback Re: Optical Reflectivity (Gumplinger Peter)

Peter,

Thank you for the response. However, I am not sure about tuning of the MC optical surface reflectivity. Can you explain a little bit more about it. Those figures I quoted in my earlier message are counts detected at the PMT before using the quantum efficiency. Thank you for the help.

Wond

Feedback Re: Photon Propagation Problem after I change the geometry  Keywords: Strange photon propagtion
by Gumplinger Peter <Gumplinger Peter>,   27 Sep, 2006

....but stopped between mirror and pmt. Is there any clue what happened?

Have you turned on /tracking/verbose ? Do you have ExN06SteppingVerbose (or equivalent) and ExN06PhysicsListMessenger if you followed the N06 example? Those would be useful.

Optical photons stop when they enter a volume where the material filling it has no MaterialPropertiesTable and/or the index of refraction is not defined in that table.

None Photon Propagation Problem after I change the geometry  Keywords: Strange photon propagtion
by <hyao@jlab.org>,   27 Sep, 2006

Hi Sir/Madam, I am doing simulation for gas cerenkov detector.

First I wrote code based on N06 example. And I saw the photons generated by electron were detected by pmt. However, since i found sth wrong with the mirror, I just changed the geometry part of mirror, the photons were reflected by mirror but stopped between mirror and pmt.

Is there any clue what happened?

Thank you very much.

Feedback Re: Photon Propagation Problem after I change the geometry  Keywords: Strange photon propagtion
by Gumplinger Peter <Gumplinger Peter>,   27 Sep, 2006
Re: None Photon Propagation Problem after I change the geometry

....but stopped between mirror and pmt. Is there any clue what happened?

Have you turned on /tracking/verbose ? Do you have ExN06SteppingVerbose (or equivalent) and ExN06PhysicsListMessenger if you followed the N06 example? Those would be useful.

Optical photons stop when they enter a volume where the material filling it has no MaterialPropertiesTable and/or the index of refraction is not defined in that table.

Feedback Re: Problem with Rayleigh scattering  Keywords: Rayleigh scattering clarity optical photon
by Gumplinger Peter <Gumplinger Peter>,   04 Oct, 2006

The Rayleigh process requires a G4MaterialPropertiesTable to be filled by the user with Rayleigh scattering length data. The Rayleigh scattering attenuation length is the average distance traveled by a photon before it is Rayleigh scattered in the medium and it is the distance returned by the GetMeanFreePath method. The actual scattering length is then sampled from an exponential with this mean free path.

The Rayleigh process only scatters photons. It does not absorb them in any way. What you may need is also add the OpAbsorption process for photon bulk absorption.

Please refer to 5.2.5.4 Tracking of Photons in processes/optical in the Application Developers Manual.

Or, you may have the opposite problem where too many photons disappear (I can't quite understand your comment). In that case, it must be blamed on the surface reflectivity you have chosen or the OpAbsorption process.

Question Problem with Rayleigh scattering  Keywords: Rayleigh scattering clarity optical photon
by Yoann Sallaz-Damaz <sallaz@lpsc.in2p3.fr>,   02 Oct, 2006

Hello,

We would like to include the Rayleigh scattering in our simulation of a Cerenkov detector with aerogel. We have included in the physics list the G4OptRayleigh process and provided for the aerogel properties a scattering length Lsc=55 mm. With this length (leading to a clarity C=0.005 um4/cm), we expect a loss of about 10% of the photons, but we get a much lower photon number. Would you have any hint about what we are doing wrong? Could you please tell us how is the Rayleigh process implemented in G4?

Thanks in advance for your help,

Feedback Re: Problem with Rayleigh scattering  Keywords: Rayleigh scattering clarity optical photon
by Gumplinger Peter <Gumplinger Peter>,   04 Oct, 2006
Re: Question Problem with Rayleigh scattering (Yoann Sallaz-Damaz)

The Rayleigh process requires a G4MaterialPropertiesTable to be filled by the user with Rayleigh scattering length data. The Rayleigh scattering attenuation length is the average distance traveled by a photon before it is Rayleigh scattered in the medium and it is the distance returned by the GetMeanFreePath method. The actual scattering length is then sampled from an exponential with this mean free path.

The Rayleigh process only scatters photons. It does not absorb them in any way. What you may need is also add the OpAbsorption process for photon bulk absorption.

Please refer to 5.2.5.4 Tracking of Photons in processes/optical in the Application Developers Manual.

Or, you may have the opposite problem where too many photons disappear (I can't quite understand your comment). In that case, it must be blamed on the surface reflectivity you have chosen or the OpAbsorption process.

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   20 Oct, 2006

Hi Benton,

G4MaterialPropertyVector.cc

generates the message when:

        if (aPhotonMomentum < PMmin)
        {
                G4cout << "\nWarning: G4MaterialPropertyVector::GetProperty";
                G4cout << "\n==> attempt to Retrieve Property below range"
                << G4endl;
                return minProp;
        }

May I suggest that you change this in your copy to print out both 'aPhotonMomentum' and 'PMin' when the warning is issued.

> A final note: Since the absorption and re-emission probability is not
> always unity (not every photon is re-emitted) it could be nice to add in
> an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Thanks for the suggestion - good point - I'll keep it in mind,

Peter

None Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   18 Oct, 2006

Thanks Peter,

I found that I could not get rid of all the warnings entirely despite ensuring that all my arrays were the same length. I am confident that the data values are ok.

I see no real problems in the results and I checked the results for a few different setups and they are all consistent. I'll report back if I find any flaws.

I found for large scintillators (several cm on a side) that the absorption and re-emission process (as a function of wavelength) plays a major role in the number of photons counted.

For plastic scintillators with PPT and POPOP, one needs the wavelength dependent absorption, emission, wls-absorption, and wls-emission spectra. Preferably the PPT and POPOP concentrations as well.

One should be able to add all these parameters in your scintillator material properties table. Mine seems to be working.

A final note: Since the absorption and re-emission probability is not always unity (not every photon is re-emitted) it could be nice to add in an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Cheers,

Benton

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   20 Oct, 2006
Re: None Re: optical photon self-absorption in scintillator (Benton Pahlka)

Hi Benton,

G4MaterialPropertyVector.cc

generates the message when:

        if (aPhotonMomentum < PMmin)
        {
                G4cout << "\nWarning: G4MaterialPropertyVector::GetProperty";
                G4cout << "\n==> attempt to Retrieve Property below range"
                << G4endl;
                return minProp;
        }

May I suggest that you change this in your copy to print out both 'aPhotonMomentum' and 'PMin' when the warning is issued.

> A final note: Since the absorption and re-emission probability is not
> always unity (not every photon is re-emitted) it could be nice to add in
> an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Thanks for the suggestion - good point - I'll keep it in mind,

Peter

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   17 Oct, 2006

Hi Benton,

I am glad you could sort out your question on your own with the help of the extended/optical/LXe example. I wasn't 100% sure that a medium defined as a scintillator can also be defined as a WLS material at the same time. I thought so, but was not going to claim that without trying it myself.

> Warning: G4MaterialPropertyVector::GetProperty

> ==> attempt to Retrieve Property below range

You define ranges of optical photon properties which do not coincide with each other in their min/max limits; i.e. for example, you generate a photon in scintillation which is outside the range of WLS (absorption), or you have a WLS photon which is outside your bulk absorption limits etc. An optical photon, once generated must be inside the range of WLS absorption, bulk absorption, index of refraction, boundary effects etc. If it is not, the above warning is written and, in your case, the value of the property in the table at the low photon energy limit is used. So, no big worries. And since it happens so rarely, in your case, there is only a small not overlapping range. Still, I suggest you get rid of the warning by checking the range of all your properties.

Peter

None Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   18 Oct, 2006
Re: Feedback Re: optical photon self-absorption in scintillator (Gumplinger Peter)

Thanks Peter,

I found that I could not get rid of all the warnings entirely despite ensuring that all my arrays were the same length. I am confident that the data values are ok.

I see no real problems in the results and I checked the results for a few different setups and they are all consistent. I'll report back if I find any flaws.

I found for large scintillators (several cm on a side) that the absorption and re-emission process (as a function of wavelength) plays a major role in the number of photons counted.

For plastic scintillators with PPT and POPOP, one needs the wavelength dependent absorption, emission, wls-absorption, and wls-emission spectra. Preferably the PPT and POPOP concentrations as well.

One should be able to add all these parameters in your scintillator material properties table. Mine seems to be working.

A final note: Since the absorption and re-emission probability is not always unity (not every photon is re-emitted) it could be nice to add in an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Cheers,

Benton

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   20 Oct, 2006
Re: None Re: optical photon self-absorption in scintillator (Benton Pahlka)

Hi Benton,

G4MaterialPropertyVector.cc

generates the message when:

        if (aPhotonMomentum < PMmin)
        {
                G4cout << "\nWarning: G4MaterialPropertyVector::GetProperty";
                G4cout << "\n==> attempt to Retrieve Property below range"
                << G4endl;
                return minProp;
        }

May I suggest that you change this in your copy to print out both 'aPhotonMomentum' and 'PMin' when the warning is issued.

> A final note: Since the absorption and re-emission probability is not
> always unity (not every photon is re-emitted) it could be nice to add in
> an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Thanks for the suggestion - good point - I'll keep it in mind,

Peter

None Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   17 Oct, 2006

Hello,

I was able to sort out the problems above. I claim that wls-absorption and wls-emission is possible using G4 within a scintillator.

I am now only getting the warning:

Warning: G4MaterialPropertyVector::GetProperty
==> attempt to Retrieve Property below range

of which I only get a few per 10000 photons generated.

I have looked closely at the Lxe example...and I have followed it as close as I can...although the physics is different.

Is the warning that I am getting due to the fact that I have two emission spectra in the same volume (same material)?

Should I be worried about the warnings?

Thanks,

Benton

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   17 Oct, 2006
Re: None Re: optical photon self-absorption in scintillator (Benton Pahlka)

Hi Benton,

I am glad you could sort out your question on your own with the help of the extended/optical/LXe example. I wasn't 100% sure that a medium defined as a scintillator can also be defined as a WLS material at the same time. I thought so, but was not going to claim that without trying it myself.

> Warning: G4MaterialPropertyVector::GetProperty

> ==> attempt to Retrieve Property below range

You define ranges of optical photon properties which do not coincide with each other in their min/max limits; i.e. for example, you generate a photon in scintillation which is outside the range of WLS (absorption), or you have a WLS photon which is outside your bulk absorption limits etc. An optical photon, once generated must be inside the range of WLS absorption, bulk absorption, index of refraction, boundary effects etc. If it is not, the above warning is written and, in your case, the value of the property in the table at the low photon energy limit is used. So, no big worries. And since it happens so rarely, in your case, there is only a small not overlapping range. Still, I suggest you get rid of the warning by checking the range of all your properties.

Peter

None Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   18 Oct, 2006
Re: Feedback Re: optical photon self-absorption in scintillator (Gumplinger Peter)

Thanks Peter,

I found that I could not get rid of all the warnings entirely despite ensuring that all my arrays were the same length. I am confident that the data values are ok.

I see no real problems in the results and I checked the results for a few different setups and they are all consistent. I'll report back if I find any flaws.

I found for large scintillators (several cm on a side) that the absorption and re-emission process (as a function of wavelength) plays a major role in the number of photons counted.

For plastic scintillators with PPT and POPOP, one needs the wavelength dependent absorption, emission, wls-absorption, and wls-emission spectra. Preferably the PPT and POPOP concentrations as well.

One should be able to add all these parameters in your scintillator material properties table. Mine seems to be working.

A final note: Since the absorption and re-emission probability is not always unity (not every photon is re-emitted) it could be nice to add in an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Cheers,

Benton

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   20 Oct, 2006
Re: None Re: optical photon self-absorption in scintillator (Benton Pahlka)

Hi Benton,

G4MaterialPropertyVector.cc

generates the message when:

        if (aPhotonMomentum < PMmin)
        {
                G4cout << "\nWarning: G4MaterialPropertyVector::GetProperty";
                G4cout << "\n==> attempt to Retrieve Property below range"
                << G4endl;
                return minProp;
        }

May I suggest that you change this in your copy to print out both 'aPhotonMomentum' and 'PMin' when the warning is issued.

> A final note: Since the absorption and re-emission probability is not
> always unity (not every photon is re-emitted) it could be nice to add in
> an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Thanks for the suggestion - good point - I'll keep it in mind,

Peter

Question optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   12 Oct, 2006

Hello!

I am running geant 4.7.0.p01 and doing some optical photon simulations.

My question is this:

I would like to simulate optical photon absorption and RE-emission in a plastic scintillator. I am using wavelength dependent values for all the physics. To my knowledge, this reqires setting

scintMPT->AddProperty("ABSLENGTH",scintEnergy,scintAbsorb,scintEntries); scintMPT->AddProperty("FASTCOMPONENT",scintEnergy,scintEmit,scintEntries); scintMPT->AddProperty("SLOWCOMPONENT",scintEnergy,scintSlow,scintEntries); scintMPT->AddProperty("WLSCOMPONENT",wlsEnergy,wlsEmit,wlsEntries); scintMPT->AddProperty("WLSABSLENGTH",wlsEnergy,wlsAbsorb,wlsEntries);

for the SCINTILLATOR (along with the other properties). I am not using WLS fibers, but I am using WLS properties in the scintillator to get the primary emission, wls absorption, wls emission and non-wls absorption.

I am running into problems with:

G4SteppingManager::InvokePSDIP(unsigned long) G4SteppingManager::InvokePostStepDoItProcs() G4SteppingManager::Stepping() G4TrackingManager::ProcessOneTrack(G4Track*) G4EventManager::DoProcessing(G4Event*) G4EventManager::ProcessOneEvent(G4Event*)

Doing a bt I find that the error is in G4MaterialPropertyVector::GetProperty()

I can't find the problem. Is what I am doing even possible in G4?

Thanks!!

Benton Pahlka

None Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   17 Oct, 2006
Re: Question optical photon self-absorption in scintillator (Benton Pahlka)

Hello,

I was able to sort out the problems above. I claim that wls-absorption and wls-emission is possible using G4 within a scintillator.

I am now only getting the warning:

Warning: G4MaterialPropertyVector::GetProperty
==> attempt to Retrieve Property below range

of which I only get a few per 10000 photons generated.

I have looked closely at the Lxe example...and I have followed it as close as I can...although the physics is different.

Is the warning that I am getting due to the fact that I have two emission spectra in the same volume (same material)?

Should I be worried about the warnings?

Thanks,

Benton

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   17 Oct, 2006
Re: None Re: optical photon self-absorption in scintillator (Benton Pahlka)

Hi Benton,

I am glad you could sort out your question on your own with the help of the extended/optical/LXe example. I wasn't 100% sure that a medium defined as a scintillator can also be defined as a WLS material at the same time. I thought so, but was not going to claim that without trying it myself.

> Warning: G4MaterialPropertyVector::GetProperty

> ==> attempt to Retrieve Property below range

You define ranges of optical photon properties which do not coincide with each other in their min/max limits; i.e. for example, you generate a photon in scintillation which is outside the range of WLS (absorption), or you have a WLS photon which is outside your bulk absorption limits etc. An optical photon, once generated must be inside the range of WLS absorption, bulk absorption, index of refraction, boundary effects etc. If it is not, the above warning is written and, in your case, the value of the property in the table at the low photon energy limit is used. So, no big worries. And since it happens so rarely, in your case, there is only a small not overlapping range. Still, I suggest you get rid of the warning by checking the range of all your properties.

Peter

None Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Benton Pahlka <Benton Pahlka>,   18 Oct, 2006
Re: Feedback Re: optical photon self-absorption in scintillator (Gumplinger Peter)

Thanks Peter,

I found that I could not get rid of all the warnings entirely despite ensuring that all my arrays were the same length. I am confident that the data values are ok.

I see no real problems in the results and I checked the results for a few different setups and they are all consistent. I'll report back if I find any flaws.

I found for large scintillators (several cm on a side) that the absorption and re-emission process (as a function of wavelength) plays a major role in the number of photons counted.

For plastic scintillators with PPT and POPOP, one needs the wavelength dependent absorption, emission, wls-absorption, and wls-emission spectra. Preferably the PPT and POPOP concentrations as well.

One should be able to add all these parameters in your scintillator material properties table. Mine seems to be working.

A final note: Since the absorption and re-emission probability is not always unity (not every photon is re-emitted) it could be nice to add in an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Cheers,

Benton

Feedback Re: optical photon self-absorption in scintillator  Keywords: optical photon wavelength shift
by Gumplinger Peter <Gumplinger Peter>,   20 Oct, 2006
Re: None Re: optical photon self-absorption in scintillator (Benton Pahlka)

Hi Benton,

G4MaterialPropertyVector.cc

generates the message when:

        if (aPhotonMomentum < PMmin)
        {
                G4cout << "\nWarning: G4MaterialPropertyVector::GetProperty";
                G4cout << "\n==> attempt to Retrieve Property below range"
                << G4endl;
                return minProp;
        }

May I suggest that you change this in your copy to print out both 'aPhotonMomentum' and 'PMin' when the warning is issued.

> A final note: Since the absorption and re-emission probability is not
> always unity (not every photon is re-emitted) it could be nice to add in
> an "EFFICIENCY" tag or something similar to G4OpWLS to account for this.

Thanks for the suggestion - good point - I'll keep it in mind,

Peter

Feedback Re: coupling an optical G4Tubs to an optical G4Torus  Keywords: optical photon G4Torus coupling
by Gumplinger Peter <Gumplinger Peter>,   07 Nov, 2006

Hi Benton,

Thanks for your interesting posting.

> Does anyone have any experience coupling a G4Tubs to a G4Torus?

No, but this is certainly something that needs to work.

> Has anyone worked with optical photon transport in curved fibers?

Again, I haven't and I don't know who has?

I have a couple suggestions: Have you specified the index of refraction to be exactly the same for both fibers, the G4Tubs and the G4Torus? Specify a constant over the range of wavelength and the same for both. If so, the photons should certainly go into the G4Torus (I assume they have the same diameter). Have you tried to visualize where the photons get lost and/or have you turned /tracking/verbose on?

We can discuss this off-line (gum@triumf.ca), maybe, until we find a resolution and then post it here again. It could well also be a 'geometry problem'. The G4Torus must return the correct normal for every place a photon bounces.

Peter

Question coupling an optical G4Tubs to an optical G4Torus  Keywords: optical photon G4Torus coupling
by Benton Pahlka <Benton Pahlka>,   06 Nov, 2006

Hi,

Does anyone have any experience coupling a G4Tubs to a G4Torus? I can't seem to get my optical photons to cross the boundary. The geometry is sound, and i've specified a large enough radius so that I'm not restricted to bending losses (i.e. > 1 meter). The fibers are WLS fibers and all the refractive indices are defined for both the straight fiber (G4Tubs) and the curved fiber (G4Torus).

Has anyone worked with optical photon transport in curved fibers?

Thanks!

Benton

Feedback Re: coupling an optical G4Tubs to an optical G4Torus  Keywords: optical photon G4Torus coupling
by Gumplinger Peter <Gumplinger Peter>,   07 Nov, 2006
Re: Question coupling an optical G4Tubs to an optical G4Torus (Benton Pahlka)

Hi Benton,

Thanks for your interesting posting.

> Does anyone have any experience coupling a G4Tubs to a G4Torus?

No, but this is certainly something that needs to work.

> Has anyone worked with optical photon transport in curved fibers?

Again, I haven't and I don't know who has?

I have a couple suggestions: Have you specified the index of refraction to be exactly the same for both fibers, the G4Tubs and the G4Torus? Specify a constant over the range of wavelength and the same for both. If so, the photons should certainly go into the G4Torus (I assume they have the same diameter). Have you tried to visualize where the photons get lost and/or have you turned /tracking/verbose on?

We can discuss this off-line (gum@triumf.ca), maybe, until we find a resolution and then post it here again. It could well also be a 'geometry problem'. The G4Torus must return the correct normal for every place a photon bounces.

Peter

None Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2006

Hello Key,

> No, in this part of the geometry I do not use G4OpticalSurface objects.

> I understand, this is not necessary for bare Fresnel type refraction

> between different dielectrics?

Correct!

> Assuming, I have not missed a mistake on my part, could this be a

> floating point problem, meaning, one would have to "pad" certain mother

> volumes?

No, no - that's not the idea. Besides, when one of your photon wants to leave a bar without going into another bar, it must go into a volume filled with air, the way you have set it up, either RadiationBlock or the World.

I suggest we continue this discussion offline, for now. I'll send you an email explaining how we/you can debug this further.

Thanks, Peter

Feedback Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Kay Ulbrich <Kay Ulbrich>,   30 Nov, 2006

Hello Peter!

Thank you very much for your answer.

No, in this part of the geometry I do not use G4OpticalSurface objects. I understand, this is not necessary for bare Fresnel type refraction between different dielectrics?

The World volume is filled by air, which is the same G4Material object for all logical volumes, refractive index is set.

Anyway, my initial problem description was a bit overloaded. I have reduced everything to the following:

(1) derive a class RadiatorBlock from G4LogicalVolume
(2) in the constructor, inititalize it with a G4Box, filled
    with air
(3) then completely fill it with Plexiglass bars, everyone a 
    separate G4LogicalVolume, no gaps between bars or between
    bars and the RadiatorBlock
(4) place it in the World volume, a big G4Box, filled with air

When placing this radiator in the mother volume, the refraction is not done correctly, in the way, described in my original posting (I generate Cherenkov photons in the block).

When, nevertheless, in step (2) giving the G4Box e.g. 1*E-9*m additional length in each direction, everything works fine.

Assuming, I have not missed a mistake on my part, could this be a floating point problem, meaning, one would have to "pad" certain mother volumes?

Greetings, Kay

None Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2006
Re: Feedback Re: Inconsistency in optical photon tracking? (Kay Ulbrich)

Hello Key,

> No, in this part of the geometry I do not use G4OpticalSurface objects.

> I understand, this is not necessary for bare Fresnel type refraction

> between different dielectrics?

Correct!

> Assuming, I have not missed a mistake on my part, could this be a

> floating point problem, meaning, one would have to "pad" certain mother

> volumes?

No, no - that's not the idea. Besides, when one of your photon wants to leave a bar without going into another bar, it must go into a volume filled with air, the way you have set it up, either RadiationBlock or the World.

I suggest we continue this discussion offline, for now. I'll send you an email explaining how we/you can debug this further.

Thanks, Peter

Feedback Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Gumplinger Peter <Gumplinger Peter>,   27 Nov, 2006

Hi Kay,

I assume you are not using 'G4OpticalSurface(s)'(?) So, when all the nesting is done, you end up with some space filled with plastic (bars) and air around it. The G4OpBoundaryProcess needs to know the index of refraction on both sides of an interface. If your bars completely fill their mother (RadiatorBlock) and if the RadiatorBlock volume itself in turn is as large as its mother - the DetectorArm, the G4Navigator will go directly from 'bar' to 'world' and will never encounter RadiatorBlock and DetectorArm. That is because outside the bar assembly is the world and none of the other volumes - they are all not larger than what is already filled with plastic.

I suspect you haven't given world a dielectric material. What is the material of your world volume; is it 'Air' and do you have specified the index of refraction for Air?

Regards, Peter

Feedback Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Kay Ulbrich <Kay Ulbrich>,   30 Nov, 2006
Re: Feedback Re: Inconsistency in optical photon tracking? (Gumplinger Peter)

Hello Peter!

Thank you very much for your answer.

No, in this part of the geometry I do not use G4OpticalSurface objects. I understand, this is not necessary for bare Fresnel type refraction between different dielectrics?

The World volume is filled by air, which is the same G4Material object for all logical volumes, refractive index is set.

Anyway, my initial problem description was a bit overloaded. I have reduced everything to the following:

(1) derive a class RadiatorBlock from G4LogicalVolume
(2) in the constructor, inititalize it with a G4Box, filled
    with air
(3) then completely fill it with Plexiglass bars, everyone a 
    separate G4LogicalVolume, no gaps between bars or between
    bars and the RadiatorBlock
(4) place it in the World volume, a big G4Box, filled with air

When placing this radiator in the mother volume, the refraction is not done correctly, in the way, described in my original posting (I generate Cherenkov photons in the block).

When, nevertheless, in step (2) giving the G4Box e.g. 1*E-9*m additional length in each direction, everything works fine.

Assuming, I have not missed a mistake on my part, could this be a floating point problem, meaning, one would have to "pad" certain mother volumes?

Greetings, Kay

None Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2006
Re: Feedback Re: Inconsistency in optical photon tracking? (Kay Ulbrich)

Hello Key,

> No, in this part of the geometry I do not use G4OpticalSurface objects.

> I understand, this is not necessary for bare Fresnel type refraction

> between different dielectrics?

Correct!

> Assuming, I have not missed a mistake on my part, could this be a

> floating point problem, meaning, one would have to "pad" certain mother

> volumes?

No, no - that's not the idea. Besides, when one of your photon wants to leave a bar without going into another bar, it must go into a volume filled with air, the way you have set it up, either RadiationBlock or the World.

I suggest we continue this discussion offline, for now. I'll send you an email explaining how we/you can debug this further.

Thanks, Peter

Question Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Kay Ulbrich <Kay Ulbrich>,   24 Nov, 2006

Hello,

I have a problem with optical tracking across the boundary between two dielectrics. For the time being, I describe it without source code.

I am using a class "RadiatorBlock", which inherits from G4LogicalVolume in order to encapsulate geometrical information. I initialize an object of RadiatorBlock, using a G4Box solid, material is Air. Then in the constructor I completely fill it with Plexiglass bars as radiators for Cerenkov light. The optical properties for the material are set accordingly and optical boundary effects are enabled in the physics list.

Then I place this logical volume in another one, which is an instance of another class "DetectorArm", inheriting from G4LogicalVolume, material Air. This logical volume is exacly as big as the RadiatorBlock.

When placing the DetectorArm volume in the World volume and generating Cerenkov light in the radiator, the optical tracks are not as expected -- I always get "TotalInternalReflection" at the boundary of the volume, not Fresnel refraction, as expected. Additionally, the photons are not reflected back, but just refracted (180° more than reflection).

Anyway, when making the DetectorArm box only slightly larger (e.g., 1E-9*m in each direction) than the contained RadiatorBlock, everything works fine and I get Fresnel refraction.

On the other hand, when -- for test's sake -- I take a RadiatorBlock, then place it in a G4LogicalVolume of exactly the same size as this block and directly place this G4LogicalVolume in the World volume, I do not encounter this problem, although the number of logical volumes put one into another is the same.

Is there any related experience? I would not like to give up the concept of hierarchically stacking objects derived from G4LogicalVolume, because this makes the code easier to understand and maintain, even, if it introduces some additional logical volumes. Due to the reduction of the problem, the depicted case of course appears to be redundant.

Thank you for related information! Kay

Feedback Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Gumplinger Peter <Gumplinger Peter>,   27 Nov, 2006
Re: Question Inconsistency in optical photon tracking? (Kay Ulbrich)

Hi Kay,

I assume you are not using 'G4OpticalSurface(s)'(?) So, when all the nesting is done, you end up with some space filled with plastic (bars) and air around it. The G4OpBoundaryProcess needs to know the index of refraction on both sides of an interface. If your bars completely fill their mother (RadiatorBlock) and if the RadiatorBlock volume itself in turn is as large as its mother - the DetectorArm, the G4Navigator will go directly from 'bar' to 'world' and will never encounter RadiatorBlock and DetectorArm. That is because outside the bar assembly is the world and none of the other volumes - they are all not larger than what is already filled with plastic.

I suspect you haven't given world a dielectric material. What is the material of your world volume; is it 'Air' and do you have specified the index of refraction for Air?

Regards, Peter

Feedback Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Kay Ulbrich <Kay Ulbrich>,   30 Nov, 2006
Re: Feedback Re: Inconsistency in optical photon tracking? (Gumplinger Peter)

Hello Peter!

Thank you very much for your answer.

No, in this part of the geometry I do not use G4OpticalSurface objects. I understand, this is not necessary for bare Fresnel type refraction between different dielectrics?

The World volume is filled by air, which is the same G4Material object for all logical volumes, refractive index is set.

Anyway, my initial problem description was a bit overloaded. I have reduced everything to the following:

(1) derive a class RadiatorBlock from G4LogicalVolume
(2) in the constructor, inititalize it with a G4Box, filled
    with air
(3) then completely fill it with Plexiglass bars, everyone a 
    separate G4LogicalVolume, no gaps between bars or between
    bars and the RadiatorBlock
(4) place it in the World volume, a big G4Box, filled with air

When placing this radiator in the mother volume, the refraction is not done correctly, in the way, described in my original posting (I generate Cherenkov photons in the block).

When, nevertheless, in step (2) giving the G4Box e.g. 1*E-9*m additional length in each direction, everything works fine.

Assuming, I have not missed a mistake on my part, could this be a floating point problem, meaning, one would have to "pad" certain mother volumes?

Greetings, Kay

None Re: Inconsistency in optical photon tracking?  Keywords: fresnel refraction, total internal reflection, optical boundary process
by Gumplinger Peter <Gumplinger Peter>,   30 Nov, 2006
Re: Feedback Re: Inconsistency in optical photon tracking? (Kay Ulbrich)

Hello Key,

> No, in this part of the geometry I do not use G4OpticalSurface objects.

> I understand, this is not necessary for bare Fresnel type refraction

> between different dielectrics?

Correct!

> Assuming, I have not missed a mistake on my part, could this be a

> floating point problem, meaning, one would have to "pad" certain mother

> volumes?

No, no - that's not the idea. Besides, when one of your photon wants to leave a bar without going into another bar, it must go into a volume filled with air, the way you have set it up, either RadiationBlock or the World.

I suggest we continue this discussion offline, for now. I'll send you an email explaining how we/you can debug this further.

Thanks, Peter

Feedback Re: What dose the excitation ratio mean for the scintillator?  by Gumplinger Peter <Gumplinger Peter>,   23 Jan, 2007

This is for scintilators with a two component spectrum; i.e. a fast and a slow scintillation spectrum.

from the source source/processes/electromagnetic/xrays/include/G4Scintillation.hh

        void SetScintillationExcitationRatio(const G4double excitationratio);
        // Called to set the scintillation exciation ratio, needed when
        // the scintillation level excitation is different for different
        // types of particles. This overwrites the YieldRatio obtained
        // from the G4MaterialPropertiesTable.

in the Application Developers Guide:

In those cases where the fast to slow excitation ratio changes with particle type, the method SetScintillationExcitationRatio can be called for each scintillation process (see the advanced underground_physics example). This overwrites the YieldRatio obtained from the G4MaterialPropertiesTable.

ExcitationRatio = 1.0; is the default, where the ratio is the intensity of fast component to the total scintillation intensity

None What dose the excitation ratio mean for the scintillator?  by <throwpen@163.com>,   23 Jan, 2007

theScintProcessAlpha->SetScintillationExcitationRatio(1.0);

i have no idea about this parameter!

Feedback Re: What dose the excitation ratio mean for the scintillator?  by Gumplinger Peter <Gumplinger Peter>,   23 Jan, 2007
Re: None What dose the excitation ratio mean for the scintillator?

This is for scintilators with a two component spectrum; i.e. a fast and a slow scintillation spectrum.

from the source source/processes/electromagnetic/xrays/include/G4Scintillation.hh

        void SetScintillationExcitationRatio(const G4double excitationratio);
        // Called to set the scintillation exciation ratio, needed when
        // the scintillation level excitation is different for different
        // types of particles. This overwrites the YieldRatio obtained
        // from the G4MaterialPropertiesTable.

in the Application Developers Guide:

In those cases where the fast to slow excitation ratio changes with particle type, the method SetScintillationExcitationRatio can be called for each scintillation process (see the advanced underground_physics example). This overwrites the YieldRatio obtained from the G4MaterialPropertiesTable.

ExcitationRatio = 1.0; is the default, where the ratio is the intensity of fast component to the total scintillation intensity

Feedback Re: Wavelength range of material properties and number of Cerenkov photons  Keywords: Cernkov photons wavelength
by Gumplinger Peter <Gumplinger Peter>,   05 Mar, 2007

Hello Weili,

> In the User Manual, optical photon is defined as photons wich
> wavelength is start from 10nm.

Hmmm, I wasn't aware that such a statement is made anywhere; where?

Optical photons are defined in the range of wavelengths you define; simple as that! In fact, I know of several applications which use the processes defined for 'optical photons' in the X-ray wavelength regime.

> then these UV photons will be shifted to the photons which
> is sensitive to the detector by the process of absorption and
> re-emission of scintillator.

So, you are using the OpWLS process - not the Scintillation process?

> Therefore, I'm confused that what is the proper wavelength range or
> photon momentum range for the physical situation?

The proper wavelength for you to use is the upper and lower limit of wavelength that can be detected in your detector after being shifted. Your WLS has an absorption spectrum that will go to zero. This is the range of Cerenkov photons you need to generate in the radiator. You you also need to propagate these and the resulting WLS photons, assuming your radiator is also the WLS material. So, the range is extended by the WLS emission spectrum. Finally, your detector has a quantum efficiency in a certain WL range. Thus, only the emission spectrum inside that range needs to be modeled.

> The simulation results of including Cerenkov, Scintillation and
> absorption-reemisson which start from 10nm and 200nm are different very
> much.

???

> So, if I enlarge the wavelength range of material properties and give
> the corresponding refractive indices, geant4 will produce more
> Cerenkov photons

This is true, but the number of detected (detectable) photons in your detector should not change.

Question Wavelength range of material properties and number of Cerenkov photons  Keywords: Cernkov photons wavelength
by <zhongwl@ihep.ac.cn>,   01 Mar, 2007

Hello,

My simulation of scintillator both includes Cerenkov and Scintillation process. The absorption and re-emission property of scintillator is also considered.

So, if I enlarge the wavelength range of material properties and give the corresponding refractive indices, geant4 will produce more Cerenkov photons, and then these UV photons will be shifted to the photons which is sensitive to the detector by the process of absorption and re-emission of scintillator.

Therefore, I'm confused that what is the proper wavelength range or photon momentum range for the physical situation? In the User Manual, optical photon is defined as photons wich wavelength is start from 10nm. The simulation results of including Cerenkov, Scintillation and absorption-reemisson which start from 10nm and 200nm are different very much.

Thanks! Regards, Weili