Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Par04ParallelFastWorld Class Reference

#include <Par04ParallelFastWorld.hh>

Inheritance diagram for Par04ParallelFastWorld:
G4VUserParallelWorld

Public Member Functions

 Par04ParallelFastWorld (G4String aWorldName, const Par04DetectorConstruction *aMassDetector, const Par04ParallelFullWorld *aParallelFull)
 
 ~Par04ParallelFastWorld ()
 
virtual void Construct () final
 
virtual void ConstructSD () final
 
void Print ()
 

Private Attributes

const Par04DetectorConstructionfMassDetector
 Messenger that allows to modify geometry.
 
const Par04ParallelFullWorldfParallelFull
 
std::vector< G4LogicalVolume * > fLogicalCell
 
G4int fNbOfLayers = 1
 
G4int fNbOfSlices = 1
 
G4int fNbOfRows = 1
 
G4double fLayerThickness = 0
 

Detailed Description

Definition at line 38 of file Par04ParallelFastWorld.hh.

Constructor & Destructor Documentation

◆ Par04ParallelFastWorld()

Par04ParallelFastWorld::Par04ParallelFastWorld ( G4String  aWorldName,
const Par04DetectorConstruction aMassDetector,
const Par04ParallelFullWorld aParallelFull 
)

Definition at line 52 of file Par04ParallelFastWorld.cc.

55 :G4VUserParallelWorld(aWorldName), fMassDetector(aMassDetector), fParallelFull(aParallelFull) {
57}
G4int GetNbOfLayers() const
Get number of layers.
const Par04ParallelFullWorld * fParallelFull
const Par04DetectorConstruction * fMassDetector
Messenger that allows to modify geometry.

◆ ~Par04ParallelFastWorld()

Par04ParallelFastWorld::~Par04ParallelFastWorld ( )
default

Member Function Documentation

◆ Construct()

void Par04ParallelFastWorld::Construct ( )
finalvirtual

Definition at line 65 of file Par04ParallelFastWorld.cc.

66{
67 // In parallel world material does not matter
68 G4Material* dummy = nullptr;
69
70 // Build parallel geometry:
71 auto parallelLogicalVolume = GetWorld()->GetLogicalVolume();
72
73 G4double detectorInnerRadius = fMassDetector->GetInnerRadius();
74 G4double detectorLength = fMassDetector->GetLength();
75 G4double fullLayerThickness = fMassDetector->GetAbsorberThickness(0)
77 fLayerThickness = fullLayerThickness;
78 // Get an updated value
82 G4double detectorRadius = fNbOfLayers * fullLayerThickness;
83 G4double detectorOuterRadius = detectorInnerRadius + detectorRadius;
84 G4double rowThickness = detectorLength / fNbOfRows;
85 G4double full2Pi = 2.* CLHEP::pi * rad;
86 Print();
87
88 // Insert cells to create a readout structure that contains both passive and active materials
89 // Mostly a copy from the detector construction
90 auto solidDetector = new G4Tubs("Detector", // name
91 detectorInnerRadius, // inner radius
92 detectorOuterRadius, // outer radius
93 detectorLength / 2., // half-width in Z
94 0, // start angle
95 full2Pi); // delta angle
96 auto logicDetector = new G4LogicalVolume(solidDetector, // solid
97 dummy, // material
98 "Detector"); // name
99 new G4PVPlacement(0, // no rotation
100 G4ThreeVector(0, 0, 0), // detector centre at (0,0,0)
101 logicDetector, // logical volume
102 "Detector", // name
103 parallelLogicalVolume, // mother volume
104 false, // not used
105 9999, // copy number
106 true); // check overlaps
107
108
109 //--------- Detector cylinder (division along z axis) ---------
110 auto solidRow = new G4Tubs("Row", detectorInnerRadius, detectorOuterRadius, rowThickness / 2.,
111 0, full2Pi);
112
113 auto logicRow = new G4LogicalVolume(solidRow, dummy, "Row");
114 if (fNbOfRows > 1)
115 new G4PVReplica("Row",
116 logicRow,
117 logicDetector,
118 kZAxis,
119 fNbOfRows,
120 rowThickness);
121 else
122 new G4PVPlacement(0,
123 G4ThreeVector(),
124 logicRow,
125 "Row",
126 logicDetector,
127 false,
128 0);
129
130 //--------- Detector slices (division in azimuthal angle) ---------
131 G4double cellPhi = full2Pi / fNbOfSlices;
132 auto solidSlice = new G4Tubs("Slice", detectorInnerRadius, detectorOuterRadius, rowThickness/2,
133 0, cellPhi);
134 auto logicSlice = new G4LogicalVolume(solidSlice,
135 dummy,
136 "Slice");
137 if(fNbOfSlices>1) {
138 new G4PVReplica("Slice",
139 logicSlice,
140 logicRow,
141 kPhi,
143 cellPhi,
144 -cellPhi);
145 } else {
146 new G4PVPlacement(0,
147 G4ThreeVector(),
148 logicSlice,
149 "Slice",
150 logicRow,
151 false,
152 0);
153 }
154
155 //--------- Detector cells (division along radial axis) ---------
156 G4VisAttributes attribs;
157 attribs.SetColour(G4Colour(0, 1, 0, 0.1));
158 attribs.SetForceSolid(true);
159 if(fNbOfLayers>1) {
160 auto solidCell = new G4Tubs("Cell", detectorInnerRadius,
161 detectorInnerRadius + fLayerThickness,
162 rowThickness/2, 0, cellPhi);
163 fLogicalCell.push_back(new G4LogicalVolume(solidCell, dummy, "Cell_0"));
164 new G4PVReplica("Cell",
165 fLogicalCell.back(),
166 logicSlice,
167 kRho,
170 detectorInnerRadius);
171 } else {
172 auto solidCell = new G4Tubs("Cell", detectorInnerRadius,
173 detectorInnerRadius + fLayerThickness,
174 rowThickness/2, 0, cellPhi);
175 fLogicalCell.push_back(new G4LogicalVolume(solidCell, dummy, "Cell"));
176 fLogicalCell.back()->SetVisAttributes(attribs);
177 new G4PVPlacement(0,
178 G4ThreeVector(),
179 fLogicalCell.back(),
180 "Cell",
181 logicSlice,
182 false,
183 0);
184 }
185 Print();
186}
G4double GetLength() const
Get length of the cylindrical detector (along z-axis)
G4double GetAbsorberThickness(const std::size_t aLayer) const
Get thickness of the layer.
G4double GetInnerRadius() const
Get inner radius of the cylindrical detector.
std::vector< G4LogicalVolume * > fLogicalCell
G4int GetNbOfRows() const
Get number of rows.
G4int GetNbOfSlices() const
Get number of slices.

◆ ConstructSD()

void Par04ParallelFastWorld::ConstructSD ( )
finalvirtual

Definition at line 190 of file Par04ParallelFastWorld.cc.

191{
192 // -- sensitive detectors:
193 G4SDManager* SDman = G4SDManager::GetSDMpointer();
196 SDman->AddNewDetector(caloSD);
197 for(const auto& logicalCell: fLogicalCell)
198 logicalCell->SetSensitiveDetector(caloSD);
199}

◆ Print()

void Par04ParallelFastWorld::Print ( )

Definition at line 203 of file Par04ParallelFastWorld.cc.

203 {
204 G4cout << "\n------------------------------------------------------"
205 << "\n Readout geometry with physics layout is set in parallel geometry:\t"
206 << "\n Cylindrical detector is divided along radius (layers), phi (slices), and z (rows)."
207 << "\n Number of layers is determined by number of layers set in detector construction. "
208 << "\n- Number of layers: " << fNbOfLayers << "\n------- Number of slices: " << fNbOfSlices
209 << "\n- Number of rows: " << fNbOfRows;
210 G4cout << "\n Readout will collect energy from fast simulation.\n------- Thickness is "
211 << "a sum of all absorbers" << " = " << G4BestUnit(fLayerThickness, "Length")
212 << "\n-----------------------------------------------------" << G4endl;
213}

Member Data Documentation

◆ fMassDetector

const Par04DetectorConstruction* Par04ParallelFastWorld::fMassDetector
private

Messenger that allows to modify geometry.

Definition at line 53 of file Par04ParallelFastWorld.hh.

◆ fParallelFull

const Par04ParallelFullWorld* Par04ParallelFastWorld::fParallelFull
private

Definition at line 54 of file Par04ParallelFastWorld.hh.

◆ fLogicalCell

std::vector<G4LogicalVolume*> Par04ParallelFastWorld::fLogicalCell
private

Definition at line 55 of file Par04ParallelFastWorld.hh.

◆ fNbOfLayers

G4int Par04ParallelFastWorld::fNbOfLayers = 1
private

Definition at line 56 of file Par04ParallelFastWorld.hh.

◆ fNbOfSlices

G4int Par04ParallelFastWorld::fNbOfSlices = 1
private

Definition at line 57 of file Par04ParallelFastWorld.hh.

◆ fNbOfRows

G4int Par04ParallelFastWorld::fNbOfRows = 1
private

Definition at line 58 of file Par04ParallelFastWorld.hh.

◆ fLayerThickness

G4double Par04ParallelFastWorld::fLayerThickness = 0
private

Definition at line 59 of file Par04ParallelFastWorld.hh.


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

Applications | User Support | Publications | Collaboration