Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
MyDetectorConstruction Class Reference

#include <MyDetectorConstruction.hh>

Inheritance diagram for MyDetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 MyDetectorConstruction ()
 
 ~MyDetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void SetSDtoScoreVoxel (G4VSensitiveDetector *asd)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 45 of file MyDetectorConstruction.hh.

Constructor & Destructor Documentation

MyDetectorConstruction::MyDetectorConstruction ( )

Definition at line 49 of file MyDetectorConstruction.cc.

50  : scoreVoxel(0)
51 ////////////////////////////////////////////////
52 {
53 }
MyDetectorConstruction::~MyDetectorConstruction ( )

Definition at line 56 of file MyDetectorConstruction.cc.

58 {
59 }

Member Function Documentation

G4VPhysicalVolume * MyDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 62 of file MyDetectorConstruction.cc.

References python.hepunit::cm, G4Material::GetMaterial(), iz, python.hepunit::m, python.hepunit::mm, and G4InuclParticleNames::z0.

64 {
65  G4Material* mate;
66  G4VisAttributes* va;
67 
68  // ==============================================================
69  // world volume
70  // ==============================================================
71  G4Box* areaSolid= new G4Box("area", 25.*cm, 25.*cm, 1.1*m);
72  G4Material* vacuum= G4Material::GetMaterial("Vacuum");
73  G4LogicalVolume* areaLV= new G4LogicalVolume(areaSolid, vacuum, "area");
74  G4PVPlacement* area= new G4PVPlacement(0, G4ThreeVector(), "area",
75  areaLV, 0, false, 0);
76  // vis. attributes
77  va= new G4VisAttributes(G4Color(1.,1.,1.));
78  va-> SetVisibility(false);
79  areaLV-> SetVisAttributes(va);
80 
81  // ==============================================================
82  // phantom
83  // ==============================================================
84  // water phantom
85  const double dxyphantom= 40.*cm;
86  const double dzphantom= 50.*cm;
87 
88  G4Box* sphantom= new G4Box("phantom",
89  dxyphantom/2., dxyphantom/2., dzphantom/2.);
90  G4Material* water= G4Material::GetMaterial("Water");
91  G4LogicalVolume* lphantom= new G4LogicalVolume(sphantom,
92  water, "phantom");
93  G4PVPlacement* phantom= new G4PVPlacement(0,
94  G4ThreeVector(0.,0., dzphantom/2.),
95  lphantom, "phantom",
96  areaLV, false, 0);
97 
98  va= new G4VisAttributes(G4Color(0.,0.1,0.8));
99  lphantom-> SetVisAttributes(va);
100 
101  // score voxels
102  const G4double dvoxel= 2.*mm;
103  const G4double dvoxel_y= 20.*mm;
104 
105  G4Box* svoxel= new G4Box("voxel", dvoxel/2., dvoxel_y/2., dvoxel/2.);
106  scoreVoxel= new G4LogicalVolume(svoxel, water, "voxel");
107  va= new G4VisAttributes(G4Color(0.,0.8,0.8));
108  va-> SetVisibility(false);
109  scoreVoxel-> SetVisAttributes(va);
110 
111  G4int ix, iz;
112  G4int index=0;
113  for (iz=0; iz<200; iz++) {
114  for (ix=-40; ix<=40; ix++) {
115  G4double x0= ix*dvoxel;
116  G4double z0= -dzphantom/2.+(iz+0.5)*dvoxel;
117  G4PVPlacement* pvoxel= new
118  G4PVPlacement(0, G4ThreeVector(x0, 0., z0),
119  scoreVoxel, "voxel", lphantom,
120  false, index);
121  index++;
122  }
123  }
124 
125  return area;
126 }
CLHEP::Hep3Vector G4ThreeVector
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
Definition: G4Box.hh:63
int G4int
Definition: G4Types.hh:78
G4double iz
Definition: TRTMaterials.hh:39
G4Colour G4Color
Definition: G4Color.hh:42
double G4double
Definition: G4Types.hh:76
void MyDetectorConstruction::SetSDtoScoreVoxel ( G4VSensitiveDetector asd)

Definition at line 130 of file MyDetectorConstruction.cc.

References G4VUserDetectorConstruction::SetSensitiveDetector().

Referenced by BOOST_PYTHON_MODULE().

132 {
133  if(scoreVoxel) {
134  scoreVoxel-> SetSensitiveDetector(asd);
135  }
136 }
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)

The documentation for this class was generated from the following files: