9#include <top/geometry/GeoTOPCreator.h>
10#include <top/geometry/TOPGeometryPar.h>
12#include <geometry/Materials.h>
13#include <geometry/CreatorFactory.h>
14#include <geometry/utilities.h>
15#include <framework/gearbox/GearDir.h>
16#include <framework/gearbox/Unit.h>
17#include <framework/logging/Logger.h>
18#include <framework/database/Database.h>
19#include <framework/database/IntervalOfValidity.h>
20#include <framework/database/DBImportObjPtr.h>
21#include <framework/database/DBObjPtr.h>
22#include <top/simulation/SensitivePMT.h>
23#include <top/simulation/SensitiveBar.h>
24#include <simulation/background/BkgSensitiveDetector.h>
25#include <simulation/kernel/RunManager.h>
29#include <G4LogicalVolume.hh>
30#include <G4PVPlacement.hh>
31#include <G4AssemblyVolume.hh>
32#include <G4LogicalSkinSurface.hh>
33#include <G4OpticalSurface.hh>
36#include <G4UserLimits.hh>
37#include <G4Material.hh>
38#include <G4ExtrudedSolid.hh>
39#include <G4UnionSolid.hh>
41#include <G4IntersectionSolid.hh>
42#include <G4SubtractionSolid.hh>
45#include <G4TwoVector.hh>
46#include <G4ThreeVector.hh>
58 using namespace geometry;
63 geometry::CreatorFactory<GeoTOPCreator> GeoTOPFactory(
"TOPCreator");
76 G4LogicalSkinSurface::CleanSurfaceTable();
88 B2ERROR(
"TOP: geometry or mappers not valid (gearbox) - geometry not created");
103 B2ERROR(
"TOP: geometry or mappers not valid (gearbox) - no payloads imported");
115 B2RESULT(
"TOP: geometry and mappers imported to database");
126 B2ERROR(
"Cannot create Geometry from Database: no configuration found for "
138 G4LogicalVolume& topVolume,
152 G4Region* aRegion = 0;
154 for (
const auto& geoModule : geo.
getModules()) {
155 int moduleID = geoModule.getModuleID();
156 double barLength = geoModule.getBarLength();
161 G4TranslateZ3D(backwardLength / 2 - prismPosition - barLength / 2);
165 const auto& displacement = geoModule.getModuleDisplacement();
166 G4Transform3D dRx = G4RotateX3D(displacement.getAlpha());
167 G4Transform3D dRy = G4RotateY3D(displacement.getBeta());
168 G4Transform3D dRz = G4RotateZ3D(displacement.getGamma());
169 G4Transform3D dtr = G4Translate3D(displacement.getX(),
171 displacement.getZ());
172 G4Transform3D D = dtr * dRz * dRy * dRx;
176 double radius = geoModule.getRadius();
177 double backwardZ = geoModule.getBackwardZ();
178 G4Transform3D tr = G4Translate3D(0, radius, barLength / 2 + backwardZ);
179 double phi = geoModule.getPhi() - M_PI / 2;
180 G4Transform3D Rz = G4RotateZ3D(phi);
181 G4Transform3D T = Rz * tr * D * T1;
183 std::string name = geoModule.getName();
186 if (not aRegion) aRegion =
new G4Region(
"TOPEnvelope");
187 module->SetRegion(aRegion);
188 aRegion->AddRootLogicalVolume(module);
190 new G4PVPlacement(T, module, name, &topVolume,
false, moduleID);
194 <<
" PMT's are optically decoupled");
198 <<
" peel-off cookie regions");
207 G4RotationMatrix rot;
211 const auto& geoQBB = geo.
getQBB();
216 const auto& geoModule = geo.
getModule(moduleID);
219 move.setZ(geoQBB.getPrismPosition() - geoQBB.getPrismEnclosure().getLength() / 2);
220 optics->MakeImprint(module, move, &rot);
227 double Lprism = geoModule.getPrism().getFullLength();
228 double Larray = geoModule.getPMTArray().getSizeZ();
229 move.setZ(move.z() - Lprism - Larray);
236 m_qbb->MakeImprint(module, move, &rot);
249 double forwardLength = geo.
getLength() - backwardLength;
250 std::vector<G4TwoVector> polygon;
252 polygon.push_back(G4TwoVector(point.first, point.second));
254 auto* backward =
new G4ExtrudedSolid(
"backwardEnvelope",
255 polygon, backwardLength / 2,
256 G4TwoVector(), 1, G4TwoVector(), 1);
259 polygon.push_back(G4TwoVector(point.first, point.second));
261 auto* forward =
new G4ExtrudedSolid(
"forwardEnvelope",
262 polygon, forwardLength / 2,
263 G4TwoVector(), 1, G4TwoVector(), 1);
265 G4Transform3D move = G4TranslateZ3D((backwardLength + forwardLength) / 2);
266 m_moduleEnvelope =
new G4UnionSolid(
"moduleEnvelope", backward, forward, move);
270 if (!material) B2FATAL(
"Material '" << geo.
getMaterial() <<
"' not found");
272 std::string name =
addNumber(
"TOPEnvelopeModule", moduleID);
280 auto* frontEnd =
new G4AssemblyVolume();
289 auto* frontBoard =
createBox(
"TOPFrontBoard",
298 move.setZ(Z - length / 2);
300 frontEnd->AddPlacedVolume(frontBoard, move, 0);
317 frontEnd->AddPlacedVolume(HVBoard, move, 0);
325 frontEnd->AddPlacedVolume(boardStack, move, 0);
334 double fullWidth = width * N;
335 std::string name =
"TOPBoardStack";
343 std::string name1 = name +
"Spacer";
350 std::string name2 = name +
"TwoSpacers";
358 move = G4TranslateX3D(-(fullWidth - spacerWidth) / 2);
359 new G4PVPlacement(move, spacer, name1, boardStack,
false, 1);
360 move = G4TranslateX3D((fullWidth - spacerWidth) / 2);
361 new G4PVPlacement(move, spacer, name1, boardStack,
false, 2);
364 for (
int i = 0; i < n; i++) {
365 move = G4TranslateX3D(width * (2 * i - n + 1) / 2.0);
366 new G4PVPlacement(move, twoSpacers, name2, boardStack,
false, i + 1);
375 auto* qbb =
new G4AssemblyVolume();
387 qbb->AddPlacedVolume(outerPanel, move, 0);
393 qbb->AddPlacedVolume(innerPanel, move, 0);
403 move.setZ(Zfront + length / 2);
404 qbb->AddPlacedVolume(forwardEndPlate, move, 0);
415 move.setZ(Z + length / 2);
416 qbb->AddPlacedVolume(backPlate, move, 0);
424 move.setZ(Z + length / 2);
425 qbb->AddPlacedVolume(prismEnclosure, move, 0);
433 move.setZ(Z + length / 2);
434 qbb->AddPlacedVolume(frontPlate, move, 0);
440 auto* extPlate =
createBox(name +
"ExtensionPlate",
446 G4ThreeVector movePlate;
447 movePlate.setZ(Z + length / 2);
449 qbb->AddPlacedVolume(extPlate, movePlate, 0);
459 qbb->AddPlacedVolume(leftRail, move, 0);
463 qbb->AddPlacedVolume(rightRail, move, 0);
478 qbb->AddPlacedVolume(coldPlateBase, move, 0);
487 qbb->AddPlacedVolume(coldPlateCool, move, 0);
500 double sideEdgeHeight = 0;
501 double sideEdgeY = 0;
503 if (type == c_Inner) {
507 sideEdgeY = geoPanel.
getY() - sideEdgeHeight / 2;
512 sideEdgeY = geoPanel.
getY() + sideEdgeHeight / 2;
524 std::string faceEdgeName = geoPanel.
getName() +
"ReinforcedFace";
531 new G4PVPlacement(move, faceEdge, faceEdgeName, panel,
false, 1);
533 new G4PVPlacement(move, faceEdge, faceEdgeName, panel,
false, 2);
539 std::string sideEdgeName = geoPanel.
getName() +
"ReinforcedSide";
547 move = G4Translate3D((width - sideEdgeWidth) / 2, sideEdgeY, 0);
548 new G4PVPlacement(move, sideEdge, sideEdgeName, panel,
false, 1);
549 move = G4Translate3D(-(width - sideEdgeWidth) / 2, sideEdgeY, 0);
550 new G4PVPlacement(move, sideEdge, sideEdgeName, panel,
false, 2);
567 auto* box =
new G4Box(
"box", A / 2, B / 2, C / 2);
568 auto* subtrBox =
new G4Box(
"subtrBox", a / 2, b / 2, c / 2);
570 if (type == c_Left) {
575 G4Transform3D move = G4Translate3D(x, -(B - b) / 2, -(C - c) / 2);
576 auto* solid =
new G4SubtractionSolid(
"sideRail", box, subtrBox, move);
583 if (type == c_Left) {
589 return new G4LogicalVolume(solid, material, name);
595 auto* optics =
new G4AssemblyVolume();
611 G4RotationMatrix rotArray;
613 optics->AddPlacedVolume(pmtArray, moveArray, &rotArray);
616 G4RotationMatrix rot;
620 rot.rotateY(M_PI / 2);
621 optics->AddPlacedVolume(prism, move, &rot);
625 optics->AddPlacedVolume(barSegment2, move, 0);
628 move.setZ(L2 + L1 / 2);
629 optics->AddPlacedVolume(barSegment1, move, 0);
633 move.setZ(L2 + L1 + Lm / 2);
634 optics->AddPlacedVolume(mirrorSegment, move, 0);
639 const double thickness = 1.0;
644 auto* peekFrameAbove =
createBox(
"PeekFrameAbove", width, thickness, length,
"Al");
645 move.setZ(-(Lp - length / 2));
646 move.setY(Yup + thickness / 2);
647 optics->AddPlacedVolume(peekFrameAbove, move, 0);
649 auto* peekFrameBelow =
createBox(
"PeekFrameBelow", width, thickness, length,
"Al");
650 move.setZ(-(Lp - length / 2));
651 move.setY(Ydn - thickness / 2);
652 optics->AddPlacedVolume(peekFrameBelow, move, 0);
677 new G4PVPlacement(fix, brokenGlue, geo.
getName() +
"BrokenGlue", glue,
false, 1);
678 B2RESULT(
"GeoTOPCreator, broken glue at " << geo.
getName()
685 new G4PVPlacement(move, glue, geo.
getName() +
"Glue", bar,
false, 1);
689 auto* optSurf = materials.createOpticalSurface(geo.
getSurface());
691 new G4LogicalSkinSurface(
"opticalSurface", bar, optSurf);
706 auto* box =
new G4Box(geo.
getName(),
727 new G4PVPlacement(fix, brokenGlue, geo.
getName() +
"BrokenGlue", glue,
false, 1);
728 B2RESULT(
"GeoTOPCreator, broken glue at " << geo.
getName()
735 new G4PVPlacement(move, glue, geo.
getName() +
"Glue", bar,
false, 1);
739 auto* optSurf = materials.createOpticalSurface(geo.
getSurface());
741 new G4LogicalSkinSurface(
"opticalSurface", bar, optSurf);
752 new G4LogicalSkinSurface(
"mirrorSurface", mirror, mirrorSurf);
755 move = G4TranslateZ3D(0);
756 new G4PVPlacement(move, mirror, geo.
getName() +
"ReflectiveCoating", bar,
false, 1);
772 std::vector<G4TwoVector> polygon;
773 polygon.push_back(G4TwoVector(0, geo.
getThickness() / 2));
779 polygon.push_back(G4TwoVector(0, -geo.
getThickness() / 2));
781 auto* volume =
new G4ExtrudedSolid(geo.
getName(), polygon, geo.
getWidth() / 2,
782 G4TwoVector(), 1, G4TwoVector(), 1);
784 if (!material) B2FATAL(
"Material '" << geo.
getMaterial() <<
"' not found");
785 auto* prism =
new G4LogicalVolume(volume, material, geo.
getName());
792 std::string filterMaterial;
793 if (filterThickness > 0) {
806 std::string message =
addNumber(
"peel-off cookie regions of Slot", moduleID) +
":";
808 if (region.fraction <= 0)
continue;
818 G4Transform3D
R = G4RotateY3D(-M_PI / 2);
819 G4Transform3D moveRegion = T *
R;
820 new G4PVPlacement(moveRegion, peelOff, name,
filter,
false, 1);
824 if (numRegions > 0) B2RESULT(
"GeoTOPCreator, " << message);
831 new G4PVPlacement(move,
filter, geo.
getName() +
"Filter", prism,
false, 1);
837 auto* optSurf = materials.createOpticalSurface(geo.
getSurface());
839 new G4LogicalSkinSurface(
"opticalSurface", prism, optSurf);
862 std::string message =
addNumber(
"optically decoupled PMT's of Slot", moduleID) +
":";
863 for (
unsigned row = 1; row <= geo.
getNumRows(); row++) {
873 G4Transform3D move = G4Translate3D(geo.
getX(col), geo.
getY(row), z);
891 G4Transform3D move = G4Translate3D(0, 0, (fullThickness - cookieThickness) / 2);
892 new G4PVPlacement(move, cookie, geo.
getName() +
"Cookie",
filter,
false, 1);
894 move = G4Translate3D(0, 0, (geo.
getSizeZ() - fullThickness) / 2);
895 new G4PVPlacement(move,
filter, geo.
getName() +
"Filter+Cookie", pmtArray,
899 if (!geo.
getDecoupledPMTs().empty()) B2RESULT(
"GeoTOPCreator, " << message);
928 new G4PVPlacement(move, photoCathode, geo.
getName() +
"PhotoCathode", window,
937 if (holeSizeX > 0 and holeSizeY > 0) {
939 holeSizeX, holeSizeY,
942 move = G4TranslateZ3D(0.0);
943 new G4PVPlacement(move, hole, geo.
getName() +
"ReflectiveEdgeHole", reflEdge,
949 new G4LogicalSkinSurface(
"reflectiveEdgeSurface", reflEdge, optSurf);
952 new G4PVPlacement(move, reflEdge, geo.
getName() +
"ReflectiveEdge", window,
955 move = G4TranslateZ3D((geo.
getSizeZ() - winThickness) / 2);
956 new G4PVPlacement(move, window, geo.
getName() +
"Window", pmt,
false, 1);
964 new G4PVPlacement(move, bottom, geo.
getName() +
"Bottom", pmt,
false, 1);
974 move = G4TranslateZ3D(-(geo.
getSizeZ() - interiorSizeZ) / 2
976 new G4PVPlacement(move, interior, geo.
getName() +
"Interior", pmt,
false, 1);
983 double A,
double B,
double C,
984 const std::string& materialName)
986 G4Box* box =
new G4Box(name, A / 2, B / 2, C / 2);
988 if (!material) B2FATAL(
"Material '" << materialName <<
"' not found");
989 return new G4LogicalVolume(box, material, name);
1001 const std::string& materialName)
1004 double x = box->GetXHalfLength();
1005 double y = box->GetYHalfLength();
1006 double z = box->GetZHalfLength();
1007 double dx = fmax(fabs(-x - xc), fabs(x - xc));
1008 double dy = fmax(fabs(-y - yc), fabs(y - yc));
1009 double dz = fmin(-z - zc, z - zc);
1010 double theta =
atan(
sqrt(dx * dx + dy * dy) / dz);
1012 auto* sphere =
new G4Sphere(name +
"Sphere",
1013 Rmin, Rmax, 0, 2 * M_PI, 0, theta);
1014 G4Translate3D move(xc, yc, zc);
1015 auto* shape =
new G4IntersectionSolid(name, box, sphere, move);
1018 if (!material) B2FATAL(
"Material '" << materialName <<
"' not found");
1019 return new G4LogicalVolume(shape, material, name);
1024 const Polygon& shape,
1026 const std::string& materialName)
1028 std::vector<G4TwoVector> polygon;
1029 for (
auto& point : shape) {
1030 polygon.push_back(G4TwoVector(point.first, point.second));
1032 G4ExtrudedSolid* solid =
new G4ExtrudedSolid(name, polygon, length / 2,
1033 G4TwoVector(), 1, G4TwoVector(), 1);
1035 if (!material) B2FATAL(
"Material '" << materialName <<
"' not found");
1036 return new G4LogicalVolume(solid, material, name);
1044 ss <<
"0" << number;
The Class for BeamBackground Sensitive Detector.
bool import(const IntervalOfValidity &iov)
Import the object to database.
Class for importing a single object to the database.
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
GearDir is the basic class used for accessing the parameter store.
A class that describes the interval of experiments/runs for which an object in the database is valid.
void addAssemblyVolume(G4AssemblyVolume *vol)
Register a G4AssemblyVolume.
static RunManager & Instance()
Static method to get a reference to the RunManager instance.
Geometry parameters of a quartz bar segment.
double getWidth() const
Returns bar segment width.
const std::string & getGlueMaterial() const
Returns glue material name (glue on -z side)
double getFullLength() const
Returns bar segment length including glue.
double getThickness() const
Returns bar segment thickness.
double getSigmaAlpha() const
Returns geant4 parameter describing surface roughness.
double getBrokenGlueFraction() const
Returns fraction of the delaminated surface.
const std::string & getMaterial() const
Returns bar segment material name.
const GeoOpticalSurface & getSurface() const
Returns optical surface.
double getLength() const
Returns bar segment length.
virtual double getGlueThickness() const
Returns glue thickness (glue on -z side)
const std::string & getBrokenGlueMaterial() const
Returns material name which represents broken glue.
const std::string & getName() const
Returns object name.
const std::string & getCoolMaterial() const
Returns cooling plate material name.
double getCoolWidth() const
Returns cooling plate width.
const std::string & getBaseMaterial() const
Returns base plate material name.
double getCoolThickness() const
Returns cooling plate thickness.
double getBaseThickness() const
Returns base plate thickness.
double getHeight() const
Returns height.
double getThickness() const
Returns thickness.
const std::string & getMaterial() const
Returns material name.
Geometry parameters of board stack (front-end electronic module)
double getHVBoardGap() const
Returns gap between HV board and front board.
const std::string & getHVBoardMaterial() const
Returns HV board material.
double getFrontBoardGap() const
Returns gap between front board and PMT array.
double getHVBoardThickness() const
Returns HV board thickness.
double getFrontBoardThickness() const
Returns front board thickness.
double getHVBoardLength() const
Returns HV board length.
const std::string & getBoardStackMaterial() const
Returns board stack material.
double getBoardStackLength() const
Returns board stack length.
double getBoardStackY() const
Returns position of board stack center in bar frame.
double getBoardStackWidth() const
Returns board stack width.
double getFrontBoardWidth() const
Returns front board width.
const std::string & getFrontBoardMaterial() const
Returns front board material.
double getBoardStackHeight() const
Returns board stack height.
double getBoardStackGap() const
Returns gap between board stack and front board.
double getHVBoardY() const
Returns position of HV board center in bar frame.
double getHVBoardWidth() const
Returns HV board width.
double getFrontBoardY() const
Returns position of front board center in bar frame.
double getFrontBoardHeight() const
Returns front board height.
const std::string & getSpacerMaterial() const
Returns board stack spacer material.
double getSpacerWidth() const
Returns board stack spacer width.
Geometry parameters of honeycomb panel.
double getWidth() const
Returns panel width.
double getMaxThickness() const
Returns panel maximal thickness.
const std::string & getEdgeMaterial() const
Returns material name of reinforced edge.
double getMinThickness() const
Returns panel minimal thickness.
double getY() const
Returns y position of the flat surface in local (bar) frame.
const std::string & getMaterial() const
Returns material name.
double getEdgeWidth() const
Returns width of the reinforced edge.
double getLength() const
Returns panel length.
Geometry parameters of a mirror segment.
double getYc() const
Returns spherical mirror center of curvature in y.
double getOuterRadius() const
Returns spherical mirror outer radius of curvature.
const std::string & getCoatingMaterial() const
Returns reflective coating material.
double getRadius() const
Returns spherical mirror radius of curvature.
const GeoOpticalSurface & getCoatingSurface() const
Returns reflective coating optical surface.
double getXc() const
Returns spherical mirror center of curvature in x.
Geometry parameters of a module (optical components + positioning)
const TOPGeoMirrorSegment & getMirrorSegment() const
Returns mirror segment.
const TOPGeoBarSegment & getBarSegment1() const
Returns bar segment No.1 (forward bar)
const TOPGeoPMTArray & getPMTArray() const
Returns PMT array.
int getModuleID() const
Returns module ID.
const TOPGeoPMTArrayDisplacement & getPMTArrayDisplacement() const
Returns PMT array displacement.
const TOPGeoPrism & getPrism() const
Returns prism.
const TOPGeoBarSegment & getBarSegment2() const
Returns bar segment No.2 (backward bar)
double getX() const
Returns translation in x.
double getAlpha() const
Returns rotation angle (around z)
double getY() const
Returns translation in y.
Geometry parameters of MCP-PMT array.
const std::string & getCookieMaterial() const
Returns silicone cookie material.
double getSizeZ() const
Returns array volume dimension in z.
unsigned getNumColumns() const
Returns number of array columns.
double getX(unsigned col) const
Returns x coordinate of column center.
double getY(unsigned row) const
Returns the y coordinate of row center.
double getFilterThickness() const
Returns wavelength filter thickness.
double getSizeX() const
Returns array volume dimension in x.
const std::string & getFilterMaterial() const
Returns wavelenght filter material.
const TOPGeoPMT & getPMT() const
Returns PMT geometry parameters.
double getSizeY() const
Returns array volume dimension in y.
const std::string & getMaterial() const
Returns material name into which PMT's are inserted.
unsigned getNumRows() const
Returns number of array rows.
double getCookieThickness() const
Returns silicone cookie thickness.
double getAirGap() const
Returns air gap.
const std::vector< unsigned > & getDecoupledPMTs() const
Returns ID's of optically decoupled PMT's.
Geometry parameters of MCP-PMT.
double getSizeZ() const
Returns full size in z.
double getReflEdgeThickness() const
Returns reflective edge thickness.
const std::string & getSensMaterial() const
Returns sensitive material name.
const GeoOpticalSurface & getReflEdgeSurface() const
Returns reflective edge optical surface.
double getWinThickness() const
Returns entrance window thickness.
double getBotThickness() const
Returns bottom thickness.
const std::string & getWallMaterial() const
Returns wall (casing) material name.
double getReflEdgeWidth() const
Returns reflective edge width.
const std::string & getFillMaterial() const
Returns fill (inside) material name.
double getSensSizeX() const
Returns sensitive volume (photo-cathode) size in x.
double getSizeX() const
Returns full size in x.
double getSizeY() const
Returns full size in y.
double getWallThickness() const
Returns wall thickness.
double getSensThickness() const
Returns sensitive volume (photo-cathode) thickness.
const std::string & getWinMaterial() const
Returns entrance window material name.
const std::string & getBotMaterial() const
Returns bottom material name.
double getSensSizeY() const
Returns sensitive volume (photo-cathode) size in y.
double getBackThickness() const
Returns back wall thickness.
double getBodyLength() const
Returns length w/o back and front plates.
const std::string & getMaterial() const
Returns material name.
double getExtensionThickness() const
Returns extension plate thickness.
double getFrontThickness() const
Returns front wall thickness.
double getLength() const
Returns full length.
Geometry parameters of prism.
const std::string & getPeelOffMaterial() const
Returns peel-off material.
double getPeelOffCenter(const PeelOffRegion ®ion) const
Returns peel-off offset in x of the given region.
double getFilterThickness() const
Returns wavelength filter thickness (filter on -z side).
const std::vector< PeelOffRegion > & getPeelOffRegions() const
Returns peel-off cookie regions.
double getExitThickness() const
Returns prism thickness at PMT side.
double getPeelOffThickness() const
Returns peel-off thickness.
const std::string & getFilterMaterial() const
Returns wavelength filter material name (filter on -z side) For backward compatibility,...
double getFlatLength() const
Returns the length of a flat surface at prism bottom.
Geometry parameters of Quartz Bar Box (mother class)
double getWidth() const
Returns full width.
const TOPGeoSideRails & getSideRails() const
Returns side rails.
const TOPGeoHoneycombPanel & getOuterPanel() const
Returns outer honeycomb panel.
double getSideRailsLength() const
Returns side rails length.
const TOPGeoEndPlate & getForwardEndPlate() const
Returns forward end plate.
const TOPGeoColdPlate & getColdPlate() const
Returns cold plate.
const TOPGeoPrismEnclosure & getPrismEnclosure() const
Returns prism enclosure.
double getPrismPosition() const
Returns the position of prism-bar joint wrt QBB back.
const std::string & getMaterial() const
Returns the name of material inside QBB.
const TOPGeoHoneycombPanel & getInnerPanel() const
Returns inner honeycomb panel.
double getLength() const
Returns full length.
double getPanelWidth() const
Returns panel width used in x-y contours of honeycomb panels.
double getHeight() const
Returns height.
double getThickness() const
Returns thickness.
const std::string & getMaterial() const
Returns material name.
double getReducedThickness() const
Returns thickness at prism enclosure.
Geometry parameters of TOP.
unsigned getNumBoardStacks() const
Returns number of boardstacks per module.
static void useGeantUnits()
Use Geant units when returning geometry parameters.
const TOPGeoQBB & getQBB() const
Returns quartz bar box.
const std::vector< TOPGeoModule > & getModules() const
Returns all modules.
const TOPGeoFrontEnd & getFrontEnd() const
Returns front-end.
void importPayload(const IntervalOfValidity &iov) const
import mappings to database
void importPayload(const IntervalOfValidity &iov) const
import mappings to database
int m_numPeelOffRegions
number of peel-off regions
virtual ~GeoTOPCreator()
Destructor.
int m_numBrokenGlues
number of broken glues
void createGeometry(const TOPGeometry ¶meters, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Create the geometry from a parameter object.
G4UnionSolid * m_moduleEnvelope
module envelope solid
G4AssemblyVolume * assembleFrontEnd(const TOPGeoFrontEnd &geo, int N)
Assembles front-end electronics.
int m_numDecoupledPMTs
number of optically decoupled PMT's
G4LogicalVolume * createPMTArray(const TOPGeoPMTArray &geo, int moduleID)
Creates PMT array.
G4AssemblyVolume * assembleQBB(const TOPGeoQBB &geo)
Assembles QBB.
G4AssemblyVolume * m_frontEnd
front-end electronics assembly volume
G4LogicalVolume * createMirrorSegment(const TOPGeoMirrorSegment &geo, int moduleID)
Creates quartz segment with spherical mirror.
virtual void createFromDB(const std::string &name, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creation of the detector geometry from database.
G4LogicalVolume * createSideRail(const TOPGeoQBB &geo, ESideRailType type)
Creates side rail.
G4AssemblyVolume * m_qbb
QBB assembly volume.
G4LogicalVolume * createHoneycombPanel(const TOPGeoQBB &geo, EPanelType type)
Creates honeycomb panel.
std::string addNumber(const std::string &str, unsigned number)
Adds number to string.
SensitiveBar * m_sensitiveBar
Sensitive vol.
virtual void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Creation of payloads.
G4LogicalVolume * createBoardStack(const TOPGeoFrontEnd &geo, int N)
Creates board stack.
BkgSensitiveDetector * m_sensitivePCB2
PCB sensitive for BG studies.
TOPGeometryPar * m_topgp
singleton class
G4LogicalVolume * createExtrudedSolid(const std::string &name, const Polygon &shape, double length, const std::string &materialName)
Creates material extruded solid.
G4LogicalVolume * createPMT(const TOPGeoPMT &geo)
Creates single PMT.
G4LogicalVolume * createModule(const TOPGeometry &geo, int moduleID)
Creates single module.
G4LogicalVolume * createBarSegment(const TOPGeoBarSegment &geo, int moduleID)
Creates quartz bar segment.
G4LogicalVolume * createPrism(const TOPGeoPrism &geo, int moduleID)
Creates quartz prism.
GeoTOPCreator()
Constructor.
BkgSensitiveDetector * m_sensitivePCB1
PCB sensitive for BG studies.
ESideRailType
Side rail types.
G4AssemblyVolume * assembleOptics(const TOPGeoModule &geo)
Assembles optical components (PMT array, prism and bar segments) along z.
G4LogicalVolume * createBox(const std::string &name, double A, double B, double C, const std::string &materialName)
Creates material box.
int m_isBeamBkgStudy
flag for beam backgound simulation
SensitivePMT * m_sensitivePMT
Sensitive vol.
G4LogicalVolume * createBoxSphereIntersection(const std::string &name, G4Box *box, double Rmin, double Rmax, double xc, double yc, double zc, const std::string &materialName)
Creates material volume that is intersection of box and half-sphere shell (z > 0)
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creation of the detector geometry from Gearbox (XML).
G4LogicalVolume * createModuleEnvelope(const TOPGeoQBB &geo, int moduleID)
Creates module envelope.
EPanelType
Honeycomb panel types.
Class providing information on MCParticles hitting the bars.
void setReplicaDepth(int depth)
Sets replica depth of module volume.
void setModuleReplicaDepth(int depth)
Sets replica depth of module volume.
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
const ChannelMapper & getChannelMapper() const
Returns default channel mapper (mapping of channels to pixels)
bool isValid() const
check if the geometry is available
const FrontEndMapper & getFrontEndMapper() const
Returns front-end mapper (mapping of SCROD's to positions within TOP modules)
void Initialize(const GearDir &content)
Initialize from Gearbox (XML)
static G4Material * get(const std::string &name)
Find given material.
static Materials & getInstance()
Get a reference to the singleton instance.
double atan(double a)
atan for double
double sqrt(double a)
sqrt for double
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
std::vector< std::pair< double, double > > getBackPlateContour() const
Returns prism enclosure back plate x-y contour.
std::vector< std::pair< double, double > > getPrismEnclosureContour() const
Returns prism enclosure wall x-y contour.
std::vector< std::pair< double, double > > getPeelOffContour(const PeelOffRegion ®ion) const
Returns the x-y contour of the peel-off region.
double getZc() const
Returns spherical mirror center of curvature in z (in local frame of this segment)
bool isPMTDecoupled(unsigned pmtID) const
Checks if PMT is optically decoupled.
const TOPGeoModule & getModule(int moduleID) const
Returns module.
std::vector< std::pair< double, double > > getFrontPlateContour() const
Returns prism enclosure front plate x-y contour.
std::vector< std::pair< double, double > > getOuterPanelContour() const
Returns outer honeycomb panel x-y contour.
std::vector< std::pair< double, double > > getForwardContour() const
Returns forward x-y contour.
std::vector< std::pair< double, double > > getBrokenGlueContour() const
Returns the x-y contour of broken glue.
unsigned getPmtID(unsigned row, unsigned col) const
Converts row and column numbers to PMT ID (1-based)
std::vector< std::pair< double, double > > getBackwardContour() const
Returns backward x-y contour.
std::vector< std::pair< double, double > > getInnerPanelContour() const
Returns inner honeycomb panel x-y contour.
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.