10 #ifndef HERD_REFFRAME_H_ 11 #define HERD_REFFRAME_H_ 44 const std::array<std::string, NAxes>
AxisName{
"X",
"Y",
"Z"};
45 inline std::ostream &
operator<<(std::ostream &out,
const Axis &axis) {
return out << AxisName[static_cast<int>(axis)]; }
46 inline std::string
operator+(
const std::string &str,
const Axis &axis) {
47 return str +
AxisName[
static_cast<int>(axis)];
71 constexpr std::array<RefFrame::Direction, RefFrame::NDirections>
Directions{
78 "Xpos",
"Xneg",
"Ypos",
"Yneg",
"Zpos",
"Zneg",
"XnegYneg",
"XposYneg",
"XnegYpos",
"XposYpos"};
81 return out << DirectionName[static_cast<int>(direction)];
101 const std::array<std::string, NViews>
ViewName{
"XY",
"XZ",
"YZ"};
117 const std::array<std::string, NSides>
SideName{
"Xpos",
"Xneg",
"Ypos",
"Yneg",
"TOP"};
118 inline std::ostream &
operator<<(std::ostream &out,
const Side &side) {
return out << SideName[static_cast<int>(side)]; }
120 return str +
SideName[
static_cast<int>(side)];
124 template <RefFrame::Axis T>
struct Ortog {};
136 template <>
struct Ortog<RefFrame::Axis::Z> {
159 throw Exception(
"RefFrame::AxesOf: Invalid view");
206 throw std::runtime_error(
"RefFrame::ToAxis: unknown direction");
208 throw std::runtime_error(
"RefFrame::ToAxis: unknown direction");
244 throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
264 throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
288 throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
301 throw std::runtime_error(
"RefFrame::NormalAxis: called with ax1 = ax2");
307 if ((ax1 ==
Axis::X && ax2 == Axis::Z) || (ax1 == Axis::Z && ax2 ==
Axis::X)) {
310 if ((ax1 == Axis::Z && ax2 ==
Axis::Y) || (ax1 ==
Axis::Y && ax2 == Axis::Z)) {
326 throw std::runtime_error(
327 "RefFrame:::IsPositive called with direction = to XposYpos or XnegYpos or XnegYneg or XposYneg");
constexpr std::array< Coo, 3 > Coos
Definition: RefFrame.h:27
Coo
Aliases for the three space coordinates. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:26
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
bool IsPositive(Direction dir)
Tells if a direction is positive or not.
Definition: RefFrame.h:323
constexpr int NSides
The number of sides (i.e. (number of elements of Side) - 1).
Definition: RefFrame.h:108
RefFrame::Axis ordinate
Definition: RefFrame.h:144
Base struct to get the two axes orthogonal to a direction.
Definition: RefFrame.h:124
Base struct to get the two axes of a given view.
Definition: RefFrame.h:142
const std::array< std::string, NViews > ViewName
Definition: RefFrame.h:101
Axis ToAxis(Coo coo)
Associates an axis to a coordinate .
Definition: RefFrame.h:184
constexpr int NViews
The number of views (i.e. (number of elements of View) - 1).
Definition: RefFrame.h:92
const std::array< std::string, NAxes > AxisName
Definition: RefFrame.h:44
Side
Aliases for the five sides. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:106
constexpr int NAxes
The number of axes (i.e. (number of elements of Axis) - 1).
Definition: RefFrame.h:35
Axis
Aliases for the axes. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:33
Coo ToCoo(Axis axis)
Associates a coordinate to an axis.
Definition: RefFrame.h:175
constexpr std::array< View, NViews > Views
Array of all the views.
Definition: RefFrame.h:100
std::string operator+(const std::string &str, const Axis &axis)
Definition: RefFrame.h:46
RefFrame::ViewAxes AxesOf(RefFrame::View view)
Definition: RefFrame.h:147
const std::array< std::string, RefFrame::NDirections > DirectionName
Definition: RefFrame.h:77
Direction NormalDirection(Side side)
Definition: RefFrame.h:273
constexpr std::array< RefFrame::Direction, RefFrame::NDirections > Directions
Definition: RefFrame.h:71
Axis NormalAxis(Side side)
Definition: RefFrame.h:231
const std::array< std::string, NSides > SideName
Definition: RefFrame.h:117
constexpr int NDirections
The number of directions (i.e. (number of elements of Direction) - 1).
Definition: RefFrame.h:69
constexpr std::array< Side, NSides > Sides
Array of all the sides.
Definition: RefFrame.h:116
std::ostream & operator<<(std::ostream &out, const Axis &axis)
Definition: RefFrame.h:45
Definition: Exception.h:24
RefFrame::Axis abscissa
Definition: RefFrame.h:143
View
Aliases for the three 2D projection planes. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:90
constexpr std::array< Axis, NAxes > Axes
Array of all the axes.
Definition: RefFrame.h:43
Direction
Aliases for the six axis directions. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:54