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