Message: How to implement G4PVReplica along two axis for hexagone volume? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to implement G4PVReplica along two axis for hexagone volume? 

Forum: Geometry
Date: 31 May, 2010
From: Suhaili Zakaria <Suhaili Zakaria>

Hi

I have a question regarding on how to replicate hexagonal volumes along x and y axis.

I can replicate box volume along two axes by inserting replica in x, and then insert a replica in y.

Using the same approach for box volume, I tried to implement it with hexagone. However, it didn't work as I anticipated. But when I tried to replicate along only one axis, it works.

I need your comment, is it doable, or show me where I did wrong.

Please help!

Below is the snippet of my code:

//------------------------------ // Collimator //------------------------------

G4ThreeVector CollimatorSize = G4ThreeVector(4.91*cm, 5.67*cm, 5.8*cm);

solidCollimator = new G4Box("Collimator",CollimatorSize.x()/2, collimatorSize.y()/2, CollimatorSize.z()/2);

logicCollimator= new G4LogicalVolume(solidCollimator,Pb,"Collimator",0,0,0);

physiCollimator = new G4PVPlacement(0,           //  rotation
				  G4ThreeVector(0,0,-.475*cm), // position
				  logicCollimator, // logical volume				  
				  "Collimator",    // its name
				  logicHead,      // its mother  volume
				  0,           // copy number 
				  false);              //  no boolean operations

//------------------------------ // Hexagonal Collimator Holes //------------------------------

  G4double startAngle = 0.*deg;
  G4double totalAngle = 360.*deg;
  G4int NumberOfSide = 6;
  G4int NumberOfPlane = 2;
  const G4double Z[2]= {-29.0*mm, 29.0*mm};
  const G4double rInner[2]= {0, 0};
  const G4double rOuter[2]= {1.5*mm, 1.5*mm};

//Replicate along x-axis //------------------------

  solidHoles = new G4Polyhedra("Holes",startAngle,
					  totalAngle,NumberOfSide,
					  NumberOfPlane, Z, rInner, rOuter);

  logicHoles = new G4LogicalVolume(solidHoles,Air,"Holes",0,0,0);

  G4int xReplica=7; 

  physiHoles = new G4PVReplica ("Holes",       // their name
				  logicHoles,    // their logical volume
				  logicCollimator, // Mother logical volume
				  kXAxis,          // Are placed along this axis
				  xReplica,    // Number of chambers
				 7.014*mm,   // The width
				 0);

//Replicate along y-axis //------------------------

  solidHolesY = new G4Polyhedra("HolesY",startAngle,
					  totalAngle,NumberOfSide,
					  NumberOfPlane, Z, rInner, rOuter);

  logicHolesY = new G4LogicalVolume(solidHolesY,Air,"HolesY",0,0,0);

  G4int yReplica=7; 

  physiHolesY = new G4PVReplica ("Holes",       // their name
				 logicHoles,    // their logical volume
				 logicHoles, // Mother logical volume
				 kYAxis,          // Are placed along this axis
				 xReplica,    // Number of chambers
				 8.1*mm,   // The width
				 0);   // 

 Add Message Add Message
to: "How to implement G4PVReplica along two axis for hexagone volume?"

 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 ]