Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JTrack3EY.hh
Go to the documentation of this file.
1#ifndef __JTRACK3EY__
2#define __JTRACK3EY__
3
4#include <istream>
5#include <ostream>
6
9#include "JLang/JManip.hh"
10
11
12/**
13 * \author mdejong, adomi
14 */
15
16namespace JGEOMETRY3D {}
17namespace JPP { using namespace JGEOMETRY3D; }
18
19namespace 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
I/O manipulators.
JFormat_t & getFormat()
Get format for given type.
Definition JManip.hh:682
3D track with energy and Bjorken Y.
Definition JTrack3EY.hh:31
friend JWriter & operator<<(JWriter &out, const JTrack3EY &track)
Write track to output.
Definition JTrack3EY.hh:160
friend std::ostream & operator<<(std::ostream &out, const JTrack3EY &track)
Write track to output.
Definition JTrack3EY.hh:125
double getBjY() const
Get Bjorken Y.
Definition JTrack3EY.hh:96
JTrack3EY(const JVector3D &pos, const JVersor3D &dir, const JTime &t0, const double E, const double Y)
Constructor.
Definition JTrack3EY.hh:64
JTrack3EY()
Default constructor.
Definition JTrack3EY.hh:36
JTrack3EY(const JVertex3D &vertex, const JVersor3D &dir, const double E, const double Y)
Constructor.
Definition JTrack3EY.hh:82
JTrack3EY(const JTrack3E &track, const double Y)
Constructor.
Definition JTrack3EY.hh:48
friend JReader & operator>>(JReader &in, JTrack3EY &track)
Read track from input.
Definition JTrack3EY.hh:144
friend std::istream & operator>>(std::istream &in, JTrack3EY &track)
Read track from input.
Definition JTrack3EY.hh:109
3D track with energy.
Definition JTrack3E.hh:32
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
Data structure for normalised vector in three dimensions.
Definition JVersor3D.hh:28
Interface for binary input.
Interface for binary output.
Interface for muon energy loss.
Definition JGeane.hh:39
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for format specifications.
Definition JManip.hh:524
Auxiliary class to temporarily define format specifications.
Definition JManip.hh:636