10 #ifndef HERD_REFFRAME_H_ 11 #define HERD_REFFRAME_H_ 42 const std::array<std::string, NAxes>
AxisName{
"X",
"Y",
"Z"};
43 inline std::ostream &
operator<<(std::ostream &out,
const Axis &axis) {
return out << AxisName[static_cast<int>(axis)]; }
44 inline std::string
operator+(
const std::string &str,
const Axis &axis) {
45 return str +
AxisName[
static_cast<int>(axis)];
69 constexpr std::array<RefFrame::Direction, RefFrame::NDirections>
Directions{
76 "Xpos",
"Xneg",
"Ypos",
"Yneg",
"Zpos",
"Zneg",
"XnegYneg",
"XposYneg",
"XnegYpos",
"XposYpos"};
79 return out << DirectionName[static_cast<int>(direction)];
99 const std::array<std::string, NViews>
ViewName{
"XY",
"XZ",
"YZ"};
115 const std::array<std::string, NSides>
SideName{
"Xpos",
"Xneg",
"Ypos",
"Yneg",
"TOP"};
116 inline std::ostream &
operator<<(std::ostream &out,
const Side &side) {
return out << SideName[static_cast<int>(side)]; }
118 return str +
SideName[
static_cast<int>(side)];
122 template <RefFrame::Axis T>
struct Ortog {};
134 template <>
struct Ortog<RefFrame::Axis::Z> {
199 throw std::runtime_error(
"RefFrame::ToAxis: unknown direction");
201 throw std::runtime_error(
"RefFrame::ToAxis: unknown direction");
237 throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
257 throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
281 throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
294 throw std::runtime_error(
"RefFrame::NormalAxis: called with ax1 = ax2");
300 if ((ax1 ==
Axis::X && ax2 == Axis::Z) || (ax1 == Axis::Z && ax2 ==
Axis::X)) {
303 if ((ax1 == Axis::Z && ax2 ==
Axis::Y) || (ax1 ==
Axis::Y && ax2 == Axis::Z)) {
319 throw std::runtime_error(
320 "RefFrame:::IsPositive called with direction = to XposYpos or XnegYpos or XnegYneg or XposYneg");
constexpr std::array< Coo, 3 > Coos
Definition: RefFrame.h:25
Coo
Aliases for the three space coordinates. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:24
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
bool IsPositive(Direction dir)
Tells if a direction is positive or not.
Definition: RefFrame.h:316
constexpr int NSides
The number of sides (i.e. (number of elements of Side) - 1).
Definition: RefFrame.h:106
Base struct to get the two axes orthogonal to a direction.
Definition: RefFrame.h:122
Base struct to get the two axes of a given view.
Definition: RefFrame.h:140
const std::array< std::string, NViews > ViewName
Definition: RefFrame.h:99
Axis ToAxis(Coo coo)
Associates an axis to a coordinate .
Definition: RefFrame.h:177
constexpr int NViews
The number of views (i.e. (number of elements of View) - 1).
Definition: RefFrame.h:90
const std::array< std::string, NAxes > AxisName
Definition: RefFrame.h:42
Side
Aliases for the five sides. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:104
constexpr int NAxes
The number of axes (i.e. (number of elements of Axis) - 1).
Definition: RefFrame.h:33
Axis
Aliases for the axes. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:31
Coo ToCoo(Axis axis)
Associates a coordinate to an axis.
Definition: RefFrame.h:168
constexpr std::array< View, NViews > Views
Array of all the views.
Definition: RefFrame.h:98
std::string operator+(const std::string &str, const Axis &axis)
Definition: RefFrame.h:44
const std::array< std::string, RefFrame::NDirections > DirectionName
Definition: RefFrame.h:75
Direction NormalDirection(Side side)
Definition: RefFrame.h:266
constexpr std::array< RefFrame::Direction, RefFrame::NDirections > Directions
Definition: RefFrame.h:69
Axis NormalAxis(Side side)
Definition: RefFrame.h:224
const std::array< std::string, NSides > SideName
Definition: RefFrame.h:115
constexpr int NDirections
The number of directions (i.e. (number of elements of Direction) - 1).
Definition: RefFrame.h:67
constexpr std::array< Side, NSides > Sides
Array of all the sides.
Definition: RefFrame.h:114
std::ostream & operator<<(std::ostream &out, const Axis &axis)
Definition: RefFrame.h:43
View
Aliases for the three 2D projection planes. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:88
constexpr std::array< Axis, NAxes > Axes
Array of all the axes.
Definition: RefFrame.h:41
Direction
Aliases for the six axis directions. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:52