Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
10 #include "JGeometry3D/JTrack3D.hh"
11 #include "JFit/JPoint4D.hh"
12 
13 /**
14  * \author lquinn
15  */
16 
17 namespace JFIT {}
18 namespace JPP { using namespace JFIT; }
19 
20 namespace JFIT {
21 
25 
26  /**
27  * Data structure for cascade in positive z-direction.
28  * Note that the position coordinates are defined with respect to the given direction.
29  */
30 
31  class JShower3Z :
32  public JPoint4D,
33  public JVersor3Z,
34  public JMATH::JMath<JShower3Z>
35  {
36  public:
37 
38  using JPoint4D::add;
39  using JPoint4D::sub;
40  using JPoint4D::getT;
41  using JVersor3Z::add;
42  using JVersor3Z::sub;
44 
45  /**
46  * Default constructor.
47  */
49  JPoint4D(),
50  JVersor3Z()
51  {}
52 
53  /**
54  * Constructor.
55  *
56  * \param point point
57  * \param dir direction
58  */
59  JShower3Z(const JPoint4D& point,
60  const JVersor3Z& dir):
61  JPoint4D(point),
62  JVersor3Z(dir)
63  {}
64 
65  /**
66  * Prefix unary minus.
67  *
68  * \return shower
69  */
71  {
74 
75  return *this;
76  }
77 
78  /**
79  * Addition operator.
80  *
81  * \param value shower
82  * \return shower
83  */
84  JShower3Z& add(const JShower3Z& value)
85  {
86  JPoint4D ::add(value);
87  JVersor3Z::add(value);
88 
89  return *this;
90  }
91 
92  /**
93  * Subtraction operator.
94  *
95  * \param value shower
96  * \return shower
97  */
98  JShower3Z& sub(const JShower3Z& value)
99  {
100  JPoint4D ::sub(value);
101  JVersor3Z::sub(value);
102 
103  return *this;
104  }
105 
106  /**
107  * Multiplication operator.
108  *
109  * \param value
110  * \return shower
111  */
112  JShower3Z& mul(const double value)
113  {
114  JPoint4D ::mul(value);
115  JVersor3Z::mul(value);
116 
117  return *this;
118  }
119 
120  /**
121  * Divison operator.
122  *
123  * \param value
124  * \return shower
125  */
126  JShower3Z& div(const double value)
127  {
128  JPoint4D ::div(value);
129  JVersor3Z::div(value);
130 
131  return *this;
132  }
133 
134  /**
135  * Read object from input.
136  *
137  * \param in input stream
138  * \param object object
139  * \return input stream
140  */
141  friend inline std::istream& operator>>(std::istream& in, JShower3Z& object)
142  {
143  in >> static_cast<JPoint4D&>(object);
144  in >> object.__dx;
145  in >> object.__dy;
146 
147  return in;
148  }
149 
150 
151  /**
152  * Write object to output.
153  *
154  * \param out output stream
155  * \param object object
156  * \return output stream
157  */
158  friend inline std::ostream& operator<<(std::ostream& out, const JShower3Z& object)
159  {
160  out << static_cast<const JPoint4D&>(object);
161  out << ' ' << object.__dx;
162  out << ' ' << object.__dy;
163 
164  return out;
165  }
166 
167 
168  typedef double JShower3Z::*parameter_type;
169 
170  static parameter_type pDX() { return &JShower3Z::__dx; }
171  static parameter_type pDY() { return &JShower3Z::__dy; }
172  };
173 }
174 #endif
static parameter_type pDX()
Definition: JShower3Z.hh:170
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:26
double getT() const
Get time.
JShower3Z(const JPoint4D &point, const JVersor3Z &dir)
Constructor.
Definition: JShower3Z.hh:59
double JPoint4D::* parameter_type
Definition: JPoint4D.hh:56
JVersor3Z & negate()
Prefix unary minus.
Definition: JVersor3Z.hh:182
Data structure for vertex fit.
Definition: JPoint4D.hh:22
double JShower3Z::* parameter_type
Definition: JShower3Z.hh:168
JVersor3Z & sub(const JVersor3Z &value)
Subtraction operator.
Definition: JVersor3Z.hh:212
JVertex3D & add(const JVertex3D &value)
Addition operator.
Definition: JVertex3D.hh:84
JVertex3D & negate()
Prefix unary minus.
Definition: JVertex3D.hh:70
JShower3Z()
Default constructor.
Definition: JShower3Z.hh:48
JVertex3D & div(const double value)
Division operator.
Definition: JVertex3D.hh:129
JShower3Z & sub(const JShower3Z &value)
Subtraction operator.
Definition: JShower3Z.hh:98
JVersor3Z & add(const JVersor3Z &value)
Addition operator.
Definition: JVersor3Z.hh:197
JVertex3D & sub(const JVertex3D &value)
Subtraction operator.
Definition: JVertex3D.hh:99
JVersor3Z & mul(const double value)
Multiplication operator.
Definition: JVersor3Z.hh:227
JShower3Z & mul(const double value)
Multiplication operator.
Definition: JShower3Z.hh:112
Data structure for vector in three dimensions.
Definition: JVector3D.hh:32
JVertex3D & mul(const double value)
Multiplication operator.
Definition: JVertex3D.hh:114
JVersor3Z & div(const double value)
Division operator.
Definition: JVersor3Z.hh:242
JShower3Z & negate()
Prefix unary minus.
Definition: JShower3Z.hh:70
Data structure for cascade in positive z-direction.
Definition: JShower3Z.hh:31
const JVersor3Z & getDirection() const
Get direction.
Definition: JVersor3Z.hh:78
JShower3Z & add(const JShower3Z &value)
Addition operator.
Definition: JShower3Z.hh:84
static parameter_type pDY()
Definition: JShower3Z.hh:171
Base class for data structures with artithmetic capabilities.
friend std::ostream & operator<<(std::ostream &out, const JShower3Z &object)
Write object to output.
Definition: JShower3Z.hh:158
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:36
friend std::istream & operator>>(std::istream &in, JShower3Z &object)
Read object from input.
Definition: JShower3Z.hh:141
JShower3Z & div(const double value)
Divison operator.
Definition: JShower3Z.hh:126