Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JShowerEH.hh
Go to the documentation of this file.
1#ifndef __JSHOWEREH__
2#define __JSHOWEREH__
3
4#include <istream>
5#include <ostream>
6
7#include "JMath/JMath.hh"
8#include "JFit/JShower3Z.hh"
9#include "JFit/JEnergy.hh"
10
11
12/**
13 * \author adomi
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 JShowerEH :
29 public JShower3Z,
30 public JEnergy,
31 public JMath<JShowerEH>
32 {
33 public:
34
35 /**
36 * Default constructor.
37 */
39 JShower3Z(),
40 __Eem(0.0),
41 __Eh(0.0),
42 __By(0.0)
43 {}
44
45
46 /**
47 * Constructor.
48 *
49 * \param line line
50 * \param x EM shower energy
51 * \param h Hadronic shower energy
52 * \param By bjorken y
53 */
54 JShowerEH(const JShower3Z& line, const double x, const double h, const double By = 0.0) :
55 JShower3Z(line),
56 __Eem(x),
57 __Eh(h),
58 __By(By)
59 {}
60
61 /**
62 * Constructor.
63 *
64 * \param point point
65 * \param dir direction
66 * \param x EM shower energy
67 * \param h Hadronic shower energy
68 * \param By bjorken y
69 */
70 JShowerEH(const JPoint4D& point,
71 const JVersor3Z& dir,
72 const double x,
73 const double h,
74 const double By = 0.0):
75 JShower3Z(JPoint4D(point), JVersor3Z(dir)),
76 __Eem(x),
77 __Eh(h),
78 __By(By)
79 {}
80
81
82 /**
83 * Get EM Energy.
84 *
85 * \return EM Energy
86 */
87 double getEMEnergy() const
88 {
89 return __Eem;
90 }
91
92 /**
93 * Get Hadronic Energy.
94 *
95 * \return Hadronic Energy
96 */
97 double getHEnergy() const
98 {
99 return __Eh;
100 }
101
102 /**
103 * Get bjorken y
104 *
105 * \return bjorken y
106 */
107 double getBy() const
108 {
109 return __By;
110 }
111
112 /**
113 * Prefix unary minus.
114 *
115 * \return shower
116 */
118 {
120 __Eem = -__Eem;
121 __Eh = -__Eh;
122 __By = -__By;
123
124 return *this;
125 }
126
127 /**
128 * Addition operator.
129 *
130 * \param value shower
131 * \return shower
132 */
133 JShowerEH& add(const JShowerEH& value)
134 {
135 JShower3Z::add(value);
136 __Eem += value.getEMEnergy();
137 __Eh += value.getHEnergy();
138 __By += value.getBy();
139
140 return *this;
141 }
142
143
144 /**
145 * Subtraction operator.
146 *
147 * \param value shower
148 * \return shower
149 */
150 JShowerEH& sub(const JShowerEH& value)
151 {
152 JShower3Z::sub(value);
153 __Eem -= value.getEMEnergy();
154 __Eh -= value.getHEnergy();
155 __By -= value.getBy();
156
157 return *this;
158 }
159
160
161 /**
162 * Multiplication operator.
163 *
164 * \param value multiplication factor
165 * \return shower
166 */
167 JShowerEH& mul(const double value)
168 {
169 JShower3Z::mul(value);
170 __Eem *= value;
171 __Eh *= value;
172 __By *= value;
173
174 return *this;
175 }
176
177
178 /**
179 * Division operator.
180 *
181 * \param value division factor
182 * \return shower
183 */
184 JShowerEH& div(const double value)
185 {
186 JShower3Z::div(value);
187 __Eem /= value;
188 __Eh /= value;
189 __By /= value;
190
191 return *this;
192 }
193
194 /**
195 * Get EM energy.
196 *
197 * \return EM Energy [log(E/GeV)]
198 */
199 double getLogEem() const
200 {
201 return __Eem;
202 }
203
204 /**
205 * Get EM energy.
206 *
207 * \return EM Energy [GeV]
208 */
209 double getEem() const
210 {
211 return pow(10.0, __Eem);
212 }
213
214 /**
215 * Put EM energy.
216 *
217 * \param E Energy [GeV]
218 */
219 void putEem(const double E)
220 {
221 __Eem = log10(E);
222 }
223
224 /**
225 * Get derivative of energy.
226 *
227 * \return dE/dx [GeV]
228 */
229 double getDEem() const
230 {
231 return getEem() * log(10.0);
232 }
233
234 /**
235 * Get Hadronic energy.
236 *
237 * \return H Energy [log(E/GeV)]
238 */
239 double getLogEh() const
240 {
241 return __Eh;
242 }
243
244 /**
245 * Get Hadronic energy.
246 *
247 * \return H Energy [GeV]
248 */
249 double getEh() const
250 {
251 return pow(10.0, __Eh);
252 }
253
254 /**
255 * Put Hadronic energy.
256 *
257 * \param E Energy [GeV]
258 */
259 void putEh(const double E)
260 {
261 __Eh = log10(E);
262 }
263
264 /**
265 * Get derivative of energy.
266 *
267 * \return dE/dx [GeV]
268 */
269 double getDEh() const
270 {
271 return getEh() * log(10.0);
272 }
273
274
275 /**
276 * Read object from input.
277 *
278 * \param in input stream
279 * \param object object
280 * \return input stream
281 */
282 friend inline std::istream& operator>>(std::istream& in, JShowerEH& object)
283 {
284 in >> static_cast<JShower3Z&>(object);
285 in >> object.__Eem;
286 in >> object.__Eh;
287 in >> object.__By;
288
289 return in;
290 }
291
292
293 /**
294 * Write object to output.
295 *
296 * \param out output stream
297 * \param object object
298 * \return output stream
299 */
300 friend inline std::ostream& operator<<(std::ostream& out, const JShowerEH& object)
301 {
302 out << static_cast<const JShower3Z&>(object);
303 out << object.__Eem;
304 out << object.__Eh;
305 out << object.__By;
306
307 return out;
308 }
309
310 typedef double JShowerEH::*parameter_type;
311
313 static parameter_type pEh() { return &JShowerEH::__Eh; }
314 static parameter_type pBy() { return &JShowerEH::__By; }
315
316 protected:
317 double __Eem;
318 double __Eh;
319 double __By;
320 };
321}
322
323#endif
Base class for data structures with artithmetic capabilities.
Data structure for fit of energy.
Definition JEnergy.hh:31
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 & 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
Data structure for fit of straight line in positive z-direction with energy.
Definition JShowerEH.hh:32
double getHEnergy() const
Get Hadronic Energy.
Definition JShowerEH.hh:97
JShowerEH & add(const JShowerEH &value)
Addition operator.
Definition JShowerEH.hh:133
JShowerEH & sub(const JShowerEH &value)
Subtraction operator.
Definition JShowerEH.hh:150
JShowerEH(const JShower3Z &line, const double x, const double h, const double By=0.0)
Constructor.
Definition JShowerEH.hh:54
friend std::ostream & operator<<(std::ostream &out, const JShowerEH &object)
Write object to output.
Definition JShowerEH.hh:300
double getDEem() const
Get derivative of energy.
Definition JShowerEH.hh:229
double getDEh() const
Get derivative of energy.
Definition JShowerEH.hh:269
JShowerEH & div(const double value)
Division operator.
Definition JShowerEH.hh:184
JShowerEH & negate()
Prefix unary minus.
Definition JShowerEH.hh:117
double getEem() const
Get EM energy.
Definition JShowerEH.hh:209
static parameter_type pEem()
Definition JShowerEH.hh:312
JShowerEH(const JPoint4D &point, const JVersor3Z &dir, const double x, const double h, const double By=0.0)
Constructor.
Definition JShowerEH.hh:70
void putEem(const double E)
Put EM energy.
Definition JShowerEH.hh:219
friend std::istream & operator>>(std::istream &in, JShowerEH &object)
Read object from input.
Definition JShowerEH.hh:282
double getLogEem() const
Get EM energy.
Definition JShowerEH.hh:199
JShowerEH & mul(const double value)
Multiplication operator.
Definition JShowerEH.hh:167
JShowerEH()
Default constructor.
Definition JShowerEH.hh:38
double getEh() const
Get Hadronic energy.
Definition JShowerEH.hh:249
double getLogEh() const
Get Hadronic energy.
Definition JShowerEH.hh:239
static parameter_type pBy()
Definition JShowerEH.hh:314
double getEMEnergy() const
Get EM Energy.
Definition JShowerEH.hh:87
double getBy() const
Get bjorken y.
Definition JShowerEH.hh:107
double JShowerEH::* parameter_type
Definition JShowerEH.hh:310
void putEh(const double E)
Put Hadronic energy.
Definition JShowerEH.hh:259
static parameter_type pEh()
Definition JShowerEH.hh:313
Data structure for normalised vector in positive z-direction.
Definition JVersor3Z.hh:41
Auxiliary classes and methods for linear and iterative data regression.
Definition JEnergy.hh:15
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