Belle II Software development
PlumeCreator.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <beast/plume/geometry/PlumeCreator.h>
10#include <beast/plume/simulation/SensitiveDetector.h>
11
12#include <geometry/Materials.h>
13#include <geometry/CreatorFactory.h>
14#include <framework/gearbox/GearDir.h>
15
16#include <cmath>
17
18#include <G4LogicalVolume.hh>
19#include <G4AssemblyVolume.hh>
20#include <G4PVPlacement.hh>
21
22//Shapes
23#include <G4Box.hh>
24#include <G4Trd.hh>
25#include "G4SubtractionSolid.hh"
26#include <G4UserLimits.hh>
27#include "G4Tubs.hh"
28#include <G4TwoVector.hh>
29//Visualization Attributes
30#include <G4VisAttributes.hh>
31#include<G4ExtrudedSolid.hh>
32
33using namespace std;
34
35namespace Belle2 {
42 namespace plume {
43
44 // Register the creator
47
49 {
50 //m_sensitive = new SensitiveDetector();
51 }
52
54 {
55 if (m_sensitive) delete m_sensitive;
56 }
57
58 void PlumeCreator::create(const GearDir& content, G4LogicalVolume& topVolume, geometry::GeometryTypes /* type */)
59 {
60
62
63 //color attributions
64 G4VisAttributes* FoamVisAtt = new G4VisAttributes(G4Colour::Blue());
65 G4VisAttributes* KaptonVisAtt = new G4VisAttributes(G4Colour::Red());
66 G4VisAttributes* GlueVisAtt = new G4VisAttributes(G4Colour::White());
67 G4VisAttributes* MetalVisAtt = new G4VisAttributes(G4Colour::Gray());
68 G4VisAttributes* SubstrateVisAtt = new G4VisAttributes(G4Colour::Green());
69 G4VisAttributes* MetalizedVisAtt = new G4VisAttributes(G4Colour::Cyan());
70 G4VisAttributes* EpitaxialVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0)); //yellow
71
72 //lets get the stepsize parameter with a default value of 5 µm
73 double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
74
75 int LadderID = 0;
76
77 GearDir activeParams(content, "Ladder");
78 G4double SensorLengthX = (activeParams.getInt("nPixelsX") * activeParams.getLength("pitchX")) * CLHEP::cm;
79 G4double SensorLengthY = (activeParams.getInt("nPixelsY") * activeParams.getLength("pitchY")) * CLHEP::cm;
80
81 G4double AirGap = activeParams.getLength("AirGap") * CLHEP::cm;
82
83 G4double SubstrateThickness = activeParams.getLength("SubstrateThickness") * CLHEP::cm;
84 G4double EpitaxialThickness = activeParams.getLength("EpitaxialThickness") * CLHEP::cm;
85 G4double MetalThickness = activeParams.getLength("MetalThickness") * CLHEP::cm;
86 G4double GlueThickness = activeParams.getLength("GlueThickness") * CLHEP::cm;
87 G4double KaptonThickness = activeParams.getLength("KaptonThickness") * CLHEP::cm;
88 G4double AluminiumThickness = activeParams.getLength("AluminiumThickness") * CLHEP::cm;
89 G4double foamlen = activeParams.getLength("Foam/length") * CLHEP::cm;
90 G4double foamwid = activeParams.getLength("Foam/width") * CLHEP::cm;
91 G4double foamthick = activeParams.getLength("Foam/thickness") * CLHEP::cm;
92 G4double foamZ = activeParams.getLength("Foam/zPosition") * CLHEP::cm;
93 G4double foamY = activeParams.getLength("Foam/yShift") * CLHEP::cm;
94 G4double flexlen = activeParams.getLength("Flex/length") * CLHEP::cm;
95 G4double flexwid = activeParams.getLength("Flex/width") * CLHEP::cm;
96 G4double flexZ = activeParams.getLength("Flex/zPosition") * CLHEP::cm;
97 G4double allen1 = activeParams.getLength("AlBat/length1") * CLHEP::cm;
98 G4double allen2 = activeParams.getLength("AlBat/length2") * CLHEP::cm;
99 G4double allen3 = activeParams.getLength("AlBat/length3") * CLHEP::cm;
100 G4double alwid = activeParams.getLength("AlBat/width") * CLHEP::cm;
101 G4double althick1 = activeParams.getLength("AlBat/thickness1") * CLHEP::cm;
102 G4double althick2 = activeParams.getLength("AlBat/thickness2") * CLHEP::cm;
103 G4double althick3 = activeParams.getLength("AlBat/thickness3") * CLHEP::cm;
104
105 // old geometry
106 /*
107 G4double SensorDistance = activeParams.getLength("SensorDistance") * CLHEP::cm;
108 G4double dx_foam = SensorLengthY / 2. + 0.15 * CLHEP::cm ;
109 G4double dy_foam = (SensorLengthX * 6. + 5.*SensorDistance) / 2.;
110 G4double DistanceFromFoamCenter = 0.1 * CLHEP::cm;
111 //Envelop dimension Thickness not divided by 2 to take into account of the 2 sides of foam
112 G4double dz_env = DistanceFromFoamCenter + KaptonThickness + GlueThickness +
113 AluminiumThickness + SubstrateThickness + EpitaxialThickness +
114 MetalThickness + 6. * AirGap;
115 G4Box* s_env = new G4Box("s_env", dx_foam, dy_foam, dz_env);
116 G4LogicalVolume* l_env = new G4LogicalVolume(s_env, geometry::Materials::get("Al"), "l_env");
117 G4Transform3D transformt = G4RotateZ3D(135. / 180 * M_PI - M_PI / 2.0) * G4Translate3D(0, 61,
118 42.2) * G4RotateX3D(- M_PI / 2.0 - 178. / 180 * M_PI);
119 new G4PVPlacement(transformt, l_env, "p_env1", &topVolume, false, 1);
120 transformt = G4RotateZ3D(225. / 180 * M_PI - M_PI / 2.0) * G4Translate3D(0, 84,
121 -21.8) * G4RotateX3D(- M_PI / 2.0 - 20. / 180 * M_PI);
122 new G4PVPlacement(transformt, l_env, "p_env2", &topVolume, false, 1);*/
123 //---------------
124
125 G4double dz_ladder = foamthick / 2. + KaptonThickness + GlueThickness +
126 AluminiumThickness + 3. * AirGap;
127 G4double dz_sensor = (SubstrateThickness + EpitaxialThickness +
128 MetalThickness + 2. * AirGap) / 2.;
129
130 G4double fullLength = allen1 + allen2 + allen3 - (foamZ - foamlen / 2.);
131 double zshift = fullLength / 2. - (allen1 + allen2 + allen3);
132
133 // Create support ladder
134 G4AssemblyVolume* support = new G4AssemblyVolume();
135 G4Transform3D transl;;
136
137 //create foam layer
138 G4Box* s_foam = new G4Box("s_foam", foamlen / 2., foamwid / 2., foamthick / 2.);
139 G4LogicalVolume* l_foam = new G4LogicalVolume(s_foam, geometry::Materials::get("SiC"), "PLUME.l_foam");
140 transl = G4Translate3D(foamZ + zshift, foamY, 0);
141 support->AddPlacedVolume(l_foam, transl);
142
143 //create glue layers
144 G4Box* s_glue = new G4Box("s_glue", flexlen / 2., foamwid / 2., GlueThickness / 2.);
145 G4LogicalVolume* l_glue = new G4LogicalVolume(s_glue, geometry::Materials::get("Glue"), "PLUME.l_glue");
146 G4double r_glue = foamthick / 2. + AirGap + GlueThickness / 2.;
147 transl = G4Translate3D(flexZ + zshift, foamY, -r_glue);
148 support->AddPlacedVolume(l_glue, transl);
149 transl = G4Translate3D(flexZ + zshift, foamY, r_glue);
150 support->AddPlacedVolume(l_glue, transl);
151
152 //create Kapton layers
153 G4Box* s_kapton = new G4Box("s_kapton", flexlen / 2., flexwid / 2., KaptonThickness / 2.);
154 G4LogicalVolume* l_kapton = new G4LogicalVolume(s_kapton, geometry::Materials::get("Kapton"), "PLUME.l_kapton");
155 G4double r_Kapton = r_glue + AirGap + (GlueThickness + KaptonThickness) / 2.;
156 transl = G4Translate3D(flexZ + zshift, 0, -r_Kapton);
157 support->AddPlacedVolume(l_kapton, transl);
158 transl = G4Translate3D(flexZ + zshift, 0, r_Kapton);
159 support->AddPlacedVolume(l_kapton, transl);
160
161 //create metal layers
162 G4Box* s_metal = new G4Box("s_metal", flexlen / 2., flexwid / 2., AluminiumThickness / 2.);
163 G4LogicalVolume* l_metal = new G4LogicalVolume(s_metal, geometry::Materials::get("Al"), "PLUME.l_metal");
164 G4double r_metal = r_Kapton + AirGap + (KaptonThickness + AluminiumThickness) / 2.;
165 transl = G4Translate3D(flexZ + zshift, 0, -r_metal);
166 support->AddPlacedVolume(l_metal, transl);
167 transl = G4Translate3D(flexZ + zshift, 0, r_metal);
168 support->AddPlacedVolume(l_metal, transl);
169
170 //create aluminum bat
171 G4Box* s_bat1p = new G4Box("s_bat1p", allen1 / 2., alwid / 2., althick1 / 2.);
172 double incut = foamZ + foamlen / 2.;
173 G4Box* s_bat1t = new G4Box("s_bat1t", incut, foamwid / 2., althick1 + 0.2 / 2.);
174
175 G4Transform3D tt = G4Translate3D(-allen1 / 2., foamY, 0);
176 G4SubtractionSolid* s_bat1 = new G4SubtractionSolid("s_bat1", s_bat1p, s_bat1t, tt);
177 G4Box* s_bat2 = new G4Box("s_bat2", allen2 / 2., alwid / 2., althick2 / 2.);
178 G4Box* s_bat3 = new G4Box("s_bat3", allen3 / 2., alwid / 2., althick3 / 2.);
179 G4LogicalVolume* l_bat1 = new G4LogicalVolume(s_bat1, geometry::Materials::get("Al"), "PLUME.l_bat1");
180 G4LogicalVolume* l_bat2 = new G4LogicalVolume(s_bat2, geometry::Materials::get("Al"), "PLUME.l_bat2");
181 G4LogicalVolume* l_bat3 = new G4LogicalVolume(s_bat3, geometry::Materials::get("Al"), "PLUME.l_bat3");
182 transl = G4Translate3D(allen1 / 2. + zshift, 0, 0);
183 support->AddPlacedVolume(l_bat1, transl);
184 transl = G4Translate3D(allen1 + allen2 / 2. + zshift, 0, 0);
185 support->AddPlacedVolume(l_bat2, transl);
186 transl = G4Translate3D(allen1 + allen2 + allen3 / 2. + zshift, 0, 0);
187 support->AddPlacedVolume(l_bat3, transl);
188
189 l_foam->SetVisAttributes(FoamVisAtt);
190 l_kapton->SetVisAttributes(KaptonVisAtt);
191 l_glue->SetVisAttributes(GlueVisAtt);
192 l_metal->SetVisAttributes(MetalVisAtt);
193
194
195 G4String symbol, name;
196 G4double a;
197 G4double density;
198 a = 1.01 * CLHEP::g / CLHEP::mole;
199 G4Element* elH = new G4Element("Hydrogen", "H", 1., a);
200 a = 12.01 * CLHEP::g / CLHEP::mole;
201 G4Element* elC = new G4Element("Carbon", "C", 6., a);
202 a = 16.00 * CLHEP::g / CLHEP::mole;
203 G4Element* elO = new G4Element("Oxygen", "O", 8., a);
204 density = 1.31 * CLHEP::g / CLHEP::cm3;
205 G4Material* peekMat = new G4Material("plumePeek", density, 3);
206 peekMat->AddElementByMassFraction(elC, 0.76);
207 peekMat->AddElementByMassFraction(elH, 0.08);
208 peekMat->AddElementByMassFraction(elO, 0.16);
209 density = 1.5 * CLHEP::g / CLHEP::cm3;
210 G4Material* carbMat = new G4Material("plumeCarb", density, 1);
211 carbMat->AddElementByMassFraction(elC, 1.0);
212
213 G4Box* s_sensor = new G4Box("s_sensor", SensorLengthX / 2., SensorLengthY / 2., dz_sensor);
214 G4LogicalVolume* l_sensor = new G4LogicalVolume(s_sensor, geometry::Materials::get("G4_AIR"), "PLUME.l_sensor");
215
216 // Substrate Layer //
217 G4Box* s_substrate = new G4Box("s_substrate", SensorLengthX / 2., SensorLengthY / 2., SubstrateThickness / 2.);
218 G4LogicalVolume* l_substrate = new G4LogicalVolume(s_substrate, geometry::Materials::get("Silicon"), "PLUME.l_substrate");
219 new G4PVPlacement(0, G4ThreeVector(0, 0, -dz_sensor + SubstrateThickness / 2.), l_substrate, "p_substrate", l_sensor, false, 1);
220
221 // Epitaxial Layer //
222 G4Box* s_epitaxial = new G4Box("s_epitaxial", SensorLengthX / 2., SensorLengthY / 2., EpitaxialThickness / 2.);
223 G4LogicalVolume* l_epitaxial = new G4LogicalVolume(s_epitaxial, geometry::Materials::get("Silicon"), "PLUME.l_epitaxial", 0,
225 new G4PVPlacement(0, G4ThreeVector(0, 0, -dz_sensor + AirGap + SubstrateThickness + EpitaxialThickness / 2.), l_epitaxial,
226 "p_epitaxial", l_sensor, false, 1);
227 // Metalized Layer //
228 G4Box* s_metalized = new G4Box("s_metalized", SensorLengthX / 2., SensorLengthY / 2., MetalThickness / 2.);
229 G4LogicalVolume* l_metalized = new G4LogicalVolume(s_metalized, geometry::Materials::get("SiO2Al"), "PLUME.l_metalized");
230 new G4PVPlacement(0, G4ThreeVector(0, 0, -dz_sensor + 2 * AirGap + SubstrateThickness + EpitaxialThickness + MetalThickness / 2.),
231 l_metalized, "p_metalized", l_sensor, false, 1);
232
233 // temporary
234 /*G4LogicalVolume* l_sensorMir = new G4LogicalVolume(s_sensor, geometry::Materials::get("G4_AIR"), "l_sensorMir");
235 new G4PVPlacement(0, G4ThreeVector(0, 0, -dz_sensor + MetalThickness / 2.), l_metalized, "p_metalized", l_sensorMir, false, 1);
236 new G4PVPlacement(0, G4ThreeVector(0, 0, -dz_sensor + MetalThickness + AirGap + EpitaxialThickness / 2.), l_epitaxial,
237 "p_epitaxial", l_sensorMir, false, 1);
238 new G4PVPlacement(0, G4ThreeVector(0, 0, -dz_sensor + MetalThickness + 2 * AirGap + EpitaxialThickness + SubstrateThickness / 2.),
239 l_substrate, "p_substrate", l_sensorMir, false, 1);
240 */
241
242
243 l_epitaxial->SetUserLimits(new G4UserLimits(stepSize));
244 l_substrate->SetVisAttributes(SubstrateVisAtt);
245 l_epitaxial->SetVisAttributes(EpitaxialVisAtt);
246 l_metalized->SetVisAttributes(MetalizedVisAtt);
247
248 // place 12 sensors on support ladder
249 double zSens = dz_ladder + dz_sensor + AirGap;
250 G4RotationMatrix ra;
251 G4ThreeVector Ta(0, 0, 0);
252 G4Transform3D tra(ra, Ta);
253
254 // build cooling tubes
255 GearDir pipeParams(content, "CoolingPipes");
256 double pipeLen = pipeParams.getLength("length") * CLHEP::cm;
257 double pipeInR = pipeParams.getLength("rIn") * CLHEP::cm;
258 double pipeOutR = pipeParams.getLength("rOut") * CLHEP::cm;
259 G4Tubs* pipe_s = new G4Tubs("pipe_s", pipeInR, pipeOutR, pipeLen / 2., 0, 2 * M_PI);
260
261 G4LogicalVolume* pipe_l = new G4LogicalVolume(pipe_s, carbMat, "PLUME.l_pipe");
262 double pipeX = pipeParams.getLength("x") * CLHEP::cm;
263 double pipeY = pipeParams.getLength("y") * CLHEP::cm;
264 double pipeZ = pipeParams.getLength("z") * CLHEP::cm;
265 G4double alphaPipe = pipeParams.getAngle("alpha");
266
267 //GearDir alignPars;
268 G4Box* s_sensors = new G4Box("s_sensors", flexlen / 2., flexwid / 2., dz_sensor + AirGap);
269
270 for (auto ladder : content.getNodes("Placements/Ladder")) {
271
272 std::string id = ladder.getString("@id");
273
274 G4AssemblyVolume* assemblyLadder = new G4AssemblyVolume();
275 assemblyLadder->AddPlacedAssembly(support, tra);
276
277 for (auto pars : content.getNodes("SensorAlignment/ladder")) {
278 if (pars.getString("@id") == id) {
279 GearDir alignPars(pars);
280
281 for (auto sidePars : alignPars.getNodes("side")) {
282 unsigned mirror = 0;
283
284 G4Transform3D transformSens;
285 if (sidePars.getString("@id") == "mirror") mirror = 1;
286
287 G4LogicalVolume* l_sensors = new G4LogicalVolume(s_sensors, geometry::Materials::get("G4_AIR"), "PLUME.l_sensors");
288
289 for (auto sensorPars : sidePars.getNodes("sensor")) {
290 double x = sensorPars.getLength("x") * CLHEP::cm + zshift;
291 double y = sensorPars.getLength("y") * CLHEP::cm;
292 int ids = sensorPars.getInt("id");
293 y = mirror ? -y : y;
294 y -= alwid / 2.;
295 double alpha1 = sensorPars.getAngle("alpha") * CLHEP::rad;
296 if (mirror) transformSens = G4Translate3D(x, y,
297 0) * G4RotateZ3D(alpha1) * G4RotateX3D(M_PI); // think if this is correct, rotation and pos shift for mirror side
298 else transformSens = G4Translate3D(x, y, 0) * G4RotateZ3D(-alpha1);
299
300 new G4PVPlacement(transformSens, l_sensor, "p_sensor", l_sensors, true,
301 (ids + mirror * 6 + LadderID * 12));
302 }
303 transformSens = G4Translate3D(0, 0, mirror ? -zSens : zSens);
304 assemblyLadder->AddPlacedVolume(l_sensors, transformSens);
305 }
306 }
307 }
308
309
310
311 G4double thetaZ = ladder.getAngle("ThetaZ");
312 G4double r = ladder.getLength("r_plume") * CLHEP::cm - zshift * sin(thetaZ);
313 G4double z = ladder.getLength("z_plume") * CLHEP::cm - zshift * cos(thetaZ);
314 G4double phi = ladder.getAngle("Phi");
315 G4double alpha = ladder.getAngle("Alpha");
316
317
318 // place cooling pipes
319 G4Transform3D transformPipe = G4Translate3D(pipeZ + zshift, pipeY, pipeX) * G4RotateZ3D(alphaPipe) * G4RotateY3D(+ M_PI / 2.);
320 assemblyLadder->AddPlacedVolume(pipe_l, transformPipe);
321 transformPipe = G4Translate3D(pipeZ + zshift
322 , pipeY, -pipeX) * G4RotateZ3D(alphaPipe) * G4RotateY3D(+ M_PI / 2.);
323 assemblyLadder->AddPlacedVolume(pipe_l, transformPipe);
324
325
326 G4Transform3D transform1;
327 if (LadderID == 1) {
328 G4AssemblyVolume* sup1 = buildSupport1();
329 G4AssemblyVolume* sup2 = buildSupport2();
330 transform1 = G4Translate3D(-fullLength / 2. - 18.7, 0., 1.2) * G4RotateY3D(thetaZ) * G4RotateX3D(M_PI / 2.) * G4RotateY3D(M_PI);
331 assemblyLadder->AddPlacedAssembly(sup1, transform1);
332 transform1 = G4Translate3D(fullLength / 2. + 19.5, 0, -2.6) * G4RotateY3D(thetaZ) * G4RotateX3D(M_PI / 2.);
333 assemblyLadder->AddPlacedAssembly(sup2, transform1);
334 }
335
336 if (LadderID == 0) {
337 G4AssemblyVolume* sup1 = buildSupport3();
338 G4AssemblyVolume* sup2 = buildSupport4();
339 transform1 = G4Translate3D(fullLength / 2. + 5, 0,
340 7.8) * G4RotateY3D(-thetaZ) * G4RotateZ3D(M_PI / 2.) * G4RotateX3D(M_PI / 2.) * G4RotateY3D(M_PI / 2.);
341 assemblyLadder->AddPlacedAssembly(sup1, transform1);
342 transform1 = G4Translate3D(-fullLength / 2. - 31, 0.,
343 -21.7) * G4RotateY3D(-thetaZ) * G4RotateZ3D(M_PI / 2.) * G4RotateX3D(-M_PI / 2.) * G4RotateY3D(M_PI);
344 assemblyLadder->AddPlacedAssembly(sup2, transform1);
345 }
346
347 G4Transform3D transform = G4RotateZ3D(phi) * G4Translate3D(r, 0,
348 z) * G4RotateY3D(thetaZ) * G4RotateZ3D(alpha + M_PI) * G4RotateY3D(- M_PI / 2.0);
349
350 assemblyLadder->MakeImprint(&topVolume, transform);
351
352 LadderID += 1;
353
354 }
355
356 }
357
358
359 G4AssemblyVolume* PlumeCreator::buildSupport1()
360 {
361
362 std::vector<G4TwoVector> points = {G4TwoVector(-11.6, 0.371), G4TwoVector(-11.504, -2.378), G4TwoVector(-1.51, -2.029), G4TwoVector(-1.51, -4.13), G4TwoVector(-11.561, -4.481), G4TwoVector(-11.686, -6.629), G4TwoVector(2.584, -6.629), G4TwoVector(4.974, -4.239), G4TwoVector(4.974, 1.761), G4TwoVector(2.0, 1.761), G4TwoVector(0.61, 0.371)};
363
364 G4Material* peek = G4Material::GetMaterial("plumePeek");
365 G4ExtrudedSolid* s1_peek0 = new G4ExtrudedSolid("s1_peek0", points, 10.0, G4TwoVector(0, 0), 1, G4TwoVector(0, 0), 1);
366 G4LogicalVolume* l1_peek0 = new G4LogicalVolume(s1_peek0, peek, "PLUME.l1_peek0");
367
368 G4Box* s1_peek1 = new G4Box("s1_peek1", 24. / 2., 6. / 2., 20. / 2.);
369 G4Box* s1_peek2 = new G4Box("s1_peek2", 19.4 / 2., 3. / 2., 20. / 2.);
370 G4LogicalVolume* l1_peek1 = new G4LogicalVolume(s1_peek1, peek, "PLUME.l1_peek1");
371 G4LogicalVolume* l1_peek2 = new G4LogicalVolume(s1_peek2, peek, "PLUME.l1_peek2");
372
373 G4AssemblyVolume* assemblySup = new G4AssemblyVolume();
374
375 G4Transform3D transform = G4Translate3D(0, 0., 0);
376
377 assemblySup->AddPlacedVolume(l1_peek1, transform);
378
379 transform = G4Translate3D(-16.974, 1.239, 0);
380 assemblySup->AddPlacedVolume(l1_peek0, transform);
381
382 transform = G4Translate3D(21.7, 1.5, 0);
383 assemblySup->AddPlacedVolume(l1_peek2, transform);
384
385 G4Trd* s1_al0 = new G4Trd("s1_al0", 12. / 2., 20. / 2., 3. / 2., 3. / 2., 94.5 / 2.);
386 G4Box* s1_al1 = new G4Box("s1_al1", 12. / 2., 20.5 / 2., 3.5 / 2.);
387 G4Box* s1_al2 = new G4Box("s1_al2", 12. / 2., 4.0 / 2., 10.5 / 2.);
388
389 G4LogicalVolume* l1_al0 = new G4LogicalVolume(s1_al0, geometry::Materials::get("Al"), "PLUME.l1_al0");
390 G4LogicalVolume* l1_al1 = new G4LogicalVolume(s1_al1, geometry::Materials::get("Al"), "PLUME.l1_al1");
391 G4LogicalVolume* l1_al2 = new G4LogicalVolume(s1_al2, geometry::Materials::get("Al"), "PLUME.l1_al2");
392
393 transform = G4Translate3D(59.25, -1.5, 0) * G4RotateY3D(-M_PI / 2.);
394 assemblySup->AddPlacedVolume(l1_al0, transform);
395
396 transform = G4Translate3D(108.25, -20.5 / 2., 0) * G4RotateY3D(-M_PI / 2.);
397 assemblySup->AddPlacedVolume(l1_al1, transform);
398
399 transform = G4Translate3D(115.25, -18.5, 0) * G4RotateY3D(-M_PI / 2.);
400 assemblySup->AddPlacedVolume(l1_al2, transform);
401
402 return assemblySup;
403 }
404
405
406 G4AssemblyVolume* PlumeCreator::buildSupport2()
407 {
408
409 std::vector<G4TwoVector> points = {G4TwoVector(-10.6, 0), G4TwoVector(-10.6, -1.7), G4TwoVector(-0.606, -2.049), G4TwoVector(-0.606, -4.15), G4TwoVector(-10.6, -3.801), G4TwoVector(-10.6, -6.11), G4TwoVector(2.28, -6.11), G4TwoVector(5.39, -3.0), G4TwoVector(23.4, -3), G4TwoVector(23.4, 0.)};
410 G4Material* peek = G4Material::GetMaterial("plumePeek");
411 G4ExtrudedSolid* s2_peek0 = new G4ExtrudedSolid("s2_peek0", points, 16.0, G4TwoVector(0, 0), 1, G4TwoVector(0, 0), 1);
412 G4LogicalVolume* l2_peek0 = new G4LogicalVolume(s2_peek0, peek, "PLUME.l2_peek0");
413
414
415 G4Box* s2_peek1 = new G4Box("s2_peek1", 10. / 2., 6.7 / 2., 12.5 / 2.);
416 G4Box* s2_peek2 = new G4Box("s2_peek2", 39.0 / 2., 4. / 2., 12.5 / 2.);
417 G4LogicalVolume* l2_peek1 = new G4LogicalVolume(s2_peek1, peek, "PLUME.l2_peek1");
418 G4LogicalVolume* l2_peek2 = new G4LogicalVolume(s2_peek2, peek, "PLUME.l2_peek2");
419
420 G4AssemblyVolume* assemblySup = new G4AssemblyVolume();
421
422 G4Transform3D transform = G4Translate3D(0, 0., 0);
423
424 assemblySup->AddPlacedVolume(l2_peek1, transform);
425
426 transform = G4Translate3D(-18.4, 6.35, 0);
427 assemblySup->AddPlacedVolume(l2_peek0, transform);
428
429 transform = G4Translate3D(24.5, -1.35, 0);
430 assemblySup->AddPlacedVolume(l2_peek2, transform);
431
432 G4Box* s2_al0 = new G4Box("s2_al0", 140. / 2., 4. / 2., 12. / 2.);
433 G4LogicalVolume* l2_al0 = new G4LogicalVolume(s2_al0, geometry::Materials::get("Al"), "PLUME.l2_al0");
434
435 transform = G4Translate3D(-26.0, -5.35, 0);
436 assemblySup->AddPlacedVolume(l2_al0, transform);
437
438 return assemblySup;
439 }
440
441
442 G4AssemblyVolume* PlumeCreator::buildSupport3()
443 {
444
445 std::vector<G4TwoVector> points = {G4TwoVector(4.7, -59.87), G4TwoVector(/*4.109*/4.7, -68.0), G4TwoVector(19.577, -62.97), G4TwoVector(18.96, -61.07), G4TwoVector(9.449, -64.162), G4TwoVector(8.8, -62.165), G4TwoVector(18.31, -59.075), G4TwoVector(17.693, -57.172), G4TwoVector(6.655, -59.873)};
446 G4Material* peek = G4Material::GetMaterial("plumePeek");
447 G4ExtrudedSolid* s3_peek0 = new G4ExtrudedSolid("s3_peek0", points, 16.0, G4TwoVector(0, 0), 1, G4TwoVector(0, 0), 1);
448 G4LogicalVolume* l3_peek0 = new G4LogicalVolume(s3_peek0, peek, "PLUME.l3_peek0");
449
450 G4Box* s3_tmp0 = new G4Box("s3_tmp0", 5. / 2., 21.5 / 2., 32. / 2.);
451 G4Box* s3_tmp1 = new G4Box("s3_tmp1", 5.2 / 2., 6.5 / 2., 30. / 2.);
452 G4Transform3D transform = G4Translate3D(0, -1.6, 0);
453 G4SubtractionSolid* s3_peek1 = new G4SubtractionSolid("s3_peek1", s3_tmp0, s3_tmp1, transform);
454
455 G4Trd* s3_peek2 = new G4Trd("s3_peek2", 5. / 2., 5. / 2., 16., 10., 3.0);
456 G4Box* s3_peek3 = new G4Box("s3_peek3", 3. / 2., 15.5 / 2., 20. / 2.);
457 G4LogicalVolume* l3_peek1 = new G4LogicalVolume(s3_peek1, peek, "PLUME.l3_peek1");
458 G4LogicalVolume* l3_peek2 = new G4LogicalVolume(s3_peek2, peek, "PLUME.l3_peek2");
459 G4LogicalVolume* l3_peek3 = new G4LogicalVolume(s3_peek3, peek, "PLUME.l3_peek3");
460
461 G4AssemblyVolume* assemblySup = new G4AssemblyVolume();
462
463 G4ThreeVector Ta(0, 0, 0);
464 G4RotationMatrix ra;
465 G4Transform3D tra(ra, Ta);
466 assemblySup->AddPlacedVolume(l3_peek1, tra);
467 Ta.setY(21.5 / 2. + 3.0);
468 ra.rotateX(-M_PI / 2.);
469 tra = G4Transform3D(ra, Ta);
470 assemblySup->AddPlacedVolume(l3_peek2, tra);
471 Ta.setY(21.5 / 2. + 6.0 + 15.5 / 2.); Ta.setX(-1.0);
472 ra.rotateX(M_PI / 2.);
473 tra = G4Transform3D(ra, Ta);
474 assemblySup->AddPlacedVolume(l3_peek3, tra);
475
476 Ta.setY(57.25); Ta.setX(-2.2);
477 tra = G4Transform3D(ra, Ta);
478 assemblySup->AddPlacedVolume(l3_peek0, tra);
479
480
481 G4Trd* s3_al0 = new G4Trd("s3_al0", 3. / 2., 3. / 2., 10.0, 6.0, 51.1566 / 2.);
482 G4Box* s3_al1 = new G4Box("s3_al1", 12. / 2., 4. / 2., 12. / 2.);
483 G4LogicalVolume* l3_al0 = new G4LogicalVolume(s3_al0, geometry::Materials::get("Al"), "PLUME.l3_al0");
484 G4LogicalVolume* l3_al1 = new G4LogicalVolume(s3_al1, geometry::Materials::get("Al"), "PLUME.l3_al1");
485 ra.rotateX(-M_PI / 2.);
486 Ta.setY(21.5 / 2. + 6.0 + 51.1566 / 2.); Ta.setX(+2.0);
487 tra = G4Transform3D(ra, Ta);
488 assemblySup->AddPlacedVolume(l3_al0, tra);
489 ra.rotateX(M_PI / 2.);
490 Ta.setY(21.5 / 2. + 6.0 + 51.1566 + 2.); Ta.setX(-2.5);
491 tra = G4Transform3D(ra, Ta);
492 assemblySup->AddPlacedVolume(l3_al1, tra);
493 return assemblySup;
494 }
495
496 G4AssemblyVolume* PlumeCreator::buildSupport4()
497 {
498
499
500 std::vector<G4TwoVector> points = {G4TwoVector(-36.8, 6.645), G4TwoVector(-26.65, 9.94), G4TwoVector(-16.04, -3.0), G4TwoVector(3.5, -3.0), G4TwoVector(3.5, 0.0), G4TwoVector(-14.62, 0.0), G4TwoVector(-27.742, 16.0), G4TwoVector(-38.68, 12.446), G4TwoVector(-38.062, 10.544), G4TwoVector(-28.551, 13.634), G4TwoVector(-27.9, 11.637), G4TwoVector(-37.41, 8.547)};
501 G4Material* peek = G4Material::GetMaterial("plumePeek");
502 G4ExtrudedSolid* s4_peek0 = new G4ExtrudedSolid("s4_peek0", points, 10.0, G4TwoVector(0, 0), 1, G4TwoVector(0, 0), 1);
503 G4LogicalVolume* l4_peek0 = new G4LogicalVolume(s4_peek0, peek, "PLUME.l4_peek0");
504
505 G4Trd* s4_al0 = new G4Trd("s4_al0", 12. / 2., 20. / 2., 3. / 2., 3. / 2., 36.5 / 2.);
506 G4Box* s4_al1 = new G4Box("s4_al1", 12. / 2., 16. / 2., 3.5 / 2.);
507 G4Box* s4_al2 = new G4Box("s4_al2", 12. / 2., 4. / 2., 14. / 2.);
508
509 G4LogicalVolume* l4_al0 = new G4LogicalVolume(s4_al0, geometry::Materials::get("Al"), "PLUME.l4_al0");
510 G4LogicalVolume* l4_al1 = new G4LogicalVolume(s4_al1, geometry::Materials::get("Al"), "PLUME.l4_al1");
511 G4LogicalVolume* l4_al2 = new G4LogicalVolume(s4_al2, geometry::Materials::get("Al"), "PLUME.l4_al2");
512
513 G4ThreeVector transl(0, 0, 0);
514 G4RotationMatrix ra;
515 G4Transform3D trans(ra, transl);
516 G4AssemblyVolume* assem_al = new G4AssemblyVolume();
517 assem_al->AddPlacedVolume(l4_al0, trans);
518 transl.setY(-16. / 2. + 3. / 2.); transl.setZ(-36.5 / 2. - 3.5 / 2.);
519 trans = G4Transform3D(ra, transl);
520 assem_al->AddPlacedVolume(l4_al1, trans);
521 transl.setZ(-36.5 / 2. - 14. / 2.); transl.setY(-16.5);
522 trans = G4Transform3D(ra, transl);
523 assem_al->AddPlacedVolume(l4_al2, trans);
524 ra.rotateY(M_PI / 2.); ra.rotateZ(M_PI);
525 transl.setZ(36.5 / 2. - 10.5); transl.setY(1.50);
526 trans = G4Transform3D(ra, transl);
527 assem_al->AddPlacedVolume(l4_peek0, trans);
528
529 return assem_al;
530 }
531
532 } // plume namespace
534} // Belle2 namespace
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
double getAngle(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard angle unit.
Definition: Interface.h:299
double getLength(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard length unit.
Definition: Interface.h:259
std::vector< GearDir > getNodes(const std::string &path="") const
Get vector of GearDirs which point to all the nodes the given path evaluates to.
Definition: Interface.cc:21
int getInt(const std::string &path="") const noexcept(false)
Get the parameter path as a int.
Definition: Interface.cc:60
static G4Material * get(const std::string &name)
Find given material.
Definition: Materials.h:63
G4AssemblyVolume * buildSupport1()
Volume of support1.
G4AssemblyVolume * buildSupport2()
Volume of support2.
virtual ~PlumeCreator()
Destructor.
Definition: PlumeCreator.cc:53
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Creation of the detector geometry from Gearbox (XML).
Definition: PlumeCreator.cc:58
G4AssemblyVolume * buildSupport4()
Volume of support4.
G4AssemblyVolume * buildSupport3()
Volume of support3.
SensitiveDetector * m_sensitive
SensitiveDetector PLUME.
Definition: PlumeCreator.h:47
Sensitive Detector implementation of the PLUME detector.
GeometryTypes
Flag indicating the type of geometry to be used.
geometry::CreatorFactory< PlumeCreator > PlumeFactory("PLUMECreator")
Creator creates the PLUME geometry.
Abstract base class for different kinds of events.
STL namespace.
Very simple class to provide an easy way to register creators with the CreatorManager.