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
 All All
Outline Depth:
 1 1
 2 2
 All All
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

1 Feedback: Re: Scintillation rise time   (Gumplinger Peter - Nov 03, 16:35)
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

1 Feedback: Re: Simulate a clear optical fiber   (Gumplinger Peter - Oct 21, 16:05)
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;
}

1 Feedback: Re: problems with optical surfaces   (Gumplinger Peter - Sep 18, 16:07)
(_ Ok: Re: problems with optical surfaces   (moritz v. sivers - Sep 23, 10:54)
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;

	  }
      }
  }

1 Feedback: Re: the method to collect OpticalPhotons   (Gumplinger Peter - Aug 21, 12:29)
1 None: Re: the method to collect OpticalPhotons   (ylzhang - Aug 22, 00:37)
2 None: Re: the method to collect OpticalPhotons   (ylzhang - Aug 23, 05:07)
1 Feedback: Re: the method to collect OpticalPhotons   (Gumplinger Peter - Aug 25, 12:26)
... 1 Message(s)
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?

1 Feedback: Re: How to turn off scintillation and Cerenkov?   (Gumplinger Peter - Jul 28, 16:19)
(_ None: Re: How to turn off scintillation and Cerenkov?   (Kareem Kazkaz - Jul 29, 12:58)
(_ None: Re: How to turn off scintillation and Cerenkov?   (Kareem Kazkaz - Jul 29, 13:01)
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;
}

1 Feedback: Re: Transmission of Optical Photons   (Benton Pahlka - Jul 02, 11:06)
2 Feedback: Re: Transmission of Optical Photons   (Gumplinger Peter - Jul 02, 17:04)
1 Feedback: Re: Transmission of Optical Photons   (jdswado@gatech.edu - Jul 16, 08:16)
(_ Feedback: Re: Transmission of Optical Photons   (Gumplinger Peter - Jul 16, 13:31)
(_ None: Re: Transmission of Optical Photons   (jdswado@gatech.edu - Jul 24, 09:21)
(_ Feedback: Re: Transmission of Optical Photons   (Gumplinger Peter - Jul 24, 18:07)
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

1 Feedback: Re: Optical Surfaces and Sigma_Alpha   (Gumplinger Peter - Jun 23, 13:15)
(_ Question: Re: Optical Surfaces and Sigma_Alpha   (Wolfgang Lukas - Jul 01, 03:48)
1 Feedback: Re: Optical Surfaces and Sigma_Alpha   (Benton Pahlka - Jul 01, 08:03)
1 Feedback: Re: Optical Surfaces and Sigma_Alpha   (Gumplinger Peter - Jul 02, 17:36)
... 1 Message(s)
2 Feedback: Re: Optical Surfaces and Sigma_Alpha   (Gumplinger Peter - Jul 02, 17:30)
1 Idea: Re: Optical Surfaces and Sigma_Alpha   (Wolfgang Lukas - Sep 22, 04:36)
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!

1 Note: Updated, one problem resolved.   (jdswado@gatech.edu - Jun 11, 12:37)
(_ Warning: Re: Updated, one problem resolved.   (Gumplinger Peter - Jun 16, 16:23)
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

1 Warning: Re: Polarized optical photons reflection problem   (Gumplinger Peter - Jun 24, 14:50)
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

1 Feedback: Re: G4Paraboloid Reflection   (Gumplinger Peter - Jun 04, 11:53)
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.

1 None: How to disnable Cerenkov Effect in a specified material/volume   (Dvorak - 21 Jun, 2003)
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.
1 Feedback: Re: Cerenkov + Scintillation (+ OpticalPhoton)   (Peter Gumplinger - 26 Jul, 2002)
(_ None: How to disnable Cerenkov Effect in a specified material/volume   (Dvorak - 21 Jun, 2003)
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

1 None: Re: Cerenkov + Scintillation (+ OpticalPhoton)   (Jacek M. Holeczek - 26 Jul, 2002)
(_ Feedback: Re: Cerenkov + Scintillation (+ OpticalPhoton)   (Peter Gumplinger - 26 Jul, 2002)
(_ None: How to disnable Cerenkov Effect in a specified material/volume   (Dvorak - 21 Jun, 2003)
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.
1 Feedback: Re: Cerenkov + Scintillation (+ OpticalPhoton)   (Peter Gumplinger - 25 Jul, 2002)
(_ None: Re: Cerenkov + Scintillation (+ OpticalPhoton)   (Jacek M. Holeczek - 26 Jul, 2002)
(_ Feedback: Re: Cerenkov + Scintillation (+ OpticalPhoton)   (Peter Gumplinger - 26 Jul, 2002)
(_ None: How to disnable Cerenkov Effect in a specified material/volume   (Dvorak - 21 Jun, 2003)
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

1 Ok: Re: G4Scintillation: Wrong number of photons   (Peter Gumplinger - 18 Nov, 2002)
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
1 Feedback: Re: G4Scintillation: Wrong number of photons   (Peter Gumplinger - 07 Nov, 2002)
(_ Ok: Re: G4Scintillation: Wrong number of photons   (Peter Gumplinger - 18 Nov, 2002)
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.
1 Feedback: Re: downscaling of optical photons   (Peter Gumplinger - 18 Nov, 2002)
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.

1 Feedback: Re: Number of reflections of Opticalphotons   (Peter Gumplinger - 06 Feb, 2003)
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
1 Feedback: Re: Polyhedra and BorderSurface - a bug?   (Peter Gumplinger - 17 Mar, 2004)
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()

1 More: Re: Polyhedra and BorderSurface - a bug?   (Gabriele Cosmo - 14 Jul, 2003)
(_ Feedback: Re: Polyhedra and BorderSurface - a bug?   (Peter Gumplinger - 17 Mar, 2004)
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 

 
1 None: Re: Polyhedra and BorderSurface - a bug?   (Peter Gumplinger - 11 Jul, 2003)
(_ More: Re: Polyhedra and BorderSurface - a bug?   (Gabriele Cosmo - 14 Jul, 2003)
(_ Feedback: Re: Polyhedra and BorderSurface - a bug?   (Peter Gumplinger - 17 Mar, 2004)
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.
1 Feedback: Re: Bug in G4OpRayleigh constructor   (Peter Gumplinger - 26 Apr, 2004)
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


1 Feedback: Re: Cherenkov photons energy distribution   (Peter Gumplinger - 01 Sep, 2004)
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 -

1 Feedback: Re: optical surface efficiency   (Peter Gumplinger - 19 Nov, 2004)
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?

1 Feedback: Re: gamma polarisation   (Peter Gumplinger - 15 Feb, 2005)
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

1 More: Re: gamma polarisation   (scott - 14 Feb, 2005)
(_ Feedback: Re: gamma polarisation   (Peter Gumplinger - 15 Feb, 2005)
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....

1 None: Re: gamma polarisation   (michel maire - 11 Feb, 2005)
(_ More: Re: gamma polarisation   (scott - 14 Feb, 2005)
(_ Feedback: Re: gamma polarisation   (Peter Gumplinger - 15 Feb, 2005)
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

1 None: Re: optical photons question   (Peter Gumplinger - 09 Mar, 2005)
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

1 Feedback: Re: Aerojel Rayleigh Scattering   (Peter Gumplinger - 16 May, 2005)
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.

1 None: Re: how to get the scintillation emission time for optical photon??   (michel maire - 16 Jun, 2005)
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??

1 Feedback: Re: how to get the scintillation emission time for optical photon??   (Peter Gumplinger - 15 Jun, 2005)
(_ None: Re: how to get the scintillation emission time for optical photon??   (michel maire - 16 Jun, 2005)
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.

1 Feedback: Re: How to know the yield factor for the scintillation process??   (Peter Gumplinger - 15 Jun, 2005)
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);

1 Feedback: Re: What the parameters mean in material properties tables?   (Peter Gumplinger - 08 Sep, 2005)
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

1 Feedback: Re: How can I read out the position information about scintillation process?   (Peter Gumplinger - 10 Sep, 2005)
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.

1 Feedback: Re: Stuck on error with optical photons   (Ben Loer - 07 Dec, 2005)
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.
1 More: Re: Stuck on error with optical photons   (Peter Gumplinger - 06 Dec, 2005)
(_ Feedback: Re: Stuck on error with optical photons   (Ben Loer - 07 Dec, 2005)
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

1 None: Re: Stuck on error with optical photons   (Ben Loer - 05 Dec, 2005)
(_ More: Re: Stuck on error with optical photons   (Peter Gumplinger - 06 Dec, 2005)
(_ Feedback: Re: Stuck on error with optical photons   (Ben Loer - 07 Dec, 2005)
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

1 More: Re: Stuck on error with optical photons   (Peter Gumplinger - 30 Nov, 2005)
(_ None: Re: Stuck on error with optical photons   (Ben Loer - 05 Dec, 2005)
(_ More: Re: Stuck on error with optical photons   (Peter Gumplinger - 06 Dec, 2005)
(_ Feedback: Re: Stuck on error with optical photons   (Ben Loer - 07 Dec, 2005)
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!

1 Idea: Re: Stuck on error with optical photons   (Peter Gumplinger - 30 Nov, 2005)
(_ More: Re: Stuck on error with optical photons   (Peter Gumplinger - 30 Nov, 2005)
(_ None: Re: Stuck on error with optical photons   (Ben Loer - 05 Dec, 2005)
(_ More: Re: Stuck on error with optical photons   (Peter Gumplinger - 06 Dec, 2005)
(_ Feedback: Re: Stuck on error with optical photons   (Ben Loer - 07 Dec, 2005)
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.

1 Feedback: Re: Bug in Wavelength Shifting (G4OpWLS) process ?   (Peter Gumplinger - 02 May, 2006)
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.

1 None: Re: Optical Reflectivity   (wmenges@sandia.gov - 30 Jun, 2006)
3 None: Re: Optical Reflectivity   (Vladimir IVANTCHENKO - 03 Jul, 2006)
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

1 Feedback: Re: Optical Reflectivity   (Peter Gumplinger - 30 Jun, 2006)
1 None: Re: Optical Reflectivity   (wmenges@sandia.gov - 30 Jun, 2006)
3 None: Re: Optical Reflectivity   (Vladimir IVANTCHENKO - 03 Jul, 2006)
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.

1 Feedback: Re: Photon Propagation Problem after I change the geometry   (Peter Gumplinger - 27 Sep, 2006)
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,

1 Feedback: Re: Problem with Rayleigh scattering   (Peter Gumplinger - 04 Oct, 2006)
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

1 Feedback: Re: optical photon self-absorption in scintillator   (Peter Gumplinger - 20 Oct, 2006)
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

1 None: Re: optical photon self-absorption in scintillator   (Benton Pahlka - 18 Oct, 2006)
(_ Feedback: Re: optical photon self-absorption in scintillator   (Peter Gumplinger - 20 Oct, 2006)
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

1 Feedback: Re: optical photon self-absorption in scintillator   (Peter Gumplinger - 17 Oct, 2006)
(_ None: Re: optical photon self-absorption in scintillator   (Benton Pahlka - 18 Oct, 2006)
(_ Feedback: Re: optical photon self-absorption in scintillator   (Peter Gumplinger - 20 Oct, 2006)
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

1 None: Re: optical photon self-absorption in scintillator   (Benton Pahlka - 17 Oct, 2006)
(_ Feedback: Re: optical photon self-absorption in scintillator   (Peter Gumplinger - 17 Oct, 2006)
(_ None: Re: optical photon self-absorption in scintillator   (Benton Pahlka - 18 Oct, 2006)
(_ Feedback: Re: optical photon self-absorption in scintillator   (Peter Gumplinger - 20 Oct, 2006)
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

1 Feedback: Re: coupling an optical G4Tubs to an optical G4Torus   (Peter Gumplinger - 07 Nov, 2006)
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

1 None: Re: Inconsistency in optical photon tracking?   (Peter Gumplinger - 30 Nov, 2006)
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

1 Feedback: Re: Inconsistency in optical photon tracking?   (Kay Ulbrich - 30 Nov, 2006)
(_ None: Re: Inconsistency in optical photon tracking?   (Peter Gumplinger - 30 Nov, 2006)
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

1 Feedback: Re: Inconsistency in optical photon tracking?   (Peter Gumplinger - 27 Nov, 2006)
(_ Feedback: Re: Inconsistency in optical photon tracking?   (Kay Ulbrich - 30 Nov, 2006)
(_ None: Re: Inconsistency in optical photon tracking?   (Peter Gumplinger - 30 Nov, 2006)
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!

1 Feedback: Re: What dose the excitation ratio mean for the scintillator?   (Peter Gumplinger - 23 Jan, 2007)
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

1 Feedback: Re: Wavelength range of material properties and number of Cerenkov photons   (Peter Gumplinger - 05 Mar, 2007)
Feedback Re: SCINTILLATIONYIELD and number of photons  Keywords: SCINTILLATIONYIELD, number of photons
by Gumplinger Peter <Gumplinger Peter>,   27 Sep, 2007

Hello Xinhua,

Before we look at the number of photos produced, could you make a histogram of the energy deposition in your scintillator. Is the MPV, as you expect 4MeV? For all the scintillation process does is:

        ScintillationYield = YieldFactor * ScintillationYield;
        MeanNumberOfPhotons = ScintillationYield * TotalEnergyDeposit;

        if (MeanNumberOfPhotons > 10.) {
          G4double sigma = ResolutionScale * sqrt(MeanNumberOfPhotons);
          NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5);        }
        else {
          NumPhotons = G4int(G4Poisson(MeanNumberOfPhotons));
        }

This is assuming you have set the YieldFactor and the ResolutionScale:

theScintillationProcess->SetScintillationYieldFactor(1.);

and

AddConstProperty("RESOLUTIONSCALE", 1.0);

in your program.

If you don't get 4MeV try standard EM physics.

Question SCINTILLATIONYIELD and number of photons  Keywords: SCINTILLATIONYIELD, number of photons
by <maxh@ihep.ac.cn>,   27 Sep, 2007

Dear everyone,

by geant4.7.0, I am simulating a plastic scintillator plane with thickness 2cm. Several muons are vertically beamed into the detector, and SCINTILLATIONYIELD is set 10./MeV. G4LowEnergyIonisation is added, and All photons are counted. In this simplest case, one very nice landau distribution of photons is obtained, but MPV of the distribution is 68.1, not as expected as 40 (1MIP is 2MeV/cm, so photons generated in 2cm thick detector should be 10./MeV x 2MeV/cm x 2cm=40). Could you please tell me what relation between SCINTILLATIONYIELD and mean value or MPV of generated photon distribution is? Moreover, sigma of the distribution is 5.335. My question is which "key" decides sigma? Thanks.

Cheers

Xinhua

1 Feedback: Re: SCINTILLATIONYIELD and number of photons   (Peter Gumplinger - 27 Sep, 2007)
Feedback Re: How to decrease the time used per event of optical process of plastical scintillation?  Keywords: secrease tme optical plastical scintillation
by Gumplinger Peter <Gumplinger Peter>,   10 Jan, 2008

Hello Xiaoxiao Li,

Not much you can do, except forego statistical precision by reducing the yield from 8000./MeV to 800./MeV. You should now get about 6 photons collected at the PMT but you would know to multiply that number by 10.

This may be a viable option as it would still allow you to test for geometrical effects etc. albeit with lower statistical accuracy.

Question How to decrease the time used per event of optical process of plastical scintillation?  Keywords: secrease tme optical plastical scintillation
by Xiaoxiao Li <Xiaoxiao Li>,   09 Jan, 2008

Hi,All :

   I am a beginners of Geant4, and now I am simulating a optical process of
plastical scintillation .
   The volume I  used is ( from outer to inner ) PAPER , air _empty , ,
Scintillation,  groove,  WLS.      
  Some properties I set are :
  (1) The REF  of paper is 0.985 , ;
 (2) Scintillation:  
      myMPT1->AddConstProperty("SCINTILLATIONYIELD",8000./MeV);
      myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
      myMPT1->AddConstProperty("FASTTIMECONSTANT", 2.*ns);
      myMPT1->AddConstProperty("YIELDRATIO",1.0);
  The number of  Photon.Eletrons which was collected by PMT is about 60, buut
the time I used is about 1 minute  per event. The reason maybe come from the
reflection of phontons in the scintillation. So how can I improve my programe
to decrease the time used per event?
  Can anyone give me advice for the this  problem?  Thanks  in advance .

Best
    Wish

Xiaoxiao Li

1 Feedback: Re: How to decrease the time used per event of optical process of plastical scintillation?   (Peter Gumplinger - 10 Jan, 2008)
Feedback Re: Optical boundary process and absorption at boundary  by Gumplinger Peter <Gumplinger Peter>,   15 Aug, 2008
Please, see also code along the same vain at:

http://www-geant4.kek.jp/lxr/source/examples/extended/optical/LXe/src/LXeSteppingAction.cc#L77

e.g. you only have to 'find' the process pointer once

and

http://www-geant4.kek.jp/lxr/source/examples/extended/optical/LXe/src/LXeSteppingAction.cc#L146

None Re: Optical boundary process and absorption at boundary  by Kay Ulbrich <Kay Ulbrich>,   15 Aug, 2008
As an afterthought -- I think, a zero length step returns a status of StepTooSmall, so the test for kCarTolerance seems not to be necessary when TotalInternalReflection or FresnelReflection are tested for.

1 Agree: Re: Optical boundary process and absorption at boundary   (Gumplinger Peter - 15 Aug, 2008)
None Re: Optical boundary process and absorption at boundary  by Kay Ulbrich <Kay Ulbrich>,   15 Aug, 2008
Hello Peter,

thank you very much for another detailed answer.

Actually, I went into the stepping and decided to use a somewhat different approach not involving killing the track, but counting the number of reflections (so one can use the same simulated data for different assumptions about the absorption probability). But the important point of course is the criteria when to increase the number of reflections (or alternatively kill the track based on a certain absorption probability).

I describe, what I have done in the following and it would be nice to get a feedback.

The geometry is such, that every photon passing the boundary of the volume is lost. So the only processes, which leave them in the volume are

* TotalInternalReflection
* FresnelReflection

In G4UserSteppingAction::UserSteppingAction(const G4Step* Step)

I do (excerpts, *fTheTrack is the actual track):

------------------------------------------------------------------------------------------------------------------------
fEndPoint = Step->GetPostStepPoint();
  fEndVol = fEndPoint->GetPhysicalVolume();
  if(!fEndVol)
    return;

  fStartPoint = Step->GetPreStepPoint();
  fStartVol = fStartPoint->GetPhysicalVolume();

if(fEndPoint->GetStepStatus() == fGeomBoundary) {
    fBoundaryProc = dynamic_cast<G4OpBoundaryProcess *>(ExistsProcess("OpBoundary",  fTheTrack));
    if(fBoundaryProc) {
      fBoundaryStatus = fBoundaryProc->GetStatus();
      if(fBoundaryStatus == TotalInternalReflection || fBoundaryStatus == FresnelReflection)
	IncNofReflections();
      else if(fBoundaryStatus == FresnelRefraction) 
	fTheTrack->SetTrackStatus(fStopButAlive);
     }
 }
------------------------------------------------------------------------------------------------------------------------

The function ExistsProcess(...) loops over the track's process vector and looks, whether the named process is in it. IncNofReflections() does, what it sounds like.

The if-clause "else if(fBoundaryStatus == FresnelRefraction)" serves to abandon tracks having left the volume of interest, which may speed up the program a little and makes the picture in visual mode less crowded.

Would I have to add a check for fTheTrack->GetStepLength()>kCarTolerance/2 here, too?

Thanks a lot for advice!

Kay

1 None: Re: Optical boundary process and absorption at boundary   (Kay Ulbrich - 15 Aug, 2008)
2 Feedback: Re: Optical boundary process and absorption at boundary   (Gumplinger Peter - 15 Aug, 2008)
Feedback Re: Optical boundary process and absorption at boundary  by Gumplinger Peter <Gumplinger Peter>,   14 Aug, 2008
> .... No G4OpticalSurface is needed for this.

Correct!

> Now I would like to add one feature: additional to this process, I want

> the photon to be absorbed with a certain probability at the boundary

> surface, where the Fresnel process takes place (this is due to

> phenomenologically introduced surface imperfections). Is this possible

> with some special G4OpticalSurface?

No, there is no special G4OpticalSurface which would accomplish this at the moment.

> If I got it right, as soon, as I introduce such a surface, the "normal" Fresnel

> type boundary process is not working anymore and all optical properties have to

> be implemented via the G4OpticalSurface.

Correct!

> So my question is: are there some standard optical properties or

> techniques implemented, or would the only solution be to go to the

> stepping level?

I'll look into extending the G4OpBoundaryProcess::PostStepDoIt so it would look for a G4OpticalSurface with a 'transmission/reflection cooefficient' defined, even for the normal Fresnel calculation (where otherwise, no G4OpticalSurface needs to be defined). In the meantime, you'll have to add code in your UserSteppingActon.

> In that case, would every single step have to be tested

> or is there a special class offering a virtual function, which is called

> when a boundary is crossed?

The G4 navigator provides you (and G4OpBoundaryProcess) the following information when a track is at a boundary:

G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();

if (pPostStepPoint->GetStepStatus() == fGeomBoundary){
   if (aTrack.GetStepLength()>kCarTolerance/2) {
      // now you want to kill the track
      G4Track* theTrack = aStep.GetTrack();
      if ( G4BooleanRand(theUserAbsorption) ) {
         theTrack->SetTrackStatus(fStopAndKill);
      }
   }
}

(you need the if-kCarTolerance because a reflected ray will have two steps on the volume boundary when it reversed direction, the 2nd of which is the 'reallocation step' of zero length - you want to sample your 'theUserAbsorption' only once, be it for a transmitted photon or reflected photon).

Hope this helps. Peter

1 None: Re: Optical boundary process and absorption at boundary   (Kay Ulbrich - 15 Aug, 2008)
Question Optical boundary process and absorption at boundary  by Kay Ulbrich <Kay Ulbrich>,   13 Aug, 2008
Hello!

For the transport of optical photons in a material I use the optical boundary process, which is based on the difference of refraction indices at volume boundaries, i.e., Fresnel type refraction. More specific, the transport is achieved by exploiting the angular limit for total reflection. No G4OpticalSurface is needed for this.

Now I would like to add one feature: additional to this process, I want the photon to be absorbed with a certain probability at the boundary surface, where the Fresnel process takes place (this is due to phenomenologically introduced surface imperfections). Is this possible with some special G4OpticalSurface? If I got it right, as soon, as I introduce such a surface, the "normal" Fresnel type boundary process is not working anymore and all optical properties have to be implemented via the G4OpticalSurface.

So my question is: are there some standard optical properties or techniques implemented, or would the only solution be to go to the stepping level? In that case, would every single step have to be tested or is there a special class offering a virtual function, which is called when a boundary is crossed?

Thanks in advance for advice!

1 Feedback: Re: Optical boundary process and absorption at boundary   (Gumplinger Peter - 14 Aug, 2008)
None Re: Who has some Optical examples?  by Gumplinger Peter <Gumplinger Peter>,   14 Feb, 2003

The optical photon example is at:

geant4/examples/novice/N06

Documentation is at:

http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#5.2.5

More information can be found at:

http://www.estec.esa.nl/wmwww/WMA/EMA_Events/g4spaceusers2003/presentations/G4SpaceForum_Optical.pdf

None Who has some Optical examples?  by Nuno Fiuza de Barros <Nuno Fiuza de Barros>,   06 Feb, 2003
I wish to make a simple simulation with optical photons with some mirrors but i can't find much examples or documentation.
Somebody can tell me where can i find some of these, please?

Thanks in advance

Nuno Barros
1 None: Re: Who has some Optical examples?   (Peter Gumplinger - 14 Feb, 2003)
Feedback Re: How does work the method G4BooleanRand()  by Gumplinger Peter <Gumplinger Peter>,   14 Feb, 2003

This is the code for G4BooleanRand in include/G4OpBoundaryProcess.hh

inline
G4bool G4OpBoundaryProcess::G4BooleanRand(const G4double prob) const
{
  /* Returns a random boolean variable with the specified probability */

return (G4UniformRand() < prob); }

i.e. it returns always TRUE for prob=1. So, since the reflectivity is 100% (=1), the code (DoAbsorption) is not executed.

Question How does work the method G4BooleanRand()  by Nuno Fiuza de Barros <Nuno Fiuza de Barros>,   10 Feb, 2003
I'm trying to make a small optical simulation and in the class G4OpBoundaryProcess there's the following code:

    if( !G4BooleanRand(theReflectivity) ) 
    {
          DoAbsorption();
          break;
    }

What is suposed to do?
If theReflectivity has the value 1.0 it will execute this code or not?

Thanks in advance

Nuno Barros
1 Feedback: Re: How does work the method G4BooleanRand()   (Peter Gumplinger - 14 Feb, 2003)
Question Re: general questions regarding G4LogicalBorderSurface  Keywords: optical G4LogicalBorderSurface volume G4LogicalSkinSurface
by Onno Kortmann <kortmann@physik.uni-kiel.de>,   20 Dec, 2006

Hello,

I'm also trying to set up a solid with different optical interfaces to other parts in GEANT4.

You write that one simply has to place the solids with their dielectric interfaces next to each other.

However, it seems that I need to have the solids overlapping by a certain amount to get a direct transportation from one into the other, without going into the mother volume inbetween.

I read that overlapping volumes are always a bad idea and may screw up the navigation code in GEANT4.

Is there something I could have done wrong here or is it ok to have a slight overlap for optical interfaces?

1 Feedback: Re: general questions regarding G4LogicalBorderSurface   (John Apostolakis - 10 Jan, 2007)
None Re: general questions regarding G4LogicalBorderSurface  Keywords: optical G4LogicalBorderSurface volume G4LogicalSkinSurface
by Aaron <Aaron>,   03 Aug, 2006

Thanks so much for all your help, Peter!!!!

Feedback Re: general questions regarding G4LogicalBorderSurface  Keywords: optical G4LogicalBorderSurface volume G4LogicalSkinSurface
by Gumplinger Peter <Gumplinger Peter>,   02 Aug, 2006

Aaron, sorry for the long delay in replying to your posting. You were unlucky in sending it on the day I went on an extended vacation.

> 1) I am trying to simulate a scintillator box with 4 sides surrounded

>    by one medium and the remaining two sides surrounded by a different

>    one.  Is G4LogicalBorderSurface the right class to use (as opposed

>    to G4LogicalSkinSurface or some other class)?

YES, G4LogicalBorderSurface is the class you want. G4LogicalSkinSurface assumes all sides of a solid have one and the same 'skin'.

> Using this class, is it possible to take into account the different

> media on each side of the box by specifying the two volumes on either

> side of each surface?

Precisely!

> I have heard people say that GEANT4 can currently only handle the same

> optical properties on all sides of a volume.

Not true,

> Does this refer to G4LogicalSkinSurface and not

> G4LogicalBorderSurface?

Yes, refers only to the special case of 'SkinSurface'.

> Is there an order to the two volumes that the constructor takes?

Yes

> I do not understand why there should be, but some of the

> documentation that I read makes me think that there is.

Yes, I kind of agree with you. However, I felt that making the order relevant I can be more general for the eventual cases where the optical properties may have to be defined differently depending on which direction the optical photon arrives at the surface.

If, in your simulation, it is possible for photons to arrive at a G4LogicalBorderSurface from both directions you need to specify (probably identical) two G4LogicalBorderSurfaces.

As a reminder, if your surface is between two dielectric media, perfectly smooth and doesn't require a G4OpticalSurface to describe it, you don't need to define any kind of G4LogicalSurface. The refraction indexes are simply taken from the media on each side of the volume boundary.

In any case, you need to build your geometry in such a way that your scintillator box is embedded in a mother volume with medium1 for the four sides and bud up against two daughters (of that same mother) with medium2 at the two other sides.

1 None: Re: general questions regarding G4LogicalBorderSurface   (Aaron - 03 Aug, 2006)
3 Question: Re: general questions regarding G4LogicalBorderSurface   (Onno Kortmann - 20 Dec, 2006)
1 Feedback: Re: general questions regarding G4LogicalBorderSurface   (John Apostolakis - 10 Jan, 2007)
Question general questions regarding G4LogicalBorderSurface  Keywords: optical G4LogicalBorderSurface volume G4LogicalSkinSurface
by Aaron <Aaron>,   11 Jul, 2006
I am new to GEANT4 and trying to learn about optical modeling.  I have
a couple of questions regarding the G4LogicalBorderSurface class.  I
apologize if the answers are obvious:

1) I am trying to simulate a scintillator box with 4 sides surrounded
   by one medium and the remaining two sides surrounded by a different
   one.  Is G4LogicalBorderSurface the right class to use (as opposed
   to G4LogicalSkinSurface or some other class)?  Using this class, is
   it possible to take into account the different media on each side
   of the box by specifying the two volumes on either side of each
   surface?  I have heard people say that GEANT4 can currently only
   handle the same optical properties on all sides of a volume.  Does
   this refer to G4LogicalSkinSurface and not G4LogicalBorderSurface?

2) Is there an order to the two volumes that the constructor takes?
   I do not understand why there should be, but some of the
   documentation that I read makes me think that there is.  If so,
   can someone please explain why an order is needed?  In other words,
   are the following lines equivalent or different:

      G4LogicalBorderSurface *surf=
        new G4LogicalBorderSurface("surf",volume1,volume2,opSurf);

      G4LogicalBorderSurface *surf=
        new G4LogicalBorderSurface("surf",volume2,volume1,opSurf);

Thank you,

Aaron
1 Feedback: Re: general questions regarding G4LogicalBorderSurface   (Peter Gumplinger - 02 Aug, 2006)
1 None: Re: general questions regarding G4LogicalBorderSurface   (Aaron - 03 Aug, 2006)
3 Question: Re: general questions regarding G4LogicalBorderSurface   (Onno Kortmann - 20 Dec, 2006)
1 Feedback: Re: general questions regarding G4LogicalBorderSurface   (John Apostolakis - 10 Jan, 2007)
...
Feedback Re: questions about optical modeling  Keywords: unified optical modeling ground
by Gumplinger Peter <Gumplinger Peter>,   14 Sep, 2006

> But what happens when a photon with an energy not explicitly specified
> in the array is encountered? Does GEANT4 perform some sort of a spline
> in between listed optical values?

Yes, but only a linear interpolation is done between listed values.

>  What happens above (below) the highest (lowest) momentum
>  in the array?

A warning is written:

                G4cout << "\nWarning: G4MaterialPropertyVector::GetProperty";
                G4cout << "\n==> attempt to Retrieve Property below range"
or
                G4cout << "\n==> attempt to Retrieve Property above range"

and the value associated with the min/max photon energy is returnd.

In the case of G4Scintillation, the array FASTCOMPONENT/SLOWCOMPONENT specifies the range of optical photons produced. It should not be wider than the arrays for the index of refraction etc. for all the materials encountered by these photons, or else, a lot of warnings are produced. For the G4Cerenkov process, the array for the refraction index of the radiator defines the range of optical photons produced. Again, all other optical propery arrays should have the same or larger range on both ends.

Now to your second question:

>   Am I correct in thinking that the above listed variables need to be
>   specified only when thin coverings are used?

No, they are needed if any kind of reflection is possible, even for total internal reflection and Fresnel reflection.

If you choose the UNIFIED model, you need to specify the probability of one of the kinds of reflection that can happen in this model at any dielectric_dielectic surface (regardless of whether there is or isn't also a wrapping). If you don't, UNIFIED assumes 'Lambertian Reflection' and models the reflected photon direction from G4LambertianRand without any reference to sigma_alpha. What you want is 100% LobeReflection whose parameter in the UNIFIED model is 'sigma_alpha' for sampling the FacetNormal. When the photon is found to be refracted none of the UNIFIED Reflection-Types come into play and the FacetNormal is sampled from sigma_alpha alone; just as you suspected.

The logic is such that all probabilities are set to 0% and Lambertian is the default. Now, if you only set:

G4double SpecularLobe[num] = {1.0, ...... ,1.0};

myMPT->AddProperty("SPECULARLOBECONSTANT",Ephoton,SpecularLobe,num);

you'll have 100% SPECULARLOBE, no other type of reflection.

As well, you only need the efficiency array for dielectric_metal surfaces and then also only if you want to tag a photon as "detected".

Question questions about optical modeling  Keywords: unified optical modeling ground
by Aaron Maschinot <Aaron Maschinot>,   08 Sep, 2006
I have a couple of questions about optical modeling in GEANT4 for
anyone who may know.  I am trying to simulate optical photons
passing through a series of contiguous blocks of materials with
different optical properties.  None of the blocks is coated with
anything.

1) Optical properties are entered via arrays as a function of photon
   momentum over a range of momenta.  But what happens when a photon
   with an energy not explicitly specified in the array is encountered?
   Does GEANT4 perform some sort of a spline in between listed optical
   values?  What happens above (below) the highest (lowest) momentum
   in the array?

2) I have read through the UNIFIED paper as well as the optical
   modeling section of the User's Guide.  I like the concept of the
   "sigma_alpha" variable to specify surface roughness in the UNIFIED
   model, and I would like to use this model (as opposed to GLISUR) in
   my simulation.

   However, I am confused as to why I need to specify the specularlobe,
   specularspike, backscatter, reflectivity, and efficiency arrays.

   In my simulation, I have no wrappings or coverings surrounding
   individual blocks.  Instead, the blocks are directly contiguous.

   Am I correct in thinking that the above listed variables need to be
   specified only when thin coverings are used?  In my simulation, my
   finish is "ground", not "groundfrontpainted" or "groundbackpainted".
   It seems to me (maybe incorrectly) that, in the absence of any thin
   coverings surrounding materials, the physics is completely
   determined once "sigma_alpha" is chosen.  Thus, I do not see the
   need for these other variables.

Thanks so much,

Aaron
1 Feedback: Re: questions about optical modeling   (Peter Gumplinger - 14 Sep, 2006)
None Re: LXe example, Segmentation fault  Keywords: LXe, Segmentation fault
by amaresh kumar <amaresh kumar>,   13 Oct, 2006

Hello Peter,
  Thanks for the help. I am incorporating the scintillation processes in A01example.
The scintillation process works fine but whe  i come to the point of detecting 
the optical photons. I am facing a problem, the detector is not detecting the optical photons. I went
throught the geant hypernews and it was helpful and refering to the
problem of Matt Orr "Optical photon detection" i have incorporated all 
the G4LogicalBoundarySurface to all my surfaces.
About the second part which ou told to put "
boundaryStatus=boundary->GetStatus();
  //Check to see if the particle was actually at a boundary 
  if(thePostPoint->GetStepStatus()==fGeomBoundary){
    switch(boundaryStatus){
    //...
      case Detection: //Note, this assumes that the volume causing detection
                      //is the photocathode because it is the only one with
                      //non-zero efficiency
        {
          //Trigger sensitive detector manually since photon is
          //absorbed but status was Detection
          G4SDManager* SDman = G4SDManager::GetSDMpointer();
          G4String sdName="/LXeDet/pmtSD";
          LXePMTSD* pmtSD = (LXePMTSD*)SDman
            ->FindSensitiveDetector(sdName);
          if(pmtSD)
            pmtSD->ProcessHits_constStep(theStep,NULL);
          break;
        }
      //...
    }"

Where do i put this part. If you want to have a look at the program i can send it through mail.

Thanks a lot for helping.

Amaresh

None Re: LXe example, Segmentation fault  Keywords: LXe, Segmentation fault
by amaresh kumar <amaresh kumar>,   13 Oct, 2006

Hello Peter,
  Thanks for the help. I am incorporating the scintillation processes in A01example.
The scintillation process works fine but whe  i come to the point of detecting 
the optical photons. I am facing a problem, the detector is not detecting the optical photons. I went
throught the geant hypernews and it was helpful and refering to the
problem of Matt Orr "Optical photon detection" i have incorporated all 
the G4LogicalBoundarySurface to all my surfaces.
About the second part which ou told to put "
boundaryStatus=boundary->GetStatus();
  //Check to see if the particle was actually at a boundary 
  if(thePostPoint->GetStepStatus()==fGeomBoundary){
    switch(boundaryStatus){
    //...
      case Detection: //Note, this assumes that the volume causing detection
                      //is the photocathode because it is the only one with
                      //non-zero efficiency
        {
          //Trigger sensitive detector manually since photon is
          //absorbed but status was Detection
          G4SDManager* SDman = G4SDManager::GetSDMpointer();
          G4String sdName="/LXeDet/pmtSD";
          LXePMTSD* pmtSD = (LXePMTSD*)SDman
            ->FindSensitiveDetector(sdName);
          if(pmtSD)
            pmtSD->ProcessHits_constStep(theStep,NULL);
          break;
        }
      //...
    }"

Where do i put this part. If you want to have a look at the program i can send it through mail.

Thanks a lot for helping.

Amaresh

1 Feedback: Re: LXe example, Segmentation fault   (Peter Gumplinger - 17 Oct, 2006)
Warning Re: LXe example, Segmentation fault  Keywords: LXe, Segmentation fault
by Gumplinger Peter <Gumplinger Peter>,   14 Sep, 2006

Hello Amaresh,

Thanks for pointing out this problem. It is a bug! I have reported it as bug #889 and fixed it in tag: LXe-V08-01-00

The fix is just one line. In LXeDetectorConstruction.cc please change the class constructor to read:

LXeDetectorConstruction::LXeDetectorConstruction()
: LXe_mt(NULL), MPTPStyrene(NULL)
{
  SetDefaults();
  detectorMessenger = new LXeDetectorMessenger(this);
}

It is quite clear that the compilers in the past must have assigned NULL by default to class members who are pointers, or else, we would have had this problem all along(?)

Best regards, Peter Gumplinger

1 None: Re: LXe example, Segmentation fault   (amaresh kumar - 13 Oct, 2006)
1 Feedback: Re: LXe example, Segmentation fault   (Peter Gumplinger - 17 Oct, 2006)
5 None: Re: LXe example, Segmentation fault   (amaresh kumar - 13 Oct, 2006)
None LXe example, Segmentation fault  Keywords: LXe, Segmentation fault
by amaresh kumar <amaresh kumar>,   11 Sep, 2006

Hello Every body,
  I am trying to run the LXe example to simulate a sintillator.
I run the "make" command in the dir /examples/extended /optical/LXe and everything goes fine.
But when I type "LXe", it gives the msg "Segmentation Fault".
  There are no error msgs.

  Can any one help me. I would like to know the problem.

Thanks in advance. amaresh

1 Warning: Re: LXe example, Segmentation fault   (Peter Gumplinger - 14 Sep, 2006)
1 None: Re: LXe example, Segmentation fault   (amaresh kumar - 13 Oct, 2006)
1 Feedback: Re: LXe example, Segmentation fault   (Peter Gumplinger - 17 Oct, 2006)
...
5 None: Re: LXe example, Segmentation fault   (amaresh kumar - 13 Oct, 2006)
Feedback Re: Scintillator Photons  Keywords: scintillators, optical photons
by Gumplinger Peter <Gumplinger Peter>,   26 Nov, 2002

Hi Mike,

Sorry, I did not see your message earlier.

I presume you set ResolutionScale to zero and still get a large fluctuation of photons at your photo sensitive area. This can arise from photon losses due to bulk absorption, surface absorption you may have specified.

I suggest you investigate and count the number of photons generated, (see: http://geant4.slac.stanford.edu/Tips/ "How can I count all optical photons generated in an event")

It may also be possible that your primary particle does not leave all its energy in your scintillator.

Regards, Peter

Question Scintillator Photons  Keywords: scintillators, optical photons
by Michael Famiano <Michael Famiano>,   18 Jul, 2002

Hello;
  I'm trying to count the number of optical photons striking a 
photodiode attached to a light guide which is attached to a scintillator.  While the number is proportional to (alpha) particle energy incident on the
scintillator, the deviation is very large (~30%) even when I set the
resolution to 0.  Can anyone help me here, or tell me what might be causing this.  I'm following very closely the advanced example "underground physics."  I've tried many things including changing my cuts, but nothing seems to be changing the apparent low resolution.
Thanks,
mike

1 Feedback: Re: Scintillator Photons   (Gumplinger Peter - 26 Nov, 2002)
Feedback Re: Scintillator surface  Keywords: optical scintillator
by Gumplinger Peter <Gumplinger Peter>,   27 Jan, 2003

Dear Peng,

Haiping wrote:

>   Now the surface between the scintillator and air and the surface
> between the scintillator and siliconoil were defined, but i did not
> know whether or not to  add the surface properties such as "RINDEX",
> "SPECULARLOBECONSTANT","SPECULARSPIKECONSTANT","BACKSCATTERCONSTANT"
> ,"REFLECTIVITY","EFFICIENCY" to the surface, i suppose the surface
> between the scintillator and air is polished. I did not know the
> meaning of the surface properties.

I suspect that you only want to simulate perfectly polished surfaces. If this is so, you don't have to specify anything about the 'surface'! All you need to do is provide the index of refraction of the materials touching; i.e. the scintillator, the air, and the silicon oil. In this case, the G4OpBoundaryProcess defaults to the 'glisur' model for dielectric_dielectric interfaces which are assumed to be perfectly polished finishes. You do NOT need to use the UNIFIED surface model!

Please, follow the following links for more information and specifically about the 'Unified Model' which only needs your above list of extra parameters.

http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#5.2.5

http://geant4.slac.stanford.edu/UsersWorkshop/G4Lectures/Peter/moisan.ps

Best regards, Peter

None Scintillator surface  Keywords: optical scintillator
by peng haiping <penghp@mail.ihep.ac.cn>,   20 Jan, 2003

hi,every one
   I want to simulate the optical photon tracking in the scintillator,
but i was confuse of the defination the surface, i did not know weather
or not the add some properties to the surface.
   The optical photon generate in the scintillator, and will detecter
by PMT at the end of scintillator, the surface between scintillator 
and air be defined, the surface is polished and the physis model is
unified, but i did not known weather or not to add the property 
such as "RINDEX","SPECULARLOBECONSTANT","SPECULARSPIKECONSTANT",
"BACKSCATTERCONSTANT","REFLECTIVITY","EFFICIENCY" to surface.
i did not understand the meaning of the surface properties.
regards
   ----Peng Haiping

1 Feedback: Re: Scintillator surface   (Peter Gumplinger - 27 Jan, 2003)
Feedback Re: Optical surface efficiency  Keywords: optical, efficiency
by Gumplinger Peter <Gumplinger Peter>,   10 Jan, 2005

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?

The 'efficiency' should be just a multiplicative factor. It wasn't always in the past for rough surfaces because the efficiency was applied (sampled) at every encounter with the surface. It is possible that for a very rough surface the reflected ray still points toward the nominal surface normal. In patch02 for G4.6.2 and in G4.7 this has been corrected so that the user gets the efficiency back she/he has input, independent of how rough the surface was specified.

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?

The efficiency, like all other optical properties, are linear interpolated between the provided table values.

Question Optical surface efficiency  Keywords: optical, efficiency
by Matt Orr <orrm@uah.edu>,   18 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 -

1 Feedback: Re: Optical surface efficiency   (Peter Gumplinger - 10 Jan, 2005)
None Re: MaterialPropertiesTable and raytracing question  Keywords: G4MaterialPropertiesTable
by Gumplinger Peter <Gumplinger Peter>,   18 Oct, 2001

Please, have a look at examples/novice/N06/src on how the MaterialPropertiesTable is used.

First, you have to generate one:

G4MaterialPropertiesTable *myMPT1 = new G4MaterialPropertiesTable();

Then, you fill it with:

myMPT1->AddProperty("ABSLENGTH",PPCKOV, ABSORPTION1, NUMENTRIES);

where "ABSLENGTH" is the name ('key') of the property. This 'key' will appear again in the code of the 'absorption process' implementation.

The variables PPCKOV and ABSORPTION1 are arrays of length NUMENTRIES:

  const G4int NUMENTRIES = 32;

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

  G4double ABSORPTION1[NUMENTRIES] =
           {344.8*cm,  408.2*cm,  632.9*cm,  917.4*cm, 1234.6*cm, 1388.9*cm,
           1515.2*cm, 1724.1*cm, 1886.8*cm, 2000.0*cm, 2631.6*cm, 3571.4*cm,
           4545.5*cm, 4761.9*cm, 5263.2*cm, 5263.2*cm, 5555.6*cm, 5263.2*cm,
           5263.2*cm, 4761.9*cm, 4545.5*cm, 4166.7*cm, 3703.7*cm, 3333.3*cm,
           3000.0*cm, 2850.0*cm, 2700.0*cm, 2450.0*cm, 2200.0*cm, 1950.0*cm,
           1750.0*cm, 1450.0*cm };

The minimum number for NUMENTRIES is 2. You your case, ABSORPTION1 would be your value for '1/mu' (can be the same for both entries) and PPCKOV would be the range of geantino momentum in your simulation.

You now have to associate the MaterialPropertiesTable with an already defined material:

Water->SetMaterialPropertiesTable(myMPT1);

As for 'geantino absorption', this isn't a defined process in GEANT4. You'll have to implement it similarly to, for example, the optical photon absorption process, see /home/gum/geant4/source/processes/optical and the files G4OpAbsorption.hh and G4OpAbsorption.cc. Your IsApplicable method would be:

inline
G4bool G4OpAbsorption::IsApplicable(const G4ParticleDefinition& aParticleType)
{
   return ( &aParticleType == G4Geantino::Geantino() );
}

In your application, you now have to generate this new process:

  G4GeantinoAbsorption* theAbsorptionProcess = new G4GeantinoAbsorption();

Now, you have to add your 'geantino absorption proccess' to the process manager of the geantino:

pmanager->AddDiscreteProcess(theAbsorptionProcess);

similar to ExN06PhysicsList.cc

As for your remaining questions:

Only you know where to retrieve the results. GEANT4 can't know that and it can't know what you mean by 'results'. If your implementation is correct, the geantino flux should deminish like exp(-mu*l) in a homogeneous medium. In your user stepping action, you can count how often a geantino makes it a certain depth into the medium. You can write your counter out at the end of the run.

Instead of using a 'geantino' to test exponential absorption, you could just as well use an 'G4OpticalPhoton and only attach the G4OpAbsorption process to it. This saves you from the problem of having to implement a new process in G4 (Geantino Absorption).

Regards, Peter Gumplinger (gum@triumf.ca)

Question MaterialPropertiesTable and raytracing question  Keywords: G4MaterialPropertiesTable
by Kevin Weiler <weiler@crd.ge.com>,   09 Oct, 2001

Hello, I'm new to Geant4 and need some advice. I'm trying to do a simple exp(-mu*l) caluclation on the passage of a geantino through a simple geometric phantom, and write the results out to a file. I see the G4MaterialPropertiesTable object allows users to store attributes of hte material indexed by photon energy... So I assume I can set up a table of material attenuation coefficients using this construction. How, then, do I retrieve the results? Where do I get the results of the exp(-mu*l), and in what event do I write those results out to disk? Thanks in advance, Kevin Weiler

1 None: Re: MaterialPropertiesTable and raytracing question   (Gumplinger Peter - 18 Oct, 2001)
None Re: Surface finish  Keywords: surface finish
by Gumplinger Peter <Gumplinger Peter>,   11 Feb, 2002

Further to my previous message:

A)Polished surface with a difuse reflector coating (e.g. carbon foil) a few micrometers apart from the polished surface.

There is presently no G4OpticalSurfaceFinish that would allow you to have a polished interface between a medium and a thin (air) layer with a diffuse reflector next to it. However, you can specifying that the G4OpticalSurface has a 'groundbackpainted' G4OpticalSurfaceFinish:

SetType(dielectric_dielectric)

SetFinish(groundbackpainted)

but then you

SetModel(unified)

SetSigmaAlpha(0.0)

or

SetModel(glisur)

SetPolish(0.0)

The reflection of the back foil will then be Lambertian.

Of course, you'll also need to specify the index of refraction of the small air (vacuum) gap between the foil and the medium by constructing a G4MaterialPropertiesTable with entries for RINDEX, and attach it to the G4OpticalSurface.

      

1 Ok: Re: Surface finish   (Rui Bugalho de Moura - 12 Feb, 2002)
None Re: Surface finish  Keywords: surface finish
by Gumplinger Peter <Gumplinger Peter>,   04 Feb, 2002

I must apoligize for the fact that references which should be specified in the application developers guide:

http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#5.2.5

once were, but are now missing.

In the meantime, you can find much detailed information about the UNIFIED surface model at my URL:

http://www.triumf.ca/people/gum/moisan.ps

Is a frontpaint a paint directly applied on the solid surface (like a house paint)?

Yes.

2.Is a backpaint a reflector coating (some thin foil a few mircometers away from the actual volume surface)?

Yes; this spares you from having to specify the few micrometer thick coating as a separate GEANT volume for tracking. You specify the refractive index of the coat as part of the G4OpticalSurface. The reflections inside, or refractions back out this thin coat are all simulated within the G4OpBoundaryProcess and do not involve the G4Navigator.

Imagine I want to test two diferent kinds of surface finish:

A)Polished surface with a difuse reflector coating (e.g. carbon foil) a few micrometers apart from the polished surface.

B)Same as A) but with a specular reflector (e.g. aluminium).

This B) would be 'polishedbackpainted'; as for A) I'll have to check the code some more, but I am afraid, this may not be coded. The 'groundbackpainted' option seems to me to assume both the initial surface and the back paint to be difuse. I'll keep you posted.

Peter

1 None: Re: Surface finish   (Gumplinger Peter - 11 Feb, 2002)
(_ Ok: Re: Surface finish   (Rui Bugalho de Moura - 12 Feb, 2002)
More Re: Surface finish  Keywords: surface finish
by Rui Bugalho de Moura <l45372@alfa.ist.utl.pt>,   04 Feb, 2002

Ok, thanks. So now I've solved my invalid type conversion with a switch statment in which I do the assignments: case 1: surfaceFinish = polished; case 2: surfaceFinish = ground; and so on...

Having solved that, I'd still like to understand what do frontpainted and backpainted mean.

Thanks in advance.

Best regards,

Rui Moura

Feedback Re: Surface finish  Keywords: surface finish
by Gumplinger Peter <Gumplinger Peter>,   04 Feb, 2002

I'll first reply to your last point regarding the enumerations (but I invite everybody to check my understanding of C++):

What you are doing may be correct in C but not C++. I assume you have code like this in your SetSurfaceFinish method:

MyDetectorConstruction::SetSurfaceFinish(G4int inputInteger) { G4OpticalSurfaceFinish surfaceFinish = inputInteger; G4OpticalSurface * mySurface = new G4OpticalSurface("MySurface"); mySurface -> SetFinish(surfaceFinish); }

I don't think this is valid code because ints are not convertible to enumerations in C++. The compiler proves the validity of the program by providing a compile-time redundancy check confirming that 'surfaceFinish' is assigned only valid values; but how can it in this case, so it may not compile?

1 More: Re: Surface finish   (Rui Bugalho de Moura - 04 Feb, 2002)
Question Surface finish  Keywords: surface finish
by Rui Bugalho de Moura <l45372@alfa.ist.utl.pt>,   01 Feb, 2002

Hi everyone,

I'm not sure I've understand all aspects of surface finish. Even going through the G4OpBoundaryProcess.cc source file I have some doubts. I know what a polished or ground surface is. What I'm not sure is what a frontpaint and a back paint is.

1.Is a frontpaint a paint directly applied on the solid surface (like a house paint)?

2.Is a backpaint a reflector coating (some thin foil a few mircometers away from the actual volume surface)?

Imagine I want to test two diferent kinds of surface finish:

A)Polished surface with a difuse reflector coating (e.g. carbon foil) a few micrometers apart from the polished surface.

B)Same as A) but with a specular reflector (e.g. aluminium).

I'm changing surface finish interactively, using a CmdWithAnInteger and a method in my DetectorConstruction class named SetSurfaceFinish. This method takes an integer. In the method SetSurfaceFinish I simply assing the integer to a G4OpticalSurfaceFinish enumeration variable which I have in my Detector Construction class, (surfaceFinish = inputInteger). Is this a bad thing do?

Thank you for your attention and any comments that might help me.

Best regards,

Rui Moura

1 Feedback: Re: Surface finish   (Gumplinger Peter - 04 Feb, 2002)
1 More: Re: Surface finish   (Rui Bugalho de Moura - 04 Feb, 2002)
2 None: Re: Surface finish   (Gumplinger Peter - 04 Feb, 2002)
1 None: Re: Surface finish   (Gumplinger Peter - 11 Feb, 2002)
(_ Ok: Re: Surface finish   (Rui Bugalho de Moura - 12 Feb, 2002)
None Re: Novice user's question.  by Gumplinger Peter <Gumplinger Peter>,   17 Apr, 2003

Further to your questions:

1) Where can i get an optical surfaces descriptions? Such as:

	MySurface->SetType(???);

Two choices:

   dielectric_metal,            // dielectric-metal interface
   dielectric_dielectric        // dielectric-dielectric interface

	MySurface->SetFinish(???);

Your choices are:

   polished,                    // smooth perfectly polished surface
   polishedfrontpainted,        // smooth top-layer (front) paint
   polishedbackpainted,         // same is 'polished' withback-paint
   ground,                      // rough surface
   groundfrontpainted,          // rough top-layer (front) paint
   groundbackpainted            // same as 'ground' but with back-paint

You must decide which of these describes your particular surface.

	MySurface->SetModel(???);

You can model your optical surface with two models:

   glisur,                      // original GEANT3 model
   unified                      // UNIFIED model

see the documentation for details.

2) If premade materials such as Air are exists, where can i
   found a desciption of them?

No premade materials exist in GEANT4 to the best of my knowledge.

3) Emmm... Can somebody show me the way to create a simple
   absorber for optical photons?

Photons can be absorbed in the medium and on a boundary. Depends what kind of absorber you are talking about. For bulk absorption, you need to add the absorption lenght "property", which in most cases is a fuction of wavelength, to the material in this way:

  G4Material* Material;

  G4MaterialPropertiesTable* myMPT = new G4MaterialPropertiesTable();

  const G4int nEntries = 32;

  G4double PhotonEnergy[nEntries] =
            { 2.034*eV, 2.068*eV etc.

  G4double RefractiveIndex[nEntries] =
            { 1.3435, 1.344, etc.

  G4double Absorption[nEntries] =
           {3.448*m,  4.082*m, etc.

  myMPT->AddProperty("RINDEX",PhotonEnergy,RefractiveIndex,nEntries);
  myMPT->AddProperty("ABSLENGTH",PhotonEnergy,Absorption,nEntries);

  Material->SetMaterialPropertiesTable(myMPT);

In the case of a surface absorber:

  const G4int num = 2;

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

  G4double Reflectivity[num] = {0.3, 0.5};

// 70% are absorbed at the long wavelength down to 50% at higher wlt.

  G4MaterialPropertiesTable *myST = new G4MaterialPropertiesTable();

  myST->AddProperty("REFLECTIVITY", Ephoton, Reflectivity, num);

  OpSurface->SetMaterialPropertiesTable(myST);

where an example OpSurface:

  G4OpticalSurface* OpSurface = new G4OpticalSurface("Surface");
  OpWaterSurface->SetType(dielectric_metal);
  OpWaterSurface->SetFinish(polished);
  OpWaterSurface->SetModel(glisur);

  G4LogicalBorderSurface* Surface = new
             G4LogicalBorderSurface("Surface", 
                 Tank_phys,Absorber_phys,OpSurface);

The G4MaterialPropertiesTable can hold material properties not already part of the G4Material class. These properties do not need to be constants but can be a function of another variable. In the case of optical photons, this is typically the photon's energy [in eV]. Examples are index of refraction, bulk absorption length etc. What the numerical values are for your material in question is for you to specify.

Hope this clarifies things?

None Re: Novice user's question.  by Gumplinger Peter <Gumplinger Peter>,   16 Apr, 2003

You can find more information at:

http://www.estec.esa.nl/wmwww/WMA/EMA_Events/g4spaceusers2003/presentations/G4SpaceForum_Optical.pdf

and

http://wwwinfo.cern.ch/asd/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#5.2.5

1 None: Re: Novice user's question.   (Peter Gumplinger - 17 Apr, 2003)
None Re: Novice user's question.  by michel maire <michel maire>,   16 Apr, 2003

User ptr wrote:

>> 1) Where can i get an optical surfaces descriptions? Such as:
>>         MySurface->SetType(???);
>>         MySurface->SetFinish(???);
>>         MySurface->SetModel(???);
>> 2) If premade materials such as Air are exists, where can i
>>    found a desciption of them?
>> 
>> 3) Emmm... Can somebody show me the way to create a simple
>>    absorber for optical photons?
>> 
>>    

 examples/novice/N06

1 None: Re: Novice user's question.   (Peter Gumplinger - 16 Apr, 2003)
(_ None: Re: Novice user's question.   (Peter Gumplinger - 17 Apr, 2003)
None Novice user's question.  by ptr <ptr@msu.dubna.ru>,   16 Apr, 2003

1) Where can i get an optical surfaces descriptions? Such as:
	MySurface->SetType(???);
	MySurface->SetFinish(???);
	MySurface->SetModel(???);
2) If premade materials such as Air are exists, where can i
   found a desciption of them?

3) Emmm... Can somebody show me the way to create a simple
   absorber for optical photons?

   

1 None: Re: Novice user's question.   (michel maire - 16 Apr, 2003)
(_ None: Re: Novice user's question.   (Peter Gumplinger - 16 Apr, 2003)
(_ None: Re: Novice user's question.   (Peter Gumplinger - 17 Apr, 2003)
None Re: Problems with the G4OpticalSurfaces  Keywords: Problems with implementing G4OpticalSurface for multiple tubes.
by Meiling Yu <yuml@mail.ihep.ac.cn>,   28 Jul, 2003

Yes. I made three different logical volumes and then placed them only once as a test. It seemed somewhere in my program is wrong, could I have your code on the revised exampleN06?

Thanks a lot

MeilingYu

Disagree Re: Problems with the G4OpticalSurfaces  Keywords: Problems with implementing G4OpticalSurface for multiple tubes.
by Gumplinger Peter <Gumplinger Peter>,   28 Jul, 2003

I have just changed exampleN06 to place eight 'air bubbles'. I do this with a loop defining only one logical volume and eight placements.

Optical photons see each and every one of them and the G4OpBoundaryProcess treats them as a water/air interface.

I don't understand what you mean with "but if I place these volumes seperately"? Are you making 18 different logical volumes and then place each one of them only once?

1 None: Re: Problems with the G4OpticalSurfaces   (Meiling Yu - 28 Jul, 2003)
Question Re: Problems with the G4OpticalSurfaces  Keywords: Problems with implementing G4OpticalSurface for multiple tubes.
by Meiling Yu <yuml@mail.ihep.ac.cn>,   28 Jul, 2003

I met almost the same problem though the volumes are positioned by G4PVPlacement. when I place these volumes in a loop, i.e.

for(int j=0;j<19;j++)
{
posX=halfwaterx-(j+1)*halfwaterx/10;
trapePhys=new G4PVPlacement(0,G4ThreeVector(posX,-posY,0.*m),
                 trapeLog,"trapePhy",waterTank_log,false,j);
        }

the surface won't reflect, but if I place these volumes seperately, then it works. I don't know why. Maybe it's because that every volume at different position has to have its own logical volume, however, when I do the above loop, all of these volumes have the same logical volume. Is it Geant4 designed to be or is there bug in my program? I'm not sure.

Thanks

Meiling Yu

1 Disagree: Re: Problems with the G4OpticalSurfaces   (Peter Gumplinger - 28 Jul, 2003)
(_ None: Re: Problems with the G4OpticalSurfaces   (Meiling Yu - 28 Jul, 2003)
None Re: Problems with the G4OpticalSurfaces  Keywords: Problems with implementing G4OpticalSurface for multiple tubes.
by Gumplinger Peter <Gumplinger Peter>,   11 Jul, 2003

Sorry, you happened to post your desperate message on the very the day I went on an extended vacation.

Please, note that for the optical boundary process to use a border surface, the two volumes must have been positioned with G4PVPlacement. I don't know why you'd use G4UnionSolid to place tubes inside a box,but then again, I am not familiar with the concept of G4UnionSolid; but this may be part of your problem.

The last time I looked the signature of G4LogicalBorderSurface was:

G4LogicalBorderSurface* Surface = new
                            G4LogicalBorderSurface("name",volume1,volume2,OpSurface);

1 Question: Re: Problems with the G4OpticalSurfaces   (Meiling Yu - 28 Jul, 2003)
(_ Disagree: Re: Problems with the G4OpticalSurfaces   (Peter Gumplinger - 28 Jul, 2003)
(_ None: Re: Problems with the G4OpticalSurfaces   (Meiling Yu - 28 Jul, 2003)
Sad Problems with the G4OpticalSurfaces  Keywords: Problems with implementing G4OpticalSurface for multiple tubes.
by Rohit Nambyar <rohitn@iastate.edu>,   11 Jun, 2003
Hello:

I am having a problem with G4OpticalSurfaces in my Detector geometry. I 
have created a Spaghetti Calorimeter, with the help of G4Box and placing 
multiple G4Tubs into the box, with the help of G4UnionSolid and G4PVPlacement. 

The tubes are made of Air and the Box is made up of Lead(Pb). I wanted to make 
the inside of the tube to be reflective using G4OpticalSurface, so that
it would reflect the optical photons that are going into the box. But for some
reason the tubes do not seem to be reflecting the opticalphotons. The 
Opticalphotons just seem to stop (maybe it gets absorbed) when they touch 
the walls of the tube. 

I have tried both the methods of using G4LogicalSkinSurface and G4LogicalBorderSurface,
but with no success at all. I tried to implement the G4logicalSkinSurface
with only one tube in the box, and the opticalphotons were being reflected in the tube quite
normally. 

I suspect that my problem is because I am using multiple tubes,and for some reason the
the G4OpticalSurfaces is not working with multiple tubes. Each 'Tube'
is actually a cylinder, with 0 inner radius and fixed outer radius.

If you could please help with this problem I am having, Or tell me why the
Optical properties work, when there is only one tube in the box and does
not work when there are multiple tubes in the box. Thanks in advance, your help is 
greatly appreciated.

Thank you

Rohit Nambyar

Here is the necesarry code snippets that show the problem that I am having.



// Here  materials and the reflective properties being generated.
// I have already defined the materials Air, Water, Pb, Vacuum above 
// in the program.
//------------ Generate & Add Material Properties Table ------------
  
  const G4int NUMENTRIES = 32;

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

  G4double RINDEX1[NUMENTRIES] =
            { 1.3435, 1.344,  1.3445, 1.345,  1.3455,
              1.346,  1.3465, 1.347,  1.3475, 1.348,
              1.3485, 1.3492, 1.35,   1.3505, 1.351,
              1.3518, 1.3522, 1.3530, 1.3535, 1.354,
              1.3545, 1.355,  1.3555, 1.356,  1.3568,
              1.3572, 1.358,  1.3585, 1.359,  1.3595,
              1.36,   1.3608};
  
  G4double n = 1.001;
  G4double RINDEX2[NUMENTRIES] = {n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n};
  
  n = 1.00;
  G4double RINDEX3[NUMENTRIES] = {n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n};
  G4double R = 0.9;
  G4double Reflectivity[NUMENTRIES]= {R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R};
	       
  G4MaterialPropertiesTable *myMPT1 = new G4MaterialPropertiesTable();
  myMPT1->AddProperty("RINDEX", PPCKOV, RINDEX1, NUMENTRIES);

  Water->SetMaterialPropertiesTable(myMPT1);
  
  G4MaterialPropertiesTable *myMPT2 = new G4MaterialPropertiesTable();
  G4MaterialPropertiesTable *myMPT3 = new G4MaterialPropertiesTable();
  
  myMPT2->AddProperty("RINDEX", PPCKOV, RINDEX2, NUMENTRIES);  
  myMPT3->AddProperty("RINDEX", PPCKOV, RINDEX3, NUMENTRIES);

  Air->SetMaterialPropertiesTable(myMPT2);
  Vacuum->SetMaterialPropertiesTable(myMPT3); 

  G4MaterialPropertiesTable *mirror_mt = new G4MaterialPropertiesTable();
  mirror_mt->AddProperty("REFLECTIVITY",PPCKOV,Reflectivity,NUMENTRIES);

  G4MaterialPropertiesTable *mirror_mt_sd= new G4MaterialPropertiesTable();
  mirror_mt_sd->AddProperty("REFLECTIVITY",PPCKOV,Reflectivity,NUMENTRIES);

// Here is the box where the tubes are inserted later on.
/-----------------------------------
//  Carrier ==> The Lead Box
//-----------------------------------

  G4double CarrierX = 22.*cm; 
  G4Box* solidCarrier = new G4Box("Carrier",CarrierX/2,CalorSizeY/2,CalorSizeZ/2);
  G4LogicalVolume* logicCarrier = new G4LogicalVolume(solidCarrier ,Pb, "Carrier",0,0,0);  // Material = Air "Tracker"
  G4VPhysicalVolume*  physiCarrier = new G4PVPlacement(0,                 // no rotation
  				                       positionTracker,   // at (x,y,z)
				  		       "Carrier",         // its name
				                       logicCarrier,      // its logical volume
				                       physiTracker,      // its mother  volume
				                       false,             // no boolean operations
				                       0);                // no particular field 

 // Here are the optical properties of the box.
  G4OpticalSurface* OpCarrierSurface = new G4OpticalSurface("CarrierSurface",unified,polished,dielectric_metal);
  G4LogicalBorderSurface* CarrierSurface = new G4LogicalBorderSurface("CarrierSurface",
				                                      physiCarrier,physiWorld,
				                                      physiCarrier,physiTracker,
 				                                      OpCarrierSurface);
  OpCarrierSurface->SetMaterialPropertiesTable(mirror_mt);

// Here are the tubes themselves
//------------------------------------------
//   Rods
//------------------------------------------

 // These are the tubes that are placed inside the box!
 
  G4int num;
  G4double Radius;
  G4double step;
  G4double delta;

  num = 1;             // The number of tubes being placed in the y direction.
  delta = 13.8*mm;     // The distance between the tubes in the y axis direction.
  step = delta;
  Radius = 2.*mm;

  G4Tubs* s_rod;
  G4LogicalVolume* l_rod;
  G4VPhysicalVolume* ph_rod;

  G4VSolid* temp; G4VSolid* temp2;
  G4VSolid* temp1; G4VSolid* rods_1;G4VSolid* rods_2;

  G4RotationMatrix rot;
  rot.rotateY(0.0*deg);

// Rods 1
//----begin----

  s_rod = new G4Tubs("Rod",0.,Radius,15.*cm/*CarrierX/2*/,0.*rad,2*pi*rad);
  temp = s_rod;

  G4int k;
  for(k=1;k<=num;k++)
  {
     temp2 = new G4UnionSolid("dva",s_rod,temp,G4Transform3D(rot,G4ThreeVector(0.*mm,delta,0.*mm)));
     temp = temp2;
  }
  
  rods_1=temp;
  
  G4VSolid* s_layer;
  G4VSolid* temp3;
  s_layer=temp; 
  temp3=temp;
  
  for(k=1;k<=20;k++)
  {
     temp2 = new G4UnionSolid("Detector",s_layer,temp3,G4Transform3D(rot,G4ThreeVector(10.*mm,0.*mm,0.*mm)));
     temp3=temp2;
  }
  
  l_rod = new G4LogicalVolume(temp3,Air,"Rod"); // Here I am changing the material of the rod from Pb to Air.
  ph_rod = new G4PVPlacement( 0,G4ThreeVector(-CarrierX/2+1.*cm,-90.,0.),"Rod",l_rod,physiCarrier,false,0);
    
  
// Here is where I am defining the optical properties of the tubes. And 
// Here is where the problem is. Am I implementing the G4LogicalSkinSurface
// or the G4LogicalBorderSurface. As you can see I have tried both methods
// but both give me the same problems. I will show you how I have implemented both
// of course when I test the code I comment the other one out.
   

  
  G4OpticalSurface* SkinSurface = new G4OpticalSurface("SkinSurf",unified,polished,dielectric_metal);
 
// HERE ARE THE TWO THINGS I HAVE TRIED ANF FAILED AT IMPLEMENTING. 
// 1). Using the G4LogicalSkinSurface  
  G4LogicalSkinSurface* CavitySkin = new G4LogicalSkinSurface("CavitySkin",l_rod,SkinSurface);
  
// 2). Using the G4logicalBorderSurfa=ce  
  G4LogicalBorderSurface* RodSurface = new G4LogicalBorderSurface("AbsSurface",physiCarrier,ph_rod,OpRodSurface);
  
  SkinSurface->SetMaterialPropertiesTable(mirror_mt);



1 None: Re: Problems with the G4OpticalSurfaces   (Peter Gumplinger - 11 Jul, 2003)
(_ Question: Re: Problems with the G4OpticalSurfaces   (Meiling Yu - 28 Jul, 2003)
(_ Disagree: Re: Problems with the G4OpticalSurfaces   (Peter Gumplinger - 28 Jul, 2003)
(_ None: Re: Problems with the G4OpticalSurfaces   (Meiling Yu - 28 Jul, 2003)
Question Re: Optical Surface properties  Keywords: rindex optical surface
by Vlasios Vasileiou <Vlasios Vasileiou>,   18 Mar, 2004
Thanks for your prompt answer,

My case of interest is about a thick tyvek lining on the inner walls of a container. The tyvek is in contact with water.

I suppose that we don't have any thin layers between the tyvek and the material of the container, so the best choice is "ground".

Is this correct?


Vlasios
Feedback Re: Optical Surface properties  Keywords: rindex optical surface
by Gumplinger Peter <Gumplinger Peter>,   17 Mar, 2004

In the UNIFIED model, the 'theFinish' option of either "polishedbackpainted" or "groundbackpainted" (notice, it says "BACKpainted") allows for the situation where a thin optical layer is between the physical volume and the reflective paint (or reflector) without having to specify this layer as a separate geometrical volume in the simulation. For example, if you have a Al wrapping tight around a volume (scintillator), there'll be a thin air layer. It is the index of refraction of this thin layer that the user specifies when he/she specifies the G4OpticalSurface for the volume.

G4OpSurface* OpSurface = new G4OpticalSurface("name"); OpSurface -> SetType(dielectric_dielectric); OpSurface -> SetModel(unified); OpSurface -> SetFinish(groundbackpainted);

const G4int NUM = 2;

G4double pp[NUM] = {2.038*eV, 4.144*eV}; G4double rindex[NUM] = {1.35, 1.40};

G4MaterialPropertiesTable* SMPT = new G4MaterialPropertiesTable();

SMPT -> AddProperty("RINDEX",pp,rindex,NUM); OpSurface -> SetMaterialPropertiesTable(SMPT);

For more explanation please look at:

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

http://geant4.slac.stanford.edu/UsersWorkshop/G4Lectures/Peter/moisan.ps

Hope this helps,

Peter

1 Question: Re: Optical Surface properties   (Vlasios Vasileiou - 18 Mar, 2004)
Question Optical Surface properties  Keywords: rindex optical surface
by Vlasios Vasileiou <Vlasios Vasileiou>,   17 Mar, 2004
From the code G4OpBoundaryProcess.hh I see that when an optical surface
is painted then the process tries to find a RINDEX parameter from the
optical surface's parameter table.


This RINDEX is for which material? The paterial of the paint, the material
of Prepoststeppoint or the one of the poststeppoint?

Thanks,
Vlasios Vasileiou



  if (theFinish == polishedbackpainted ||
                  theFinish == groundbackpainted ) {
                  Rindex =
                  aMaterialPropertiesTable->GetProperty("RINDEX");
                  if (Rindex) {
                     Rindex2 = Rindex->GetProperty(thePhotonMomentum);
                  }
                  else {
                     aParticleChange.SetStatusChange(fStopAndKill);
                     return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
                  }
              }
                                                                                                                                                                                                     
1 Feedback: Re: Optical Surface properties   (Peter Gumplinger - 17 Mar, 2004)
(_ Question: Re: Optical Surface properties   (Vlasios Vasileiou - 18 Mar, 2004)
Feedback Re: Surface conditions for CSG (Need Clarification for BREP)  Keywords: BREP, CSG, optical surface condition
by Gumplinger Peter <Gumplinger Peter>,   13 Jul, 2005

> Does this mean that there is also no way to define different surface

> properties for the different faces of a BREP solid without creating an

> extra volume adjacent to each face?

Yes, I don't see how, given that the constructor of G4LogicalBoundarySurface takes two G4VPhysicalVolume(s) as arguments.

Question Re: Surface conditions for CSG (Need Clarification for BREP)  Keywords: BREP, CSG, optical surface condition
by Christine Dumoulin <dumoulic@research.ge.com>,   13 Jul, 2005

Regarding the last statement of the post above: (G4LogicalSkinSurface takes a G4LogicalVolume* as argument in the constructor. G4LogicalBorderSurface takes two G4VPhysicalVolume* as arguments in the constructor. This has nothing to do with how the volume itself is defined, CSG or BREP.)

Does this mean that there is also no way to define different surface properties for the different faces of a BREP solid without creating an extra volume adjacent to each face?

1 Feedback: Re: Surface conditions for CSG (Need Clarification for BREP)   (Peter Gumplinger - 13 Jul, 2005)
Feedback Re: Surface conditions for CSG  Keywords: BREP, CSG, optical surface condition
by Gumplinger Peter <Gumplinger Peter>,   25 Feb, 2005

While the G4LogicalSkinSurface is the same surface for all faces of a CSG, this is not necessarily the case when you use a G4LogicalBorderSurface. In fact, the G4LogicalBorderSurface is define by TWO volumes, i.e. the two volumes on each side of the face. So, now if you want to have six different surfaces, one for each side of your G4Box, what you need to do is contact each face with a different outside volume. These extraneous volumes can all be filled with the same material, if that's the reality for the world around this CSG, so long as they are different G4VPhysicalVolume objects. They can also be very thin.

For you this is even the real physical situation where each face shares a boundary with a different material.

Hope this answers your question.

(G4LogicalSkinSurface takes a G4LogicalVolume* as argument in the constructor. G4LogicalBorderSurface takes two G4VPhysicalVolume* as arguments in the constructor. This has nothing to do with how the volume itself is defined, CSG or BREP.)

1 Question: Re: Surface conditions for CSG (Need Clarification for BREP)   (Christine Dumoulin - 13 Jul, 2005)
(_ Feedback: Re: Surface conditions for CSG (Need Clarification for BREP)   (Peter Gumplinger - 13 Jul, 2005)
Question Surface conditions for CSG  Keywords: BREP, CSG, optical surface condition
by <smitha.thrivikraman@geind.ge.com>,   22 Feb, 2005

Is it possible to assign different optical surface conditions to different surfaces of a CSG solid? By optical surface condition I mean surface type, surface finish and surface model. If I have a cube that is made up of a certain material would it be possible to have all six faces of the cube to have different optical surfaces? If I understand right, it should be possible using a BREP solid where one defines 6 planes of different optical surfaces and allign them in the required space to make a cube. I would like to know if this is possible for CSG Solids. In that case one could define a cube as a G4box and define different optical surface properties to each face. This is useful in the study cases where the cube shares boundary with a different material on each face.

1 Feedback: Re: Surface conditions for CSG   (Peter Gumplinger - 25 Feb, 2005)
(_ Question: Re: Surface conditions for CSG (Need Clarification for BREP)   (Christine Dumoulin - 13 Jul, 2005)
(_ Feedback: Re: Surface conditions for CSG (Need Clarification for BREP)   (Peter Gumplinger - 13 Jul, 2005)
Feedback Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   Keywords: surface absorbing diffuse
by Gumplinger Peter <Gumplinger Peter>,   28 Jul, 2005

> The value of G4double polish should be set to 0.0 (default), isn't it?

No, with the 'glisur' model, the opposite, polish=1.0, is default:

        G4OpticalSurface(const G4String& name,
                         G4OpticalSurfaceModel model = glisur,
                         G4OpticalSurfaceFinish finish = polished,
                         G4SurfaceType type = dielectric_dielectric,
                         G4double value = 1.0);

> I use the G4AssemblyVolume class to construct the scintillator,

I have never used G4AssemblyVolume. In fact, I don't really know what it does but I question whether you actually need to resort to it for your application.

> Could I use the same "code logic" in case of the glisur-model but
> dielectric_dielectric?

No, in the glisur-model, the 'REFLECTIVITY' is only associated with a reflector; a 'dielectric_metal' G4SurfaceType. However, this reflector doesn't actually have to be a 'metal', in the chemical sense, it can also be a 'paint' (epoxy).

You could use the unified-model. In that case, you can specify: finish = groundfrontpainted and you will have a 'REFLECTIFITY' associated with the 'dielectric_dielectric' type.

I suggest you stick your array of NaI modules into a mother volume which is as large as the array's outside dimensions (your EpoxyElement_log). Then, your code snippet is correct, except for either:

new G4OpticalSurface("EpoxySurface",glisur,ground,dielectric_metal,0.0);

or

new G4OpticalSurface("EpoxySurface",unified,groundfrontpainted,
                                                dielectric_dielectric);

Now, this encloses your scintillator array completely and optical photons reflect everywhere. Where is your photon sensor?

Feedback Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   Keywords: surface absorbing diffuse
by Maria Lucia <lucia.magliozzi@iss.infn.it>,   28 Jul, 2005
Hi and... Thank you!

Could I use the same "code logic" in case 
of the glisur-model but dielectric_dielectric?

I have to model an element of a NaI scintillator,
composed by a scintillator crystal inclused in a 
box of epoxy--EpoxyElement_log--.

I use the G4AssemblyVolume class to construct 
the scintillator, so I can't define the surface optical properties
by means of border surface(crystals/epoxy).

The scintillator optical properties are attached 
as skin surface properties
to the logical volume EpoxyElement_log.  

It has to be 98% diffusive and 2% absorbing.

This is the fragment of my code

  //**Epoxy element surface properties
  const G4int num = 2;
  G4double Ephoton[num] = {2.58*eV , 3.54*eV};

  G4OpticalSurface* Epoxy_OpSurf 
   = new G4OpticalSurface("EpoxySurface",glisur,ground,dielectric_dielectric);
  G4double Epoxy_REF[num] = {0.98, 0.98};  
  G4MaterialPropertiesTable* EpoxyEl_mpt 
   = new G4MaterialPropertiesTable();
  EpoxyEl_mpt->AddProperty("REFLECTIVITY", Ephoton, Epoxy_REF, num);
  Epoxy_OpSurf->SetMaterialPropertiesTable(EpoxyEl_mpt);
  G4LogicalSkinSurface* Epoxy_Surf 
    =  new G4LogicalSkinSurface("Epoxy_Surf", EpoxyElement_log, Epoxy_OpSurf );

Is it the implementation of what i want to do?

The value of G4double polish should be set to 0.0 (default),
isn't it?

Thank you in advantage

MLucia

1 Feedback: Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   (Peter Gumplinger - 28 Jul, 2005)
Feedback Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   Keywords: surface absorbing diffuse
by Gumplinger Peter <Gumplinger Peter>,   26 Jul, 2005

Please, take a look at the Application Developers Manual's: Source listing 5.2.10 (for example).

You need to specify, in case of the glisur-model and dielectric_metal:

OpSurface -> SetFinish(ground); // for diffuse reflector

and just how diffuse with:

G4double polish = 0.0;

OpSurface -> SetPolish(polish);

The value 0 means maximum roughness with effective plane of reflection distributed as cos(alpha) where alpha is the angle between the unit normal to the effective plane of reflection and the normal to the nominal medium boundary. The value 1 means perfect smoothness. In between the surface is modeled as a bell-shaped distribution in alpha with limits given by:

sin(alpha) = +-(1 - value)

When the value = 0 the distribution of the normal to the surface is ~ cos(theta).

Also, the reflectivity as 0.98 for the range of frequencies in question:

OpSurfaceProperty = AddProperty("REFLECTIVITY",pp,reflectivity,NUM);

1 Feedback: Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   (Maria Lucia - 28 Jul, 2005)
(_ Feedback: Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   (Peter Gumplinger - 28 Jul, 2005)
Question Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   Keywords: surface absorbing diffuse
by Maria Lucia Magliozzi <lucia.magliozzi@iss.infn.it>,   18 Jul, 2005
Dear G4Users,

I'm trying to model a segmented scintillator:
NaI crystals inclused in an epoxy matrix.

I have problems simulating the scintillator's behaviour:
particulary to set the attributes of the surfaces 
defined by the boundary of the epoxy matrix and the inclused crystals.

The surface has to diffuse optical photon (98%) or  
absorbing (2%) them.

How could I implement it???

Thank you for your help,
you are so efficient!!!


Maria Lucia Magliozzi
1 Feedback: Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   (Peter Gumplinger - 26 Jul, 2005)
(_ Feedback: Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   (Maria Lucia - 28 Jul, 2005)
(_ Feedback: Re: Surface Properties:how to model a diffusive (98%) and absorbing (2%) surface   (Peter Gumplinger - 28 Jul, 2005)
Disagree Re: wrapped cerenkov  by Gumplinger Peter <Gumplinger Peter>,   31 Jul, 2006

In my reply above, I wrote

> while:
>
> SMPT -> AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
>
> and 'polishedbackpainted' or 'groundbackpainted' concern the wrapping.

but what I meant to say is that the 'backpainted' part of the specification specifies a wrapping. In truth, the 'polished' and 'ground' part of the specification concern the initial interface between the radiator and the thin dielectric layer.

Similarly, I was wrong in writing:

> SetFinish(groundbackpainted) or SetFinish(polishedbackpainted)
>
> depending on whether your wrapping is a diffuse or polished reflector.

The wrapping itself is ALWAYS assumed to be a Lambertian reflector; i.e. an "external diffuse reflector" for those photons which are refracted (transmitted) through the surface interface into the thin dielectric layer.

Feedback Re: wrapped cerenkov  by Gumplinger Peter <Gumplinger Peter>,   17 Oct, 2005

Andreas,

Sorry for the delay in response but your posting was just brought to my attention.

It seems to me that you want to define your G4OpticalSurface along the lines of 'Source listing 5.2.9' in the Application Developers Manual:

SetFinish(groundbackpainted) or SetFinish(polishedbackpainted)

depending on whether your wrapping is a diffuse or polished reflector.

'backpainted' means that there is a dielectric layer between your detector and the wrapping (not the case with 'frontpainted').

myST1->AddProperty("RINDEX", Ephoton, RefractiveIndex, num);

This sets the refractive index of the dielectric layer between your detector and the wrapping. Note, with the wrapping (paint) in place, the refractive index of the physiWorld outside is of no significance.

myST1 -> AddProperty("REFLECTIVITY",pp,reflectivity,NUM);

This sets the reflectivity of your back-wrapping; i.e. your wapping may not be a perfect reflector. - The EFFICIENCY is not really required because photons absorbed by the wrapping don't get counted as "detected".

Note,

OpSurface -> SetSigmaAlpha(sigma_alpha);

SMPT -> AddProperty("SPECULARLOBECONSTANT",pp,specularlobe,NUM);

SMPT -> AddProperty("SPECULARSPIKECONSTANT",pp,specularspike,NUM);

SMPT -> AddProperty("BACKSCATTERCONSTANT",pp,backscatter,NUM);

concern the interface between your detector and the thin dielectric layer between it and the wrapping, while:

SMPT -> AddProperty("REFLECTIVITY",pp,reflectivity,NUM);

and 'polishedbackpainted' or 'groundbackpainted' concern the wrapping.

Hope this helps, Peter

1 Disagree: Re: wrapped cerenkov   (Peter Gumplinger - 31 Jul, 2006)
Question wrapped cerenkov  by andreas battaglia <andreas.battaglia@roma1.infn.it>,   11 Oct, 2005
I'm trying to simulate a cerenkov counter wrapped with some material.

With example NO6's help, I've already simulated a leadglass (PbGl) cerenkov 
counter without wrapping surrounded by air; this should be my code:


// ------------ Generate & Add Material Properties Table ------------

  const G4int nEntries = ...;
  G4double PhotonEnergy[nEntries] = { ... };
  
//
// LeadGlass
//	      
  G4double RefractiveIndex1[nEntries] = { ... };
  G4double Absorption1[nEntries] = { ... };   
  G4double ScintilFast[nEntries] = { ... };            
  G4double ScintilSlow[nEntries] = { ... };
            

  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", ...);
  myMPT1->AddConstProperty("RESOLUTIONSCALE", ...);
  myMPT1->AddConstProperty("FASTTIMECONSTANT", ...);
  myMPT1->AddConstProperty("SLOWTIMECONSTANT", ...);
  myMPT1->AddConstProperty("YIELDRATIO", ...);
  
  PbGl->SetMaterialPropertiesTable(myMPT1);


// Air

  G4double RefractiveIndex2[nEntries] = { ... };     

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


//	------------- Surfaces --------------

// LeadGlass

  G4OpticalSurface* OpPbGlSurface = new G4OpticalSurface("PbGl");
  OpPbGlSurface->SetType(dielectric_dielectric);
  OpPbGlSurface->SetFinish(ground);
  OpPbGlSurface->SetModel(unified);

  G4LogicalBorderSurface* PbGlSurface = 
                                 new G4LogicalBorderSurface("PbGl",
                                 physiCerenkov,physiWorld,OpPbGlSurface);


  //OpticalPbGlSurface 
  
  const G4int num = ...;
  G4double Ephoton[num] = { ... };  
  G4double RefractiveIndex[num] = { ... };
  G4double SpecularLobe[num]    = { ... };
  G4double SpecularSpike[num]   = { ... };
  G4double Backscatter[num]     = { ... };

  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);

  OpPbGlSurface->SetMaterialPropertiesTable(myST1);



Now I'd like to add the wrapping; could you please help me ?

(I've read the documentation in the user develope manual and the Levin and Moisan's
article:"A More Physical Approach to Model the Surface Treatment of Scintillation
Counters and its Implementation into DETECT" , about the unified model.
I think I have understood that is possible to add a reflective coat or a painting
by specifying its refractive index and perhaps using "groundfrontpaint" 
or "groundbackpaint" (which is the difference in my case?) finish.
But actually I don't know how!!!)


Thanks a lot

Andreas
1 Feedback: Re: wrapped cerenkov   (Peter Gumplinger - 17 Oct, 2005)
(_ Disagree: Re: wrapped cerenkov   (Peter Gumplinger - 31 Jul, 2006)
Feedback Re: how to define optical surface properties of interface between non-metal and metal? &#20316;&#32773;&#65306; Y  by Gumplinger Peter <Gumplinger Peter>,   23 Feb, 2006

Let me point out again that you do NOT have to specify a G4OpticalSurface if the surface you want to model is perfectly polished and of type dielectric_dielectric. Conversely, if you have an interface between two dielectric media and you haven't done anything except attached a G4MaterialPropertiesTable with the index of refraction to each of the volumes on either side of the interface, optical photons will see that surface as polished and as a dielectric_dielectric interface governed by Snell's Law, Law of Reflection and the Fresnel Equations.

In your case, you did not have to specify 'OpScintSurface' although there is certainly nothing wrong with doing so.

I must assume that you position the 'cath_log' volume so that there is a thin gap between it and the 'scint_log' volume. Both scint_log and cath_log are positioned inside some larger volume (housing) and the gap is then made up of the material of the 'housing'. If that material has an index of refraction, the photons crossing the gap will first encounter the (default) dielectric_dielectric polished interface between scintillator and 'housing' and then across the gap encounter the dielectric_metal skin of the cathode.

Question how to define optical surface properties of interface between non-metal and metal? &#20316;&#32773;&#65306; Yan  by dingdang <xiongsl@ihep.ac.cn>,   14 Feb, 2006

I defined a plastic scintillator with a surface like this:
  G4OpticalSurface* OpScintSurface =     new G4OpticalSurface("ScintSurface",glisur,polished,dielectric_dielectric); 
  new G4LogicalSkinSurface("scint_surf",scin_log,OpScintSurface);

and a pmt with Al cathode like this:
  G4double photocath_EFF[num]={0.26,0.27,0.27,0.28,0.28,0.29,0.29,0.30,0.30,0.30,0.29,0.28,0.28,0.27,0.27,0.26,0.26,0.25,0.25,0.24,0.23,0.22,0.22,0.21,0.21,0.20,0.20,0.19,0.18};
  G4double photocath_REFL[num]={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};
  G4MaterialPropertiesTable* photocath_mt = new G4MaterialPropertiesTable();
  photocath_mt->AddProperty("EFFICIENCY",Ephoton,photocath_EFF,num);
  photocath_mt->AddProperty("REFLECTIVITY",Ephoton,photocath_REFL,num);
  G4OpticalSurface* photocath_opsurf=
    new G4OpticalSurface("photocath_opsurf",glisur,polished,dielectric_metal);
  photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
  new G4LogicalSkinSurface("photocath_surf",cath_log,photocath_opsurf);

There should exist a thin non-metal interface whick is contacted with the non-metal plastic scintillator at one side and the pmt at the other side. How should I define the optical surface properties for this part?

1 Feedback: Re: how to define optical surface properties of interface between non-metal and metal? &#20316;&#32773;&#65306; Y   (Peter Gumplinger - 23 Feb, 2006)
Feedback Re: Surface reflectivity  by Gumplinger Peter <Gumplinger Peter>,   23 Feb, 2006

> 2) define a dielectric_dielectric groundfrontpainted surface: in this case....

I think you meant to write 'groundbackpainted' (you can also use 'groundfrontpainted' but the result is the same as your approach 1)

> Now, if all this is correct, ....

I see a problem, you need to specify:

OpSurface -> SetType(dielectric_dielectric);

for 'backpainted' (see Source listing 5.2.9 in the Application Developers Guide).

> how can I check the reflectivity, in particular in the second case?

Yes, counting reflections in 1) is easy. The photon reflects off the metal surface only once or it is absorbed. The probability of absortion is sampled from "Reflectivity".

In the second case, what happens is somewhat more involved. A photon encountering a 'backpainted' surface can do several things. It can be totally internally reflected on the interface of scintillator/air-gap. This 'reflectivity' has nothing to do with the wrapping and depends on the incident angle and the index of refraction of scintillator and the air-gap. It can also be Fresnel reflected. If the photon is Fresnel refracted out and into the air-gap it will reflect off the wrapping (backpaint) with set probability. It then encounters the air/scintillator interface again. If the wrapping was perfectly polished, I gather, it'll refract out of the air-gap and back into the scintillator. If not, the incident angle may have changed from the rough wrapping and a reflection occurs or it Fresnel reflects on that interface and bounces back to the wrapping where the reflectivity is sampled yet again. So, the set reflectivity for the wrapping is convoluted with the bounce history the photon takes and in general the simulated reflectivity will be lower than the set reflectivity for the wrapping.

theStatus is the last thing that happens to the photon as its bounces are simulated internally to the G4OpBoundaryProcess routine.

Question Surface reflectivity  by andreas battaglia <andreas.battaglia@roma1.infn.it>,   20 Feb, 2006
Hallo,
I'm simulating a scintillator wrapped with tyvek;
I'd like to set the Scintillator-Wrapping surface reflectivity at a given value.
I found two ways to do that:

1) define a dielectric_metal surface: in this case a photon can only be reflected (with a probability you can set) or absorped by the surface (it can not enter the surface being refracted); the code should be:


    //Scintillator-Wrapping Surface

      G4OpticalSurface* OpScintSurface = new G4OpticalSurface("ScintSurface");
      OpScintSurface->SetType(dielectric_metal);
      OpScintSurface->SetFinish(ground);
      OpScintSurface->SetModel(unified);
      G4LogicalBorderSurface* ScintSurface = new G4LogicalBorderSurface("ScintSurface", physiScintCore,physiScintSlice,OpScintSurface);     
      
      G4double Reflectivity[nEntriesTyvek] = { 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97};

      G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();      
      myST1->AddProperty("REFLECTIVITY", PhotonEnergyTyvek, Reflectivity, nEntriesTyvek);      
      OpScintSurface->SetMaterialPropertiesTable(myST1);



2) define a dielectric_dielectric groundfrontpainted surface: in this case (without writing a dedicated volume) G4 simulates a thin air gap between the wrapping and the scintillator.
The far side of the optical surface (the back-paint) is simulated as a Lambertian reflector with my finite reflectivity. 
What should happen is that photons either totally internal reflect off the scintillator/air gap, or enter the air gap (refraction on the scintillator/air interface), and then reflect or get absorbed off of the 'back-paint'. 
If they are reflected off the 'back-paint' they may then Fresnel refract back into the scintillator or Fresnel reflect off theair/scintillator surface. If they reflect, they bounce back to the paint and the cycle continues. 
The code in this case should be:


      //Scintillator-Wrapping

      G4OpticalSurface* OpScintSurface = new G4OpticalSurface("ScintSurface");
      G4double sigma_alpha = 0;
      OpScintSurface -> SetSigmaAlpha(sigma_alpha);
      OpScintSurface->SetType(dielectric_metal);
      OpScintSurface->SetFinish(groundbackpainted);
      OpScintSurface->SetModel(unified);
      G4LogicalBorderSurface* ScintSurface = new G4LogicalBorderSurface("ScintSurface", physiScintCore,physiScintSlice,OpScintSurface);

      G4double Reflectivity[nEntriesTyvek] = { 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97};
      G4double RefractiveIndexAir[nEntriesTyvek] =  { 1, 1, 1, 1, 1, 1, 1, 1, 1 };

      G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();      
      myST1->AddProperty("REFLECTIVITY", PhotonEnergyTyvek, Reflectivity, nEntriesTyvek); 
       myST1->AddProperty("RINDEX",PhotonEnergyTyvek, RefractiveIndexAir, nEntriesTyvek);     
      OpScintSurface->SetMaterialPropertiesTable(myST1);



Now, if all this is correct, my question is: how can I check the reflectivity, in particular in the second case?
I have some ideas, but I'm not sure.

1) In the first case, I can simply ask the number of reflections and divide for the number of times in which a photon has reached the surface: this gave me a quite exact response.

2) In the second case, the upper method didn't work and I discovered a proportional dependence between the setted reflectivity and the number of refractions from the scintillator to the wrapping. So I supposed that the refractions counted by G4 (and written in the Step verbose) are actually those from the air gap to the scintillator (and not from the scintillator to the air gap), which are connected with the number of reflections on the air gap-wrapping surface. 
If this is correct, I supposed that a good way to check the setted reflectivity was to count the number of refractions from the scintillator to the wrapping and divide by the sum of the number of refractions from the scintillator to the wrapping and the number of absorption on the scintillator-wrapping surface.
By this method I obtained a good accordance with the setted value of reflectivity, but a little less good than the first method.

Are the check methods (in particular the second one) correct?

Thanks a lot in advantage.

Andreas Battaglia
1 Feedback: Re: Surface reflectivity   (Peter Gumplinger - 23 Feb, 2006)
Feedback Re: sigma_alpha properties  by Gumplinger Peter <Gumplinger Peter>,   02 Aug, 2006

> OpSurface -> SetSigmaAlpha(sigma_alpha);

> SMPT -> AddProperty("SPECULARLOBECONSTANT",pp,specularlobe,NUM);

> SMPT -> AddProperty("SPECULARSPIKECONSTANT",pp,specularspike,NUM);

> SMPT -> AddProperty("BACKSCATTERCONSTANT",pp,backscatter,NUM);

> concern the interface between your detector and the thin dielectric
> layer between it and the wrapping,

Yes, correct.

> while:

> SMPT -> AddProperty("REFLECTIVITY",pp,reflectivity,NUM);

> and 'polishedbackpainted' or 'groundbackpainted' concern the

> wrapping. "

No, not correct as written and as you understand my remark. What I meant is that the part 'backpainted' means there is a wrapping with intermediate thin layer (as opposed to 'frontpainted' where there is no such layer)

Also, in my same reply to http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/geometry/448/1.html I incorrectly wrote:

> SetFinish(groundbackpainted) or SetFinish(polishedbackpainted)
>
> depending on whether your wrapping is a diffuse or polished reflector.

The 'ground' and 'polished' part actually refers to the interface scintillator/dielectric layer. The wrapping itself is ALWAYS assumed to be Lambertian reflector; an "external diffuse reflector" for those photons which are refracted (transmitted) through the surface interface into the thin dielectric layer:

At:

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

In case the surface is painted or wrapped (but not a cladding), the table may include the thin layer's index of refraction. This allows the simulation of boundary effects at the intersection between the medium and the surface layer, as well as the Lambertian reflection at the far side of the thin layer.

> If revetment reflectivity is zero, all photons are absorbed by the

> wrapping.

Yes, correct

> If sigma_alpha is a property of the interface detector-dielectric

> layer

Yes, the interface of your dielectric scintillator and the thin dielectric layer between it and the wrapping.

> and groundbackpainted is a property of the wrapping, and if photons

> are all absorbed by the wrapping, then why sigma_alpha acts only if

> the wrapping is grounbackpainted and not polishedbackpainted?

Now, here 'polished' doesn't refer to the wrapping, as I corrected myself above, but to the initial dielectric interface and since it is perfectly 'polished' the sigma_alpha is ignored. It acts only if you specify "groundbackpainted"

I'll post an errata to my posting from Oct. 2005 which was confusing as it was formulated.

Question sigma_alpha properties  by Francesca Ciocia <Francesca Ciocia>,   11 Jul, 2006

Dear All, could you please help me to clarify a doubt that I have? In mail of Peter Gumplinger:

--------

Base:  Geometry
Re: Question wrapped cerenkov (andreas battaglia)
Date: Mon, 17 Oct 2005 21:04:12 GMT
From: Peter Gumplinger <gum@triumf.ca>
--------

he describes some surface properties; in particular he writes:

"Note,

OpSurface -> SetSigmaAlpha(sigma_alpha);

SMPT -> AddProperty("SPECULARLOBECONSTANT",pp,specularlobe,NUM);

SMPT -> AddProperty("SPECULARSPIKECONSTANT",pp,specularspike,NUM);

SMPT -> AddProperty("BACKSCATTERCONSTANT",pp,backscatter,NUM);

concern the interface between your detector and the thin dielectric layer between it and the wrapping, while:

SMPT -> AddProperty("REFLECTIVITY",pp,reflectivity,NUM);

and 'polishedbackpainted' or 'groundbackpainted' concern the wrapping. "

In my Geant4 program I have the following:

  G4OpticalSurface* OpYapSurface = new
G4OpticalSurface("YapSurface");
  OpYapSurface->SetModel(unified);
  OpYapSurface->SetType(dielectric_dielectric);
  OpYapSurface->SetFinish(groundbackpainted);
  OpYapSurface->SetSigmaAlpha(1.0); 
//
  G4double RefractiveIndex[num] = {1.0, 1.0};
  G4double SpecularLobe[num]    = {1.0, 1.0};
  G4double SpecularSpike[num]   = {0.0, 0.0};
  G4double Backscatter[num]     = {0.0, 0.0};
  G4double Reflectivity11[num] = {0.0, 0.0};

If revetment reflectivity is zero, all photons are absorbed by the wrapping. If sigma_alpha is a property of the interface detector-dielectric layer and groundbackpainted is a property of the wrapping, and if photons are all absorbed by the wrapping, then why sigma_alpha acts only if the wrapping is grounbackpainted and not polishedbackpainted?

Thanks in advance for your kindly reply.

Best regards, Francesca

1 Feedback: Re: sigma_alpha properties   (Peter Gumplinger - 02 Aug, 2006)
Feedback Re: Confusion on simulating a foil wrapping  Keywords: optical processes, optical surfaces
by Gumplinger Peter <Gumplinger Peter>,   17 Nov, 2006

> I've read that using 'groundbackpainted' always results in lambertian
> reflection from the wrap.

Yes, this is correct. Also, note that the 'groundbackpainted' finish applies only the 'dielectric_dielectric' surface types.

> Is this the case even with a dielectric-metal interface?

If your surface type is 'dielectric_metal' then there is no implied narrow dielectric layer between your scintillator and the metal reflector.

> Is it possible wrap a volume in a specular reflector?

Yes, but you must specify the thin air layer as a separate dielectric volume space in G4. What you have then is a dielectric_dielectic surface between the lead glass block and the air gap, and a second surface 'dielectric_metal' between the air gap and the Al wrap. The finish of the second surface can be perfectly polished resulting in a specular reflector.

As an aside, at the moment, the unified model's list of options: SpikeReflection, LobeReflection, BackScattering and LambertianReflection, in the case of 'groundbackpainted' refer to the interface of the scintillator with the implied dielectric (air) gap. The reflection of the wrapping is always lambertian. As things are coded, it is not possible to specify these choices for both this interface and for the wrapping. Allowing both choices can be considered for a future extended functionality.

Question Confusion on simulating a foil wrapping  Keywords: optical processes, optical surfaces
by Chris Cude <Chris Cude>,   31 Oct, 2006
I'm trying to simulate the propagation of optical photons in a lead
glass block wrapped with aluminized mylar(w/ an air gap).  I've read that using 
'groundbackpainted' always results in lambertian reflection from the wrap.
Is this the case even with a dielectric-metal interface?  Is it possible 
wrap a volume in a specular reflector? Thanks.

-Chris
1 Feedback: Re: Confusion on simulating a foil wrapping   (Peter Gumplinger - 17 Nov, 2006)
Feedback Re: How to define two different optical surfaces on each side of BGO slab!  Keywords: optical surface
by Gumplinger Peter <Gumplinger Peter>,   27 Nov, 2006

At the moment, in order for you to have different optical properties for different sides of the same volume you'll need to define adjacent volumes in the simulation that butt up with the various sides. For example, if the top and bottom of a G4Box 'BGO' should have different optical surfaces than the four other sides, you can place the BGO into its 'mother', then place a volume, let's call it 'needed', adjacent to both the top and bottom sides of BGO with dimensions as large as the top/bottom face and some finite (but can be very small) thickness. It is now possible to define two border surfaces, one between BGO and 'mother' which applies to the four sides, and a second and third border surface between 'detector' and 'top needed' and 'bottom needed'. The 'needed' volume can be made of the same physical material as the mother. It is needed, however, because the constructor of G4LogicalBorderSurface requires two pointers to actual G4VPhysicalVolume(s). You can now define two G4OpticalSurface(s) one attached to the one G4LogicalBorderSurface and the other G4OpticalSurface associated with your second/third border surface.

None Re: How to define two different optical surfaces on each side of BGO slab!  Keywords: optical surface
by Changchun Sun <Changchun Sun>,   10 Nov, 2006

I should mention that this BGO slab is completely enclosed by the mother volume.

1 Feedback: Re: How to define two different optical surfaces on each side of BGO slab!   (Peter Gumplinger - 27 Nov, 2006)
None How to define two different optical surfaces on each side of BGO slab!  Keywords: optical surface
by Changchun Sun <Changchun Sun>,   09 Nov, 2006

Hi All,

I have a BGO slab. I want to define two different optical surfaces on each side of BGO slab. For instance, one side is ground and another side is polished. There is any way to do that? The example N06 only shows me that the optical surface properties are same on each side of water tank.

Thanks!

Chang

1 None: Re: How to define two different optical surfaces on each side of BGO slab!   (Changchun Sun - 10 Nov, 2006)
(_ Feedback: Re: How to define two different optical surfaces on each side of BGO slab!   (Peter Gumplinger - 27 Nov, 2006)
Feedback Re: How to introduce a Hole in a LogicalBorderSurface  Keywords: BorderSurface
by Gumplinger Peter <Gumplinger Peter>,   05 Mar, 2007

Hi Jean-Eric,

What you need to do is construct your geometry such that your 'exit window' is a third volume (volume 3) butt up against your volume 1 and also a daughter of your volume 2. If that exit window is assumed to be perfectly smooth between two dialectric media you don't even have to define a LogicalBorderSurface for it. The G4 navigator will know the two volumes on each side of the boundary and only call your LogicalBorderSurface when that is volume1/volume2.

Hope this helps, Peter

None How to introduce a Hole in a LogicalBorderSurface  Keywords: BorderSurface
by <campagne@lal.in2p3.fr>,   26 Feb, 2007

Hello,

Imagine that I have a volume 1 embeded in a mother volume 2, and I describe the optical interface by using a LogicalBoderSurface. How can I introduce a hole to allow some optical photons to pass from volume 1 to volume 2 without beeing perturbed by the OpticaSurface attached to the LogicalBorderSurface?

Jean-Eric

1 Feedback: Re: How to introduce a Hole in a LogicalBorderSurface   (Peter Gumplinger - 05 Mar, 2007)
None Re: Optical problem with geometry subtraction  by alexandre Creusot <alexandre Creusot>,   21 Aug, 2008
Hi all,

  I had exactly the same problem than Withney. I used a trick to solved it...
in the file G4OpBoundaryProcess.cc:
in the G4OpBoundaryProcess::PostStepDoIt method, I skip the boundary process for the specific case of the involved volumes (and in the right order). 
If HDPE and vacuum are the material of the two volumes after the reflection then: 

  G4StepPoint *pPreStepPoint  = aStep.GetPreStepPoint();
  G4StepPoint *pPostStepPoint = aStep.GetPostStepPoint();
  if ((pPostStepPoint->GetStepStatus() == fGeomBoundary) && 
      (pPreStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetMaterial()->GetName() == "HDPE") && 
      (pPostStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetMaterial()->GetName() == "Vacuum"))
        return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);

The track is not killed anymore... it is a bit dangerous and radical... but well, this is the only way I found!

best regards, Alexandre.