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>
40 #include <G4Sphere.hh>
41 #include <G4IntersectionSolid.hh>
42 #include <G4SubtractionSolid.hh>
43 #include <G4Region.hh>
44 #include <G4Colour.hh>
45 #include <G4TwoVector.hh>
46 #include <G4ThreeVector.hh>
58 using namespace geometry;
63 geometry::CreatorFactory<GeoTOPCreator> GeoTOPFactory(
"TOPCreator");
66 GeoTOPCreator::GeoTOPCreator()
70 GeoTOPCreator::~GeoTOPCreator()
72 if (m_sensitivePMT)
delete m_sensitivePMT;
73 if (m_sensitiveBar)
delete m_sensitiveBar;
74 if (m_sensitivePCB1)
delete m_sensitivePCB1;
75 if (m_sensitivePCB2)
delete m_sensitivePCB2;
76 G4LogicalSkinSurface::CleanSurfaceTable();
80 void GeoTOPCreator::create(
const GearDir& content, G4LogicalVolume& topVolume,
84 m_isBeamBkgStudy = content.getInt(
"BeamBackgroundStudy");
86 m_topgp->Initialize(content);
87 if (!m_topgp->isValid()) {
88 B2ERROR(
"TOP: geometry or mappers not valid (gearbox) - geometry not created");
92 const auto* geo = m_topgp->getGeometry();
93 createGeometry(*geo, topVolume, type);
98 void GeoTOPCreator::createPayloads(
const GearDir& content,
101 m_topgp->Initialize(content);
102 if (!m_topgp->isValid()) {
103 B2ERROR(
"TOP: geometry or mappers not valid (gearbox) - no payloads imported");
108 const auto* geo = m_topgp->getGeometry();
112 m_topgp->getChannelMapper().importPayload(iov);
113 m_topgp->getFrontEndMapper().importPayload(iov);
115 B2RESULT(
"TOP: geometry and mappers imported to database");
120 void GeoTOPCreator::createFromDB(
const std::string& name, G4LogicalVolume& topVolume,
124 m_topgp->Initialize();
125 if (!m_topgp->isValid()) {
126 B2ERROR(
"Cannot create Geometry from Database: no configuration found for "
131 const auto* geo = m_topgp->getGeometry();
132 createGeometry(*geo, topVolume, type);
138 G4LogicalVolume& topVolume,
144 m_sensitivePMT->setModuleReplicaDepth(4);
145 m_sensitiveBar->setReplicaDepth(1);
152 G4Region* aRegion =
new G4Region(
"TOPEnvelope");
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;
182 auto* module = createModule(geo, moduleID);
183 std::string name = geoModule.getName();
186 module->SetRegion(aRegion);
187 aRegion->AddRootLogicalVolume(module);
189 new G4PVPlacement(T, module, name, &topVolume,
false, moduleID);
192 if (m_numDecoupledPMTs > 0) B2WARNING(
"GeoTOPCreator, " << m_numDecoupledPMTs
193 <<
" PMT's are optically decoupled");
194 if (m_numBrokenGlues > 0) B2WARNING(
"GeoTOPCreator, " << m_numBrokenGlues
196 if (m_numPeelOffRegions > 0) B2WARNING(
"GeoTOPCreator, " << m_numPeelOffRegions
197 <<
" peel-off cookie regions");
201 G4LogicalVolume* GeoTOPCreator::createModule(
const TOPGeometry& geo,
int moduleID)
206 G4RotationMatrix rot;
210 const auto& geoQBB = geo.
getQBB();
211 auto* module = createModuleEnvelope(geoQBB, moduleID);
215 const auto& geoModule = geo.
getModule(moduleID);
216 auto* optics = assembleOptics(geoModule);
218 move.setZ(geoQBB.getPrismPosition() - geoQBB.getPrismEnclosure().getLength() / 2);
219 optics->MakeImprint(module, move, &rot);
226 double Lprism = geoModule.getPrism().getFullLength();
227 double Larray = geoModule.getPMTArray().getSizeZ();
228 move.setZ(move.z() - Lprism - Larray);
229 m_frontEnd->MakeImprint(module, move, &rot);
233 if (!m_qbb) m_qbb = assembleQBB(geoQBB);
235 m_qbb->MakeImprint(module, move, &rot);
241 G4LogicalVolume* GeoTOPCreator::createModuleEnvelope(
const TOPGeoQBB& geo,
246 if (!m_moduleEnvelope) {
248 double forwardLength = geo.
getLength() - backwardLength;
249 std::vector<G4TwoVector> polygon;
251 polygon.push_back(G4TwoVector(point.first, point.second));
253 auto* backward =
new G4ExtrudedSolid(
"backwardEnvelope",
254 polygon, backwardLength / 2,
255 G4TwoVector(), 1, G4TwoVector(), 1);
258 polygon.push_back(G4TwoVector(point.first, point.second));
260 auto* forward =
new G4ExtrudedSolid(
"forwardEnvelope",
261 polygon, forwardLength / 2,
262 G4TwoVector(), 1, G4TwoVector(), 1);
264 G4Transform3D move = G4TranslateZ3D((backwardLength + forwardLength) / 2);
265 m_moduleEnvelope =
new G4UnionSolid(
"moduleEnvelope", backward, forward, move);
268 G4Material* material = Materials::get(geo.
getMaterial());
269 if (!material) B2FATAL(
"Material '" << geo.
getMaterial() <<
"' not found");
271 std::string name = addNumber(
"TOPEnvelopeModule", moduleID);
272 return new G4LogicalVolume(m_moduleEnvelope, material, name);
277 G4AssemblyVolume* GeoTOPCreator::assembleFrontEnd(
const TOPGeoFrontEnd& geo,
int N)
279 auto* frontEnd =
new G4AssemblyVolume();
280 Simulation::RunManager::Instance().addAssemblyVolume(frontEnd);
288 auto* frontBoard = createBox(
"TOPFrontBoard",
293 if (m_isBeamBkgStudy) {
295 frontBoard->SetSensitiveDetector(m_sensitivePCB1);
297 move.setZ(Z - length / 2);
299 frontEnd->AddPlacedVolume(frontBoard, move, 0);
305 auto* HVBoard = createBox(
"TOPHVBoard",
310 if (m_isBeamBkgStudy) {
312 HVBoard->SetSensitiveDetector(m_sensitivePCB2);
316 frontEnd->AddPlacedVolume(HVBoard, move, 0);
323 auto* boardStack = createBoardStack(geo, N);
324 frontEnd->AddPlacedVolume(boardStack, move, 0);
330 G4LogicalVolume* GeoTOPCreator::createBoardStack(
const TOPGeoFrontEnd& geo,
int N)
333 double fullWidth = width * N;
334 std::string name =
"TOPBoardStack";
335 auto* boardStack = createBox(name,
342 std::string name1 = name +
"Spacer";
343 auto* spacer = createBox(name1,
349 std::string name2 = name +
"TwoSpacers";
350 auto* twoSpacers = createBox(name2,
357 move = G4TranslateX3D(-(fullWidth - spacerWidth) / 2);
358 new G4PVPlacement(move, spacer, name1, boardStack,
false, 1);
359 move = G4TranslateX3D((fullWidth - spacerWidth) / 2);
360 new G4PVPlacement(move, spacer, name1, boardStack,
false, 2);
363 for (
int i = 0; i < n; i++) {
364 move = G4TranslateX3D(width * (2 * i - n + 1) / 2.0);
365 new G4PVPlacement(move, twoSpacers, name2, boardStack,
false, i + 1);
372 G4AssemblyVolume* GeoTOPCreator::assembleQBB(
const TOPGeoQBB& geo)
374 auto* qbb =
new G4AssemblyVolume();
375 Simulation::RunManager::Instance().addAssemblyVolume(qbb);
384 auto* outerPanel = createHoneycombPanel(geo, c_Outer);
386 qbb->AddPlacedVolume(outerPanel, move, 0);
390 auto* innerPanel = createHoneycombPanel(geo, c_Inner);
392 qbb->AddPlacedVolume(innerPanel, move, 0);
402 move.setZ(Zfront + length / 2);
403 qbb->AddPlacedVolume(forwardEndPlate, move, 0);
410 auto* backPlate = createExtrudedSolid(name +
"BackPlate",
414 move.setZ(Z + length / 2);
415 qbb->AddPlacedVolume(backPlate, move, 0);
419 auto* prismEnclosure = createExtrudedSolid(name +
"Body",
423 move.setZ(Z + length / 2);
424 qbb->AddPlacedVolume(prismEnclosure, move, 0);
428 auto* frontPlate = createExtrudedSolid(name +
"FrontPlate",
432 move.setZ(Z + length / 2);
433 qbb->AddPlacedVolume(frontPlate, move, 0);
439 auto* extPlate = createBox(name +
"ExtensionPlate",
445 G4ThreeVector movePlate;
446 movePlate.setZ(Z + length / 2);
448 qbb->AddPlacedVolume(extPlate, movePlate, 0);
453 auto* leftRail = createSideRail(geo, c_Left);
458 qbb->AddPlacedVolume(leftRail, move, 0);
460 auto* rightRail = createSideRail(geo, c_Right);
462 qbb->AddPlacedVolume(rightRail, move, 0);
477 qbb->AddPlacedVolume(coldPlateBase, move, 0);
486 qbb->AddPlacedVolume(coldPlateCool, move, 0);
492 G4LogicalVolume* GeoTOPCreator::createHoneycombPanel(
const TOPGeoQBB& geo,
499 double sideEdgeHeight = 0;
500 double sideEdgeY = 0;
502 if (type == c_Inner) {
506 sideEdgeY = geoPanel.
getY() - sideEdgeHeight / 2;
511 sideEdgeY = geoPanel.
getY() + sideEdgeHeight / 2;
516 auto* panel = createExtrudedSolid(geoPanel.
getName(),
523 std::string faceEdgeName = geoPanel.
getName() +
"ReinforcedFace";
524 auto* faceEdge = createExtrudedSolid(faceEdgeName,
530 new G4PVPlacement(move, faceEdge, faceEdgeName, panel,
false, 1);
532 new G4PVPlacement(move, faceEdge, faceEdgeName, panel,
false, 2);
538 std::string sideEdgeName = geoPanel.
getName() +
"ReinforcedSide";
539 auto* sideEdge = createBox(sideEdgeName,
546 move = G4Translate3D((width - sideEdgeWidth) / 2, sideEdgeY, 0);
547 new G4PVPlacement(move, sideEdge, sideEdgeName, panel,
false, 1);
548 move = G4Translate3D(-(width - sideEdgeWidth) / 2, sideEdgeY, 0);
549 new G4PVPlacement(move, sideEdge, sideEdgeName, panel,
false, 2);
555 G4LogicalVolume* GeoTOPCreator::createSideRail(
const TOPGeoQBB& geo,
566 auto* box =
new G4Box(
"box", A / 2, B / 2, C / 2);
567 auto* subtrBox =
new G4Box(
"subtrBox", a / 2, b / 2, c / 2);
569 if (type == c_Left) {
574 G4Transform3D move = G4Translate3D(x, -(B - b) / 2, -(C - c) / 2);
575 auto* solid =
new G4SubtractionSolid(
"sideRail", box, subtrBox, move);
582 if (type == c_Left) {
588 return new G4LogicalVolume(solid, material, name);
592 G4AssemblyVolume* GeoTOPCreator::assembleOptics(
const TOPGeoModule& geo)
594 auto* optics =
new G4AssemblyVolume();
595 Simulation::RunManager::Instance().addAssemblyVolume(optics);
610 G4RotationMatrix rotArray;
612 optics->AddPlacedVolume(pmtArray, moveArray, &rotArray);
615 G4RotationMatrix rot;
619 rot.rotateY(M_PI / 2);
620 optics->AddPlacedVolume(prism, move, &rot);
624 optics->AddPlacedVolume(barSegment2, move, 0);
627 move.setZ(L2 + L1 / 2);
628 optics->AddPlacedVolume(barSegment1, move, 0);
632 move.setZ(L2 + L1 + Lm / 2);
633 optics->AddPlacedVolume(mirrorSegment, move, 0);
638 const double thickness = 1.0;
643 auto* peekFrameAbove = createBox(
"PeekFrameAbove", width, thickness, length,
"Al");
644 move.setZ(-(Lp - length / 2));
645 move.setY(Yup + thickness / 2);
646 optics->AddPlacedVolume(peekFrameAbove, move, 0);
648 auto* peekFrameBelow = createBox(
"PeekFrameBelow", width, thickness, length,
"Al");
649 move.setZ(-(Lp - length / 2));
650 move.setY(Ydn - thickness / 2);
651 optics->AddPlacedVolume(peekFrameBelow, move, 0);
663 auto* bar = createBox(geo.
getName(),
667 auto* glue = createBox(geo.
getName() +
"Glue",
671 auto* brokenGlue = createExtrudedSolid(geo.
getName() +
"BrokenGlue",
676 new G4PVPlacement(fix, brokenGlue, geo.
getName() +
"BrokenGlue", glue,
false, 1);
677 B2RESULT(
"GeoTOPCreator, broken glue at " << geo.
getName()
678 << addNumber(
" of Slot", moduleID));
684 new G4PVPlacement(move, glue, geo.
getName() +
"Glue", bar,
false, 1);
687 auto& materials = Materials::getInstance();
688 auto* optSurf = materials.createOpticalSurface(geo.
getSurface());
690 new G4LogicalSkinSurface(
"opticalSurface", bar, optSurf);
693 bar->SetSensitiveDetector(m_sensitiveBar);
705 auto* box =
new G4Box(geo.
getName(),
710 auto* bar = createBoxSphereIntersection(geo.
getName(),
717 auto* glue = createBox(geo.
getName() +
"Glue",
721 auto* brokenGlue = createExtrudedSolid(geo.
getName() +
"BrokenGlue",
726 new G4PVPlacement(fix, brokenGlue, geo.
getName() +
"BrokenGlue", glue,
false, 1);
727 B2RESULT(
"GeoTOPCreator, broken glue at " << geo.
getName()
728 << addNumber(
" of Slot", moduleID));
734 new G4PVPlacement(move, glue, geo.
getName() +
"Glue", bar,
false, 1);
737 auto& materials = Materials::getInstance();
738 auto* optSurf = materials.createOpticalSurface(geo.
getSurface());
740 new G4LogicalSkinSurface(
"opticalSurface", bar, optSurf);
743 auto* mirror = createBoxSphereIntersection(geo.
getName() +
"ReflectiveCoating",
751 new G4LogicalSkinSurface(
"mirrorSurface", mirror, mirrorSurf);
754 move = G4TranslateZ3D(0);
755 new G4PVPlacement(move, mirror, geo.
getName() +
"ReflectiveCoating", bar,
false, 1);
758 bar->SetSensitiveDetector(m_sensitiveBar);
764 G4LogicalVolume* GeoTOPCreator::createPrism(
const TOPGeoPrism& geo,
int moduleID)
771 std::vector<G4TwoVector> polygon;
772 polygon.push_back(G4TwoVector(0, geo.
getThickness() / 2));
778 polygon.push_back(G4TwoVector(0, -geo.
getThickness() / 2));
780 auto* volume =
new G4ExtrudedSolid(geo.
getName(), polygon, geo.
getWidth() / 2,
781 G4TwoVector(), 1, G4TwoVector(), 1);
782 G4Material* material = Materials::get(geo.
getMaterial());
783 if (!material) B2FATAL(
"Material '" << geo.
getMaterial() <<
"' not found");
784 auto* prism =
new G4LogicalVolume(volume, material, geo.
getName());
791 std::string filterMaterial;
792 if (filterThickness > 0) {
805 std::string message = addNumber(
"peel-off cookie regions of Slot", moduleID) +
":";
807 if (region.fraction <= 0)
continue;
808 std::string name = addNumber(geo.
getName() +
"PeelOff", region.ID);
810 auto* peelOff = createExtrudedSolid(name,
817 G4Transform3D
R = G4RotateY3D(-M_PI / 2);
818 G4Transform3D moveRegion = T *
R;
819 new G4PVPlacement(moveRegion, peelOff, name,
filter,
false, 1);
820 message += addNumber(
" ", region.ID);
823 if (numRegions > 0) B2RESULT(
"GeoTOPCreator, " << message);
824 m_numPeelOffRegions += numRegions;
830 new G4PVPlacement(move,
filter, geo.
getName() +
"Filter", prism,
false, 1);
835 auto& materials = Materials::getInstance();
836 auto* optSurf = materials.createOpticalSurface(geo.
getSurface());
838 new G4LogicalSkinSurface(
"opticalSurface", prism, optSurf);
842 prism->SetSensitiveDetector(m_sensitiveBar);
852 auto* pmtArray = createBox(geo.
getName(),
858 auto* pmt = createPMT(geo.
getPMT());
861 std::string message = addNumber(
"optically decoupled PMT's of Slot", moduleID) +
":";
862 for (
unsigned row = 1; row <= geo.
getNumRows(); row++) {
868 message += addNumber(
" ",
id);
869 m_numDecoupledPMTs++;
872 G4Transform3D move = G4Translate3D(geo.
getX(col), geo.
getY(row), z);
873 new G4PVPlacement(move, pmt, addNumber(geo.
getPMT().
getName(),
id), pmtArray,
886 auto* cookie = createBox(geo.
getName() +
"Cookie",
890 G4Transform3D move = G4Translate3D(0, 0, (fullThickness - cookieThickness) / 2);
891 new G4PVPlacement(move, cookie, geo.
getName() +
"Cookie",
filter,
false, 1);
893 move = G4Translate3D(0, 0, (geo.
getSizeZ() - fullThickness) / 2);
894 new G4PVPlacement(move,
filter, geo.
getName() +
"Filter+Cookie", pmtArray,
898 if (!geo.
getDecoupledPMTs().empty()) B2RESULT(
"GeoTOPCreator, " << message);
904 G4LogicalVolume* GeoTOPCreator::createPMT(
const TOPGeoPMT& geo)
909 auto* pmt = createBox(geo.
getName(),
915 auto* window = createBox(geo.
getName() +
"Window",
919 auto* photoCathode = createBox(geo.
getName() +
"PhotoCathode",
923 photoCathode->SetSensitiveDetector(m_sensitivePMT);
927 new G4PVPlacement(move, photoCathode, geo.
getName() +
"PhotoCathode", window,
930 auto* reflEdge = createBox(geo.
getName() +
"ReflectiveEdge",
936 if (holeSizeX > 0 and holeSizeY > 0) {
937 auto* hole = createBox(geo.
getName() +
"ReflectiveEdgeHole",
938 holeSizeX, holeSizeY,
941 move = G4TranslateZ3D(0.0);
942 new G4PVPlacement(move, hole, geo.
getName() +
"ReflectiveEdgeHole", reflEdge,
946 auto& materials = Materials::getInstance();
948 new G4LogicalSkinSurface(
"reflectiveEdgeSurface", reflEdge, optSurf);
951 new G4PVPlacement(move, reflEdge, geo.
getName() +
"ReflectiveEdge", window,
954 move = G4TranslateZ3D((geo.
getSizeZ() - winThickness) / 2);
955 new G4PVPlacement(move, window, geo.
getName() +
"Window", pmt,
false, 1);
959 auto* bottom = createBox(geo.
getName() +
"Bottom",
963 new G4PVPlacement(move, bottom, geo.
getName() +
"Bottom", pmt,
false, 1);
968 auto* interior = createBox(geo.
getName() +
"Interior",
973 move = G4TranslateZ3D(-(geo.
getSizeZ() - interiorSizeZ) / 2
975 new G4PVPlacement(move, interior, geo.
getName() +
"Interior", pmt,
false, 1);
981 G4LogicalVolume* GeoTOPCreator::createBox(
const std::string& name,
982 double A,
double B,
double C,
983 const std::string& materialName)
985 G4Box* box =
new G4Box(name, A / 2, B / 2, C / 2);
986 G4Material* material = Materials::get(materialName);
987 if (!material) B2FATAL(
"Material '" << materialName <<
"' not found");
988 return new G4LogicalVolume(box, material, name);
993 GeoTOPCreator::createBoxSphereIntersection(
const std::string& name,
1000 const std::string& materialName)
1003 double x = box->GetXHalfLength();
1004 double y = box->GetYHalfLength();
1005 double z = box->GetZHalfLength();
1006 double dx = fmax(fabs(-x - xc), fabs(x - xc));
1007 double dy = fmax(fabs(-y - yc), fabs(y - yc));
1008 double dz = fmin(-z - zc, z - zc);
1009 double theta =
atan(
sqrt(dx * dx + dy * dy) / dz);
1011 auto* sphere =
new G4Sphere(name +
"Sphere",
1012 Rmin, Rmax, 0, 2 * M_PI, 0, theta);
1013 G4Translate3D move(xc, yc, zc);
1014 auto* shape =
new G4IntersectionSolid(name, box, sphere, move);
1016 G4Material* material = Materials::get(materialName);
1017 if (!material) B2FATAL(
"Material '" << materialName <<
"' not found");
1018 return new G4LogicalVolume(shape, material, name);
1022 G4LogicalVolume* GeoTOPCreator::createExtrudedSolid(
const std::string& name,
1023 const Polygon& shape,
1025 const std::string& materialName)
1027 std::vector<G4TwoVector> polygon;
1028 for (
auto& point : shape) {
1029 polygon.push_back(G4TwoVector(point.first, point.second));
1031 G4ExtrudedSolid* solid =
new G4ExtrudedSolid(name, polygon, length / 2,
1032 G4TwoVector(), 1, G4TwoVector(), 1);
1033 G4Material* material = Materials::get(materialName);
1034 if (!material) B2FATAL(
"Material '" << materialName <<
"' not found");
1035 return new G4LogicalVolume(solid, material, name);
1039 std::string GeoTOPCreator::addNumber(
const std::string& str,
unsigned number)
1043 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.
Geometry parameters of a quartz bar segment.
double getWidth() const
Returns bar segment width.
const std::string & getBrokenGlueMaterial() const
Returns material name which represents broken glue.
double getFullLength() const
Returns bar segment length including glue.
const std::string & getGlueMaterial() const
Returns glue material name (glue on -z side)
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 & getName() const
Returns object name.
const std::string & getCoolMaterial() const
Returns cooling plate material name.
double getCoolWidth() const
Returns cooling plate width.
double getCoolThickness() const
Returns cooling plate thickness.
double getBaseThickness() const
Returns base plate thickness.
const std::string & getBaseMaterial() const
Returns base plate material name.
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.
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.
double getBoardStackHeight() const
Returns board stack height.
const std::string & getFrontBoardMaterial() const
Returns front board material.
double getBoardStackGap() const
Returns gap between board stack and front board.
const std::string & getSpacerMaterial() const
Returns board stack spacer material.
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.
double getSpacerWidth() const
Returns board stack spacer width.
const std::string & getHVBoardMaterial() const
Returns HV board material.
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.
const std::string & getCoatingMaterial() const
Returns reflective coating material.
double getYc() const
Returns spherical mirror center of curvature in y.
double getOuterRadius() const
Returns spherical mirror outer radius of curvature.
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 TOPGeoBarSegment & getBarSegment1() const
Returns bar segment No.1 (forward bar)
const TOPGeoPrism & getPrism() const
Returns prism.
const TOPGeoPMTArrayDisplacement & getPMTArrayDisplacement() const
Returns PMT array displacement.
int getModuleID() const
Returns module ID.
const TOPGeoBarSegment & getBarSegment2() const
Returns bar segment No.2 (backward bar)
const TOPGeoPMTArray & getPMTArray() const
Returns PMT array.
const TOPGeoMirrorSegment & getMirrorSegment() const
Returns mirror segment.
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.
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.
const std::string & getCookieMaterial() const
Returns silicone cookie material.
const std::vector< unsigned > & getDecoupledPMTs() const
Returns ID's of optically decoupled PMT's.
double getSizeX() const
Returns array volume dimension in x.
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.
const TOPGeoPMT & getPMT() const
Returns PMT geometry parameters.
double getCookieThickness() const
Returns silicone cookie thickness.
const std::string & getFilterMaterial() const
Returns wavelenght filter material.
double getAirGap() const
Returns air gap.
Geometry parameters of MCP-PMT.
double getSizeZ() const
Returns full size in z.
const std::string & getSensMaterial() const
Returns sensitive material name.
const std::string & getFillMaterial() const
Returns fill (inside) material name.
double getReflEdgeThickness() const
Returns reflective edge thickness.
const std::string & getWinMaterial() const
Returns entrance window material name.
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.
double getSensSizeX() const
Returns sensitive volume (photo-cathode) size in x.
double getSizeX() const
Returns full size in x.
const std::string & getBotMaterial() const
Returns bottom material name.
double getSizeY() const
Returns full size in y.
double getWallThickness() const
Returns wall thickness.
double getSensThickness() const
Returns sensitive volume (photo-cathode) thickness.
const GeoOpticalSurface & getReflEdgeSurface() const
Returns reflective edge optical surface.
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.
double getPeelOffCenter(const PeelOffRegion ®ion) const
Returns peel-off offset in x of the given region.
const std::string & getPeelOffMaterial() const
Returns peel-off material.
double getFilterThickness() const
Returns wavelength filter thickness (filter on -z side).
double getExitThickness() const
Returns prism thickness at PMT side.
double getPeelOffThickness() const
Returns peel-off thickness.
double getFlatLength() const
Returns the length of a flat surface at prism bottom.
const std::vector< PeelOffRegion > & getPeelOffRegions() const
Returns peel-off cookie regions.
const std::string & getFilterMaterial() const
Returns wavelength filter material name (filter on -z side) For backward compatibility,...
Geometry parameters of Quartz Bar Box (mother class)
double getWidth() const
Returns full width.
const TOPGeoPrismEnclosure & getPrismEnclosure() const
Returns prism enclosure.
const TOPGeoEndPlate & getForwardEndPlate() const
Returns forward end plate.
const TOPGeoSideRails & getSideRails() const
Returns side rails.
const TOPGeoColdPlate & getColdPlate() const
Returns cold plate.
double getSideRailsLength() const
Returns side rails length.
const TOPGeoHoneycombPanel & getInnerPanel() const
Returns inner honeycomb panel.
const TOPGeoHoneycombPanel & getOuterPanel() const
Returns outer honeycomb panel.
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.
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 std::vector< TOPGeoModule > & getModules() const
Returns all modules.
const TOPGeoFrontEnd & getFrontEnd() const
Returns front-end.
const TOPGeoQBB & getQBB() const
Returns quartz bar box.
ESideRailType
Side rail types.
EPanelType
Honeycomb panel types.
Class providing information on MCParticles hitting the bars.
double sqrt(double a)
sqrt for double
double atan(double a)
atan for double
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.
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
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.