Message: Re: GEANT4 tracking does not see part of my geometry Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: GEANT4 tracking does not see part of my geometry 

Keywords: Geometry, Tracking, Sensitive Detector
Forum: Geometry
Re: Question GEANT4 tracking does not see part of my geometry (Aram)
Date: 16 Apr, 2008
From: Aram <ateymura@yahoo.com>

Hi all,

I believe I found a bug probably in the G4Tubs class;

the problem arises if you place a place an object (let say a G4Box or a G4Tubs) inside of a hollow cylinder (i.e., a G4Tubs with an inner radius greater 0). then the object inside of the hollow cylinder is not seen by the GEANT4 tracking. A small snippet of a code that helps to reproduce the bug is shown bellow.

G4VPhysicalVolume* DetectorConstruction::Construct() {

//------------------------- //Define materials //-------------------------

G4double A, Z;

G4String name, symbol;

A=1.00794*g/mole; Z=1.; name="Element_Hydrogen"; symbol="H"; new G4Element(name, symbol, Z, A);

A=14.01*g/mole; Z=7.; name="Element_Nitrogen"; symbol="N"; new G4Element(name, symbol, Z, A);

A=16.00*g/mole; Z=8.; name="Element_Oxygen"; symbol="O"; new G4Element(name, symbol, Z, A);

A=39.95*g/mole; Z=18.; name="Element_Argon"; symbol="Ar"; new G4Element(name, symbol, Z, A);

A=22.9898*g/mole; Z=11.; name="Element_Natrium"; symbol="Na"; new G4Element(name, symbol, Z, A);

A=126.90447*g/mole; Z=53.; name="Element_Iodine"; symbol="I"; new G4Element(name, symbol, Z, A);

G4int ncomponents; G4double density, fraction; G4double temperature=STP_Temperature; G4double pressure=STP_Pressure;

name="Material_Air"; ncomponents=4; density=1.214*mg/cm3;

G4Material* mat = new G4Material(name, density, ncomponents, kStateGas, temperature, pressure);

fraction=0.7494; name="Element_Nitrogen"; mat -> AddElement(G4Element::GetElement(name), fraction); fraction=0.2369; name="Element_Oxygen"; mat -> AddElement(G4Element::GetElement(name), fraction); fraction=0.0129; name="Element_Argon"; mat -> AddElement(G4Element::GetElement(name), fraction); fraction=0.0008; name="Element_Hydrogen"; mat -> AddElement(G4Element::GetElement(name), fraction);

name="Material_NaI" ncomponents=2; density=3.67*g/cm3;

mat = new G4Material(name, density, ncomponents, kStateSolid, temperature, pressure);

fraction=0.154258; name="Element_Natrium" mat -> AddElement(G4Element::GetElement(name), fraction); fraction=0.845741; component="Element_Iodine" mat -> AddElement(G4Element::GetElement(name), fraction);

 fWorldLength= 9.144*m;

  //------------------------------ 
  // World
  //------------------------------ 

  G4double HalfWorldLength = 0.5*fWorldLength;

  G4GeometryManager::GetInstance()->SetWorldMaximumExtent(fWorldLength);
  G4cout << "Computed tolerance = "
         << G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/mm
         << " mm" << G4endl;

  solidWorld= new G4Box("world",HalfWorldLength,HalfWorldLength,HalfWorldLength);
  logicWorld= new G4LogicalVolume( solidWorld, G4Material::GetMaterial("Material_Air"), "World", 0, 0, 0);

  physiWorld = new G4PVPlacement(0,                               // no rotation
                                 G4ThreeVector(0*mm, 0*mm, 0*mm), // at (0,0,0)
                                 logicWorld,                      // its logical volume
				 "World",                         // its name
                                 0,                               // its mother  volume
                                 false,                           // no boolean operations
                                 0);                              // copy number

 G4double in_R =  13.589*cm;
 G4double out_R = 21.2725*cm;
 G4double hight = 0.5*33.57372*cm;
 G4double start_Angl = 0.*deg;
 G4double span_Angl = 360.*deg;

 G4Tubs* solidShell = new G4Tubs("Shell", in_R,out_R, hight, start_Angl, span_Angl);
 G4LogicalVolume* logicShell = 
     new G4LogicalVolume(solidShieldShell, 
     G4Material::GetMaterial("Material_Air"), 
     "Shell", 0, 0, 0);

 new G4PVPlacement(0,                                  // no rotation
		   G4ThreeVector(0*mm, 0*mm, 1.7*m),   // at (x,y,z)
		   "Shell",                            // its name
		   logicShell,                         // its logical volume   
		   physiWorld,            // its mother  volume
		   false,                  // no boolean operations
			0);           // copy number 

//G4double in_R_Core = 0*mm; // G4double out_R_Core = 12.7*cm; // G4double hight_Core = 0.5*25.4*cm; // G4double start_Angl_Core = 0.*deg; // G4double span_Angl_Core = 360.*deg;

  G4ThreeVector positionCore = G4ThreeVector(0,0,0);

  //G4Tubs*  solidCore = new G4Tubs("CORE", in_R_Core,out_R_Core, hight_Core, start_Angl_Core, span_Angl_Core);
  G4Box* solidCore = new G4Box("CORE", 7.*cm, 7.*cm, 7.*cm);
  G4LogicalVolume*  logicCore = new G4LogicalVolume(solidCore, G4Material::GetMaterial("Material_Na"), "CoreHIND", 0, 0, 0);
  new G4PVPlacement(0,                 // no rotation
		    positionCore,      // at (x,y,z)
		    logicCore,         // its logical volume 
		    "CoreHIND",        // its name  
		    logicShell,    // its mother  volume
		    false,             // no boolean operations
		    0);                // copy number 

 logicWorld->SetVisAttributes(G4VisAttributes::Invisible);

 // Sets a max Step length in the tracker region, with G4StepLimiter
 //
 G4double maxStep = 0.1*mm;
 stepLimit = new G4UserLimits(maxStep);
 logicWorld->SetUserLimits(stepLimit);

return physiWorld; }

Using this detector geometry one can see that the "CORE" (be it a G4Tubs or a G4Box) is not by the tracking unless the variable in_R=0 (i.e., the inner radius of the outer cylinder).

Thank you in advance for any help or comment.

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

1 More: Re: GEANT4 tracking does not see part of my geometry   (Gabriele Cosmo - 17 Apr, 2008)
(_ Question: Re: GEANT4 tracking does not see part of my geometry   (Aram - 17 Apr, 2008)
1 None: Re: GEANT4 tracking does not see part of my geometry   (John Apostolakis - 17 Apr, 2008)
2 None: Re: GEANT4 tracking does not see part of my geometry   (Vladimir Grichine - 17 Apr, 2008)
 Add Message Add Message
to: "Re: GEANT4 tracking does not see part of my geometry"

 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 ]