Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JLine3EZ.hh
Go to the documentation of this file.
1#ifndef __JLINE3EZ__
2#define __JLINE3EZ__
3
4#include <istream>
5#include <ostream>
6
7#include "JMath/JMath.hh"
8#include "JFit/JLine3Z.hh"
9#include "JFit/JEnergy.hh"
10
11
12/**
13 * \author mdejong
14 */
15
16namespace JFIT {}
17namespace JPP { using namespace JFIT; }
18
19namespace JFIT {
20
21 using JMATH::JMath;
22
23
24 /**
25 * Data structure for fit of straight line in positive z-direction with energy.
26 * Note that the position coordinates are defined with respect to the given direction.
27 */
28 class JLine3EZ :
29 public JLine3Z,
30 public JEnergy,
31 public JMath<JLine3EZ>
32 {
33 public:
34
35 /**
36 * Default constructor.
37 */
39 JLine3Z(),
40 JEnergy()
41 {}
42
43
44 /**
45 * Constructor.
46 *
47 * \param line line
48 * \param x energy
49 */
50 JLine3EZ(const JLine3Z& line, const JEnergy& x) :
51 JLine3Z(line),
52 JEnergy(x)
53 {}
54
55
56 /**
57 * Prefix unary minus.
58 *
59 * \return line
60 */
62 {
65
66 return *this;
67 }
68
69
70 /**
71 * Addition operator.
72 *
73 * \param value line
74 * \return line
75 */
76 JLine3EZ& add(const JLine3EZ& value)
77 {
78 JLine3Z::add(value);
79 JEnergy::add(value);
80
81 return *this;
82 }
83
84
85 /**
86 * Subtraction operator.
87 *
88 * \param value line
89 * \return line
90 */
91 JLine3EZ& sub(const JLine3EZ& value)
92 {
93 JLine3Z::sub(value);
94 JEnergy::sub(value);
95
96 return *this;
97 }
98
99
100 /**
101 * Multiplication operator.
102 *
103 * \param value multiplication factor
104 * \return line
105 */
106 JLine3EZ& mul(const double value)
107 {
108 JLine3Z::mul(value);
109 JEnergy::mul(value);
110
111 return *this;
112 }
113
114
115 /**
116 * Division operator.
117 *
118 * \param value multiplication factor
119 * \return line
120 */
121 JLine3EZ& div(const double value)
122 {
123 JLine3Z::div(value);
124 JEnergy::div(value);
125
126 return *this;
127 }
128
129
130 /**
131 * Read object from input.
132 *
133 * \param in input stream
134 * \param object object
135 * \return input stream
136 */
137 friend inline std::istream& operator>>(std::istream& in, JLine3EZ& object)
138 {
139 in >> static_cast<JLine3Z&>(object);
140 in >> static_cast<JEnergy&>(object);
141
142 return in;
143 }
144
145
146 /**
147 * Write object to output.
148 *
149 * \param out output stream
150 * \param object object
151 * \return output stream
152 */
153 friend inline std::ostream& operator<<(std::ostream& out, const JLine3EZ& object)
154 {
155 out << static_cast<const JLine3Z&>(object);
156 out << static_cast<const JEnergy&>(object);
157
158 return out;
159 }
160 };
161}
162
163#endif
Base class for data structures with artithmetic capabilities.
Data structure for fit of energy.
JEnergy & mul(const double value)
Multiplication operator.
JEnergy & div(const double value)
Division operator.
JEnergy & sub(const JEnergy &value)
Subtraction operator.
JEnergy & add(const JEnergy &value)
Addition operator.
JEnergy & negate()
Prefix unary minus.
Data structure for fit of straight line in positive z-direction with energy.
Definition JLine3EZ.hh:32
JLine3EZ()
Default constructor.
Definition JLine3EZ.hh:38
JLine3EZ & sub(const JLine3EZ &value)
Subtraction operator.
Definition JLine3EZ.hh:91
JLine3EZ & add(const JLine3EZ &value)
Addition operator.
Definition JLine3EZ.hh:76
friend std::ostream & operator<<(std::ostream &out, const JLine3EZ &object)
Write object to output.
Definition JLine3EZ.hh:153
friend std::istream & operator>>(std::istream &in, JLine3EZ &object)
Read object from input.
Definition JLine3EZ.hh:137
JLine3EZ & div(const double value)
Division operator.
Definition JLine3EZ.hh:121
JLine3EZ & mul(const double value)
Multiplication operator.
Definition JLine3EZ.hh:106
JLine3EZ & negate()
Prefix unary minus.
Definition JLine3EZ.hh:61
JLine3EZ(const JLine3Z &line, const JEnergy &x)
Constructor.
Definition JLine3EZ.hh:50
Data structure for fit of straight line in positive z-direction.
Definition JLine3Z.hh:40
JLine3Z & sub(const JLine3Z &value)
Subtraction operator.
Definition JLine3Z.hh:146
JLine3Z & negate()
Prefix unary minus.
Definition JLine3Z.hh:116
JLine3Z & div(const double value)
Division operator.
Definition JLine3Z.hh:176
JLine3Z & add(const JLine3Z &value)
Addition operator.
Definition JLine3Z.hh:131
JLine3Z & mul(const double value)
Multiplication operator.
Definition JLine3Z.hh:161
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