Jpp
JShower3EZ.hh
Go to the documentation of this file.
1 #ifndef __JSHOWER3EZ__
2 #define __JSHOWER3EZ__
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 lquinn
14  */
15 
16 namespace JFIT {}
17 namespace JPP { using namespace JFIT; }
18 
19 namespace JFIT {
20 
21  /**
22  * Data structure for fit of straight line in positive z-direction with energy.
23  * Note that the position coordinates are defined with respect to the given direction.
24  */
25  class JShower3EZ :
26  public JShower3Z,
27  public JEnergy,
28  public JMATH::JMath<JShower3EZ>
29  {
30  public:
31 
32  /**
33  * Default constructor.
34  */
36  JShower3Z(),
37  JEnergy()
38  {}
39 
40 
41  /**
42  * Constructor.
43  *
44  * \param line line
45  * \param x energy
46  * \param By bjorken y
47  */
48  JShower3EZ(const JShower3Z& line, const JEnergy& x, const double By = 1.0) :
49  JShower3Z(line),
50  JEnergy(x),
51  __By(By)
52  {}
53 
54  /**
55  * Constructor.
56  *
57  * \param point point
58  * \param dir direction
59  * \param x energy
60  * \param By bjorken y
61  */
62  JShower3EZ(const JPoint4D& point,
63  const JVersor3Z& dir,
64  const JEnergy& x,
65  const double By = 1.0):
66  JShower3Z(JPoint4D(point), JVersor3Z(dir)),
67  JEnergy(x),
68  __By(By)
69  {}
70 
71  /**
72  * Get bjorken y
73  *
74  * \return bjorken y
75  */
76  double getBy() const
77  {
78  return __By;
79  }
80 
81  /**
82  * Prefix unary minus.
83  *
84  * \return shower
85  */
87  {
90  __By = -__By;
91 
92  return *this;
93  }
94 
95 
96  /**
97  * Addition operator.
98  *
99  * \param value shower
100  * \return shower
101  */
102  JShower3EZ& add(const JShower3EZ& value)
103  {
104  JShower3Z::add(value);
105  JEnergy::add(value);
106  __By += value.getBy();
107 
108  return *this;
109  }
110 
111 
112  /**
113  * Subtraction operator.
114  *
115  * \param value shower
116  * \return shower
117  */
118  JShower3EZ& sub(const JShower3EZ& value)
119  {
120  JShower3Z::sub(value);
121  JEnergy::sub(value);
122  __By -= value.getBy();
123 
124  return *this;
125  }
126 
127 
128  /**
129  * Multiplication operator.
130  *
131  * \param value multiplication factor
132  * \return shower
133  */
134  JShower3EZ& mul(const double value)
135  {
136  JShower3Z::mul(value);
137  JEnergy::mul(value);
138  __By *= value;
139 
140  return *this;
141  }
142 
143 
144  /**
145  * Division operator.
146  *
147  * \param value division factor
148  * \return shower
149  */
150  JShower3EZ& div(const double value)
151  {
152  JShower3Z::div(value);
153  JEnergy::div(value);
154  __By /= value;
155 
156  return *this;
157  }
158 
159 
160  /**
161  * Read object from input.
162  *
163  * \param in input stream
164  * \param object object
165  * \return input stream
166  */
167  friend inline std::istream& operator>>(std::istream& in, JShower3EZ& object)
168  {
169  in >> static_cast<JShower3Z&>(object);
170  in >> static_cast<JEnergy&>(object);
171  in >> object.__By;
172 
173  return in;
174  }
175 
176 
177  /**
178  * Write object to output.
179  *
180  * \param out output stream
181  * \param object object
182  * \return output stream
183  */
184  friend inline std::ostream& operator<<(std::ostream& out, const JShower3EZ& object)
185  {
186  out << static_cast<const JShower3Z&>(object);
187  out << static_cast<const JEnergy&>(object);
188  out << object.__By;
189 
190  return out;
191  }
192 
193  typedef double JShower3EZ::*parameter_type;
194 
195  static parameter_type pBy() { return &JShower3EZ::__By; }
196 
197  protected:
198  double __By;
199  };
200 }
201 
202 #endif
JFIT::JShower3EZ::JShower3EZ
JShower3EZ(const JPoint4D &point, const JVersor3Z &dir, const JEnergy &x, const double By=1.0)
Constructor.
Definition: JShower3EZ.hh:62
JFIT::JShower3EZ::negate
JShower3EZ & negate()
Prefix unary minus.
Definition: JShower3EZ.hh:86
JFIT::JShower3EZ::JShower3EZ
JShower3EZ()
Default constructor.
Definition: JShower3EZ.hh:35
JFIT::JEnergy
Data structure for fit of energy.
Definition: JEnergy.hh:24
JFIT
Auxiliary classes and methods for linear and iterative data regression.
Definition: JEnergy.hh:15
JFIT::JShower3Z::div
JShower3Z & div(const double value)
Divison operator.
Definition: JShower3Z.hh:126
JFIT::JShower3EZ
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShower3EZ.hh:25
JFIT::JShower3EZ::pBy
static parameter_type pBy()
Definition: JShower3EZ.hh:195
JGEOMETRY3D::JVersor3Z
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:37
JFIT::JEnergy::mul
JEnergy & mul(const double value)
Multiplication operator.
Definition: JEnergy.hh:106
JFIT::JEnergy::parameter_type
double JEnergy::* parameter_type
Definition: JEnergy.hh:235
JFIT::JShower3Z::mul
JShower3Z & mul(const double value)
Multiplication operator.
Definition: JShower3Z.hh:112
JFIT::JShower3EZ::getBy
double getBy() const
Get bjorken y.
Definition: JShower3EZ.hh:76
JMATH::JMath
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:26
JFIT::JShower3EZ::JShower3EZ
JShower3EZ(const JShower3Z &line, const JEnergy &x, const double By=1.0)
Constructor.
Definition: JShower3EZ.hh:48
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JFIT::JShower3EZ::add
JShower3EZ & add(const JShower3EZ &value)
Addition operator.
Definition: JShower3EZ.hh:102
JShower3Z.hh
JFIT::JShower3EZ::div
JShower3EZ & div(const double value)
Division operator.
Definition: JShower3EZ.hh:150
JFIT::JShower3Z::negate
JShower3Z & negate()
Prefix unary minus.
Definition: JShower3Z.hh:70
JFIT::JShower3Z::sub
JShower3Z & sub(const JShower3Z &value)
Subtraction operator.
Definition: JShower3Z.hh:98
JFIT::JShower3Z
Data structure for cascade in positive z-direction.
Definition: JShower3Z.hh:31
JFIT::JShower3EZ::operator<<
friend std::ostream & operator<<(std::ostream &out, const JShower3EZ &object)
Write object to output.
Definition: JShower3EZ.hh:184
JFIT::JShower3Z::add
JShower3Z & add(const JShower3Z &value)
Addition operator.
Definition: JShower3Z.hh:84
JFIT::JPoint4D
Data structure for vertex fit.
Definition: JPoint4D.hh:22
JFIT::JEnergy::negate
JEnergy & negate()
Prefix unary minus.
Definition: JEnergy.hh:64
JFIT::JEnergy::sub
JEnergy & sub(const JEnergy &value)
Subtraction operator.
Definition: JEnergy.hh:92
JMath.hh
JFIT::JShower3EZ::__By
double __By
Definition: JShower3EZ.hh:198
JFIT::JEnergy::div
JEnergy & div(const double value)
Division operator.
Definition: JEnergy.hh:120
JFIT::JShower3EZ::mul
JShower3EZ & mul(const double value)
Multiplication operator.
Definition: JShower3EZ.hh:134
JEnergy.hh
JFIT::JEnergy::add
JEnergy & add(const JEnergy &value)
Addition operator.
Definition: JEnergy.hh:78
JFIT::JShower3EZ::parameter_type
double JShower3EZ::* parameter_type
Definition: JShower3EZ.hh:193
JFIT::JShower3EZ::operator>>
friend std::istream & operator>>(std::istream &in, JShower3EZ &object)
Read object from input.
Definition: JShower3EZ.hh:167
JFIT::JShower3EZ::sub
JShower3EZ & sub(const JShower3EZ &value)
Subtraction operator.
Definition: JShower3EZ.hh:118