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

#include <Par04ParallelFullWorld.hh>

Inheritance diagram for Par04ParallelFullWorld:
G4VUserParallelWorld

Public Member Functions

 Par04ParallelFullWorld (G4String aWorldName, const Par04DetectorConstruction *aMassDetector)
 
 ~Par04ParallelFullWorld ()
 
virtual void Construct () final
 
virtual void ConstructSD () final
 
void SetNbOfSlices (G4int aNumber)
 Set number of slices.
 
G4int GetNbOfSlices () const
 Get number of slices.
 
void SetNbOfRows (G4int aNumber)
 Set number of rows.
 
G4int GetNbOfRows () const
 Get number of rows.
 
G4int GetNbOfLayers () const
 Get number of layers.
 
void Print ()
 

Private Attributes

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

Detailed Description

Definition at line 37 of file Par04ParallelFullWorld.hh.

Constructor & Destructor Documentation

◆ Par04ParallelFullWorld()

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

Definition at line 52 of file Par04ParallelFullWorld.cc.

54 :G4VUserParallelWorld(aWorldName), fMassDetector(aMassDetector) {
57}
G4int GetNbOfLayers() const
Get number of layers.
Par04ParallelMessenger * fParallelMessenger
Messenger that allows to modify geometry.
const Par04DetectorConstruction * fMassDetector

◆ ~Par04ParallelFullWorld()

Par04ParallelFullWorld::~Par04ParallelFullWorld ( )
default

Member Function Documentation

◆ Construct()

void Par04ParallelFullWorld::Construct ( )
finalvirtual

Definition at line 65 of file Par04ParallelFullWorld.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 G4double sensitiveLayerOffset = 0;
80 else
81 sensitiveLayerOffset = fMassDetector->GetAbsorberThickness(0);
84
85 fNbOfLayers = fMassDetector->GetNbOfLayers(); // Get an updated value
86 G4double detectorRadius = fNbOfLayers * fullLayerThickness;
87 G4double detectorOuterRadius = detectorInnerRadius + detectorRadius;
88 G4double rowThickness = detectorLength / fNbOfRows;
89 G4double full2Pi = 2.* CLHEP::pi * rad;
90 Print();
91
92 // Insert cells to create a readout structure that contains both passive and active materials
93 // Mostly a copy from the detector construction
94 auto solidDetector = new G4Tubs("Detector", // name
95 detectorInnerRadius, // inner radius
96 detectorOuterRadius, // outer radius
97 detectorLength / 2., // half-width in Z
98 0, // start angle
99 full2Pi); // delta angle
100 auto logicDetector = new G4LogicalVolume(solidDetector, // solid
101 dummy, // material
102 "Detector"); // name
103 new G4PVPlacement(0, // no rotation
104 G4ThreeVector(0, 0, 0), // detector centre at (0,0,0)
105 logicDetector, // logical volume
106 "Detector", // name
107 parallelLogicalVolume, // mother volume
108 false, // not used
109 9999, // copy number
110 true); // check overlaps
111
112
113 //--------- Detector cylinder (division along z axis) ---------
114 auto solidRow = new G4Tubs("Row", detectorInnerRadius, detectorOuterRadius, rowThickness / 2.,
115 0, full2Pi);
116
117 auto logicRow = new G4LogicalVolume(solidRow, dummy, "Row");
118 if (fNbOfRows > 1)
119 new G4PVReplica("Row",
120 logicRow,
121 logicDetector,
122 kZAxis,
123 fNbOfRows,
124 rowThickness);
125 else
126 new G4PVPlacement(0,
127 G4ThreeVector(),
128 logicRow,
129 "Row",
130 logicDetector,
131 false,
132 0);
133
134 //--------- Detector slices (division in azimuthal angle) ---------
135 G4double cellPhi = full2Pi / fNbOfSlices;
136 auto solidSlice = new G4Tubs("Slice", detectorInnerRadius, detectorOuterRadius, rowThickness/2,
137 0, cellPhi);
138 auto logicSlice = new G4LogicalVolume(solidSlice,
139 dummy,
140 "Slice");
141 if(fNbOfLayers>1 && fullLayerThickness == fLayerThickness) {
142 new G4PVReplica("Slice",
143 logicSlice,
144 logicRow,
145 kPhi,
147 cellPhi,
148 -cellPhi);
149 } else {
150 // full simulation readout, cannot use replica because of gaps between absorbers
151 for (int iSlice = 0; iSlice<fNbOfSlices; iSlice++) {
152 auto rotation = new G4RotationMatrix();
153 rotation->setPhi((iSlice+0.5)*cellPhi);
154 new G4PVPlacement(rotation,
155 G4ThreeVector(),
156 logicSlice,
157 "Slice_"+std::to_string(iSlice),
158 logicRow,
159 false,
160 iSlice);
161 }
162 }
163
164 //--------- Detector cells (division along radial axis) ---------
165 G4VisAttributes attribs;
166 attribs.SetColour(G4Colour(0, 1, 0, 0.1));
167 attribs.SetForceSolid(true);
168 if(fNbOfLayers>1 && fullLayerThickness == fLayerThickness) {
169 auto solidCell = new G4Tubs("Cell", detectorInnerRadius + sensitiveLayerOffset,
170 detectorInnerRadius + sensitiveLayerOffset + fLayerThickness,
171 rowThickness/2, 0, cellPhi);
172 fLogicalCell.push_back(new G4LogicalVolume(solidCell, dummy, "Cell_0"));
173 new G4PVReplica("Cell",
174 fLogicalCell.back(),
175 logicSlice,
176 kRho,
179 detectorInnerRadius);
180 } else {
181 // full simulation readout, cannot use replica because of gaps between absorbers
182 for (int iLayer = 0; iLayer<fNbOfLayers; iLayer++) {
183 auto solidCell = new G4Tubs("Cell_"+std::to_string(iLayer),
184 detectorInnerRadius + iLayer * fullLayerThickness
185 + sensitiveLayerOffset,
186 detectorInnerRadius + iLayer * fullLayerThickness
187 + sensitiveLayerOffset + fLayerThickness,
188 rowThickness/2, 0, cellPhi);
189 fLogicalCell.push_back(new G4LogicalVolume(solidCell, dummy, "Cell_"+std::to_string(iLayer)));
190 fLogicalCell.back()->SetVisAttributes(attribs);
191 new G4PVPlacement(0,
192 G4ThreeVector(),
193 fLogicalCell.back(),
194 "Cell_"+std::to_string(iLayer),
195 logicSlice,
196 false,
197 iLayer);
198 }
199 }
200 Print();
201}
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.
G4bool GetAbsorberSensitivity(const std::size_t aLayer) const
Get sensitivity of the layer.
std::vector< G4LogicalVolume * > fLogicalCell

◆ ConstructSD()

void Par04ParallelFullWorld::ConstructSD ( )
finalvirtual

Definition at line 205 of file Par04ParallelFullWorld.cc.

206{
207 // -- sensitive detectors:
208 G4SDManager* SDman = G4SDManager::GetSDMpointer();
211 SDman->AddNewDetector(caloSD);
212 for(const auto& logicalCell: fLogicalCell)
213 logicalCell->SetSensitiveDetector(caloSD);
214}

◆ SetNbOfSlices()

void Par04ParallelFullWorld::SetNbOfSlices ( G4int  aNumber)
inline

Set number of slices.

Definition at line 48 of file Par04ParallelFullWorld.hh.

48{ fNbOfSlices = aNumber; };

◆ GetNbOfSlices()

G4int Par04ParallelFullWorld::GetNbOfSlices ( ) const
inline

Get number of slices.

Definition at line 50 of file Par04ParallelFullWorld.hh.

50{ return fNbOfSlices; };

◆ SetNbOfRows()

void Par04ParallelFullWorld::SetNbOfRows ( G4int  aNumber)
inline

Set number of rows.

Definition at line 52 of file Par04ParallelFullWorld.hh.

52{ fNbOfRows = aNumber; };

◆ GetNbOfRows()

G4int Par04ParallelFullWorld::GetNbOfRows ( ) const
inline

Get number of rows.

Definition at line 54 of file Par04ParallelFullWorld.hh.

54{ return fNbOfRows; };

◆ GetNbOfLayers()

G4int Par04ParallelFullWorld::GetNbOfLayers ( ) const
inline

Get number of layers.

Definition at line 56 of file Par04ParallelFullWorld.hh.

56{ return fNbOfLayers; };

◆ Print()

void Par04ParallelFullWorld::Print ( )

Definition at line 218 of file Par04ParallelFullWorld.cc.

218 {
219 G4cout << "\n------------------------------------------------------"
220 << "\n Readout geometry with physics layout is set in parallel geometry:\t"
221 << "\n Cylindrical detector is divided along radius (layers), phi (slices), and z (rows)."
222 << "\n Number of layers is determined by number of layers set in detector construction. "
223 << "\n- Number of layers: " << fNbOfLayers << "\n------- Number of slices: " << fNbOfSlices
224 << "\n- Number of rows: " << fNbOfRows;
225 G4cout << "\n Readout will collect energy for full simulation.\n------- Therefore thickness is "
226 << "only a thickness of sensitive absorbers = " << G4BestUnit(fLayerThickness, "Length")
227 << "\n-----------------------------------------------------" << G4endl;
228}

Member Data Documentation

◆ fParallelMessenger

Par04ParallelMessenger* Par04ParallelFullWorld::fParallelMessenger = nullptr
private

Messenger that allows to modify geometry.

Definition at line 62 of file Par04ParallelFullWorld.hh.

◆ fMassDetector

const Par04DetectorConstruction* Par04ParallelFullWorld::fMassDetector
private

Definition at line 63 of file Par04ParallelFullWorld.hh.

◆ fLogicalCell

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

Definition at line 64 of file Par04ParallelFullWorld.hh.

◆ fNbOfLayers

G4int Par04ParallelFullWorld::fNbOfLayers = 1
private

Definition at line 65 of file Par04ParallelFullWorld.hh.

◆ fNbOfSlices

G4int Par04ParallelFullWorld::fNbOfSlices = 1
private

Definition at line 66 of file Par04ParallelFullWorld.hh.

◆ fNbOfRows

G4int Par04ParallelFullWorld::fNbOfRows = 1
private

Definition at line 67 of file Par04ParallelFullWorld.hh.

◆ fLayerThickness

G4double Par04ParallelFullWorld::fLayerThickness = 0
private

Definition at line 68 of file Par04ParallelFullWorld.hh.


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

Applications | User Support | Publications | Collaboration