Belle II Software  release-05-01-25
GeoTOPCreator.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Petric, Marko Staric *
7  * Major revision: 2016 *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 #include <top/geometry/GeoTOPCreator.h>
13 #include <top/geometry/TOPGeometryPar.h>
14 
15 #include <geometry/Materials.h>
16 #include <geometry/CreatorFactory.h>
17 #include <geometry/utilities.h>
18 #include <framework/gearbox/GearDir.h>
19 #include <framework/gearbox/Unit.h>
20 #include <framework/logging/Logger.h>
21 #include <framework/database/Database.h>
22 #include <framework/database/IntervalOfValidity.h>
23 #include <framework/database/DBImportObjPtr.h>
24 #include <framework/database/DBObjPtr.h>
25 #include <top/simulation/SensitivePMT.h>
26 #include <top/simulation/SensitiveBar.h>
27 #include <simulation/background/BkgSensitiveDetector.h>
28 #include <simulation/kernel/RunManager.h>
29 
30 #include <cmath>
31 
32 #include <G4LogicalVolume.hh>
33 #include <G4PVPlacement.hh>
34 #include <G4AssemblyVolume.hh>
35 #include <G4LogicalSkinSurface.hh>
36 #include <G4OpticalSurface.hh>
37 
38 #include <G4Box.hh>
39 #include <G4UserLimits.hh>
40 #include <G4Material.hh>
41 #include <G4ExtrudedSolid.hh>
42 #include <G4UnionSolid.hh>
43 #include <G4Sphere.hh>
44 #include <G4IntersectionSolid.hh>
45 #include <G4SubtractionSolid.hh>
46 #include <G4Region.hh>
47 #include <G4Colour.hh>
48 #include <G4TwoVector.hh>
49 #include <G4ThreeVector.hh>
50 
51 #include <sstream>
52 
53 using namespace std;
54 
55 namespace Belle2 {
61  using namespace geometry;
62 
63  namespace TOP {
64 
66  geometry::CreatorFactory<GeoTOPCreator> GeoTOPFactory("TOPCreator");
67 
68 
69  GeoTOPCreator::GeoTOPCreator()
70  {}
71 
72 
73  GeoTOPCreator::~GeoTOPCreator()
74  {
75  if (m_sensitivePMT) delete m_sensitivePMT;
76  if (m_sensitiveBar) delete m_sensitiveBar;
77  if (m_sensitivePCB1) delete m_sensitivePCB1;
78  if (m_sensitivePCB2) delete m_sensitivePCB2;
79  G4LogicalSkinSurface::CleanSurfaceTable();
80  }
81 
82 
83  void GeoTOPCreator::create(const GearDir& content, G4LogicalVolume& topVolume,
85  {
86 
87  m_isBeamBkgStudy = content.getInt("BeamBackgroundStudy");
88 
89  m_topgp->Initialize(content);
90  if (!m_topgp->isValid()) {
91  B2ERROR("TOP: geometry or mappers not valid (gearbox) - geometry not created");
92  return;
93  }
94 
95  const auto* geo = m_topgp->getGeometry();
96  createGeometry(*geo, topVolume, type);
97 
98  }
99 
100 
101  void GeoTOPCreator::createPayloads(const GearDir& content,
102  const IntervalOfValidity& iov)
103  {
104  m_topgp->Initialize(content);
105  if (!m_topgp->isValid()) {
106  B2ERROR("TOP: geometry or mappers not valid (gearbox) - no payloads imported");
107  return;
108  }
109 
110  DBImportObjPtr<TOPGeometry> importObj;
111  const auto* geo = m_topgp->getGeometry();
112  importObj.construct(*geo);
113  importObj.import(iov);
114 
115  m_topgp->getChannelMapper().import(iov);
116  m_topgp->getFrontEndMapper().import(iov);
117 
118  B2RESULT("TOP: geometry and mappers imported to database");
119 
120  }
121 
122 
123  void GeoTOPCreator::createFromDB(const std::string& name, G4LogicalVolume& topVolume,
125  {
126 
127  m_topgp->Initialize();
128  if (!m_topgp->isValid()) {
129  B2ERROR("Cannot create Geometry from Database: no configuration found for "
130  << name);
131  return;
132  }
133 
134  const auto* geo = m_topgp->getGeometry();
135  createGeometry(*geo, topVolume, type);
136 
137  }
138 
139 
140  void GeoTOPCreator::createGeometry(const TOPGeometry& geo,
141  G4LogicalVolume& topVolume,
143  {
144  m_sensitivePMT = new SensitivePMT();
145  m_sensitiveBar = new SensitiveBar();
146 
147  m_sensitivePMT->setModuleReplicaDepth(4);
148  m_sensitiveBar->setReplicaDepth(1);
149 
150  geo.useGeantUnits();
151 
152  double backwardLength = geo.getQBB().getPrismEnclosure().getLength();
153  double prismPosition = geo.getQBB().getPrismPosition();
154 
155  G4Region* aRegion = new G4Region("TOPEnvelope");
156 
157  for (const auto& geoModule : geo.getModules()) {
158  int moduleID = geoModule.getModuleID();
159  double barLength = geoModule.getBarLength();
160 
161  // go to local (bar) frame
162 
163  G4Transform3D T1 =
164  G4TranslateZ3D(backwardLength / 2 - prismPosition - barLength / 2);
165 
166  // displaced geometry
167 
168  const auto& displacement = geoModule.getModuleDisplacement();
169  G4Transform3D dRx = G4RotateX3D(displacement.getAlpha());
170  G4Transform3D dRy = G4RotateY3D(displacement.getBeta());
171  G4Transform3D dRz = G4RotateZ3D(displacement.getGamma());
172  G4Transform3D dtr = G4Translate3D(displacement.getX(),
173  displacement.getY(),
174  displacement.getZ());
175  G4Transform3D D = dtr * dRz * dRy * dRx;
176 
177  // position the module
178 
179  double radius = geoModule.getRadius();
180  double backwardZ = geoModule.getBackwardZ();
181  G4Transform3D tr = G4Translate3D(0, radius, barLength / 2 + backwardZ);
182  double phi = geoModule.getPhi() - M_PI / 2;
183  G4Transform3D Rz = G4RotateZ3D(phi);
184  G4Transform3D T = Rz * tr * D * T1;
185  auto* module = createModule(geo, moduleID);
186  std::string name = geoModule.getName();
187 
188  // Set up region for production cuts
189  module->SetRegion(aRegion);
190  aRegion->AddRootLogicalVolume(module);
191 
192  new G4PVPlacement(T, module, name, &topVolume, false, moduleID);
193  }
194 
195  if (m_numDecoupledPMTs > 0) B2WARNING("GeoTOPCreator, " << m_numDecoupledPMTs
196  << " PMT's are optically decoupled");
197  if (m_numBrokenGlues > 0) B2WARNING("GeoTOPCreator, " << m_numBrokenGlues
198  << " broken glues");
199  if (m_numPeelOffRegions > 0) B2WARNING("GeoTOPCreator, " << m_numPeelOffRegions
200  << " peel-off cookie regions");
201  }
202 
203 
204  G4LogicalVolume* GeoTOPCreator::createModule(const TOPGeometry& geo, int moduleID)
205  {
206  // note: z = 0 is at center of backward envelope
207 
208  G4ThreeVector move;
209  G4RotationMatrix rot;
210 
211  // create module envelope volume
212 
213  const auto& geoQBB = geo.getQBB();
214  auto* module = createModuleEnvelope(geoQBB, moduleID);
215 
216  // add quartz optics together with PMT array
217 
218  const auto& geoModule = geo.getModule(moduleID);
219  auto* optics = assembleOptics(geoModule);
220 
221  move.setZ(geoQBB.getPrismPosition() - geoQBB.getPrismEnclosure().getLength() / 2);
222  optics->MakeImprint(module, move, &rot);
223 
224  // add front-end electronics
225 
226  if (!m_frontEnd) {
227  m_frontEnd = assembleFrontEnd(geo.getFrontEnd(), geo.getNumBoardStacks());
228  }
229  double Lprism = geoModule.getPrism().getFullLength();
230  double Larray = geoModule.getPMTArray().getSizeZ();
231  move.setZ(move.z() - Lprism - Larray);
232  m_frontEnd->MakeImprint(module, move, &rot);
233 
234  // add QBB
235 
236  if (!m_qbb) m_qbb = assembleQBB(geoQBB);
237  move.setZ(0);
238  m_qbb->MakeImprint(module, move, &rot);
239 
240  return module;
241  }
242 
243 
244  G4LogicalVolume* GeoTOPCreator::createModuleEnvelope(const TOPGeoQBB& geo,
245  int moduleID)
246  {
247  // note: z = 0 is at center of backward envelope
248 
249  if (!m_moduleEnvelope) {
250  double backwardLength = geo.getPrismEnclosure().getLength();
251  double forwardLength = geo.getLength() - backwardLength;
252  std::vector<G4TwoVector> polygon;
253  for (auto& point : geo.getBackwardContour()) {
254  polygon.push_back(G4TwoVector(point.first, point.second));
255  }
256  auto* backward = new G4ExtrudedSolid("backwardEnvelope",
257  polygon, backwardLength / 2,
258  G4TwoVector(), 1, G4TwoVector(), 1);
259  polygon.clear();
260  for (auto& point : geo.getForwardContour()) {
261  polygon.push_back(G4TwoVector(point.first, point.second));
262  }
263  auto* forward = new G4ExtrudedSolid("forwardEnvelope",
264  polygon, forwardLength / 2,
265  G4TwoVector(), 1, G4TwoVector(), 1);
266 
267  G4Transform3D move = G4TranslateZ3D((backwardLength + forwardLength) / 2);
268  m_moduleEnvelope = new G4UnionSolid("moduleEnvelope", backward, forward, move);
269  }
270 
271  G4Material* material = Materials::get(geo.getMaterial());
272  if (!material) B2FATAL("Material '" << geo.getMaterial() << "' not found");
273 
274  std::string name = addNumber("TOPEnvelopeModule", moduleID);
275  return new G4LogicalVolume(m_moduleEnvelope, material, name);
276 
277  }
278 
279 
280  G4AssemblyVolume* GeoTOPCreator::assembleFrontEnd(const TOPGeoFrontEnd& geo, int N)
281  {
282  auto* frontEnd = new G4AssemblyVolume();
283  Simulation::RunManager::Instance().addAssemblyVolume(frontEnd);
284 
285  G4ThreeVector move;
286 
287  // front board
288 
289  double Z = -geo.getFrontBoardGap();
290  double length = geo.getFrontBoardThickness();
291  auto* frontBoard = createBox("TOPFrontBoard",
292  geo.getFrontBoardWidth(),
293  geo.getFrontBoardHeight(),
294  length,
295  geo.getFrontBoardMaterial());
296  if (m_isBeamBkgStudy) {
297  if (!m_sensitivePCB1) m_sensitivePCB1 = new BkgSensitiveDetector("TOP", 1);
298  frontBoard->SetSensitiveDetector(m_sensitivePCB1);
299  }
300  move.setZ(Z - length / 2);
301  move.setY(geo.getFrontBoardY());
302  frontEnd->AddPlacedVolume(frontBoard, move, 0);
303  Z -= length;
304 
305  // HV board
306 
307  length = geo.getHVBoardLength();
308  auto* HVBoard = createBox("TOPHVBoard",
309  geo.getHVBoardWidth(),
310  geo.getHVBoardThickness(),
311  length,
312  geo.getHVBoardMaterial());
313  if (m_isBeamBkgStudy) {
314  if (!m_sensitivePCB2) m_sensitivePCB2 = new BkgSensitiveDetector("TOP", 2);
315  HVBoard->SetSensitiveDetector(m_sensitivePCB2);
316  }
317  move.setZ(Z - geo.getHVBoardGap() - length / 2);
318  move.setY(geo.getHVBoardY());
319  frontEnd->AddPlacedVolume(HVBoard, move, 0);
320 
321  // board stack
322 
323  length = geo.getBoardStackLength();
324  move.setZ(Z - geo.getBoardStackGap() - length / 2);
325  move.setY(geo.getBoardStackY());
326  auto* boardStack = createBoardStack(geo, N);
327  frontEnd->AddPlacedVolume(boardStack, move, 0);
328 
329  return frontEnd;
330  }
331 
332 
333  G4LogicalVolume* GeoTOPCreator::createBoardStack(const TOPGeoFrontEnd& geo, int N)
334  {
335  double width = geo.getBoardStackWidth();
336  double fullWidth = width * N;
337  std::string name = "TOPBoardStack";
338  auto* boardStack = createBox(name,
339  fullWidth,
340  geo.getBoardStackHeight(),
341  geo.getBoardStackLength(),
342  geo.getBoardStackMaterial());
343 
344  double spacerWidth = geo.getSpacerWidth();
345  std::string name1 = name + "Spacer";
346  auto* spacer = createBox(name1,
347  spacerWidth,
348  geo.getBoardStackHeight(),
349  geo.getBoardStackLength(),
350  geo.getSpacerMaterial());
351 
352  std::string name2 = name + "TwoSpacers";
353  auto* twoSpacers = createBox(name2,
354  spacerWidth * 2,
355  geo.getBoardStackHeight(),
356  geo.getBoardStackLength(),
357  geo.getSpacerMaterial());
358 
359  G4Transform3D move;
360  move = G4TranslateX3D(-(fullWidth - spacerWidth) / 2);
361  new G4PVPlacement(move, spacer, name1, boardStack, false, 1);
362  move = G4TranslateX3D((fullWidth - spacerWidth) / 2);
363  new G4PVPlacement(move, spacer, name1, boardStack, false, 2);
364 
365  int n = N - 1;
366  for (int i = 0; i < n; i++) {
367  move = G4TranslateX3D(width * (2 * i - n + 1) / 2.0);
368  new G4PVPlacement(move, twoSpacers, name2, boardStack, false, i + 1);
369  }
370 
371  return boardStack;
372  }
373 
374 
375  G4AssemblyVolume* GeoTOPCreator::assembleQBB(const TOPGeoQBB& geo)
376  {
377  auto* qbb = new G4AssemblyVolume();
378  Simulation::RunManager::Instance().addAssemblyVolume(qbb);
379 
380  double Zback = -geo.getPrismEnclosure().getLength() / 2;
381  double Zfront = Zback + geo.getLength() - geo.getForwardEndPlate().getThickness();
382 
383  G4ThreeVector move;
384 
385  // outer panel
386 
387  auto* outerPanel = createHoneycombPanel(geo, c_Outer);
388  move.setZ(Zfront - geo.getOuterPanel().getLength() / 2);
389  qbb->AddPlacedVolume(outerPanel, move, 0);
390 
391  // inner panel
392 
393  auto* innerPanel = createHoneycombPanel(geo, c_Inner);
394  move.setZ(Zfront - geo.getInnerPanel().getLength() / 2);
395  qbb->AddPlacedVolume(innerPanel, move, 0);
396 
397  // forward end plate
398 
399  double length = geo.getForwardEndPlate().getThickness();
400  auto* forwardEndPlate = createBox(geo.getForwardEndPlate().getName(),
401  geo.getWidth(),
403  length,
405  move.setZ(Zfront + length / 2);
406  qbb->AddPlacedVolume(forwardEndPlate, move, 0);
407 
408  // prism enclosure box
409 
410  std::string name = geo.getPrismEnclosure().getName();
411  double Z = Zback;
412  length = geo.getPrismEnclosure().getBackThickness();
413  auto* backPlate = createExtrudedSolid(name + "BackPlate",
414  geo.getBackPlateContour(),
415  length,
417  move.setZ(Z + length / 2);
418  qbb->AddPlacedVolume(backPlate, move, 0);
419  Z += length;
420 
421  length = geo.getPrismEnclosure().getBodyLength();
422  auto* prismEnclosure = createExtrudedSolid(name + "Body",
424  length,
426  move.setZ(Z + length / 2);
427  qbb->AddPlacedVolume(prismEnclosure, move, 0);
428  Z += length;
429 
430  length = geo.getPrismEnclosure().getFrontThickness();
431  auto* frontPlate = createExtrudedSolid(name + "FrontPlate",
432  geo.getFrontPlateContour(),
433  length,
435  move.setZ(Z + length / 2);
436  qbb->AddPlacedVolume(frontPlate, move, 0);
437  Z += length;
438 
439  length = Zfront - Z - geo.getInnerPanel().getLength();
440  if (length > 0) {
441  double height = geo.getPrismEnclosure().getExtensionThickness();
442  auto* extPlate = createBox(name + "ExtensionPlate",
443  geo.getPanelWidth(),
444  height,
445  length,
447 
448  G4ThreeVector movePlate;
449  movePlate.setZ(Z + length / 2);
450  movePlate.setY((height - geo.getSideRails().getHeight()) / 2);
451  qbb->AddPlacedVolume(extPlate, movePlate, 0);
452  }
453 
454  // side rails
455 
456  auto* leftRail = createSideRail(geo, c_Left);
457  move.setZ(Zfront - geo.getSideRailsLength() / 2);
458  move.setY(geo.getOuterPanel().getY() + geo.getOuterPanel().getMinThickness() -
459  geo.getSideRails().getHeight() / 2);
460  move.setX(-(geo.getWidth() - geo.getSideRails().getThickness()) / 2);
461  qbb->AddPlacedVolume(leftRail, move, 0);
462 
463  auto* rightRail = createSideRail(geo, c_Right);
464  move.setX((geo.getWidth() - geo.getSideRails().getThickness()) / 2);
465  qbb->AddPlacedVolume(rightRail, move, 0);
466 
467  // cold plate
468 
469  length = geo.getLength() - geo.getPrismEnclosure().getBackThickness() -
471  auto* coldPlateBase = createBox(geo.getColdPlate().getName() + "Base",
472  geo.getPanelWidth(),
474  length,
475  geo.getColdPlate().getBaseMaterial());
476  move.setZ(Zback + geo.getPrismEnclosure().getBackThickness() + length / 2);
477  move.setY(geo.getOuterPanel().getY() + geo.getOuterPanel().getMinThickness() -
478  geo.getColdPlate().getBaseThickness() / 2);
479  move.setX(0);
480  qbb->AddPlacedVolume(coldPlateBase, move, 0);
481 
482  auto* coldPlateCool = createBox(geo.getColdPlate().getName() + "Cooler",
483  geo.getColdPlate().getCoolWidth(),
485  length,
486  geo.getColdPlate().getCoolMaterial());
487  move.setY(geo.getOuterPanel().getY() + geo.getOuterPanel().getMinThickness() +
488  geo.getColdPlate().getCoolThickness() / 2);
489  qbb->AddPlacedVolume(coldPlateCool, move, 0);
490 
491  return qbb;
492  }
493 
494 
495  G4LogicalVolume* GeoTOPCreator::createHoneycombPanel(const TOPGeoQBB& geo,
496  EPanelType type)
497  {
498  G4Transform3D move;
499 
500  TOPGeoHoneycombPanel geoPanel;
501  Polygon contour;
502  double sideEdgeHeight = 0;
503  double sideEdgeY = 0;
504 
505  if (type == c_Inner) {
506  geoPanel = geo.getInnerPanel();
507  contour = geo.getInnerPanelContour();
508  sideEdgeHeight = geoPanel.getMaxThickness();
509  sideEdgeY = geoPanel.getY() - sideEdgeHeight / 2;
510  } else {
511  geoPanel = geo.getOuterPanel();
512  contour = geo.getOuterPanelContour();
513  sideEdgeHeight = geoPanel.getMinThickness();
514  sideEdgeY = geoPanel.getY() + sideEdgeHeight / 2;
515  }
516 
517  // honeycomb panel
518 
519  auto* panel = createExtrudedSolid(geoPanel.getName(),
520  contour,
521  geoPanel.getLength(),
522  geoPanel.getMaterial());
523 
524  // reinforced faces
525 
526  std::string faceEdgeName = geoPanel.getName() + "ReinforcedFace";
527  auto* faceEdge = createExtrudedSolid(faceEdgeName,
528  contour,
529  geoPanel.getEdgeWidth(),
530  geoPanel.getEdgeMaterial());
531 
532  move = G4TranslateZ3D((geoPanel.getLength() - geoPanel.getEdgeWidth()) / 2);
533  new G4PVPlacement(move, faceEdge, faceEdgeName, panel, false, 1);
534  move = G4TranslateZ3D(-(geoPanel.getLength() - geoPanel.getEdgeWidth()) / 2);
535  new G4PVPlacement(move, faceEdge, faceEdgeName, panel, false, 2);
536 
537  // reinforced sides
538 
539  double width = geo.getPanelWidth();
540  double sideEdgeWidth = geoPanel.getEdgeWidth() + (width - geoPanel.getWidth()) / 2;
541  std::string sideEdgeName = geoPanel.getName() + "ReinforcedSide";
542  auto* sideEdge = createBox(sideEdgeName,
543  sideEdgeWidth,
544  sideEdgeHeight,
545  geoPanel.getLength() - 2 * geoPanel.getEdgeWidth(),
546  geoPanel.getEdgeMaterial());
547 
548 
549  move = G4Translate3D((width - sideEdgeWidth) / 2, sideEdgeY, 0);
550  new G4PVPlacement(move, sideEdge, sideEdgeName, panel, false, 1);
551  move = G4Translate3D(-(width - sideEdgeWidth) / 2, sideEdgeY, 0);
552  new G4PVPlacement(move, sideEdge, sideEdgeName, panel, false, 2);
553 
554  return panel;
555  }
556 
557 
558  G4LogicalVolume* GeoTOPCreator::createSideRail(const TOPGeoQBB& geo,
559  ESideRailType type)
560  {
561  double A = geo.getSideRails().getThickness();
562  double B = geo.getSideRails().getHeight();
563  double C = geo.getSideRailsLength();
564  double a = A - geo.getSideRails().getReducedThickness();
565  double b = B - geo.getColdPlate().getBaseThickness();
566  double c = geo.getPrismEnclosure().getLength() -
568 
569  auto* box = new G4Box("box", A / 2, B / 2, C / 2);
570  auto* subtrBox = new G4Box("subtrBox", a / 2, b / 2, c / 2);
571  double x = 0;
572  if (type == c_Left) {
573  x = (A - a) / 2;
574  } else {
575  x = -(A - a) / 2;
576  }
577  G4Transform3D move = G4Translate3D(x, -(B - b) / 2, -(C - c) / 2);
578  auto* solid = new G4SubtractionSolid("sideRail", box, subtrBox, move);
579 
580  G4Material* material = Materials::get(geo.getSideRails().getMaterial());
581  if (!material) B2FATAL("Material '" << geo.getSideRails().getMaterial() <<
582  "' not found");
583 
584  std::string name = geo.getSideRails().getName();
585  if (type == c_Left) {
586  name += "Left";
587  } else {
588  name += "Rigth";
589  }
590 
591  return new G4LogicalVolume(solid, material, name);
592  }
593 
594 
595  G4AssemblyVolume* GeoTOPCreator::assembleOptics(const TOPGeoModule& geo)
596  {
597  auto* optics = new G4AssemblyVolume();
598  Simulation::RunManager::Instance().addAssemblyVolume(optics);
599 
600  const double Lm = geo.getMirrorSegment().getFullLength();
601  const double L1 = geo.getBarSegment1().getFullLength();
602  const double L2 = geo.getBarSegment2().getFullLength();
603  const double Lp = geo.getPrism().getFullLength();
604  const double La = geo.getPMTArray().getSizeZ();
605 
606  // note: z = 0 is at prism-bar joint
607 
608  auto* pmtArray = createPMTArray(geo.getPMTArray(), geo.getModuleID());
609  double Dy = (geo.getPrism().getThickness() - geo.getPrism().getExitThickness()) / 2;
610  G4ThreeVector moveArray(geo.getPMTArrayDisplacement().getX(),
611  geo.getPMTArrayDisplacement().getY() + Dy,
612  -(Lp + La / 2));
613  G4RotationMatrix rotArray;
614  rotArray.rotateZ(geo.getPMTArrayDisplacement().getAlpha());
615  optics->AddPlacedVolume(pmtArray, moveArray, &rotArray);
616 
617  G4ThreeVector move;
618  G4RotationMatrix rot;
619 
620  auto* prism = createPrism(geo.getPrism(), geo.getModuleID());
621  move.setZ(0);
622  rot.rotateY(M_PI / 2);
623  optics->AddPlacedVolume(prism, move, &rot);
624 
625  auto* barSegment2 = createBarSegment(geo.getBarSegment2(), geo.getModuleID());
626  move.setZ(L2 / 2);
627  optics->AddPlacedVolume(barSegment2, move, 0);
628 
629  auto* barSegment1 = createBarSegment(geo.getBarSegment1(), geo.getModuleID());
630  move.setZ(L2 + L1 / 2);
631  optics->AddPlacedVolume(barSegment1, move, 0);
632 
633  auto* mirrorSegment = createMirrorSegment(geo.getMirrorSegment(),
634  geo.getModuleID());
635  move.setZ(L2 + L1 + Lm / 2);
636  optics->AddPlacedVolume(mirrorSegment, move, 0);
637 
638  // peek frame approximation (in order to shadow total reflection at prism end)
639  // a call to getFilterThickness is added for backward compatibility
640  const double length = geo.getPrism().getFilterThickness() + 3.5; //mm
641  const double thickness = 1.0; //mm
642  const double width = geo.getPrism().getWidth();
643  const double Yup = geo.getPrism().getThickness() / 2;
644  const double Ydn = Yup - geo.getPrism().getExitThickness();
645 
646  auto* peekFrameAbove = createBox("PeekFrameAbove", width, thickness, length, "Al");
647  move.setZ(-(Lp - length / 2));
648  move.setY(Yup + thickness / 2);
649  optics->AddPlacedVolume(peekFrameAbove, move, 0);
650 
651  auto* peekFrameBelow = createBox("PeekFrameBelow", width, thickness, length, "Al");
652  move.setZ(-(Lp - length / 2));
653  move.setY(Ydn - thickness / 2);
654  optics->AddPlacedVolume(peekFrameBelow, move, 0);
655 
656  return optics;
657  }
658 
659 
660  G4LogicalVolume* GeoTOPCreator::createBarSegment(const TOPGeoBarSegment& geo,
661  int moduleID)
662  {
663  G4Transform3D move;
664 
665  // mother volume
666  auto* bar = createBox(geo.getName(),
667  geo.getWidth(), geo.getThickness(), geo.getFullLength(),
668  geo.getMaterial());
669  // glue
670  auto* glue = createBox(geo.getName() + "Glue",
671  geo.getWidth(), geo.getThickness(), geo.getGlueThickness(),
672  geo.getGlueMaterial());
673  if (geo.getBrokenGlueFraction() > 0) {
674  auto* brokenGlue = createExtrudedSolid(geo.getName() + "BrokenGlue",
675  geo.getBrokenGlueContour(),
676  geo.getGlueThickness(),
677  geo.getBrokenGlueMaterial());
678  G4Transform3D fix;
679  new G4PVPlacement(fix, brokenGlue, geo.getName() + "BrokenGlue", glue, false, 1);
680  B2RESULT("GeoTOPCreator, broken glue at " << geo.getName()
681  << addNumber(" of Slot", moduleID));
682  m_numBrokenGlues++;
683  }
684 
685  // place glue to -z side
686  move = G4TranslateZ3D(-(geo.getFullLength() - geo.getGlueThickness()) / 2);
687  new G4PVPlacement(move, glue, geo.getName() + "Glue", bar, false, 1);
688 
689  // optical surface
690  auto& materials = Materials::getInstance();
691  auto* optSurf = materials.createOpticalSurface(geo.getSurface());
692  optSurf->SetSigmaAlpha(geo.getSigmaAlpha());
693  new G4LogicalSkinSurface("opticalSurface", bar, optSurf);
694 
695  // Activate sensitive volume
696  bar->SetSensitiveDetector(m_sensitiveBar);
697 
698  return bar;
699  }
700 
701 
702  G4LogicalVolume* GeoTOPCreator::createMirrorSegment(const TOPGeoMirrorSegment& geo,
703  int moduleID)
704  {
705  G4Transform3D move;
706 
707  // box of the bar
708  auto* box = new G4Box(geo.getName(),
709  geo.getWidth() / 2, geo.getThickness() / 2,
710  geo.getFullLength() / 2);
711 
712  // mother volume
713  auto* bar = createBoxSphereIntersection(geo.getName(),
714  box,
715  0, geo.getOuterRadius(),
716  geo.getXc(), geo.getYc(), geo.getZc(),
717  geo.getMaterial());
718 
719  // glue
720  auto* glue = createBox(geo.getName() + "Glue",
721  geo.getWidth(), geo.getThickness(), geo.getGlueThickness(),
722  geo.getGlueMaterial());
723  if (geo.getBrokenGlueFraction() > 0) {
724  auto* brokenGlue = createExtrudedSolid(geo.getName() + "BrokenGlue",
725  geo.getBrokenGlueContour(),
726  geo.getGlueThickness(),
727  geo.getBrokenGlueMaterial());
728  G4Transform3D fix;
729  new G4PVPlacement(fix, brokenGlue, geo.getName() + "BrokenGlue", glue, false, 1);
730  B2RESULT("GeoTOPCreator, broken glue at " << geo.getName()
731  << addNumber(" of Slot", moduleID));
732  m_numBrokenGlues++;
733  }
734 
735  // place glue to -z side
736  move = G4TranslateZ3D(-(geo.getFullLength() - geo.getGlueThickness()) / 2);
737  new G4PVPlacement(move, glue, geo.getName() + "Glue", bar, false, 1);
738 
739  // bar optical surface
740  auto& materials = Materials::getInstance();
741  auto* optSurf = materials.createOpticalSurface(geo.getSurface());
742  optSurf->SetSigmaAlpha(geo.getSigmaAlpha());
743  new G4LogicalSkinSurface("opticalSurface", bar, optSurf);
744 
745  // mirror reflective coating
746  auto* mirror = createBoxSphereIntersection(geo.getName() + "ReflectiveCoating",
747  box,
748  geo.getRadius(), geo.getOuterRadius(),
749  geo.getXc(), geo.getYc(), geo.getZc(),
750  geo.getCoatingMaterial());
751 
752  // mirror optical surface
753  auto* mirrorSurf = materials.createOpticalSurface(geo.getCoatingSurface());
754  new G4LogicalSkinSurface("mirrorSurface", mirror, mirrorSurf);
755 
756  // place reflective coating
757  move = G4TranslateZ3D(0);
758  new G4PVPlacement(move, mirror, geo.getName() + "ReflectiveCoating", bar, false, 1);
759 
760  // Activate sensitive volume
761  bar->SetSensitiveDetector(m_sensitiveBar);
762 
763  return bar;
764  }
765 
766 
767  G4LogicalVolume* GeoTOPCreator::createPrism(const TOPGeoPrism& geo, int moduleID)
768 
769  {
770  G4Transform3D move;
771 
772  // mother volume
773 
774  std::vector<G4TwoVector> polygon;
775  polygon.push_back(G4TwoVector(0, geo.getThickness() / 2));
776  polygon.push_back(G4TwoVector(geo.getFullLength(), geo.getThickness() / 2));
777  polygon.push_back(G4TwoVector(geo.getFullLength(),
778  geo.getThickness() / 2 - geo.getExitThickness()));
779  polygon.push_back(G4TwoVector(geo.getLength() - geo.getFlatLength(),
780  geo.getThickness() / 2 - geo.getExitThickness()));
781  polygon.push_back(G4TwoVector(0, -geo.getThickness() / 2));
782 
783  auto* volume = new G4ExtrudedSolid(geo.getName(), polygon, geo.getWidth() / 2,
784  G4TwoVector(), 1, G4TwoVector(), 1);
785  G4Material* material = Materials::get(geo.getMaterial());
786  if (!material) B2FATAL("Material '" << geo.getMaterial() << "' not found");
787  auto* prism = new G4LogicalVolume(volume, material, geo.getName());
788 
789  // wavelenght filter (old payload) and peel-off regions (if defined)
790  // new payload: wavelength filter is a part of PMT array
791 
792  if (geo.getFilterThickness() > 0 or !geo.getPeelOffRegions().empty()) {
793  double filterThickness = geo.getFilterThickness();
794  std::string filterMaterial;
795  if (filterThickness > 0) { // old payload, put wavelength filter into prism
796  filterMaterial = geo.getFilterMaterial();
797  } else { // new payload, make a dummy volume in which to put peel-off regions
798  filterThickness = geo.getPeelOffThickness();
799  filterMaterial = geo.getMaterial();
800  }
801  auto* filter = createBox(geo.getName() + "Filter",
802  filterThickness,
803  geo.getExitThickness(),
804  geo.getWidth(),
805  filterMaterial);
806  // place peel-off regions (if any) into filter
807  int numRegions = 0;
808  std::string message = addNumber("peel-off cookie regions of Slot", moduleID) + ":";
809  for (const auto& region : geo.getPeelOffRegions()) {
810  if (region.fraction <= 0) continue;
811  std::string name = addNumber(geo.getName() + "PeelOff", region.ID);
812  double thickness = geo.getPeelOffThickness();
813  auto* peelOff = createExtrudedSolid(name,
814  geo.getPeelOffContour(region),
815  thickness,
816  geo.getPeelOffMaterial());
817  G4Transform3D T = G4Translate3D((geo.getFilterThickness() - thickness) / 2,
818  0,
819  geo.getPeelOffCenter(region));
820  G4Transform3D R = G4RotateY3D(-M_PI / 2);
821  G4Transform3D moveRegion = T * R;
822  new G4PVPlacement(moveRegion, peelOff, name, filter, false, 1);
823  message += addNumber(" ", region.ID);
824  numRegions++;
825  }
826  if (numRegions > 0) B2RESULT("GeoTOPCreator, " << message);
827  m_numPeelOffRegions += numRegions;
828 
829  // place filter to +x side
830  move = G4Translate3D(geo.getFullLength() - geo.getFilterThickness() / 2,
831  (geo.getThickness() - geo.getExitThickness()) / 2,
832  0);
833  new G4PVPlacement(move, filter, geo.getName() + "Filter", prism, false, 1);
834  }
835 
836  // optical surface
837 
838  auto& materials = Materials::getInstance();
839  auto* optSurf = materials.createOpticalSurface(geo.getSurface());
840  optSurf->SetSigmaAlpha(geo.getSigmaAlpha());
841  new G4LogicalSkinSurface("opticalSurface", prism, optSurf);
842 
843  // Activate sensitive volume
844 
845  prism->SetSensitiveDetector(m_sensitiveBar);
846 
847  return prism;
848  }
849 
850 
851  G4LogicalVolume* GeoTOPCreator::createPMTArray(const TOPGeoPMTArray& geo,
852  int moduleID)
853  {
854  // mother volume
855  auto* pmtArray = createBox(geo.getName(),
856  geo.getSizeX(), geo.getSizeY(),
857  geo.getSizeZ(),
858  geo.getMaterial());
859 
860  // single PMT
861  auto* pmt = createPMT(geo.getPMT());
862 
863  // place PMT's
864  std::string message = addNumber("optically decoupled PMT's of Slot", moduleID) + ":";
865  for (unsigned row = 1; row <= geo.getNumRows(); row++) {
866  for (unsigned col = 1; col <= geo.getNumColumns(); col++) {
867  auto id = geo.getPmtID(row, col);
868  double z = geo.getAirGap();
869  if (geo.isPMTDecoupled(id)) {
870  z = 0;
871  message += addNumber(" ", id);
872  m_numDecoupledPMTs++;
873  }
874  z -= (geo.getSizeZ() - geo.getPMT().getSizeZ()) / 2;
875  G4Transform3D move = G4Translate3D(geo.getX(col), geo.getY(row), z);
876  new G4PVPlacement(move, pmt, addNumber(geo.getPMT().getName(), id), pmtArray,
877  false, id);
878  }
879  }
880 
881  // wavelenght filter and silicone cookies (new payload)
882  if (geo.getFilterThickness() > 0) { // new payload
883  double fullThickness = geo.getFilterThickness() + geo.getCookieThickness();
884  auto* filter = createBox(geo.getName() + "Filter+Cookie",
885  geo.getSizeX(), geo.getSizeY(),
886  fullThickness,
887  geo.getFilterMaterial());
888  double cookieThickness = geo.getCookieThickness();
889  auto* cookie = createBox(geo.getName() + "Cookie",
890  geo.getSizeX(), geo.getSizeY(),
891  cookieThickness,
892  geo.getCookieMaterial());
893  G4Transform3D move = G4Translate3D(0, 0, (fullThickness - cookieThickness) / 2);
894  new G4PVPlacement(move, cookie, geo.getName() + "Cookie", filter, false, 1);
895 
896  move = G4Translate3D(0, 0, (geo.getSizeZ() - fullThickness) / 2);
897  new G4PVPlacement(move, filter, geo.getName() + "Filter+Cookie", pmtArray,
898  false, 1);
899  }
900 
901  if (!geo.getDecoupledPMTs().empty()) B2RESULT("GeoTOPCreator, " << message);
902 
903  return pmtArray;
904  }
905 
906 
907  G4LogicalVolume* GeoTOPCreator::createPMT(const TOPGeoPMT& geo)
908  {
909  G4Transform3D move;
910 
911  // mother volume
912  auto* pmt = createBox(geo.getName(),
913  geo.getSizeX(), geo.getSizeY(), geo.getSizeZ(),
914  geo.getWallMaterial());
915 
916  // window + photocathode + reflective edge
917  double winThickness = geo.getWinThickness() + geo.getReflEdgeThickness();
918  auto* window = createBox(geo.getName() + "Window",
919  geo.getSizeX(), geo.getSizeY(),
920  winThickness,
921  geo.getWinMaterial());
922  auto* photoCathode = createBox(geo.getName() + "PhotoCathode",
923  geo.getSensSizeX(), geo.getSensSizeY(),
924  geo.getSensThickness(),
925  geo.getSensMaterial());
926  photoCathode->SetSensitiveDetector(m_sensitivePMT); // Activate sensitive area
927 
928  move = G4TranslateZ3D(-(winThickness - geo.getSensThickness()) / 2
929  + geo.getReflEdgeThickness());
930  new G4PVPlacement(move, photoCathode, geo.getName() + "PhotoCathode", window,
931  false, 1);
932 
933  auto* reflEdge = createBox(geo.getName() + "ReflectiveEdge",
934  geo.getSizeX(), geo.getSizeY(),
935  geo.getReflEdgeThickness(),
936  geo.getWallMaterial());
937  double holeSizeX = geo.getSizeX() - 2 * geo.getReflEdgeWidth();
938  double holeSizeY = geo.getSizeY() - 2 * geo.getReflEdgeWidth();
939  if (holeSizeX > 0 and holeSizeY > 0) {
940  auto* hole = createBox(geo.getName() + "ReflectiveEdgeHole",
941  holeSizeX, holeSizeY,
942  geo.getReflEdgeThickness(),
943  geo.getFillMaterial());
944  move = G4TranslateZ3D(0.0);
945  new G4PVPlacement(move, hole, geo.getName() + "ReflectiveEdgeHole", reflEdge,
946  false, 1);
947  }
948 
949  auto& materials = Materials::getInstance();
950  auto* optSurf = materials.createOpticalSurface(geo.getReflEdgeSurface());
951  new G4LogicalSkinSurface("reflectiveEdgeSurface", reflEdge, optSurf);
952 
953  move = G4TranslateZ3D(-(winThickness - geo.getReflEdgeThickness()) / 2);
954  new G4PVPlacement(move, reflEdge, geo.getName() + "ReflectiveEdge", window,
955  false, 1);
956 
957  move = G4TranslateZ3D((geo.getSizeZ() - winThickness) / 2);
958  new G4PVPlacement(move, window, geo.getName() + "Window", pmt, false, 1);
959 
960  // bottom
961  if (geo.getBotMaterial() != geo.getWallMaterial()) {
962  auto* bottom = createBox(geo.getName() + "Bottom",
963  geo.getSizeX(), geo.getSizeY(), geo.getBotThickness(),
964  geo.getBotMaterial());
965  move = G4TranslateZ3D(-(geo.getSizeZ() - geo.getBotThickness()) / 2);
966  new G4PVPlacement(move, bottom, geo.getName() + "Bottom", pmt, false, 1);
967  }
968 
969  // interior
970  double interiorSizeZ = geo.getSizeZ() - winThickness - geo.getBotThickness();
971  auto* interior = createBox(geo.getName() + "Interior",
972  geo.getSizeX() - 2 * geo.getWallThickness(),
973  geo.getSizeY() - 2 * geo.getWallThickness(),
974  interiorSizeZ,
975  geo.getBotMaterial());
976  move = G4TranslateZ3D(-(geo.getSizeZ() - interiorSizeZ) / 2
977  + geo.getBotThickness());
978  new G4PVPlacement(move, interior, geo.getName() + "Interior", pmt, false, 1);
979 
980  return pmt;
981  }
982 
983 
984  G4LogicalVolume* GeoTOPCreator::createBox(const std::string& name,
985  double A, double B, double C,
986  const std::string& materialName)
987  {
988  G4Box* box = new G4Box(name, A / 2, B / 2, C / 2);
989  G4Material* material = Materials::get(materialName);
990  if (!material) B2FATAL("Material '" << materialName << "' not found");
991  return new G4LogicalVolume(box, material, name);
992  }
993 
994 
995  G4LogicalVolume*
996  GeoTOPCreator::createBoxSphereIntersection(const std::string& name,
997  G4Box* box,
998  double Rmin,
999  double Rmax,
1000  double xc,
1001  double yc,
1002  double zc,
1003  const std::string& materialName)
1004  {
1005  // determine max theta - note: not valid generically!
1006  double x = box->GetXHalfLength();
1007  double y = box->GetYHalfLength();
1008  double z = box->GetZHalfLength();
1009  double dx = fmax(fabs(-x - xc), fabs(x - xc));
1010  double dy = fmax(fabs(-y - yc), fabs(y - yc));
1011  double dz = fmin(-z - zc, z - zc);
1012  double theta = atan(sqrt(dx * dx + dy * dy) / dz);
1013 
1014  auto* sphere = new G4Sphere(name + "Sphere",
1015  Rmin, Rmax, 0, 2 * M_PI, 0, theta);
1016  G4Translate3D move(xc, yc, zc);
1017  auto* shape = new G4IntersectionSolid(name, box, sphere, move);
1018 
1019  G4Material* material = Materials::get(materialName);
1020  if (!material) B2FATAL("Material '" << materialName << "' not found");
1021  return new G4LogicalVolume(shape, material, name);
1022  }
1023 
1024 
1025  G4LogicalVolume* GeoTOPCreator::createExtrudedSolid(const std::string& name,
1026  const Polygon& shape,
1027  double length,
1028  const std::string& materialName)
1029  {
1030  std::vector<G4TwoVector> polygon;
1031  for (auto& point : shape) {
1032  polygon.push_back(G4TwoVector(point.first, point.second));
1033  }
1034  G4ExtrudedSolid* solid = new G4ExtrudedSolid(name, polygon, length / 2,
1035  G4TwoVector(), 1, G4TwoVector(), 1);
1036  G4Material* material = Materials::get(materialName);
1037  if (!material) B2FATAL("Material '" << materialName << "' not found");
1038  return new G4LogicalVolume(solid, material, name);
1039  }
1040 
1041 
1042  std::string GeoTOPCreator::addNumber(const std::string& str, unsigned number)
1043  {
1044  stringstream ss;
1045  if (number < 10) {
1046  ss << "0" << number;
1047  } else {
1048  ss << number;
1049  }
1050  string out;
1051  ss >> out;
1052  return str + out;
1053  }
1054 
1055  } // name space TOP
1057 } // name space Belle2
Belle2::TOPGeoPMTArrayDisplacement::getAlpha
double getAlpha() const
Returns rotation angle (around z)
Definition: TOPGeoPMTArrayDisplacement.h:70
Belle2::TOPGeoQBB::getPrismEnclosureContour
std::vector< std::pair< double, double > > getPrismEnclosureContour() const
Returns prism enclosure wall x-y contour.
Definition: TOPGeoQBB.cc:141
Belle2::IntervalOfValidity
A class that describes the interval of experiments/runs for which an object in the database is valid.
Definition: IntervalOfValidity.h:35
Belle2::TOPGeoMirrorSegment::getRadius
double getRadius() const
Returns spherical mirror radius of curvature.
Definition: TOPGeoMirrorSegment.h:91
Belle2::TOPGeoColdPlate::getCoolWidth
double getCoolWidth() const
Returns cooling plate width.
Definition: TOPGeoColdPlate.h:84
Belle2::TOPGeoBarSegment::getMaterial
const std::string & getMaterial() const
Returns bar segment material name.
Definition: TOPGeoBarSegment.h:135
Belle2::TOPGeoPMT::getSensSizeX
double getSensSizeX() const
Returns sensitive volume (photo-cathode) size in x.
Definition: TOPGeoPMT.h:175
Belle2::TOPGeoPMT
Geometry parameters of MCP-PMT.
Definition: TOPGeoPMT.h:34
Belle2::TOPGeoFrontEnd::getSpacerWidth
double getSpacerWidth() const
Returns board stack spacer width.
Definition: TOPGeoFrontEnd.h:223
Belle2::TOPGeoPMT::getFillMaterial
const std::string & getFillMaterial() const
Returns fill (inside) material name.
Definition: TOPGeoPMT.h:169
Belle2::TOPGeoSideRails::getMaterial
const std::string & getMaterial() const
Returns material name.
Definition: TOPGeoSideRails.h:80
Belle2::TOPGeoPrismEnclosure::getLength
double getLength() const
Returns full length.
Definition: TOPGeoPrismEnclosure.h:76
Belle2::TOPGeoHoneycombPanel::getWidth
double getWidth() const
Returns panel width.
Definition: TOPGeoHoneycombPanel.h:78
Belle2::TOPGeoPMT::getSensThickness
double getSensThickness() const
Returns sensitive volume (photo-cathode) thickness.
Definition: TOPGeoPMT.h:187
Belle2::TOPGeoFrontEnd::getBoardStackGap
double getBoardStackGap() const
Returns gap between board stack and front board.
Definition: TOPGeoFrontEnd.h:205
Belle2::TOPGeoFrontEnd::getFrontBoardThickness
double getFrontBoardThickness() const
Returns front board thickness.
Definition: TOPGeoFrontEnd.h:125
Belle2::TOPGeoPrism
Geometry parameters of prism.
Definition: TOPGeoPrism.h:36
Belle2::TOPGeoQBB::getSideRails
const TOPGeoSideRails & getSideRails() const
Returns side rails.
Definition: TOPGeoQBB.h:166
Belle2::TOPGeometry
Geometry parameters of TOP.
Definition: TOPGeometry.h:44
Belle2::TOPGeoBarSegment::getGlueMaterial
const std::string & getGlueMaterial() const
Returns glue material name (glue on -z side)
Definition: TOPGeoBarSegment.h:147
Belle2::TOPGeoPMT::getBotMaterial
const std::string & getBotMaterial() const
Returns bottom material name.
Definition: TOPGeoPMT.h:235
Belle2::TOPGeoPMTArray::getFilterMaterial
const std::string & getFilterMaterial() const
Returns wavelenght filter material.
Definition: TOPGeoPMTArray.h:188
Belle2::TOPGeoPrismEnclosure::getBackThickness
double getBackThickness() const
Returns back wall thickness.
Definition: TOPGeoPrismEnclosure.h:115
Belle2::TOPGeoBarSegment::getLength
double getLength() const
Returns bar segment length.
Definition: TOPGeoBarSegment.h:123
Belle2::TOPGeoMirrorSegment::getOuterRadius
double getOuterRadius() const
Returns spherical mirror outer radius of curvature.
Definition: TOPGeoMirrorSegment.h:97
Belle2::TOP::SensitiveBar
Class providing information on MCParticles hitting the bars.
Definition: SensitiveBar.h:41
Belle2::TOPGeoFrontEnd::getSpacerMaterial
const std::string & getSpacerMaterial() const
Returns board stack spacer material.
Definition: TOPGeoFrontEnd.h:229
Belle2::TOPGeoBarSegment
Geometry parameters of a quartz bar segment.
Definition: TOPGeoBarSegment.h:37
Belle2::TOPGeoPrism::getExitThickness
double getExitThickness() const
Returns prism thickness at PMT side.
Definition: TOPGeoPrism.h:109
Belle2::TOPGeoPMTArray::getSizeY
double getSizeY() const
Returns array volume dimension in y.
Definition: TOPGeoPMTArray.h:200
Belle2::TOPGeoPrism::getPeelOffMaterial
const std::string & getPeelOffMaterial() const
Returns peel-off material.
Definition: TOPGeoPrism.h:168
Belle2::TOPGeoPMT::getWallThickness
double getWallThickness() const
Returns wall thickness.
Definition: TOPGeoPMT.h:157
Belle2::TOPGeoFrontEnd::getHVBoardMaterial
const std::string & getHVBoardMaterial() const
Returns HV board material.
Definition: TOPGeoFrontEnd.h:180
Belle2::TOPGeoPrismEnclosure::getBodyLength
double getBodyLength() const
Returns length w/o back and front plates.
Definition: TOPGeoPrismEnclosure.h:82
Belle2::TOPGeoFrontEnd::getHVBoardThickness
double getHVBoardThickness() const
Returns HV board thickness.
Definition: TOPGeoFrontEnd.h:162
Belle2::TOPGeometry::useGeantUnits
static void useGeantUnits()
Use Geant units when returning geometry parameters.
Definition: TOPGeometry.h:68
Belle2::TOPGeoFrontEnd::getFrontBoardY
double getFrontBoardY() const
Returns position of front board center in bar frame.
Definition: TOPGeoFrontEnd.h:137
Belle2::TOPGeoQBB
Geometry parameters of Quartz Bar Box (mother class)
Definition: TOPGeoQBB.h:40
Belle2::TOPGeoQBB::getWidth
double getWidth() const
Returns full width.
Definition: TOPGeoQBB.h:112
Belle2::TOPGeoPMT::getWinMaterial
const std::string & getWinMaterial() const
Returns entrance window material name.
Definition: TOPGeoPMT.h:223
Belle2::TOPGeoFrontEnd::getHVBoardWidth
double getHVBoardWidth() const
Returns HV board width.
Definition: TOPGeoFrontEnd.h:150
Belle2::TOPGeoQBB::getBackPlateContour
std::vector< std::pair< double, double > > getBackPlateContour() const
Returns prism enclosure back plate x-y contour.
Definition: TOPGeoQBB.cc:176
Belle2::TOPGeoBarSegment::getBrokenGlueMaterial
const std::string & getBrokenGlueMaterial() const
Returns material name which represents broken glue.
Definition: TOPGeoBarSegment.h:165
Belle2::TOPGeoFrontEnd::getHVBoardY
double getHVBoardY() const
Returns position of HV board center in bar frame.
Definition: TOPGeoFrontEnd.h:174
Belle2::TOPGeoHoneycombPanel::getLength
double getLength() const
Returns panel length.
Definition: TOPGeoHoneycombPanel.h:84
Belle2::TOPGeoQBB::getBackwardContour
std::vector< std::pair< double, double > > getBackwardContour() const
Returns backward x-y contour.
Definition: TOPGeoQBB.cc:108
Belle2::TOPGeoPMT::getSizeY
double getSizeY() const
Returns full size in y.
Definition: TOPGeoPMT.h:145
Belle2::TOPGeoBarSegment::getFullLength
double getFullLength() const
Returns bar segment length including glue.
Definition: TOPGeoBarSegment.h:129
Belle2::filter
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double >> &runs, double cut, std::map< ExpRun, std::pair< double, double >> &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:43
Belle2::TOPGeoPMT::getSizeX
double getSizeX() const
Returns full size in x.
Definition: TOPGeoPMT.h:139
Belle2::TOPGeoPrism::getFlatLength
double getFlatLength() const
Returns the length of a flat surface at prism bottom.
Definition: TOPGeoPrism.h:115
Belle2::TOPGeoPMTArray::getSizeX
double getSizeX() const
Returns array volume dimension in x.
Definition: TOPGeoPMTArray.h:194
Belle2::BkgSensitiveDetector
The Class for BeamBackground Sensitive Detector.
Definition: BkgSensitiveDetector.h:34
Belle2::TOPGeoPMTArray::getNumRows
unsigned getNumRows() const
Returns number of array rows.
Definition: TOPGeoPMTArray.h:116
Belle2::DBImportObjPtr::construct
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
Definition: DBImportObjPtr.h:57
Belle2::TOPGeoColdPlate::getCoolThickness
double getCoolThickness() const
Returns cooling plate thickness.
Definition: TOPGeoColdPlate.h:78
Belle2::TOPGeoPrismEnclosure::getExtensionThickness
double getExtensionThickness() const
Returns extension plate thickness.
Definition: TOPGeoPrismEnclosure.h:127
Belle2::DBImportBase::import
bool import(const IntervalOfValidity &iov)
Import the object to database.
Definition: DBImportBase.cc:38
Belle2::TOPGeoFrontEnd::getFrontBoardMaterial
const std::string & getFrontBoardMaterial() const
Returns front board material.
Definition: TOPGeoFrontEnd.h:143
Belle2::TOPGeoEndPlate::getHeight
double getHeight() const
Returns height.
Definition: TOPGeoEndPlate.h:65
Belle2::TOPGeoFrontEnd
Geometry parameters of board stack (front-end electronic module)
Definition: TOPGeoFrontEnd.h:33
Belle2::TOPGeoModule::getMirrorSegment
const TOPGeoMirrorSegment & getMirrorSegment() const
Returns mirror segment.
Definition: TOPGeoModule.h:256
Belle2::TOPGeoBase::getName
const std::string & getName() const
Returns object name.
Definition: TOPGeoBase.h:61
Belle2::TOPGeoQBB::getMaterial
const std::string & getMaterial() const
Returns the name of material inside QBB.
Definition: TOPGeoQBB.h:148
Belle2::TOPGeoPMTArray::isPMTDecoupled
bool isPMTDecoupled(unsigned pmtID) const
Checks if PMT is optically decoupled.
Definition: TOPGeoPMTArray.cc:86
Belle2::TOPGeoPMTArray::getDecoupledPMTs
const std::vector< unsigned > & getDecoupledPMTs() const
Returns ID's of optically decoupled PMT's.
Definition: TOPGeoPMTArray.h:292
Belle2::TOPGeoMirrorSegment::getZc
double getZc() const
Returns spherical mirror center of curvature in z (in local frame of this segment)
Definition: TOPGeoMirrorSegment.cc:23
Belle2::TOPGeoFrontEnd::getFrontBoardGap
double getFrontBoardGap() const
Returns gap between front board and PMT array.
Definition: TOPGeoFrontEnd.h:131
Belle2::TOPGeoBarSegment::getBrokenGlueFraction
double getBrokenGlueFraction() const
Returns fraction of the delaminated surface.
Definition: TOPGeoBarSegment.h:153
Belle2::TOPGeometry::getModule
const TOPGeoModule & getModule(int moduleID) const
Returns module.
Definition: TOPGeometry.cc:44
Belle2::TOPGeoPrism::getPeelOffContour
std::vector< std::pair< double, double > > getPeelOffContour(const PeelOffRegion &region) const
Returns the x-y contour of the peel-off region.
Definition: TOPGeoPrism.cc:107
Belle2::TOPGeoPrism::getPeelOffRegions
const std::vector< PeelOffRegion > & getPeelOffRegions() const
Returns peel-off cookie regions.
Definition: TOPGeoPrism.h:174
Belle2::TOPGeoMirrorSegment::getYc
double getYc() const
Returns spherical mirror center of curvature in y.
Definition: TOPGeoMirrorSegment.h:109
Belle2::TOPGeoEndPlate::getMaterial
const std::string & getMaterial() const
Returns material name.
Definition: TOPGeoEndPlate.h:71
Belle2::TOPGeoPrism::getFilterThickness
double getFilterThickness() const
Returns wavelength filter thickness (filter on -z side).
Definition: TOPGeoPrism.h:137
Belle2::TOPGeoPMT::getBotThickness
double getBotThickness() const
Returns bottom thickness.
Definition: TOPGeoPMT.h:229
Belle2::TOPGeoModule::getBarSegment2
const TOPGeoBarSegment & getBarSegment2() const
Returns bar segment No.2 (backward bar)
Definition: TOPGeoModule.h:250
Belle2::TOPGeoPMT::getWinThickness
double getWinThickness() const
Returns entrance window thickness.
Definition: TOPGeoPMT.h:217
Belle2::TOPGeoMirrorSegment::getXc
double getXc() const
Returns spherical mirror center of curvature in x.
Definition: TOPGeoMirrorSegment.h:103
Belle2::TOPGeometry::getQBB
const TOPGeoQBB & getQBB() const
Returns quartz bar box.
Definition: TOPGeometry.h:184
Belle2::TOPGeoPMT::getReflEdgeSurface
const GeoOpticalSurface & getReflEdgeSurface() const
Returns reflective edge optical surface.
Definition: TOPGeoPMT.h:253
Belle2::TOP::SensitivePMT
Class providing SimHits.
Definition: SensitivePMT.h:40
Belle2::TOPGeoMirrorSegment::getCoatingMaterial
const std::string & getCoatingMaterial() const
Returns reflective coating material.
Definition: TOPGeoMirrorSegment.h:127
Belle2::TOPGeoHoneycombPanel
Geometry parameters of honeycomb panel.
Definition: TOPGeoHoneycombPanel.h:35
Belle2::TOPGeoPrism::getFilterMaterial
const std::string & getFilterMaterial() const
Returns wavelength filter material name (filter on -z side) For backward compatibility,...
Definition: TOPGeoPrism.h:144
Belle2::TOPGeoHoneycombPanel::getMaterial
const std::string & getMaterial() const
Returns material name.
Definition: TOPGeoHoneycombPanel.h:120
Belle2::TOPGeoModule
Geometry parameters of a module (optical components + positioning)
Definition: TOPGeoModule.h:40
Belle2::TOPGeoQBB::getPrismPosition
double getPrismPosition() const
Returns the position of prism-bar joint wrt QBB back.
Definition: TOPGeoQBB.h:142
Belle2::TOPGeoPMTArray::getFilterThickness
double getFilterThickness() const
Returns wavelength filter thickness.
Definition: TOPGeoPMTArray.h:182
Belle2::TOPGeoPMTArray::getNumColumns
unsigned getNumColumns() const
Returns number of array columns.
Definition: TOPGeoPMTArray.h:110
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPGeoPMTArray::getX
double getX(unsigned col) const
Returns x coordinate of column center.
Definition: TOPGeoPMTArray.h:216
Belle2::TOPGeoBarSegment::getSurface
const GeoOpticalSurface & getSurface() const
Returns optical surface.
Definition: TOPGeoBarSegment.h:176
Belle2::TOPGeoFrontEnd::getHVBoardLength
double getHVBoardLength() const
Returns HV board length.
Definition: TOPGeoFrontEnd.h:156
Belle2::TOPGeoPMTArray
Geometry parameters of MCP-PMT array.
Definition: TOPGeoPMTArray.h:34
Belle2::TOPGeoPMT::getReflEdgeWidth
double getReflEdgeWidth() const
Returns reflective edge width.
Definition: TOPGeoPMT.h:241
Belle2::TOPGeoPrism::getPeelOffThickness
double getPeelOffThickness() const
Returns peel-off thickness.
Definition: TOPGeoPrism.h:162
Belle2::TOPGeoQBB::getInnerPanelContour
std::vector< std::pair< double, double > > getInnerPanelContour() const
Returns inner honeycomb panel x-y contour.
Definition: TOPGeoQBB.cc:56
Belle2::TOPGeoFrontEnd::getBoardStackY
double getBoardStackY() const
Returns position of board stack center in bar frame.
Definition: TOPGeoFrontEnd.h:211
Belle2::TOPGeoQBB::getLength
double getLength() const
Returns full length.
Definition: TOPGeoQBB.h:127
Belle2::TOPGeoBarSegment::getGlueThickness
virtual double getGlueThickness() const
Returns glue thickness (glue on -z side)
Definition: TOPGeoBarSegment.h:141
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::TOPGeoHoneycombPanel::getMinThickness
double getMinThickness() const
Returns panel minimal thickness.
Definition: TOPGeoHoneycombPanel.h:90
Belle2::DBImportObjPtr
Class for importing a single object to the database.
Definition: DBImportObjPtr.h:33
Belle2::TOPGeoPMTArray::getY
double getY(unsigned row) const
Returns the y coordinate of row center.
Definition: TOPGeoPMTArray.h:226
Belle2::TOPGeoPMTArray::getCookieMaterial
const std::string & getCookieMaterial() const
Returns silicone cookie material.
Definition: TOPGeoPMTArray.h:176
Belle2::TOPGeoPMT::getWallMaterial
const std::string & getWallMaterial() const
Returns wall (casing) material name.
Definition: TOPGeoPMT.h:163
Belle2::TOPGeoPMT::getReflEdgeThickness
double getReflEdgeThickness() const
Returns reflective edge thickness.
Definition: TOPGeoPMT.h:247
Belle2::TOPGeoModule::getModuleID
int getModuleID() const
Returns module ID.
Definition: TOPGeoModule.h:214
Belle2::TOPGeoBarSegment::getWidth
double getWidth() const
Returns bar segment width.
Definition: TOPGeoBarSegment.h:111
Belle2::TOPGeoFrontEnd::getBoardStackMaterial
const std::string & getBoardStackMaterial() const
Returns board stack material.
Definition: TOPGeoFrontEnd.h:217
Belle2::TOP::GeoTOPCreator::ESideRailType
ESideRailType
Side rail types.
Definition: GeoTOPCreator.h:94
Belle2::TOPGeoQBB::getForwardContour
std::vector< std::pair< double, double > > getForwardContour() const
Returns forward x-y contour.
Definition: TOPGeoQBB.cc:23
Belle2::TOPGeoQBB::getInnerPanel
const TOPGeoHoneycombPanel & getInnerPanel() const
Returns inner honeycomb panel.
Definition: TOPGeoQBB.h:154
Belle2::TOPGeoHoneycombPanel::getEdgeWidth
double getEdgeWidth() const
Returns width of the reinforced edge.
Definition: TOPGeoHoneycombPanel.h:108
Belle2::TOPGeoModule::getPrism
const TOPGeoPrism & getPrism() const
Returns prism.
Definition: TOPGeoModule.h:262
Belle2::TOPGeoPMTArrayDisplacement::getY
double getY() const
Returns translation in y.
Definition: TOPGeoPMTArrayDisplacement.h:64
Belle2::TOPGeoQBB::getForwardEndPlate
const TOPGeoEndPlate & getForwardEndPlate() const
Returns forward end plate.
Definition: TOPGeoQBB.h:178
Belle2::TOPGeoPMTArray::getAirGap
double getAirGap() const
Returns air gap.
Definition: TOPGeoPMTArray.h:286
Belle2::TOPGeoQBB::getSideRailsLength
double getSideRailsLength() const
Returns side rails length.
Definition: TOPGeoQBB.h:133
Belle2::TOPGeoPMTArray::getCookieThickness
double getCookieThickness() const
Returns silicone cookie thickness.
Definition: TOPGeoPMTArray.h:170
Belle2::TOPGeoMirrorSegment::getCoatingSurface
const GeoOpticalSurface & getCoatingSurface() const
Returns reflective coating optical surface.
Definition: TOPGeoMirrorSegment.h:133
Belle2::TOPGeoPMT::getSizeZ
double getSizeZ() const
Returns full size in z.
Definition: TOPGeoPMT.h:151
Belle2::TOPGeoMirrorSegment
Geometry parameters of a mirror segment.
Definition: TOPGeoMirrorSegment.h:32
Belle2::TOPGeoModule::getPMTArray
const TOPGeoPMTArray & getPMTArray() const
Returns PMT array.
Definition: TOPGeoModule.h:268
Belle2::TOPGeoFrontEnd::getBoardStackLength
double getBoardStackLength() const
Returns board stack length.
Definition: TOPGeoFrontEnd.h:199
Belle2::TOPGeoEndPlate::getThickness
double getThickness() const
Returns thickness.
Definition: TOPGeoEndPlate.h:59
Belle2::TOPGeoPrism::getPeelOffCenter
double getPeelOffCenter(const PeelOffRegion &region) const
Returns peel-off offset in x of the given region.
Definition: TOPGeoPrism.h:181
Belle2::TOPGeoPMT::getSensSizeY
double getSensSizeY() const
Returns sensitive volume (photo-cathode) size in y.
Definition: TOPGeoPMT.h:181
Belle2::TOPGeoPMTArray::getMaterial
const std::string & getMaterial() const
Returns material name into which PMT's are inserted.
Definition: TOPGeoPMTArray.h:235
Belle2::TOPGeoColdPlate::getCoolMaterial
const std::string & getCoolMaterial() const
Returns cooling plate material name.
Definition: TOPGeoColdPlate.h:90
Belle2::TOPGeoQBB::getOuterPanel
const TOPGeoHoneycombPanel & getOuterPanel() const
Returns outer honeycomb panel.
Definition: TOPGeoQBB.h:160
Belle2::TOPGeoBarSegment::getBrokenGlueContour
std::vector< std::pair< double, double > > getBrokenGlueContour() const
Returns the x-y contour of broken glue.
Definition: TOPGeoBarSegment.cc:61
Belle2::TOPGeoFrontEnd::getBoardStackHeight
double getBoardStackHeight() const
Returns board stack height.
Definition: TOPGeoFrontEnd.h:193
Belle2::TOPGeoHoneycombPanel::getMaxThickness
double getMaxThickness() const
Returns panel maximal thickness.
Definition: TOPGeoHoneycombPanel.h:96
Belle2::TOPGeoFrontEnd::getFrontBoardHeight
double getFrontBoardHeight() const
Returns front board height.
Definition: TOPGeoFrontEnd.h:119
Belle2::TOPGeoPMT::getSensMaterial
const std::string & getSensMaterial() const
Returns sensitive material name.
Definition: TOPGeoPMT.h:211
Belle2::TOPGeoFrontEnd::getBoardStackWidth
double getBoardStackWidth() const
Returns board stack width.
Definition: TOPGeoFrontEnd.h:187
Belle2::TOPGeometry::getModules
const std::vector< TOPGeoModule > & getModules() const
Returns all modules.
Definition: TOPGeometry.h:159
Belle2::TOPGeometry::getNumBoardStacks
unsigned getNumBoardStacks() const
Returns number of boardstacks per module.
Definition: TOPGeometry.h:178
Belle2::TOPGeoPMTArray::getSizeZ
double getSizeZ() const
Returns array volume dimension in z.
Definition: TOPGeoPMTArray.h:206
Belle2::TOPGeoHoneycombPanel::getY
double getY() const
Returns y position of the flat surface in local (bar) frame.
Definition: TOPGeoHoneycombPanel.h:114
Belle2::TOPGeoColdPlate::getBaseThickness
double getBaseThickness() const
Returns base plate thickness.
Definition: TOPGeoColdPlate.h:66
Belle2::TOPGeoHoneycombPanel::getEdgeMaterial
const std::string & getEdgeMaterial() const
Returns material name of reinforced edge.
Definition: TOPGeoHoneycombPanel.h:126
Belle2::TOPGeometry::getFrontEnd
const TOPGeoFrontEnd & getFrontEnd() const
Returns front-end.
Definition: TOPGeometry.h:172
Belle2::TOPGeoPMTArray::getPmtID
unsigned getPmtID(unsigned row, unsigned col) const
Converts row and column numbers to PMT ID (1-based)
Definition: TOPGeoPMTArray.cc:23
Belle2::TOPGeoPrismEnclosure::getFrontThickness
double getFrontThickness() const
Returns front wall thickness.
Definition: TOPGeoPrismEnclosure.h:121
Belle2::TOPGeoSideRails::getThickness
double getThickness() const
Returns thickness.
Definition: TOPGeoSideRails.h:62
Belle2::TOPGeoQBB::getPrismEnclosure
const TOPGeoPrismEnclosure & getPrismEnclosure() const
Returns prism enclosure.
Definition: TOPGeoQBB.h:172
Belle2::TOPGeoFrontEnd::getHVBoardGap
double getHVBoardGap() const
Returns gap between HV board and front board.
Definition: TOPGeoFrontEnd.h:168
Belle2::TOPGeoSideRails::getHeight
double getHeight() const
Returns height.
Definition: TOPGeoSideRails.h:74
Belle2::TOPGeoPMTArray::getPMT
const TOPGeoPMT & getPMT() const
Returns PMT geometry parameters.
Definition: TOPGeoPMTArray.h:241
Belle2::TOPGeoModule::getPMTArrayDisplacement
const TOPGeoPMTArrayDisplacement & getPMTArrayDisplacement() const
Returns PMT array displacement.
Definition: TOPGeoModule.h:274
Belle2::TOPGeoQBB::getColdPlate
const TOPGeoColdPlate & getColdPlate() const
Returns cold plate.
Definition: TOPGeoQBB.h:184
Belle2::geometry::GeometryTypes
GeometryTypes
Flag indiciating the type of geometry to be used.
Definition: GeometryManager.h:39
Belle2::TOPGeoPMTArrayDisplacement::getX
double getX() const
Returns translation in x.
Definition: TOPGeoPMTArrayDisplacement.h:58
Belle2::TOPGeoPrismEnclosure::getMaterial
const std::string & getMaterial() const
Returns material name.
Definition: TOPGeoPrismEnclosure.h:133
Belle2::TOPGeoQBB::getOuterPanelContour
std::vector< std::pair< double, double > > getOuterPanelContour() const
Returns outer honeycomb panel x-y contour.
Definition: TOPGeoQBB.cc:82
Belle2::TOPGeoQBB::getPanelWidth
double getPanelWidth() const
Returns panel width used in x-y contours of honeycomb panels.
Definition: TOPGeoQBB.h:118
Belle2::TOPGeoColdPlate::getBaseMaterial
const std::string & getBaseMaterial() const
Returns base plate material name.
Definition: TOPGeoColdPlate.h:72
Belle2::TOPGeoBarSegment::getSigmaAlpha
double getSigmaAlpha() const
Returns geant4 parameter describing surface roughness.
Definition: TOPGeoBarSegment.h:192
Belle2::TOPGeoBarSegment::getThickness
double getThickness() const
Returns bar segment thickness.
Definition: TOPGeoBarSegment.h:117
Belle2::TOP::GeoTOPCreator::EPanelType
EPanelType
Honeycomb panel types.
Definition: GeoTOPCreator.h:89
Belle2::TOPGeoFrontEnd::getFrontBoardWidth
double getFrontBoardWidth() const
Returns front board width.
Definition: TOPGeoFrontEnd.h:113
Belle2::TOPGeoModule::getBarSegment1
const TOPGeoBarSegment & getBarSegment1() const
Returns bar segment No.1 (forward bar)
Definition: TOPGeoModule.h:244
Belle2::TOPGeoQBB::getFrontPlateContour
std::vector< std::pair< double, double > > getFrontPlateContour() const
Returns prism enclosure front plate x-y contour.
Definition: TOPGeoQBB.cc:205
Belle2::TOPGeoSideRails::getReducedThickness
double getReducedThickness() const
Returns thickness at prism enclosure.
Definition: TOPGeoSideRails.h:68