Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  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 JShower3EZ :
29  public JShower3Z,
30  public JEnergy,
31  public JMath<JShower3EZ>
32  {
33  public:
34 
35  /**
36  * Default constructor.
37  */
39  JShower3Z(),
40  JEnergy()
41  {}
42 
43 
44  /**
45  * Constructor.
46  *
47  * \param line line
48  * \param x energy
49  * \param By bjorken y
50  */
51  JShower3EZ(const JShower3Z& line, const JEnergy& x, const double By = 1.0) :
52  JShower3Z(line),
53  JEnergy(x),
54  __By(By)
55  {}
56 
57  /**
58  * Constructor.
59  *
60  * \param point point
61  * \param dir direction
62  * \param x energy
63  * \param By bjorken y
64  */
65  JShower3EZ(const JPoint4D& point,
66  const JVersor3Z& dir,
67  const JEnergy& x,
68  const double By = 1.0):
69  JShower3Z(JPoint4D(point), JVersor3Z(dir)),
70  JEnergy(x),
71  __By(By)
72  {}
73 
74  /**
75  * Get bjorken y
76  *
77  * \return bjorken y
78  */
79  double getBy() const
80  {
81  return __By;
82  }
83 
84  /**
85  * Prefix unary minus.
86  *
87  * \return shower
88  */
90  {
93  __By = -__By;
94 
95  return *this;
96  }
97 
98 
99  /**
100  * Addition operator.
101  *
102  * \param value shower
103  * \return shower
104  */
105  JShower3EZ& add(const JShower3EZ& value)
106  {
107  JShower3Z::add(value);
108  JEnergy::add(value);
109  __By += value.getBy();
110 
111  return *this;
112  }
113 
114 
115  /**
116  * Subtraction operator.
117  *
118  * \param value shower
119  * \return shower
120  */
121  JShower3EZ& sub(const JShower3EZ& value)
122  {
123  JShower3Z::sub(value);
124  JEnergy::sub(value);
125  __By -= value.getBy();
126 
127  return *this;
128  }
129 
130 
131  /**
132  * Multiplication operator.
133  *
134  * \param value multiplication factor
135  * \return shower
136  */
137  JShower3EZ& mul(const double value)
138  {
139  JShower3Z::mul(value);
140  JEnergy::mul(value);
141  __By *= value;
142 
143  return *this;
144  }
145 
146 
147  /**
148  * Division operator.
149  *
150  * \param value division factor
151  * \return shower
152  */
153  JShower3EZ& div(const double value)
154  {
155  JShower3Z::div(value);
156  JEnergy::div(value);
157  __By /= value;
158 
159  return *this;
160  }
161 
162 
163  /**
164  * Read object from input.
165  *
166  * \param in input stream
167  * \param object object
168  * \return input stream
169  */
170  friend inline std::istream& operator>>(std::istream& in, JShower3EZ& object)
171  {
172  in >> static_cast<JShower3Z&>(object);
173  in >> static_cast<JEnergy&>(object);
174  in >> object.__By;
175 
176  return in;
177  }
178 
179 
180  /**
181  * Write object to output.
182  *
183  * \param out output stream
184  * \param object object
185  * \return output stream
186  */
187  friend inline std::ostream& operator<<(std::ostream& out, const JShower3EZ& object)
188  {
189  out << static_cast<const JShower3Z&>(object);
190  out << static_cast<const JEnergy&>(object);
191  out << object.__By;
192 
193  return out;
194  }
195 
196  typedef double JShower3EZ::*parameter_type;
197 
198  static parameter_type pBy() { return &JShower3EZ::__By; }
199 
200  protected:
201  double __By;
202  };
203 }
204 
205 #endif
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:110
Data structure for vertex fit.
Definition: JPoint4D.hh:22
JShower3EZ & sub(const JShower3EZ &value)
Subtraction operator.
Definition: JShower3EZ.hh:121
JShower3EZ()
Default constructor.
Definition: JShower3EZ.hh:38
JShower3EZ(const JShower3Z &line, const JEnergy &x, const double By=1.0)
Constructor.
Definition: JShower3EZ.hh:51
JShower3Z & sub(const JShower3Z &value)
Subtraction operator.
Definition: JShower3Z.hh:99
JEnergy & sub(const JEnergy &value)
Subtraction operator.
Definition: JEnergy.hh:118
friend std::istream & operator>>(std::istream &in, JShower3EZ &object)
Read object from input.
Definition: JShower3EZ.hh:170
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShower3EZ.hh:28
JShower3Z & mul(const double value)
Multiplication operator.
Definition: JShower3Z.hh:113
JEnergy & div(const double value)
Division operator.
Definition: JEnergy.hh:146
JShower3EZ(const JPoint4D &point, const JVersor3Z &dir, const JEnergy &x, const double By=1.0)
Constructor.
Definition: JShower3EZ.hh:65
JEnergy & negate()
Prefix unary minus.
Definition: JEnergy.hh:90
double JEnergy::* parameter_type
Definition: JEnergy.hh:261
static parameter_type pBy()
Definition: JShower3EZ.hh:198
double JShower3EZ::* parameter_type
Definition: JShower3EZ.hh:196
JShower3Z & negate()
Prefix unary minus.
Definition: JShower3Z.hh:71
Data structure for cascade in positive z-direction.
Definition: JShower3Z.hh:32
friend std::ostream & operator<<(std::ostream &out, const JShower3EZ &object)
Write object to output.
Definition: JShower3EZ.hh:187
JShower3EZ & add(const JShower3EZ &value)
Addition operator.
Definition: JShower3EZ.hh:105
JShower3Z & add(const JShower3Z &value)
Addition operator.
Definition: JShower3Z.hh:85
double getBy() const
Get bjorken y.
Definition: JShower3EZ.hh:79
Base class for data structures with artithmetic capabilities.
Data structure for fit of energy.
Definition: JEnergy.hh:28
JShower3EZ & div(const double value)
Division operator.
Definition: JShower3EZ.hh:153
JShower3EZ & negate()
Prefix unary minus.
Definition: JShower3EZ.hh:89
JShower3EZ & mul(const double value)
Multiplication operator.
Definition: JShower3EZ.hh:137
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
JEnergy & mul(const double value)
Multiplication operator.
Definition: JEnergy.hh:132
JEnergy & add(const JEnergy &value)
Addition operator.
Definition: JEnergy.hh:104
JShower3Z & div(const double value)
Divison operator.
Definition: JShower3Z.hh:127