16 #ifndef ROOT7_TPadCoord 17 #define ROOT7_TPadCoord 20 namespace Experimental {
28 template <
class DERIVED>
34 DERIVED &
ToDerived() {
return static_cast<DERIVED &
>(*this); }
38 friend DERIVED
operator+(DERIVED lhs, DERIVED rhs) {
return DERIVED{lhs.
fVal + rhs.fVal}; }
39 friend DERIVED
operator-(DERIVED lhs, DERIVED rhs) {
return DERIVED{lhs.
fVal - rhs.fVal}; }
40 friend double operator/(DERIVED lhs, DERIVED rhs) {
return lhs.fVal / rhs.fVal; }
56 friend bool operator<(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal < rhs.fVal; }
57 friend bool operator>(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal > rhs.fVal; }
58 friend bool operator<=(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal <= rhs.fVal; }
59 friend bool operator>=(
const DERIVED &lhs,
const DERIVED &rhs) {
return lhs.fVal >= rhs.fVal; }
130 return TPadCoord(-fNormal, -fPixel, -fUser);
friend bool operator>(const DERIVED &lhs, const DERIVED &rhs)
TPadCoord(User user)
Constructor from a User coordinate.
Namespace for new ROOT classes and functions.
Normal fNormal
The normalized coordinate summand.
A user coordinate, as defined by the EUserCoordSystem parameter of the TPad.
DERIVED & operator-=(const DERIVED &rhs)
A pixel coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the TPad...
friend bool operator<=(const DERIVED &lhs, const DERIVED &rhs)
TPadCoord & operator-=(const TPadCoord &rhs)
Subtract a TPadCoord.
TPadCoord(Pixel px)
Constructor from a Pixel coordinate.
double fVal
Coordinate value.
friend bool operator<(const DERIVED &lhs, const DERIVED &rhs)
friend TPadCoord operator+(TPadCoord lhs, const TPadCoord &rhs)
Add two TPadCoords.
TPadCoord()=default
Default constructor, initializing all coordinate parts to 0..
Pixel fPixel
The pixel coordinate summand.
DERIVED & operator*=(double scale)
TPadCoord(Normal normal)
Constructor from a Normal coordinate.
TPadCoord & operator+=(const TPadCoord &rhs)
Add a TPadCoord.
friend DERIVED operator-(DERIVED lhs, DERIVED rhs)
friend TPadCoord operator-(TPadCoord lhs, const TPadCoord &rhs)
Subtract two TPadCoords.
friend DERIVED operator+(DERIVED lhs, DERIVED rhs)
friend double operator/(DERIVED lhs, DERIVED rhs)
User fUser
The user coordinate summand.
friend bool operator>=(const DERIVED &lhs, const DERIVED &rhs)
TPadCoord & operator*=(double scale)
A normalized coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the TPad...
TPadCoord operator-()
Unary -.
def normal(shape, name=None)
DERIVED & operator+=(const DERIVED &rhs)
TPadCoord(Normal normal, Pixel px, User user)
Sort-of aggregate initialization constructor taking normal, pixel and user parts. ...