Jpp  18.2.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JTrack3EY.hh
Go to the documentation of this file.
1 #ifndef __JTRACK3EY__
2 #define __JTRACK3EY__
3 
4 #include <istream>
5 #include <ostream>
6 
8 #include "JIO/JSerialisable.hh"
9 #include "JLang/JManip.hh"
10 
11 
12 /**
13  * \author mdejong, adomi
14  */
15 
16 namespace JGEOMETRY3D {}
17 namespace JPP { using namespace JGEOMETRY3D; }
18 
19 namespace JGEOMETRY3D {
20 
21  using JIO::JReader;
22  using JIO::JWriter;
23  using JPHYSICS::JGeane;
24 
25 
26  /**
27  * 3D track with energy and Bjorken Y.
28  */
29  class JTrack3EY :
30  public JTrack3E
31  {
32  public:
33  /**
34  * Default constructor.
35  */
37  JTrack3E(),
38  __Y(0.0)
39  {}
40 
41 
42  /**
43  * Constructor.
44  *
45  * \param track track
46  * \param Y Bjorken Y
47  */
48  JTrack3EY(const JTrack3E& track,
49  const double Y) :
50  JTrack3E(track),
51  __Y(Y)
52  {}
53 
54 
55  /**
56  * Constructor.
57  *
58  * \param pos position
59  * \param dir direction
60  * \param t0 time at vertex
61  * \param E energy at vertex
62  * \param Y Bjorken Y
63  */
64  JTrack3EY(const JVector3D& pos,
65  const JVersor3D& dir,
66  const JTime& t0,
67  const double E,
68  const double Y) :
69  JTrack3E(pos, dir, t0, E),
70  __Y(Y)
71  {}
72 
73 
74  /**
75  * Constructor.
76  *
77  * \param vertex vertex
78  * \param dir direction
79  * \param E energy at vertex
80  * \param Y Bjorken Y
81  */
82  JTrack3EY(const JVertex3D& vertex,
83  const JVersor3D& dir,
84  const double E,
85  const double Y) :
86  JTrack3E(vertex, dir, E),
87  __Y(Y)
88  {}
89 
90 
91  /**
92  * Get Bjorken Y.
93  *
94  * \return Bjorken Y
95  */
96  inline double getBjY() const
97  {
98  return __Y;
99  }
100 
101 
102  /**
103  * Read track from input.
104  *
105  * \param in input stream
106  * \param track track
107  * \return input stream
108  */
109  friend inline std::istream& operator>>(std::istream& in, JTrack3EY& track)
110  {
111  in >> static_cast<JTrack3E&>(track);
112  in >> track.__Y;
113 
114  return in;
115  }
116 
117 
118  /**
119  * Write track to output.
120  *
121  * \param out output stream
122  * \param track track
123  * \return output stream
124  */
125  friend inline std::ostream& operator<<(std::ostream& out, const JTrack3EY& track)
126  {
127  const JFormat format(out, getFormat<JTrack3EY>(JFormat_t(9, 3, std::ios::fixed | std::ios::showpos)));
128 
129  out << static_cast<const JTrack3E&>(track);
130  out << ' ';
131  out << format << track.__Y;
132 
133  return out;
134  }
135 
136 
137  /**
138  * Read track from input.
139  *
140  * \param in reader
141  * \param track track
142  * \return reader
143  */
144  friend inline JReader& operator>>(JReader& in, JTrack3EY& track)
145  {
146  in >> static_cast<JTrack3E&>(track);
147  in >> track.__Y;
148 
149  return in;
150  }
151 
152 
153  /**
154  * Write track to output.
155  *
156  * \param out writer
157  * \param track track
158  * \return writer
159  */
160  friend inline JWriter& operator<<(JWriter& out, const JTrack3EY& track)
161  {
162  out << static_cast<const JTrack3E&>(track);
163  out << track.__Y;
164 
165  return out;
166  }
167 
168  protected:
169  double __Y;
170  };
171 }
172 
173 #endif
Interface for binary output.
double getBjY() const
Get Bjorken Y.
Definition: JTrack3EY.hh:96
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
friend std::istream & operator>>(std::istream &in, JTrack3EY &track)
Read track from input.
Definition: JTrack3EY.hh:109
friend JWriter & operator<<(JWriter &out, const JTrack3EY &track)
Write track to output.
Definition: JTrack3EY.hh:160
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
3D track with energy and Bjorken Y.
Definition: JTrack3EY.hh:29
3D track with energy.
Definition: JTrack3E.hh:30
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:632
JTrack3EY(const JVertex3D &vertex, const JVersor3D &dir, const double E, const double Y)
Constructor.
Definition: JTrack3EY.hh:82
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Interface for binary input.
Interface for muon energy loss.
Definition: JGeane.hh:39
I/O manipulators.
JTrack3EY(const JVector3D &pos, const JVersor3D &dir, const JTime &t0, const double E, const double Y)
Constructor.
Definition: JTrack3EY.hh:64
friend JReader & operator>>(JReader &in, JTrack3EY &track)
Read track from input.
Definition: JTrack3EY.hh:144
JTrack3EY()
Default constructor.
Definition: JTrack3EY.hh:36
friend std::ostream & operator<<(std::ostream &out, const JTrack3EY &track)
Write track to output.
Definition: JTrack3EY.hh:125
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
JTrack3EY(const JTrack3E &track, const double Y)
Constructor.
Definition: JTrack3EY.hh:48
Data structure for format specifications.
Definition: JManip.hh:522