HerdSoftware  0.3.2
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 
13 #include "common/CooArray.h"
14 #include "common/DefaultValues.h"
15 #include "common/RefFrame.h"
16 #include "common/Vec3D.h"
17 #include "dataobjects/Point.h"
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  float ResX() const { return _res[RefFrame::Coo::X]; }
80  void SetResX(float resX) { _res[RefFrame::Coo::X] = resX; }
81 
86  float ResY() const { return _res[RefFrame::Coo::Y]; }
91  void SetResY(float resY) { _res[RefFrame::Coo::Y] = resY; }
92 
97  float ResZ() const { return _res[RefFrame::Coo::Z]; }
102  void SetResZ(float resZ) { _res[RefFrame::Coo::Z] = resZ; }
103 
108  CooArray<float> ResAsArray() const { return _res; }
109 
114  void SetResFromArray(const std::array<float, 3> arr) { _res = arr; }
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_ */
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
A class describing a physical point in the 3D space.
Definition: PhysPoint.h:36
float ResX() const
Returns the resolution of the X coordinate of the point.
Definition: PhysPoint.h:75
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
CooArray< float > ResAsArray() const
Returns the point resolution as array.
Definition: PhysPoint.h:108
CooArray< float > _res
Definition: PhysPoint.h:117
PhysPoint()
Default constructor.
Definition: PhysPoint.h:43
float ResY() const
Returns the resolution of the Y coordinate of the point.
Definition: PhysPoint.h:86
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Vec3D Point
Definition: Point.h:23
PhysPoint(float xCoo, float yCoo, float zCoo, float resX=0., float resY=0., float resZ=0.)
Constructor.
Definition: PhysPoint.h:56
void SetResY(float resY)
Definition: PhysPoint.h:91
void SetResZ(float resZ)
Definition: PhysPoint.h:102
PhysPoint(const Vec3D &coo, std::array< float, 3 > res={0., 0., 0.})
Array constructor.
Definition: PhysPoint.h:66
void SetResX(float resX)
Definition: PhysPoint.h:80
void SetResFromArray(const std::array< float, 3 > arr)
Sets the resolution from array.
Definition: PhysPoint.h:114
virtual ~PhysPoint()=default
Virtual destructor.
float ResZ() const
Returns the resolution of the Z coordinate of the point.
Definition: PhysPoint.h:97