Belle II Software development
EKLMGeometry::ShieldDetailGeometry Class Reference

Shield layer detail geometry data. More...

#include <EKLMGeometry.h>

Inheritance diagram for EKLMGeometry::ShieldDetailGeometry:

Public Member Functions

 ShieldDetailGeometry ()
 Constructor.
 
 ShieldDetailGeometry (const ShieldDetailGeometry &geometry)
 Copy constructor.
 
ShieldDetailGeometryoperator= (const ShieldDetailGeometry &geometry)
 Operator =.
 
 ~ShieldDetailGeometry ()
 Destructor.
 
double getLengthX () const
 Get X length.
 
void setLengthX (double lengthX)
 Set X length.
 
double getLengthY () const
 Get Y length.
 
void setLengthY (double lengthY)
 Set Y length.
 
int getNPoints () const
 Get number of points.
 
void setNPoints (int nPoints)
 Set number of points.
 
const PointgetPoint (int i) const
 Get point.
 
void setPoint (int i, const Point &point)
 Set point.
 

Private Member Functions

 ClassDef (ShieldDetailGeometry, 1)
 Class version.
 

Private Attributes

double m_LengthX = 0
 X length.
 
double m_LengthY = 0
 Y length.
 
int m_NPoints = 0
 Number of points.
 
Pointm_Points = nullptr
 Points.
 

Detailed Description

Shield layer detail geometry data.

Definition at line 1375 of file EKLMGeometry.h.

Constructor & Destructor Documentation

◆ ShieldDetailGeometry() [1/2]

Constructor.

Definition at line 71 of file EKLMGeometry.cc.

72{
73}

◆ ShieldDetailGeometry() [2/2]

Copy constructor.

Definition at line 75 of file EKLMGeometry.cc.

76 : TObject(geometry)
77{
78 /* cppcheck-suppress variableScope */
79 int i;
80 m_LengthX = geometry.getLengthX();
81 m_LengthY = geometry.getLengthY();
82 m_NPoints = geometry.getNPoints();
83 if (m_NPoints > 0) {
84 m_Points = new Point[m_NPoints];
85 for (i = 0; i < m_NPoints; i++)
86 m_Points[i] = *geometry.getPoint(i);
87 } else
88 m_Points = nullptr;
89}

◆ ~ShieldDetailGeometry()

Destructor.

Definition at line 113 of file EKLMGeometry.cc.

114{
115 if (m_Points != nullptr)
116 delete[] m_Points;
117}

Member Function Documentation

◆ getLengthX()

double getLengthX ( ) const
inline

Get X length.

Definition at line 1402 of file EKLMGeometry.h.

1403 {
1404 return m_LengthX;
1405 }

◆ getLengthY()

double getLengthY ( ) const
inline

Get Y length.

Definition at line 1419 of file EKLMGeometry.h.

1420 {
1421 return m_LengthY;
1422 }

◆ getNPoints()

int getNPoints ( ) const
inline

Get number of points.

Definition at line 1436 of file EKLMGeometry.h.

1437 {
1438 return m_NPoints;
1439 }

◆ getPoint()

const EKLMGeometry::Point * getPoint ( int  i) const

Get point.

Parameters
[in]iNumber of point (array index).

Definition at line 133 of file EKLMGeometry.cc.

134{
135 if (i < 0 || i >= m_NPoints)
136 B2FATAL("Number of point must be from 0 to " << m_NPoints - 1 << ".");
137 return &m_Points[i];
138}

◆ operator=()

EKLMGeometry::ShieldDetailGeometry & operator= ( const ShieldDetailGeometry geometry)

Operator =.

Definition at line 92 of file EKLMGeometry.cc.

94{
95 /* cppcheck-suppress variableScope */
96 int i;
97 if (&geometry == this)
98 return *this;
99 m_LengthX = geometry.getLengthX();
100 m_LengthY = geometry.getLengthY();
101 m_NPoints = geometry.getNPoints();
102 if (m_Points != nullptr)
103 delete[] m_Points;
104 if (m_NPoints > 0) {
105 m_Points = new Point[m_NPoints];
106 for (i = 0; i < m_NPoints; i++)
107 m_Points[i] = *geometry.getPoint(i);
108 } else
109 m_Points = nullptr;
110 return *this;
111}

◆ setLengthX()

void setLengthX ( double  lengthX)
inline

Set X length.

Parameters
[in]lengthXX length.

Definition at line 1411 of file EKLMGeometry.h.

1412 {
1413 m_LengthX = lengthX;
1414 }

◆ setLengthY()

void setLengthY ( double  lengthY)
inline

Set Y length.

Parameters
[in]lengthYY length.

Definition at line 1428 of file EKLMGeometry.h.

1429 {
1430 m_LengthY = lengthY;
1431 }

◆ setNPoints()

void setNPoints ( int  nPoints)

Set number of points.

Parameters
[in]nPointsNumber of points.

Definition at line 119 of file EKLMGeometry.cc.

120{
121 if (nPoints < 0)
122 B2FATAL("Number of points must be nonnegative.");
123 m_NPoints = nPoints;
124 if (m_Points != nullptr)
125 delete[] m_Points;
126 if (m_NPoints > 0)
127 m_Points = new Point[m_NPoints];
128 else
129 m_Points = nullptr;
130}

◆ setPoint()

void setPoint ( int  i,
const Point point 
)

Set point.

Parameters
[in]iNumber of point (array index).
[in]pointPoint.

Definition at line 140 of file EKLMGeometry.cc.

141{
142 if (i < 0 || i >= m_NPoints)
143 B2FATAL("Number of point must be from 0 to " << m_NPoints - 1 << ".");
144 m_Points[i] = point;
145}

Member Data Documentation

◆ m_LengthX

double m_LengthX = 0
private

X length.

Definition at line 1463 of file EKLMGeometry.h.

◆ m_LengthY

double m_LengthY = 0
private

Y length.

Definition at line 1466 of file EKLMGeometry.h.

◆ m_NPoints

int m_NPoints = 0
private

Number of points.

Definition at line 1469 of file EKLMGeometry.h.

◆ m_Points

Point* m_Points = nullptr
private

Points.

Definition at line 1472 of file EKLMGeometry.h.


The documentation for this class was generated from the following files: