Message: Problem with G4Ellipsoid surface Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problem with G4Ellipsoid surface 

Forum: Processes Involving Optical Photons
Date: 02 Jan, 2012
From: moritz v. sivers <moritz v. sivers>

Hello, I have a problem with the G4Ellipsoid class. I am simulating optical photons inside an ellipsoidal-shaped reflective housing. The interface between the housing and the experimental hall is defined as "dielectric_metal" and I have assigned some values for the reflectivity to it. Therefore, photons should be either absorbed or reflected at this interface. When I run the simulation on version 4.9.3 everything works fine. However, when I use version 4.9.2p01 some photons are transmitted through the interface. If I use a different geometry for the housing (e.g. G4Box) in version 4.9.2p01 everything seems to work though. Is there a bug with defining an optical surface using G4Ellipsoid in version 4.9.2p01? I have attached my detector construction code. Thanks in advance. Moritz

CODE:

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

#include "ExN06DetectorConstruction.hh"
#include "ExN06LDSD.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"
#include "G4Cons.hh"//
#include "G4Trd.hh"//
#include "G4Para.hh"//
#include "G4UnionSolid.hh"
#include "G4Sphere.hh"
#include "G4Paraboloid.hh"
#include "G4Ellipsoid.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"

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

ExN06DetectorConstruction::ExN06DetectorConstruction()
{
  expHall_x = expHall_y = expHall_z = 20.*cm;
}

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

ExN06DetectorConstruction::~ExN06DetectorConstruction(){;}

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

G4VPhysicalVolume* ExN06DetectorConstruction::Construct() {

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

  G4double a, z, density;
  G4int nelements;

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

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

const G4int nEntries_vac = 2;

G4double PhotonEnergy_vac[nEntries_vac] ={1.0*eV,4.5*eV};

// Vacuum
//
  G4double RefractiveIndex_vac[nEntries_vac] =
            { 1.00, 1.00 };

  G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
  myMPT2->AddProperty("RINDEX", PhotonEnergy_vac, RefractiveIndex_vac, nEntries_vac);

  Vacuum->SetMaterialPropertiesTable(myMPT2);

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

// The experimental Hall
//
  G4Box* expHall_box = new G4Box("World",expHall_x,expHall_y,expHall_z);

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

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

	expHall_log -> SetVisAttributes (G4VisAttributes::Invisible);

// refl housing //

	G4double b_hsg=1.;
	G4double a_hsg=2.;

	G4Ellipsoid* reflHousing_tubs= new G4Ellipsoid("Housing", b_hsg*cm, b_hsg*cm, a_hsg*cm, 0, 0);
	//G4Box* reflHousing_tubs= new G4Box("Housing", b_hsg*cm, b_hsg*cm, a_hsg*cm);

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

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

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

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

// // Generate & Add Material Properties Table attached to the optical surfaces //

  const G4int num_hsg = 7;
  G4double Ephoton_hsg[num_hsg] =
{4.5*eV,
3.44398055555556*eV,
3.35090000000000*eV,
3.26271842105263*eV,
3.17905897435897*eV,
3.09958250000000*eV,
1.0*eV};

//housing surface
//
	G4double Reflectivity_hsg[num_hsg] = 
{0.08,
0.08,
0.07,
0.32,
0.8,
0.98,
0.98}; 
  G4double Efficiency_hsg[num_hsg]   = {1. ,1. ,1. ,1. ,1. ,1. , 1.};

  G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();

  myST1->AddProperty("REFLECTIVITY",           Ephoton_hsg, Reflectivity_hsg, num_hsg);
  myST1->AddProperty("EFFICIENCY",             Ephoton_hsg, Efficiency_hsg,   num_hsg);

  OpHousingSurface->SetMaterialPropertiesTable(myST1);

//
//sensitive detector
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String HsgSDname = "reflHousing_sd";
    ExN06LDSD* aHsgSD = new ExN06LDSD( HsgSDname);

    SDman->AddNewDetector( aHsgSD );

            	expHall_log->SetSensitiveDetector( aHsgSD );

//always return the physical World
  return expHall_phys;
}

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

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Problem with G4Ellipsoid surface   (Gumplinger Peter - 16 Jan, 2012)
 Add Message Add Message
to: "Problem with G4Ellipsoid surface"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews