Jpp  test_elongated_shower_pde
the software that should make you happy
 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 
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  {
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
static parameter_type pDX()
Definition: JShower3Z.hh:171
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:110
double getT() const
Get time.
JShower3Z(const JPoint4D &point, const JVersor3Z &dir)
Constructor.
Definition: JShower3Z.hh:60
double JPoint4D::* parameter_type
Definition: JPoint4D.hh:56
JVersor3Z & negate()
Prefix unary minus.
Definition: JVersor3Z.hh:185
Data structure for vertex fit.
Definition: JPoint4D.hh:22
double JShower3Z::* parameter_type
Definition: JShower3Z.hh:169
JVersor3Z & sub(const JVersor3Z &value)
Subtraction operator.
Definition: JVersor3Z.hh:215
JVertex3D & add(const JVertex3D &value)
Addition operator.
Definition: JVertex3D.hh:87
JVertex3D & negate()
Prefix unary minus.
Definition: JVertex3D.hh:73
JShower3Z()
Default constructor.
Definition: JShower3Z.hh:49
JVertex3D & div(const double value)
Division operator.
Definition: JVertex3D.hh:132
JShower3Z & sub(const JShower3Z &value)
Subtraction operator.
Definition: JShower3Z.hh:99
JVersor3Z & add(const JVersor3Z &value)
Addition operator.
Definition: JVersor3Z.hh:200
JVertex3D & sub(const JVertex3D &value)
Subtraction operator.
Definition: JVertex3D.hh:102
JVersor3Z & mul(const double value)
Multiplication operator.
Definition: JVersor3Z.hh:230
JShower3Z & mul(const double value)
Multiplication operator.
Definition: JShower3Z.hh:113
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
JVertex3D & mul(const double value)
Multiplication operator.
Definition: JVertex3D.hh:117
JVersor3Z & div(const double value)
Division operator.
Definition: JVersor3Z.hh:245
JShower3Z & negate()
Prefix unary minus.
Definition: JShower3Z.hh:71
Data structure for cascade in positive z-direction.
Definition: JShower3Z.hh:32
const JVersor3Z & getDirection() const
Get direction.
Definition: JVersor3Z.hh:81
JShower3Z & add(const JShower3Z &value)
Addition operator.
Definition: JShower3Z.hh:85
static parameter_type pDY()
Definition: JShower3Z.hh:172
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:159
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:39
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
friend std::istream & operator>>(std::istream &in, JShower3Z &object)
Read object from input.
Definition: JShower3Z.hh:142
JShower3Z & div(const double value)
Divison operator.
Definition: JShower3Z.hh:127