Belle II Software development
ARICHPositionElement Class Reference

Position element for ARICH. More...

#include <ARICHPositionElement.h>

Inheritance diagram for ARICHPositionElement:
ARICHGeoBase

Public Member Functions

 ARICHPositionElement ()
 Default constructor.
 
 ARICHPositionElement (double x, double y, double z, double alpha, double beta, double gamma, const std::string &name="ARICHAlignment")
 Full constructor.
 
void setX (double x)
 Sets translation in x.
 
void setY (double y)
 Sets translation in y.
 
void setZ (double z)
 Sets translation in z.
 
void setRPhi (double r, double phi)
 Sets x,y from r,phi.
 
void setAlpha (double alpha)
 Sets rotation around x.
 
void setBeta (double beta)
 Sets rotation around y.
 
void setGamma (double gamma)
 Sets rotation around z.
 
void addShift (double dx, double dy, double dz, double dalpha, double dbeta, double dgamma)
 Shift the existing values of parameters.
 
double getX () const
 Returns translation in x.
 
double getY () const
 Returns translation in y.
 
double getZ () const
 Returns translation in z.
 
double getAlpha () const
 Returns rotation angle around x.
 
double getBeta () const
 Returns rotation angle around y.
 
double getGamma () const
 Returns rotation angle around z.
 
ROOT::Math::Rotation3D getRotation () const
 Returns rotation matrix.
 
ROOT::Math::XYZVector getTranslation () const
 Returns translation vector (always in basf2 units!)
 
bool isConsistent () const override
 Check for consistency of data members.
 
void print (const std::string &title="Parmeters of position element") const override
 Print the content of the class.
 
void setName (const std::string &name)
 Sets object name.
 
const std::string & getName () const
 Returns object name.
 
virtual void printSurface (const GeoOpticalSurface &surface) const
 Print the content of optical surface.
 
virtual void printPlacement (double x, double y, double z, double rx, double ry, double rz) const
 Print volume positioning parameters.
 

Protected Member Functions

 ClassDef (ARICHGeoBase, 2)
 ClassDef.
 

Protected Attributes

std::string m_name
 geometry object name
 

Static Protected Attributes

static double s_unit = Unit::cm
 conversion unit for length
 
static std::string s_unitName
 conversion unit name
 

Private Member Functions

 ClassDefOverride (ARICHPositionElement, 1)
 ClassDef.
 

Private Attributes

float m_x = 0
 translation in x
 
float m_y = 0
 translation in y
 
float m_z = 0
 translation in z
 
float m_alpha = 0
 rotation angle around x
 
float m_beta = 0
 rotation angle around y
 
float m_gamma = 0
 rotation angle around z
 

Detailed Description

Position element for ARICH.

Holding parameters for displacement and alignment of arich components

Definition at line 29 of file ARICHPositionElement.h.

Constructor & Destructor Documentation

◆ ARICHPositionElement() [1/2]

Default constructor.

Definition at line 35 of file ARICHPositionElement.h.

36 {}

◆ ARICHPositionElement() [2/2]

ARICHPositionElement ( double  x,
double  y,
double  z,
double  alpha,
double  beta,
double  gamma,
const std::string &  name = "ARICHAlignment" 
)
inline

Full constructor.

Parameters
xtranslation in x
ytranslation in y
ztranslation in z
alpharotation angle around x
betarotation angle around y
gammarotation angle around z
nameobject name

Definition at line 48 of file ARICHPositionElement.h.

49 :
50 ARICHGeoBase(name),
51 m_x(x), m_y(y), m_z(z),
52 m_alpha(alpha), m_beta(beta), m_gamma(gamma)
53 {}
ARICHGeoBase()
Default constructor.
Definition: ARICHGeoBase.h:30
float m_beta
rotation angle around y
float m_alpha
rotation angle around x
float m_gamma
rotation angle around z

◆ ~ARICHPositionElement()

~ARICHPositionElement ( )
inline

Definition at line 55 of file ARICHPositionElement.h.

56 {}

Member Function Documentation

◆ addShift()

void addShift ( double  dx,
double  dy,
double  dz,
double  dalpha,
double  dbeta,
double  dgamma 
)
inline

Shift the existing values of parameters.

Parameters
dxtranslation in x
dytranslation in y
dztranslation in z
dalpharotation angle around x
dbetarotation angle around y
dgammarotation angle around z

Definition at line 116 of file ARICHPositionElement.h.

117 {
118 m_x += dx;
119 m_y += dy;
120 m_z += dz;
121 m_alpha += dalpha;
122 m_beta += dbeta;
123 m_gamma += dgamma;
124 };

◆ getAlpha()

double getAlpha ( ) const
inline

Returns rotation angle around x.

Returns
rotation angle

Definition at line 148 of file ARICHPositionElement.h.

148{return m_alpha;}

◆ getBeta()

double getBeta ( ) const
inline

Returns rotation angle around y.

Returns
rotation angle

Definition at line 154 of file ARICHPositionElement.h.

154{return m_beta;}

◆ getGamma()

double getGamma ( ) const
inline

Returns rotation angle around z.

Returns
rotation angle

Definition at line 160 of file ARICHPositionElement.h.

160{return m_gamma;}

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns object name.

Returns
object name

Definition at line 49 of file ARICHGeoBase.h.

49{return m_name;}
std::string m_name
geometry object name
Definition: ARICHGeoBase.h:82

◆ getRotation()

ROOT::Math::Rotation3D getRotation ( ) const
inline

Returns rotation matrix.

Returns
rotation matrix

Definition at line 166 of file ARICHPositionElement.h.

167 {
168 ROOT::Math::Rotation3D rot;
169 ROOT::Math::RotationX rotX(m_alpha);
170 ROOT::Math::RotationY rotY(m_beta);
171 ROOT::Math::RotationZ rotZ(m_gamma);
172 rot *= rotZ * rotY * rotX;
173 return rot;
174 }

◆ getTranslation()

ROOT::Math::XYZVector getTranslation ( ) const
inline

Returns translation vector (always in basf2 units!)

Returns
translation vector

Definition at line 180 of file ARICHPositionElement.h.

180{return ROOT::Math::XYZVector(m_x, m_y, m_z);}

◆ getX()

double getX ( ) const
inline

Returns translation in x.

Returns
x coordinate

Definition at line 130 of file ARICHPositionElement.h.

130{return m_x / s_unit;}
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:83

◆ getY()

double getY ( ) const
inline

Returns translation in y.

Returns
y coordinate

Definition at line 136 of file ARICHPositionElement.h.

136{return m_y / s_unit;}

◆ getZ()

double getZ ( ) const
inline

Returns translation in z.

Returns
z coordinate

Definition at line 142 of file ARICHPositionElement.h.

142{return m_z / s_unit;}

◆ isConsistent()

bool isConsistent ( ) const
inlineoverridevirtual

Check for consistency of data members.

Returns
true if values consistent (valid)

Reimplemented from ARICHGeoBase.

Definition at line 186 of file ARICHPositionElement.h.

186{return true;}

◆ print()

void print ( const std::string &  title = "Parmeters of position element") const
inlineoverridevirtual

Print the content of the class.

Parameters
titletitle to be printed

Reimplemented from ARICHGeoBase.

Definition at line 192 of file ARICHPositionElement.h.

193 {
194 std::cout << title << std::endl;
195 std::cout << "translations (x,y,z): " << m_x << " " << m_y << " " << m_z << std::endl;
196 std::cout << "rotations (x,y,z axis): " << m_alpha << " " << m_beta << " " << m_gamma << std::endl;
197
198 }

◆ printPlacement()

void printPlacement ( double  x,
double  y,
double  z,
double  rx,
double  ry,
double  rz 
) const
virtualinherited

Print volume positioning parameters.

Parameters
xx position
yy position
zz position
rxrotation around x-axis
ryrotation around y-axis
rzrotation around z-axis

Definition at line 25 of file ARICHGeoBase.cc.

26{
27// cout << "Volume positioning information (inside local ARICH frame)" << endl;
28 cout << " Center position; x: " << x << " " << s_unitName << ", y: " << y << " " << s_unitName << ", z: " << z << " " << s_unitName
29 << endl;
30 cout << " Rotations; x-axis: " << rx << " y-axis: " << ry << " z-axis: " << rz << " (in rad)" << endl;
31}
static std::string s_unitName
conversion unit name
Definition: ARICHGeoBase.h:84

◆ printSurface()

void printSurface ( const GeoOpticalSurface surface) const
virtualinherited

Print the content of optical surface.

Parameters
surfaceoptical surface parameters

Definition at line 32 of file ARICHGeoBase.cc.

33{
34 cout << " Optical surface: ";
35 if (surface.getName().empty() and !surface.hasProperties()) {
36 cout << "not defined" << endl;
37 return;
38 }
39 cout << surface.getName();
40 cout << ", model: " << surface.getModel();
41 cout << ", finish: " << surface.getFinish();
42 cout << ", type: " << surface.getType();
43 cout << ", value: " << surface.getValue();
44 cout << endl;
45 if (surface.hasProperties()) {
46 for (const auto& property : surface.getProperties()) {
47 cout << " - property: ";
48 cout << property.getName() << " [";
49 for (const auto& value : property.getValues()) cout << value << ", ";
50 cout << "], @[";
51 for (const auto& value : property.getEnergies()) cout << value / Unit::eV << ", ";
52 cout << "] eV" << endl;
53 }
54 } else {
55 cout << " - properties: None" << endl;
56 }
57
58}
const std::string & getName() const
get name of the optical surface
int getFinish() const
get finish of the surface
const std::vector< GeoMaterialProperty > & getProperties() const
get all properties
double getValue() const
get value for the surface condition
int getType() const
get type of the surface
bool hasProperties() const
check if the material has at least one property
int getModel() const
get model for the surface
static const double eV
[electronvolt]
Definition: Unit.h:112

◆ setAlpha()

void setAlpha ( double  alpha)
inline

Sets rotation around x.

Parameters
alpharotation angle around x

Definition at line 91 of file ARICHPositionElement.h.

91{m_alpha = alpha;}

◆ setBeta()

void setBeta ( double  beta)
inline

Sets rotation around y.

Parameters
betarotation angle around y

Definition at line 98 of file ARICHPositionElement.h.

98{m_beta = beta;}

◆ setGamma()

void setGamma ( double  gamma)
inline

Sets rotation around z.

Parameters
gammarotation angle around z

Definition at line 105 of file ARICHPositionElement.h.

105{m_gamma = gamma;}

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Sets object name.

Parameters
nameobject name

Definition at line 43 of file ARICHGeoBase.h.

43{m_name = name;}

◆ setRPhi()

void setRPhi ( double  r,
double  phi 
)
inline

Sets x,y from r,phi.

Parameters
rradius
phiphi angle

Definition at line 81 of file ARICHPositionElement.h.

82 {
83 m_x = r * cos(phi / Unit::rad);
84 m_y = r * sin(phi / Unit::rad);
85 }
static const double rad
Standard of [angle].
Definition: Unit.h:50

◆ setX()

void setX ( double  x)
inline

Sets translation in x.

Parameters
xtranslation in x

Definition at line 62 of file ARICHPositionElement.h.

62{m_x = x;}

◆ setY()

void setY ( double  y)
inline

Sets translation in y.

Parameters
ytranslation in y

Definition at line 68 of file ARICHPositionElement.h.

68{m_y = y;}

◆ setZ()

void setZ ( double  z)
inline

Sets translation in z.

Parameters
ztranslation in z

Definition at line 74 of file ARICHPositionElement.h.

74{m_z = z;}

Member Data Documentation

◆ m_alpha

float m_alpha = 0
private

rotation angle around x

Definition at line 205 of file ARICHPositionElement.h.

◆ m_beta

float m_beta = 0
private

rotation angle around y

Definition at line 206 of file ARICHPositionElement.h.

◆ m_gamma

float m_gamma = 0
private

rotation angle around z

Definition at line 207 of file ARICHPositionElement.h.

◆ m_name

std::string m_name
protectedinherited

geometry object name

Definition at line 82 of file ARICHGeoBase.h.

◆ m_x

float m_x = 0
private

translation in x

Definition at line 202 of file ARICHPositionElement.h.

◆ m_y

float m_y = 0
private

translation in y

Definition at line 203 of file ARICHPositionElement.h.

◆ m_z

float m_z = 0
private

translation in z

Definition at line 204 of file ARICHPositionElement.h.

◆ s_unit

double s_unit = Unit::cm
staticprotectedinherited

conversion unit for length

Definition at line 83 of file ARICHGeoBase.h.

◆ s_unitName

std::string s_unitName
staticprotectedinherited

conversion unit name

Definition at line 84 of file ARICHGeoBase.h.


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