77 using namespace CLHEP;
94 fWorldMaterialName(
"G4_Galactic"),
95 fTargetMaterialName(
"G4_B"),
96 fCasingMaterialName(
"G4_WATER"),
100 fMfdName(
"Target_MFD")
140 /fTargetSections.
z()));
141 G4bool check_overlap =
true;
148 materials.find(
"World")
155 0,
false, 0, check_overlap);
157 G4int nz = fTargetSections.
z();
158 G4int ny = fTargetSections.
y();
159 G4int nx = fTargetSections.
x();
162 G4double sx = fTargetDim.
x()/fTargetSections.
x();
163 G4double sy = fTargetDim.
y()/fTargetSections.
y();
164 G4double sz = fTargetDim.
z()/fTargetSections.
z();
187 world_log->SetVisAttributes(white);
189 for(
G4int k = 0; k < nz; ++k)
190 for(
G4int j = 0; j < ny; ++j)
191 for(
G4int i = 0; i < nx; ++i)
195 = 0.5*sx +
static_cast<G4double>(i)*sx - 0.5*fWorldDim.
x();
197 = 0.5*sy +
static_cast<G4double>(j)*sy - 0.5*fWorldDim.
y();
199 = 0.5*sz +
static_cast<G4double>(k)*sz - 0.5*fWorldDim.
z();
202 std::stringstream ss_name;
203 ss_name <<
"Target_" << i <<
"_" << j <<
"_" << k;
205 G4Box* target_solid =
new G4Box(ss_name.str(),
214 if(j == 0 || j+1 == ny || i == 0 || i+1 == nx ||
215 (nz > 1 && (k == 0 || k+1 == nz)))
216 target_material = materials.find(
"Casing")->second;
218 target_material = materials.find(
"Target")->second;
238 fScoringVolumes.insert(target_log);
245 G4bool even_z = (k%2 == 0) ?
true :
false;
246 G4bool even_y = (j%2 == 0) ?
true :
false;
247 G4bool even_x = (i%2 == 0) ?
true :
false;
253 if((even_y && even_x) || (!even_y && !even_x))
259 if((!even_y && even_x) || (even_y && !even_x))
291 for(
auto ite : fScoringVolumes)
virtual void ConstructSDandField()
static constexpr double m
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
virtual MaterialCollection_t ConstructMaterials()
void SetUserLimits(G4UserLimits *pULimits)
static G4NistManager * Instance()
static TSDetectorConstruction * Instance()
void SetForceSolid(G4bool=true)
virtual G4VPhysicalVolume * ConstructWorld(const MaterialCollection_t &)
void SetVisibility(G4bool=true)
std::map< G4String, G4Material * > MaterialCollection_t
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void AddNewDetector(G4VSensitiveDetector *aSD)
virtual ~TSDetectorConstruction()
static G4SDManager * GetSDMpointer()
Definition of the TSDetectorConstruction class.
G4VPhysicalVolume * Construct()
void SetForceWireframe(G4bool=true)
void SetVisAttributes(const G4VisAttributes *pVA)