31 #include "G4Material.hh" 35 #include "G4Sphere.hh" 37 #include "G4PVPlacement.hh" 38 #include "G4PVReplica.hh" 39 #include "G4PVParameterised.hh" 40 #include "G4VisAttributes.hh" 81 G4double dx, G4double dy, G4double dz)
85 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 90 solid=
new G4Box(
name, dx/2., dy/2., dz/2.);
94 va=
new G4VisAttributes();
95 lv-> SetVisAttributes(
va);
101 G4double rmin, G4double rmax, G4double dz,
102 G4double phi0, G4double dphi)
106 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 111 solid=
new G4Tubs(
name, rmin, rmax, dz, phi0, dphi);
115 va=
new G4VisAttributes();
116 lv-> SetVisAttributes(
va);
122 G4double rmin1, G4double rmax1,
123 G4double rmin2, G4double rmax2,
125 G4double phi0, G4double dphi)
129 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 134 solid=
new G4Cons(
name, rmin1, rmax1, rmin2, rmax2,
139 va=
new G4VisAttributes();
140 lv-> SetVisAttributes(
va);
146 G4double rmin, G4double rmax,
147 G4double phi0, G4double dphi,
148 G4double theta0, G4double dtheta)
152 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 157 solid=
new G4Sphere(
name, rmin, rmax, phi0, dphi, theta0, dtheta);
161 va=
new G4VisAttributes();
162 lv-> SetVisAttributes(
va);
171 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 180 va=
new G4VisAttributes();
181 lv-> SetVisAttributes(
va);
192 G4cout <<
"%%% Warning (G4EzVolume): volume is not yet created." 200 pv=
new G4PVPlacement(0, pos,
name,
lv, world,
false, ncopy);
202 pv=
new G4PVPlacement(0, pos,
lv,
name, parent->
lv,
false, ncopy);
217 G4cout <<
"%%% Warning (G4EzVolume): volume is not yet created." 225 pv=
new G4PVPlacement(transform,
name,
lv, world,
false, ncopy);
227 pv=
new G4PVPlacement(transform,
lv,
name, parent->
lv,
false, ncopy);
237 EAxis pAxis, G4int nReplicas,
238 G4double width, G4double offset)
242 G4cout <<
"%%% Warning (G4EzVolume): volume is not yet created." 248 new G4PVReplica(
name,
lv, parent->
lv, pAxis, nReplicas, width, offset);
260 G4Box* avolume=
dynamic_cast<G4Box*
>(
solid);
262 G4cout <<
"%%% Error (G4EzVolume): voxelization is valid " 263 <<
"only for Box geometry." << G4endl;
264 return G4ThreeVector();
268 G4cout <<
"%%% Error (G4EzVolume): already voxelized." << G4endl;
269 return G4ThreeVector();
272 G4double dx= (avolume-> GetXHalfLength())*2.;
273 G4double dy= (avolume-> GetYHalfLength())*2.;
274 G4double dz= (avolume-> GetZHalfLength())*2.;
281 G4Box* voxel=
new G4Box(
"voxel", ddx/2., ddy/2., ddz/2.);
283 lvsub=
new G4LogicalVolume(voxel, voxelMaterial,
"voxel");
285 G4VisAttributes* vavoxel=
new G4VisAttributes(G4Color(1.,0.,0.));
286 lvsub-> SetVisAttributes(vavoxel);
290 G4int nvoxel= nx*ny*nz;
291 new G4PVParameterised(
name+
"_voxel",
lvsub,
lv, kXAxis,
294 return G4ThreeVector(ddx, ddy, ddz);
G4ThreeVector VoxelizeIt(G4int nx, G4int ny, G4int nz)
void SetSensitiveDetector(G4VSensitiveDetector *asd)
void CreateTubeVolume(G4Material *amaterial, G4double rmin, G4double rmax, G4double dz, G4double phi0=0., G4double dphi=360 *deg)
void CreateConeVolume(G4Material *amaterial, G4double rmin1, G4double rmax1, G4double rmin2, G4double rmax2, G4double dz, G4double phi0=0., G4double dphi=360.*deg)
void CreateOrbVolume(G4Material *amaterial, G4double rmax)
G4Material * GetMaterial() const
void CreateBoxVolume(G4Material *amaterial, G4double dx, G4double dy, G4double dz)
void CreateSphereVolume(G4Material *amaterial, G4double rmin, G4double rmax, G4double phi0=0., G4double dphi=360.*deg, G4double theta0=0., G4double dtheta=180.*deg)
G4VPhysicalVolume * ReplicateIt(G4EzVolume *parent, EAxis pAxis, G4int nReplicas, G4double width, G4double offset=0)
static G4VPhysicalVolume * GetWorldVolume()
G4VPhysicalVolume * PlaceIt(const G4ThreeVector &pos, G4int ncopy=0, G4EzVolume *parent=0)