32 #include "G4Material.hh" 36 #include "G4Sphere.hh" 38 #include "G4PVPlacement.hh" 39 #include "G4PVReplica.hh" 40 #include "G4PVParameterised.hh" 41 #include "G4VisAttributes.hh" 82 G4double dx, G4double dy, G4double dz)
86 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 91 solid=
new G4Box(
name, dx/2., dy/2., dz/2.);
95 va=
new G4VisAttributes();
96 lv-> SetVisAttributes(
va);
102 G4double rmin, G4double rmax, G4double dz,
103 G4double phi0, G4double dphi)
107 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 112 solid=
new G4Tubs(
name, rmin, rmax, dz, phi0, dphi);
116 va=
new G4VisAttributes();
117 lv-> SetVisAttributes(
va);
123 G4double rmin1, G4double rmax1,
124 G4double rmin2, G4double rmax2,
126 G4double phi0, G4double dphi)
130 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 135 solid=
new G4Cons(
name, rmin1, rmax1, rmin2, rmax2,
140 va=
new G4VisAttributes();
141 lv-> SetVisAttributes(
va);
147 G4double rmin, G4double rmax,
148 G4double phi0, G4double dphi,
149 G4double theta0, G4double dtheta)
153 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 158 solid=
new G4Sphere(
name, rmin, rmax, phi0, dphi, theta0, dtheta);
162 va=
new G4VisAttributes();
163 lv-> SetVisAttributes(
va);
172 G4cout <<
"%%% Warning (G4EzVolume): volume is already created." 181 va=
new G4VisAttributes();
182 lv-> SetVisAttributes(
va);
193 G4cout <<
"%%% Warning (G4EzVolume): volume is not yet created." 201 pv=
new G4PVPlacement(0, pos,
name,
lv, world,
false, ncopy);
203 pv=
new G4PVPlacement(0, pos,
lv,
name, parent->
lv,
false, ncopy);
218 G4cout <<
"%%% Warning (G4EzVolume): volume is not yet created." 226 pv=
new G4PVPlacement(transform,
name,
lv, world,
false, ncopy);
228 pv=
new G4PVPlacement(transform,
lv,
name, parent->
lv,
false, ncopy);
238 EAxis pAxis, G4int nReplicas,
239 G4double width, G4double offset)
243 G4cout <<
"%%% Warning (G4EzVolume): volume is not yet created." 249 new G4PVReplica(
name,
lv, parent->
lv, pAxis, nReplicas, width, offset);
261 G4Box* avolume=
dynamic_cast<G4Box*
>(
solid);
263 G4cout <<
"%%% Error (G4EzVolume): voxelization is valid " 264 <<
"only for Box geometry." << G4endl;
265 return G4ThreeVector();
269 G4cout <<
"%%% Error (G4EzVolume): already voxelized." << G4endl;
270 return G4ThreeVector();
273 G4double dx= (avolume-> GetXHalfLength())*2.;
274 G4double dy= (avolume-> GetYHalfLength())*2.;
275 G4double dz= (avolume-> GetZHalfLength())*2.;
282 G4Box* voxel=
new G4Box(
"voxel", ddx/2., ddy/2., ddz/2.);
284 lvsub=
new G4LogicalVolume(voxel, voxelMaterial,
"voxel");
286 G4VisAttributes* vavoxel=
new G4VisAttributes(G4Color(1.,0.,0.));
287 lvsub-> SetVisAttributes(vavoxel);
291 G4int nvoxel= nx*ny*nz;
292 new G4PVParameterised(
name+
"_voxel",
lvsub,
lv, kXAxis,
295 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)