Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JShower3Z.hh
Go to the documentation of this file.
1#ifndef __JSHOWER3Z__
2#define __JSHOWER3Z__
3
4#include <istream>
5#include <ostream>
6
7#include "JMath/JMath.hh"
11#include "JFit/JPoint4D.hh"
12
13/**
14 * \author lquinn
15 */
16
17namespace JFIT {}
18namespace JPP { using namespace JFIT; }
19
20namespace JFIT {
21
22 using JMATH::JMath;
26
27
28 /**
29 * Data structure for cascade in positive z-direction.
30 * Note that the position coordinates are defined with respect to the given direction.
31 */
32 class JShower3Z :
33 public JPoint4D,
34 public JVersor3Z,
35 public JMath<JShower3Z>
36 {
37 public:
38
39 using JPoint4D::add;
40 using JPoint4D::sub;
41 using JPoint4D::getT;
42 using JVersor3Z::add;
43 using JVersor3Z::sub;
45
46 /**
47 * Default constructor.
48 */
50 JPoint4D(),
51 JVersor3Z()
52 {}
53
54 /**
55 * Constructor.
56 *
57 * \param point point
58 * \param dir direction
59 */
60 JShower3Z(const JPoint4D& point,
61 const JVersor3Z& dir):
62 JPoint4D(point),
63 JVersor3Z(dir)
64 {}
65
66 /**
67 * Prefix unary minus.
68 *
69 * \return shower
70 */
72 {
73 JPoint4D ::negate();
75
76 return *this;
77 }
78
79 /**
80 * Addition operator.
81 *
82 * \param value shower
83 * \return shower
84 */
85 JShower3Z& add(const JShower3Z& value)
86 {
87 JPoint4D ::add(value);
88 JVersor3Z::add(value);
89
90 return *this;
91 }
92
93 /**
94 * Subtraction operator.
95 *
96 * \param value shower
97 * \return shower
98 */
99 JShower3Z& sub(const JShower3Z& value)
100 {
101 JPoint4D ::sub(value);
102 JVersor3Z::sub(value);
103
104 return *this;
105 }
106
107 /**
108 * Multiplication operator.
109 *
110 * \param value
111 * \return shower
112 */
113 JShower3Z& mul(const double value)
114 {
115 JPoint4D ::mul(value);
116 JVersor3Z::mul(value);
117
118 return *this;
119 }
120
121 /**
122 * Divison operator.
123 *
124 * \param value
125 * \return shower
126 */
127 JShower3Z& div(const double value)
128 {
129 JPoint4D ::div(value);
130 JVersor3Z::div(value);
131
132 return *this;
133 }
134
135 /**
136 * Read object from input.
137 *
138 * \param in input stream
139 * \param object object
140 * \return input stream
141 */
142 friend inline std::istream& operator>>(std::istream& in, JShower3Z& object)
143 {
144 in >> static_cast<JPoint4D&>(object);
145 in >> object.__dx;
146 in >> object.__dy;
147
148 return in;
149 }
150
151
152 /**
153 * Write object to output.
154 *
155 * \param out output stream
156 * \param object object
157 * \return output stream
158 */
159 friend inline std::ostream& operator<<(std::ostream& out, const JShower3Z& object)
160 {
161 out << static_cast<const JPoint4D&>(object);
162 out << ' ' << object.__dx;
163 out << ' ' << object.__dy;
164
165 return out;
166 }
167
168
169 typedef double JShower3Z::*parameter_type;
170
171 static parameter_type pDX() { return &JShower3Z::__dx; }
172 static parameter_type pDY() { return &JShower3Z::__dy; }
173 };
174}
175#endif
Base class for data structures with artithmetic capabilities.
Data structure for vertex fit.
Definition JPoint4D.hh:24
Data structure for cascade in positive z-direction.
Definition JShower3Z.hh:36
JShower3Z & negate()
Prefix unary minus.
Definition JShower3Z.hh:71
JShower3Z()
Default constructor.
Definition JShower3Z.hh:49
JShower3Z(const JPoint4D &point, const JVersor3Z &dir)
Constructor.
Definition JShower3Z.hh:60
friend std::ostream & operator<<(std::ostream &out, const JShower3Z &object)
Write object to output.
Definition JShower3Z.hh:159
double JShower3Z::* parameter_type
Definition JShower3Z.hh:169
static parameter_type pDY()
Definition JShower3Z.hh:172
friend std::istream & operator>>(std::istream &in, JShower3Z &object)
Read object from input.
Definition JShower3Z.hh:142
JShower3Z & sub(const JShower3Z &value)
Subtraction operator.
Definition JShower3Z.hh:99
JShower3Z & add(const JShower3Z &value)
Addition operator.
Definition JShower3Z.hh:85
JShower3Z & div(const double value)
Divison operator.
Definition JShower3Z.hh:127
JShower3Z & mul(const double value)
Multiplication operator.
Definition JShower3Z.hh:113
static parameter_type pDX()
Definition JShower3Z.hh:171
JTime & add(const JTime &value)
Addition operator.
double getT() const
Get time.
JTime & sub(const JTime &value)
Subtraction operator.
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
Data structure for normalised vector in positive z-direction.
Definition JVersor3Z.hh:41
JVersor3Z & add(const JVersor3Z &value)
Addition operator.
Definition JVersor3Z.hh:200
JVersor3Z & sub(const JVersor3Z &value)
Subtraction operator.
Definition JVersor3Z.hh:215
JVersor3Z & mul(const double value)
Multiplication operator.
Definition JVersor3Z.hh:230
JVersor3Z & negate()
Prefix unary minus.
Definition JVersor3Z.hh:185
const JVersor3Z & getDirection() const
Get direction.
Definition JVersor3Z.hh:81
JVersor3Z & div(const double value)
Division operator.
Definition JVersor3Z.hh:245
Auxiliary classes and methods for linear and iterative data regression.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary base class for aritmetic operations of derived class types.
Definition JMath.hh:347