Message: Problems changing G4Polyhedra dimensions at run time. Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problems changing G4Polyhedra dimensions at run time. 

Forum: Geometry
Date: 01 Mar, 2008
From: Aczel García Ríos <acze.garcia@yahoo.es>

Hi every one!

I'm simulating the light response of a hexagonal BC501A scintillator detector in a way that I can modify its dimensions at run time using the SetGeometryForNewRun(G4double Increment) method I implemented in the DetectorConstruction and is listed below.

void DetectorConstruction::SetGeometryForNewRun(G4double Increment)
	{
	G4Polyhedra *DetectorCoat = (G4Polyhedra*)(LSDetectorCoat->GetSolid());
	G4Polyhedra *Scintillator = (G4Polyhedra*)(LSScintillator->GetSolid());

	G4PolyhedraHistorical *aPolyhedraHistorical = new G4PolyhedraHistorical;

	aPolyhedraHistorical = DetectorCoat->GetOriginalParameters();
	aPolyhedraHistorical->Rmax[0] += Increment;
	aPolyhedraHistorical->Rmax[1] = aPolyhedraHistorical->Rmax[0];
	DetectorCoat->SetOriginalParameters(aPolyhedraHistorical);

	aPolyhedraHistorical = Scintillator->GetOriginalParameters();
	aPolyhedraHistorical->Rmax[0] += Increment;
	aPolyhedraHistorical->Rmax[1] = aPolyhedraHistorical->Rmax[0];
	Scintillator->SetOriginalParameters(aPolyhedraHistorical);
	}

The geometry definition is:

G4VPhysicalVolume *DetectorConstruction::Construct()
	{

	...

	const G4double rScint = 6.35*cm;
	const G4double hScint = 5.*cm;
	const G4double dDet = 3.*mm;
	G4double rDetectorCoat = rScint+dDet;

	//...cubierta del detector...

		G4double zPlanes[2] = {hScint/2.+dDet,-(hScint/2.+dDet)};
		G4double rInners[2] = {0.*cm,0.*cm};
		G4double rOuters[2] = {rDetectorCoat,rDetectorCoat};

		G4Polyhedra *DetectorCoat = new G4Polyhedra("DetectorCoatSD",0.*deg,360.*deg,NumberOfSides,2,zPlanes,rInners,rOuters);
		LSDetectorCoat = new G4LogicalVolume(DetectorCoat,Al,"DetectorCoatSD");
		PSDetectorCoat = new G4PVPlacement(0,G4ThreeVector(0.*cm,0.*cm,0.*cm),"DetectorCoatSD",LSDetectorCoat,PWorld,false,0);

	//...volumen centellante...

		zPlanes[0] = hScint/2.;
		zPlanes[1] = -hScint/2.;
		rInners[0] = 0.*cm;
		rInners[1] = 0.*cm;
		rOuters[0] = rScint;
		rOuters[1] = rScint;

		G4Polyhedra *Scintillator = new G4Polyhedra("ScintillatorSD",0.*deg,360.*deg,NumberOfSides,2,zPlanes,rInners,rOuters);
		LSScintillator = new G4LogicalVolume(Scintillator,BC501A,"ScintillatorSD");
		PSScintillator = new G4PVPlacement(0,G4ThreeVector(0.*cm,0.*cm,0.*cm),"ScintillatorSD",LSScintillator,PSDetectorCoat,false,0);

	//...superficie de contacto entre el volumen centellante y la cubierta del detector...

		G4OpticalSurface *OpSurf = new G4OpticalSurface("OpSurf");
		G4LogicalBorderSurface *LBSurf = new G4LogicalBorderSurface("OpSurf",PSScintillator,PSDetectorCoat,OpSurf);

		OpSurf->SetType(dielectric_metal);
		OpSurf->SetFinish(polished);

		G4MaterialPropertiesTable *OpSurfMPT = new G4MaterialPropertiesTable();

		G4double REFLECTIVITY[NumberOfEntries] = { 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500,
							   0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500,
							   0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500, 0.9500 };

		OpSurfMPT->AddProperty("REFLECTIVITY",PhotonEnergy,REFLECTIVITY,NumberOfEntries);

		OpSurf->SetMaterialPropertiesTable(OpSurfMPT);

	...

	}

When I try to change the dimensions of the G4Polyhedras at run time they do change but the optical surface remains the same than from the begining, I mean, it doesn' change its dimensions. Why?

Thanks in advance.

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

1 Feedback: Re: Problems changing G4Polyhedra dimensions at run time.   (Gabriele Cosmo - 07 Mar, 2008)
 Add Message Add Message
to: "Problems changing G4Polyhedra dimensions at run time."

 Subscribe Subscribe

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


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]