HerdSoftware  0.4.0
PhysPoint.h
Go to the documentation of this file.
1 /*
2  * PhysPoint.h
3  *
4  * Created on: 23 Set 2019
5  * Author: Lorenzo Pacini
6  */
7 
10 #ifndef HERD_PHYSPOINT_H_
11 #define HERD_PHYSPOINT_H_
12 
18 
19 #ifdef HS_USE_ROOT
20 #include "Rtypes.h"
21 #endif
22 
23 #include <array>
24 #include <iostream>
25 #include <limits>
26 #include <type_traits>
27 
28 namespace Herd {
29 
36 class PhysPoint : public Point {
37 public:
44 
56  PhysPoint(float xCoo, float yCoo, float zCoo, float resX = 0., float resY = 0., float resZ = 0.)
57  : Point(xCoo, yCoo, zCoo), _res{resX, resY, resZ} {}
58 
66  PhysPoint(const Vec3D &coo, std::array<float, 3> res = {0., 0., 0.}) : Point(coo), _res{res} {}
67 
69  virtual ~PhysPoint() = default;
70 
75  [[nodiscard]] float ResX() const { return _res[RefFrame::Coo::X]; }
80  void SetResX(float resX) { _res[RefFrame::Coo::X] = resX; }
81 
86  [[nodiscard]] float ResY() const { return _res[RefFrame::Coo::Y]; }
91  void SetResY(float resY) { _res[RefFrame::Coo::Y] = resY; }
92 
97  [[nodiscard]] float ResZ() const { return _res[RefFrame::Coo::Z]; }
102  void SetResZ(float resZ) { _res[RefFrame::Coo::Z] = resZ; }
103 
108  [[nodiscard]] CooArray<float> ResAsArray() const { return _res; }
109 
114  void SetResFromArray(const std::array<float, 3> res) { _res = res; }
115 
116 private:
118 
119 #ifdef HS_USE_ROOT
120  ClassDef(PhysPoint, 1)
121 #endif
122 }; // namespace Herd
123 
124 } // namespace Herd
125 
126 #endif /* HERD_POINT_H_ */
Herd::RefFrame::Coo::Y
@ Y
Herd::PhysPoint::_res
CooArray< float > _res
Definition: PhysPoint.h:117
Point.h
Herd::PhysPoint::SetResFromArray
void SetResFromArray(const std::array< float, 3 > res)
Sets the resolution from array.
Definition: PhysPoint.h:114
Herd::Vec3D
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Herd::RefFrame::Coo::X
@ X
Herd::CooArray< float >
Herd::PhysPoint
A class describing a physical point in the 3D space.
Definition: PhysPoint.h:36
Herd::PhysPoint::~PhysPoint
virtual ~PhysPoint()=default
Virtual destructor
DEFAULT_INIT
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
Herd::PhysPoint::ResY
float ResY() const
Returns the resolution of the Y coordinate of the point.
Definition: PhysPoint.h:86
Herd::PhysPoint::PhysPoint
PhysPoint(float xCoo, float yCoo, float zCoo, float resX=0., float resY=0., float resZ=0.)
Constructor.
Definition: PhysPoint.h:56
Vec3D.h
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::PhysPoint::SetResY
void SetResY(float resY)
Sets the value of the Y resolution.
Definition: PhysPoint.h:91
CooArray.h
Herd::Point
Vec3D Point
Definition: Point.h:23
Herd::PhysPoint::PhysPoint
PhysPoint()
Default constructor.
Definition: PhysPoint.h:43
RefFrame.h
Herd::RefFrame::Coo::Z
@ Z
Herd::PhysPoint::SetResX
void SetResX(float resX)
Sets the value of the X resolution.
Definition: PhysPoint.h:80
Herd::PhysPoint::ResZ
float ResZ() const
Returns the resolution of the Z coordinate of the point.
Definition: PhysPoint.h:97
DefaultValues.h
Herd::PhysPoint::PhysPoint
PhysPoint(const Vec3D &coo, std::array< float, 3 > res={0., 0., 0.})
Array constructor.
Definition: PhysPoint.h:66
Herd::PhysPoint::SetResZ
void SetResZ(float resZ)
Sets the value of the Z resolution.
Definition: PhysPoint.h:102
Herd::PhysPoint::ResX
float ResX() const
Returns the resolution of the X coordinate of the point.
Definition: PhysPoint.h:75
Herd::PhysPoint::ResAsArray
CooArray< float > ResAsArray() const
Returns the point resolution as array.
Definition: PhysPoint.h:108