10#include <klm/eklm/geometry/GeometryData.h>
13#include <klm/eklm/geometry/Circle2D.h>
14#include <klm/eklm/geometry/Line2D.h>
17#include <framework/database/DBObjPtr.h>
18#include <framework/database/Database.h>
19#include <framework/logging/Logger.h>
22#include <CLHEP/Geometry/Point3D.h>
23#include <CLHEP/Units/SystemOfUnits.h>
30static const char c_MemErr[] =
"Memory allocation error.";
68static void readSectorSupportGeometry(
97static void readShieldDetailGeometry(
107 for (i = 0; i < n; i++) {
109 name =
"/Point[" + std::to_string(i + 1) +
"]";
111 p.setX(point.getLength(
"X") * CLHEP::cm);
112 p.setY(point.getLength(
"Y") * CLHEP::cm);
120 Line2D line23Outer(0, m_SectorSupportPosition.getY(), 1, 0);
121 Line2D line23Inner(0, m_SectorSupportPosition.getY() +
122 m_SectorSupportGeometry.getThickness(), 1, 0);
123 Line2D line23Prism(0, m_SectorSupportPosition.getY() +
124 m_SectorSupportGeometry.getThickness() +
125 m_SectorSupportGeometry.getCorner3LY(), 1, 0);
126 Line2D line41Outer(m_SectorSupportPosition.getX(), 0, 0, 1);
127 Line2D line41Inner(m_SectorSupportPosition.getX() +
128 m_SectorSupportGeometry.getThickness(), 0, 0, 1);
129 Line2D line41Prism(m_SectorSupportPosition.getX() +
130 m_SectorSupportGeometry.getThickness() +
131 m_SectorSupportGeometry.getCorner4LX(), 0, 0, 1);
132 Line2D line41Corner1B(m_SectorSupportPosition.getX() +
133 m_SectorSupportGeometry.getCornerX(), 0, 0, 1);
134 Circle2D circleInnerOuter(0, 0, m_SectorSupportPosition.getInnerR());
135 Circle2D circleInnerInner(0, 0, m_SectorSupportPosition.getInnerR() +
136 m_SectorSupportGeometry.getThickness());
137 Circle2D circleOuterInner(0, 0, m_SectorSupportPosition.getOuterR() -
138 m_SectorSupportGeometry.getThickness());
139 Circle2D circleOuterOuter(0, 0, m_SectorSupportPosition.getOuterR());
142 p.setX(m_SectorSupportPosition.getX());
143 p.setY(m_SectorSupportPosition.getOuterR() -
144 m_SectorSupportGeometry.getDeltaLY());
146 m_SectorSupportGeometry.setCorner1A(p);
148 m_SectorSupportGeometry.setCorner1B(intersections[1]);
149 m_SectorSupportGeometry.setCornerAngle(
150 atan2(m_SectorSupportGeometry.getCorner1B().y() -
151 m_SectorSupportGeometry.getCorner1A().y(),
152 m_SectorSupportGeometry.getCorner1B().x() -
153 m_SectorSupportGeometry.getCorner1A().x()) * CLHEP::rad);
154 p.setX(m_SectorSupportPosition.getX() +
155 m_SectorSupportGeometry.getThickness());
156 p.setY(m_SectorSupportGeometry.getCorner1A().y() -
157 m_SectorSupportGeometry.getThickness() *
158 (1.0 / cos(m_SectorSupportGeometry.getCornerAngle()) -
159 tan(m_SectorSupportGeometry.getCornerAngle())));
161 m_SectorSupportGeometry.setCorner1AInner(p);
162 Line2D lineCorner1(m_SectorSupportGeometry.getCorner1AInner().x(),
163 m_SectorSupportGeometry.getCorner1AInner().y(),
164 m_SectorSupportGeometry.getCorner1B().x() -
165 m_SectorSupportGeometry.getCorner1A().x(),
166 m_SectorSupportGeometry.getCorner1B().y() -
167 m_SectorSupportGeometry.getCorner1A().y());
169 m_SectorSupportGeometry.setCorner1BInner(intersections[1]);
172 m_SectorSupportGeometry.setCorner2Inner(intersections[1]);
175 m_SectorSupportGeometry.setCorner3(intersections[1]);
177 m_SectorSupportGeometry.setCorner3Inner(intersections[1]);
179 p.setX(intersections[1].x());
180 p.setY(m_SectorSupportPosition.getY() +
181 m_SectorSupportGeometry.getThickness());
183 m_SectorSupportGeometry.setCorner3Prism(p);
186 m_SectorSupportGeometry.setCorner4(intersections[1]);
188 m_SectorSupportGeometry.setCorner4Inner(intersections[1]);
190 p.setX(m_SectorSupportPosition.getX() +
191 m_SectorSupportGeometry.getThickness());
192 p.setY(intersections[1].y());
194 m_SectorSupportGeometry.setCorner4Prism(p);
197static bool compareLength(
double a,
double b)
204 const char err[] =
"Strip sorting algorithm error.";
207 std::vector<double> strips;
208 std::vector<double>::iterator it;
209 std::map<double, int> mapLengthStrip;
210 std::map<double, int> mapLengthStrip2;
211 std::map<double, int>::iterator itm;
212 for (i = 0; i < m_NStrips; i++) {
213 strips.push_back(m_StripPosition[i].getLength());
214 mapLengthStrip.insert(
215 std::pair<double, int>(m_StripPosition[i].getLength(), i));
217 sort(strips.begin(), strips.end(), compareLength);
219 m_nStripDifferent = 1;
220 for (it = strips.begin(); it != strips.end(); ++it) {
226 m_StripLenToAll = (
int*)malloc(m_nStripDifferent *
sizeof(
int));
227 if (m_StripLenToAll ==
nullptr)
231 itm = mapLengthStrip.find(l);
232 if (itm == mapLengthStrip.end())
234 m_StripLenToAll[i] = itm->second;
235 mapLengthStrip2.insert(std::pair<double, int>(l, i));
236 for (it = strips.begin(); it != strips.end(); ++it) {
240 itm = mapLengthStrip.find(l);
241 if (itm == mapLengthStrip.end())
243 m_StripLenToAll[i] = itm->second;
244 mapLengthStrip2.insert(std::pair<double, int>(l, i));
247 m_StripAllToLen = (
int*)malloc(m_NStrips *
sizeof(
int));
248 if (m_StripAllToLen ==
nullptr)
250 for (i = 0; i < m_NStrips; i++) {
251 itm = mapLengthStrip2.find(m_StripPosition[i].getLength());
252 if (itm == mapLengthStrip2.end())
254 m_StripAllToLen[i] = itm->second;
264 m_StripGeometry.setWidth(Strips.
getLength(
"Width") * CLHEP::cm);
265 m_StripGeometry.setThickness(Strips.
getLength(
"Thickness") * CLHEP::cm);
266 m_StripGeometry.setGrooveDepth(Strips.
getLength(
"GrooveDepth") * CLHEP::cm);
267 m_StripGeometry.setGrooveWidth(Strips.
getLength(
"GrooveWidth") * CLHEP::cm);
268 m_StripGeometry.setNoScintillationThickness(
269 Strips.
getLength(
"NoScintillationThickness") * CLHEP::cm);
270 m_StripGeometry.setRSSSize(Strips.
getLength(
"RSSSize") * CLHEP::cm);
273 }
catch (std::bad_alloc& ba) {
276 for (i = 0; i < m_NStrips; i++) {
278 name =
"/Strip[" + std::to_string(i + 1) +
"]";
279 StripContent.
append(name);
280 m_StripPosition[i].setLength(StripContent.
getLength(
"Length") * CLHEP::cm);
281 m_StripPosition[i].setX(StripContent.
getLength(
"X") * CLHEP::cm);
282 m_StripPosition[i].setY(StripContent.
getLength(
"Y") * CLHEP::cm);
283 m_StripPosition[i].setZ(StripContent.
getLength(
"Z") * CLHEP::cm);
298 double r,
double kx,
double ky,
299 double& dx,
double& dy)
304 double a, b, c, d, t, maxt = 0, x1, y1, x2, y2, u;
311 a = kx * kx + ky * ky;
312 intersection =
false;
313 for (i = 0; i < nPoints; i++) {
316 b = 2.0 * (kx * x1 + ky * y1);
317 c = x1 * x1 + y1 * y1 - r * r;
318 d = b * b - 4.0 * a * c;
320 t = (-b +
sqrt(d)) / (2.0 * a);
331 B2FATAL(
"Shield layer geometry calculation error.");
342 for (i = 0; i < nPoints; i++) {
345 if (i < nPoints - 1) {
346 x2 = points[i + 1].x();
347 y2 = points[i + 1].y();
352 a = (x2 - x1) * ky - (y2 - y1) * kx;
355 b = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
356 t = (x1 * y2 - x2 * y1 + r *
sqrt(b)) / a;
362 u = -((x2 - x1) * (x1 + kx * t) + (y2 - y1) * (y2 + ky * t)) / b;
380 pointCLHEP.setX(pointEKLM->
getX());
381 pointCLHEP.setY(pointEKLM->
getY());
388 double r, l, dx, dy, xCenter, yCenter;
389 const double asqrt2 = 1.0 /
sqrt(2.0);
395 r = m_SectorSupportPosition.getInnerR() +
396 m_SectorSupportGeometry.getThickness();
398 EKLMPointToCLHEP(detailA->
getPoint(0), points[0]);
399 EKLMPointToCLHEP(detailA->
getPoint(1), points[1]);
400 EKLMPointToCLHEP(detailA->
getPoint(2), points[2]);
401 EKLMPointToCLHEP(detailA->
getPoint(3), points[3]);
402 EKLMPointToCLHEP(detailA->
getPoint(4), points[4]);
406 EKLMPointToCLHEP(detailA->
getPoint(5), points[6]);
407 EKLMPointToCLHEP(detailA->
getPoint(6), points[7]);
409 xCenter = -asqrt2 * l;
410 yCenter = asqrt2 * l;
411 for (i = 0; i < 8; i++)
412 points[i] = HepGeom::Translate3D(xCenter, yCenter, 0) *
413 HepGeom::RotateZ3D(-45.0 * CLHEP::deg) *
414 HepGeom::Translate3D(-detailA->
getLengthX() / 2,
417 getDetailDxDy(points, 8, r, 1, 1, dx, dy);
418 m_ShieldGeometry.setDetailACenter(xCenter + dx, yCenter + dy);
432 EKLMPointToCLHEP(detailB->
getPoint(0), points[4]);
433 EKLMPointToCLHEP(detailB->
getPoint(1), points[5]);
434 EKLMPointToCLHEP(detailB->
getPoint(2), points[6]);
435 EKLMPointToCLHEP(detailB->
getPoint(3), points[7]);
437 for (i = 0; i < 8; i++)
438 points[i] = HepGeom::RotateZ3D(-45.0 * CLHEP::deg) *
439 HepGeom::Translate3D(-detailB->
getLengthX() / 2,
442 getDetailDxDy(points, 8, r, 1, 1, dx, dy);
443 m_ShieldGeometry.setDetailBCenter(dx, dy);
445 EKLMPointToCLHEP(detailC->
getPoint(0), points[0]);
446 EKLMPointToCLHEP(detailC->
getPoint(1), points[1]);
447 EKLMPointToCLHEP(detailC->
getPoint(2), points[2]);
448 EKLMPointToCLHEP(detailC->
getPoint(3), points[3]);
449 EKLMPointToCLHEP(detailC->
getPoint(4), points[4]);
453 EKLMPointToCLHEP(detailC->
getPoint(5), points[6]);
454 EKLMPointToCLHEP(detailC->
getPoint(6), points[7]);
456 xCenter = asqrt2 * l;
457 yCenter = -asqrt2 * l;
458 for (i = 0; i < 8; i++)
459 points[i] = HepGeom::Translate3D(xCenter, yCenter, 0) *
460 HepGeom::RotateZ3D(-45.0 * CLHEP::deg) *
461 HepGeom::RotateY3D(180.0 * CLHEP::deg) *
462 HepGeom::Translate3D(-detailC->
getLengthX() / 2,
465 getDetailDxDy(points, 8, r, 1, 1, dx, dy);
466 m_ShieldGeometry.setDetailCCenter(xCenter + dx, yCenter + dy);
472 d.append(
"/EndcapStructure");
473 m_EndcapStructureGeometry.setPhi(d.getAngle(
"Phi") * CLHEP::rad);
474 m_EndcapStructureGeometry.setNSides(d.getInt(
"NSides"));
485 m_BeamBackgroundStudy = gd.
getBool(
"BeamBackgroundStudy");
487 m_NSections = gd.
getInt(
"NSections");
488 m_ElementNumbers->checkSection(m_NSections);
489 m_NLayers = gd.
getInt(
"NLayers");
490 m_ElementNumbers->checkLayer(m_NLayers);
491 m_NDetectorLayers =
new int[m_NSections];
492 m_NDetectorLayers[0] = gd.
getInt(
"NDetectorLayersBackward");
493 checkDetectorLayerNumber(1, m_NDetectorLayers[0]);
494 if (m_NSections == 2) {
495 m_NDetectorLayers[1] = gd.
getInt(
"NDetectorLayersForward");
496 checkDetectorLayerNumber(2, m_NDetectorLayers[1]);
498 m_NSectors = gd.
getInt(
"NSectors");
499 m_ElementNumbers->checkSector(m_NSectors);
500 m_NPlanes = gd.
getInt(
"NPlanes");
501 m_ElementNumbers->checkPlane(m_NPlanes);
502 m_NSegments = gd.
getInt(
"NSegments");
503 m_ElementNumbers->checkSegment(m_NSegments);
504 m_NSegmentSupportElementsSector = (m_NSegments + 1) * m_NPlanes;
505 m_NStrips = gd.
getInt(
"NStrips");
506 m_ElementNumbers->checkStrip(m_NStrips);
508 m_SolenoidZ = gd.
getLength(
"SolenoidZ") * CLHEP::cm;
509 readEndcapStructureGeometry(gd);
511 section.append(
"/Section");
512 readPositionData(&m_SectionPosition, §ion);
513 readSizeData(&m_SectionPosition, §ion);
515 layer.append(
"/Layer");
516 readSizeData(&m_LayerPosition, &layer);
517 m_LayerShiftZ = layer.getLength(
"ShiftZ") * CLHEP::cm;
519 sector.append(
"/Sector");
520 readSizeData(&m_SectorPosition, §or);
522 sectorSupport.
append(
"/SectorSupport");
523 readPositionData(&m_SectorSupportPosition, §orSupport);
524 readSizeData(&m_SectorSupportPosition, §orSupport);
525 readSectorSupportGeometry(&m_SectorSupportGeometry, §orSupport);
527 plane.append(
"/Plane");
528 readPositionData(&m_PlanePosition, &plane);
529 readSizeData(&m_PlanePosition, &plane);
531 plasticSheet.
append(
"/PlasticSheet");
532 m_PlasticSheetGeometry.setWidth(plasticSheet.
getLength(
"Width") * CLHEP::cm);
533 m_PlasticSheetGeometry.setDeltaL(plasticSheet.
getLength(
"DeltaL") *
536 segmentSupport.
append(
"/SegmentSupport");
537 m_SegmentSupportGeometry.setTopWidth(
538 segmentSupport.
getLength(
"TopWidth") * CLHEP::cm);
539 m_SegmentSupportGeometry.setTopThickness(
540 segmentSupport.
getLength(
"TopThickness") * CLHEP::cm);
541 m_SegmentSupportGeometry.setMiddleWidth(
542 segmentSupport.
getLength(
"MiddleWidth") * CLHEP::cm);
543 m_SegmentSupportGeometry.setMiddleThickness(
544 segmentSupport.
getLength(
"MiddleThickness") * CLHEP::cm);
546 m_SegmentSupportPosition =
548 }
catch (std::bad_alloc& ba) {
551 for (j = 0; j < m_NPlanes; j++) {
552 for (i = 0; i <= m_NSegments; i++) {
553 k = j * (m_NSegments + 1) + i;
554 GearDir segmentSupport2(segmentSupport);
555 name =
"/SegmentSupportPlane[" + std::to_string(j + 1) +
"]";
556 segmentSupport2.append(name);
557 name =
"/SegmentSupport[" + std::to_string(i + 1) +
"]";
558 segmentSupport2.append(name);
559 m_SegmentSupportPosition[k].setLength(
560 segmentSupport2.getLength(
"Length") * CLHEP::cm);
561 m_SegmentSupportPosition[k].setX(
562 segmentSupport2.getLength(
"X") * CLHEP::cm);
563 m_SegmentSupportPosition[k].setY(
564 segmentSupport2.getLength(
"Y") * CLHEP::cm);
565 m_SegmentSupportPosition[k].setZ(
566 segmentSupport2.getLength(
"Z") * CLHEP::cm);
567 m_SegmentSupportPosition[k].setDeltaLRight(
568 segmentSupport2.getLength(
"DeltaLRight") * CLHEP::cm);
569 m_SegmentSupportPosition[k].setDeltaLLeft(
570 segmentSupport2.getLength(
"DeltaLLeft") * CLHEP::cm);
573 readXMLDataStrips(gd);
576 m_ShieldGeometry.setThickness(shield.
getLength(
"Thickness") * CLHEP::cm);
578 shieldDetailA.
append(
"/Detail[@id=\"A\"]");
579 readShieldDetailGeometry(&shieldDetailGeometry, &shieldDetailA);
580 m_ShieldGeometry.setDetailA(shieldDetailGeometry);
582 shieldDetailB.
append(
"/Detail[@id=\"B\"]");
583 readShieldDetailGeometry(&shieldDetailGeometry, &shieldDetailB);
584 m_ShieldGeometry.setDetailB(shieldDetailGeometry);
586 shieldDetailC.
append(
"/Detail[@id=\"C\"]");
587 readShieldDetailGeometry(&shieldDetailGeometry, &shieldDetailC);
588 m_ShieldGeometry.setDetailC(shieldDetailGeometry);
590 shieldDetailD.
append(
"/Detail[@id=\"D\"]");
591 readShieldDetailGeometry(&shieldDetailGeometry, &shieldDetailD);
592 m_ShieldGeometry.setDetailD(shieldDetailGeometry);
600 B2FATAL(
"No EKLM geometry data in the database.");
608 m_Geometry =
nullptr;
609 switch (dataSource) {
611 initializeFromGearbox(gearDir);
614 initializeFromDatabase();
617 m_MinZForward = m_SolenoidZ + m_SectionPosition.getZ() -
618 0.5 * m_SectionPosition.getLength();
619 m_MaxZBackward = m_SolenoidZ - m_SectionPosition.getZ() +
620 0.5 * m_SectionPosition.getLength();
621 calculateSectorSupportGeometry();
622 fillStripIndexArrays();
623 calculateShieldGeometry();
628 if (m_Geometry !=
nullptr)
630 free(m_StripLenToAll);
631 free(m_StripAllToLen);
643 return (zMm > m_MinZForward) || (zMm < m_MaxZBackward);
653 *t = HepGeom::Translate3D(m_SectionPosition.getX(), m_SectionPosition.getY(),
654 -m_SectionPosition.getZ() + m_SolenoidZ);
656 *t = HepGeom::Translate3D(m_SectionPosition.getX(), m_SectionPosition.getY(),
657 m_SectionPosition.getZ() + m_SolenoidZ) *
658 HepGeom::RotateY3D(180.*CLHEP::deg);
664 *t = HepGeom::Translate3D(0.0, 0.0, m_SectionPosition.getLength() / 2.0 -
665 (n + 1) * m_LayerShiftZ +
666 0.5 * m_LayerPosition.getLength());
674 *t = HepGeom::Translate3D(0., 0., 0.);
677 *t = HepGeom::RotateY3D(180.0 * CLHEP::deg);
680 *t = HepGeom::RotateZ3D(90.0 * CLHEP::deg) *
681 HepGeom::RotateY3D(180.0 * CLHEP::deg);
684 *t = HepGeom::RotateZ3D(-90.0 * CLHEP::deg);
693 *t = HepGeom::Translate3D(m_PlanePosition.getX(), m_PlanePosition.getY(),
694 m_PlanePosition.getZ()) *
695 HepGeom::Rotate3D(180. * CLHEP::deg,
696 HepGeom::Vector3D<double>(1., 1., 0.));
698 *t = HepGeom::Translate3D(m_PlanePosition.getX(), m_PlanePosition.getY(),
699 -m_PlanePosition.getZ());
705 *t = HepGeom::Translate3D(m_StripPosition[n].getX(),
706 m_StripPosition[n].getY(), 0.0);
713 y = m_StripPosition[n].getY();
714 if (n % m_ElementNumbers->getNStripsSegment() == 0)
715 y = y + 0.5 * m_PlasticSheetGeometry.getDeltaL();
716 else if (n % m_ElementNumbers->getNStripsSegment() ==
717 m_ElementNumbers->getNStripsSegment() - 1)
718 y = y - 0.5 * m_PlasticSheetGeometry.getDeltaL();
719 *t = HepGeom::Translate3D(m_StripPosition[n].getX(), y, 0.0);
bool isValid() const
Check whether a valid object was obtained from the database.
Class for accessing objects in the database.
Position information for the elements of detector.
void setInnerR(double innerR)
Set inner radius.
void setOuterR(double outerR)
Set outer radius.
void setZ(double z)
Set Z coordinate.
void setLength(double length)
Set length.
void setY(double y)
Set Y coordinate.
void setX(double x)
Set X coordinate.
double getX() const
Get X coordinate.
double getY() const
Get Y coordinate.
Sector support geometry data.
void setCornerX(double cornerX)
Set coordinate X of corner 1.
void setCorner1LX(double corner1LX)
Set corner 1 X length.
void setCorner2LY(double corner2LY)
Set corner 2 Y length.
void setCorner4Thickness(double corner4Thickness)
Set corner 4 thickness.
void setThickness(double thickness)
Set thickness.
void setCorner1Z(double corner1Z)
Set corner 1 Z coordinate.
void setCorner1Thickness(double corner1Thickness)
Set corner 1 thickness.
void setCorner2Thickness(double corner2Thickness)
Set corner 2 thickness.
void setCorner3LY(double corner3LY)
Set corner 3 Y length.
void setDeltaLY(double deltaLY)
Set outerR - Y of upper edge of BoxY.
void setCorner4LY(double corner4LY)
Set corner 4 Y length.
void setCorner3LX(double corner3LX)
Set corner 3 X length.
void setCorner4Z(double corner4Z)
Set corner 4 Z coordinate.
void setCorner3Thickness(double corner3Thickness)
Set corner 3 thickness.
void setCorner3Z(double corner3Z)
Set corner 3 Z coordinate.
void setCorner2LX(double corner2LX)
Set corner 2 X length.
void setCorner2Z(double corner2Z)
Set corner 2 Z coordinate.
void setCorner1Width(double corner1Width)
Set corner 1 width.
void setCorner4LX(double corner4LX)
Set corner 4 X length.
Segment support position.
Shield layer detail geometry data.
void setPoint(int i, const Point &point)
Set point.
void setLengthY(double lengthY)
Set Y length.
const Point * getPoint(int i) const
Get point.
double getLengthY() const
Get Y length.
double getLengthX() const
Get X length.
void setLengthX(double lengthX)
Set X length.
void setNPoints(int nPoints)
Set number of points.
Class to store EKLM geometry data in the database.
EKLMGeometry & operator=(const EKLMGeometry &geometry)
Operator =.
void getSectorTransform(HepGeom::Transform3D *t, int n) const
Get sector transformation.
void fillStripIndexArrays()
Fill strip index arrays.
void getSheetTransform(HepGeom::Transform3D *t, int n) const
Get plastic sheet element transformation.
bool hitInEKLM(double z) const
Check if z coordinate may be in EKLM.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
void calculateSectorSupportGeometry()
Calculate sector support geometry data.
void saveToDatabase(const IntervalOfValidity &iov) const
Save geometry data to database.
GeometryData(enum DataSource dataSource, const GearDir *gearDir)
Constructor.
void initializeFromGearbox(const GearDir *gearDir)
Initialize from Gearbox (XML).
void getStripTransform(HepGeom::Transform3D *t, int n) const
Get strip transformation.
void readEndcapStructureGeometry(const GearDir &gd)
Read section structure geometry data.
void getSectionTransform(HepGeom::Transform3D *t, int n) const
Get section transformation.
void getLayerTransform(HepGeom::Transform3D *t, int n) const
Get layer transformation.
void calculateShieldGeometry()
Calculate shield geometry data.
void initializeFromDatabase()
Initialize from database.
DataSource
Geometry data source.
void getPlaneTransform(HepGeom::Transform3D *t, int n) const
Get plane transformation.
~GeometryData()
Destructor.
void readXMLDataStrips(const GearDir &gd)
Read strip parameters from XML database.
int findIntersection(const Line2D &line, HepGeom::Point3D< double > *intersection) const
Find intersection with a line.
GearDir is the basic class used for accessing the parameter store.
void append(const std::string &path)
Append something to the current path, modifying the GearDir in place.
virtual int getNumberNodes(const std::string &path="") const override
Return the number of nodes a given path will expand to.
A class that describes the interval of experiments/runs for which an object in the database is valid.
static const double cm
Standard units with the value = 1.
double getLength(const std::string &path="") const noexcept(false)
Get the parameter path as a double converted to the standard length unit.
bool getBool(const std::string &path="") const noexcept(false)
Get the parameter path as a bool.
int getInt(const std::string &path="") const noexcept(false)
Get the parameter path as a int.
static Database & Instance()
Instance of a singleton Database.
bool storeData(const std::string &name, TObject *object, const IntervalOfValidity &iov)
Store an object in the database.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.