31#include "G4NistManager.hh"
32#include "G4Material.hh"
35#include "G4LogicalVolume.hh"
36#include "G4PVPlacement.hh"
37#include "G4PVReplica.hh"
38#include "G4VisAttributes.hh"
39#include "G4RunManager.hh"
41#include "G4SDManager.hh"
43#include "G4UnitsTable.hh"
46#include "G4RegionStore.hh"
69 G4Material* air = nistManager->FindOrBuildMaterial(
"G4_AIR");
72 G4double full2Pi = 2. * CLHEP::pi * rad;
78 auto fSolidWorld =
new G4Box(
"World",
95 auto fSolidDetector =
new G4Tubs(
"Detector",
116 auto detectorRegion =
new G4Region(
"DetectorRegion");
117 detectorRegion->AddRootLogicalVolume(fLogicDetector);
121 auto fSolidLayer =
new G4Tubs(
"Layer",
148 auto fSolidRow =
new G4Tubs(
"Row",
177 auto fSolidCell =
new G4Tubs(
"Cell",
205 fLogicWorld->SetVisAttributes(G4VisAttributes::GetInvisible());
206 fLogicLayer->SetVisAttributes(G4VisAttributes::GetInvisible());
207 fLogicRow->SetVisAttributes(G4VisAttributes::GetInvisible());
209 attribs.SetColour(
G4Colour(0, 0, 1, 0.3));
210 attribs.SetForceSolid(
true);
223 G4SDManager::GetSDMpointer()->AddNewDetector(caloSD);
226 auto detectorRegion =
227 G4RegionStore::GetInstance()->GetRegion(
"DetectorRegion");
235 G4cout <<
"\n------------------------------------------------------"
241 <<
"\n--- Number of phi-cells:\t" <<
fNbOfPhiCells << G4endl;
242 G4cout <<
"-----------------------------------------------------" << G4endl;
250 G4Material* material = G4NistManager::Instance()->FindOrBuildMaterial(aName);
254 G4Exception(
"Par03DetectorConstruction::SetMaterial()",
"InvalidSetup",
255 FatalException, (
"Unknown material name: " + aName).c_str());
256 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
265 G4Exception(
"Par03DetectorConstruction::SetRadius()",
"InvalidSetup",
267 (
"Detector radius cannot be larger than the world size (" +
278 G4Exception(
"Par03DetectorConstruction::SetLength()",
"InvalidSetup",
280 (
"Detector length cannot be larger than the world size (" +
G4double fDetectorRadius
Radius of the cylindrical detector.
G4int fNbOfRhoCells
Number of cells along radius.
virtual ~Par03DetectorConstruction()
G4Material * fDetectorMaterial
Material of the detector.
G4int fNbOfPhiCells
Number of cells in azimuthal angle.
virtual G4VPhysicalVolume * Construct() final
void SetRadius(G4double aRadius)
Par03DetectorMessenger * fDetectorMessenger
Messenger that allows to modify geometry.
virtual void ConstructSDandField() final
G4int fNbOfLayers
Number of layers = slices along z axis.
G4double fDetectorLength
Length of the cylindrical detector (along z axis)
void SetMaterial(const G4String &aMaterial)
G4double fWorldSize
World size (in each X, Y, Z dimension)
G4LogicalVolume * fLogicCell
Logical volume of replicated cell.
Par03DetectorConstruction()
void SetLength(G4double aLength)
Example fast simulation model for EM showers.