66{
67
69
70
71 auto parallelLogicalVolume = GetWorld()->GetLogicalVolume();
72
77 G4double sensitiveLayerOffset = 0;
80 else
84
86 G4double detectorRadius =
fNbOfLayers * fullLayerThickness;
87 G4double detectorOuterRadius = detectorInnerRadius + detectorRadius;
88 G4double rowThickness = detectorLength /
fNbOfRows;
89 G4double full2Pi = 2.* CLHEP::pi * rad;
91
92
93
94 auto solidDetector =
new G4Tubs(
"Detector",
95 detectorInnerRadius,
96 detectorOuterRadius,
97 detectorLength / 2.,
98 0,
99 full2Pi);
101 dummy,
102 "Detector");
104 G4ThreeVector(0, 0, 0),
105 logicDetector,
106 "Detector",
107 parallelLogicalVolume,
108 false,
109 9999,
110 true);
111
112
113
114 auto solidRow =
new G4Tubs(
"Row", detectorInnerRadius, detectorOuterRadius, rowThickness / 2.,
115 0, full2Pi);
116
120 logicRow,
121 logicDetector,
122 kZAxis,
124 rowThickness);
125 else
127 G4ThreeVector(),
128 logicRow,
129 "Row",
130 logicDetector,
131 false,
132 0);
133
134
136 auto solidSlice =
new G4Tubs(
"Slice", detectorInnerRadius, detectorOuterRadius, rowThickness/2,
137 0, cellPhi);
139 dummy,
140 "Slice");
143 logicSlice,
144 logicRow,
145 kPhi,
147 cellPhi,
148 -cellPhi);
149 } else {
150
151 for (
int iSlice = 0; iSlice<
fNbOfSlices; iSlice++) {
152 auto rotation = new G4RotationMatrix();
153 rotation->setPhi((iSlice+0.5)*cellPhi);
155 G4ThreeVector(),
156 logicSlice,
157 "Slice_"+std::to_string(iSlice),
158 logicRow,
159 false,
160 iSlice);
161 }
162 }
163
164
166 attribs.SetColour(
G4Colour(0, 1, 0, 0.1));
167 attribs.SetForceSolid(true);
169 auto solidCell =
new G4Tubs(
"Cell", detectorInnerRadius + sensitiveLayerOffset,
171 rowThickness/2, 0, cellPhi);
175 logicSlice,
176 kRho,
179 detectorInnerRadius);
180 } else {
181
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
188 rowThickness/2, 0, cellPhi);
192 G4ThreeVector(),
194 "Cell_"+std::to_string(iLayer),
195 logicSlice,
196 false,
197 iLayer);
198 }
199 }
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