Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JBjorkenY.hh
Go to the documentation of this file.
1#ifndef __JGEOMETRY3D_JBJORKEN_Y__
2#define __JGEOMETRY3D_JBJORKEN_Y__
3
4#include <istream>
5#include <ostream>
6
8#include "JLang/JManip.hh"
9
10
11/**
12 * \author mdejong
13 */
14
15namespace JGEOMETRY3D {}
16namespace JPP { using namespace JGEOMETRY3D; }
17
18namespace JGEOMETRY3D {
19
20 using JIO::JReader;
21 using JIO::JWriter;
22
23
24 /**
25 * Bjorken-y.
26 */
28 {
29 public:
30 /**
31 * Default constructor.
32 */
34 __BY(0.0)
35 {}
36
37
38 /**
39 * Constructor.
40 *
41 * \param Y Bjorken-y
42 */
43 JBjorkenY(const double Y) :
44 __BY(Y)
45 {}
46
47
48 /**
49 * Set Bjorken-y.
50 *
51 * \param Y Bjorken-y
52 */
53 inline void setBjY(const double Y)
54 {
55 __BY = Y;
56 }
57
58
59 /**
60 * Get Borken-y.
61 *
62 * \return Bjorken-y
63 */
64 inline double getBjY() const
65 {
66 return __BY;
67 }
68
69
70 /**
71 * Read Bjorken-y from input.
72 *
73 * \param in input stream
74 * \param bjorkeny Bjorken-y
75 * \return input stream
76 */
77 friend inline std::istream& operator>>(std::istream& in, JBjorkenY& bjorkeny)
78 {
79 in >> bjorkeny.__BY;
80
81 return in;
82 }
83
84
85 /**
86 * Write Bjorken-y to output.
87 *
88 * \param out output stream
89 * \param bjorkeny bjorkeny
90 * \return output stream
91 */
92 friend inline std::ostream& operator<<(std::ostream& out, const JBjorkenY& bjorkeny)
93 {
94 const JFormat format(out, getFormat<JBjorkenY>(JFormat_t(7, 3, std::ios::scientific)));
95
96 out << bjorkeny.__BY;
97
98 return out;
99 }
100
101
102 /**
103 * Read Bjorken-y from input.
104 *
105 * \param in reader
106 * \param bjorkeny Bjorken-y
107 * \return reader
108 */
109 friend inline JReader& operator>>(JReader& in, JBjorkenY& bjorkeny)
110 {
111 in >> bjorkeny.__BY;
112
113 return in;
114 }
115
116
117 /**
118 * Write Bjorken-y to output.
119 *
120 * \param out writer
121 * \param bjorkeny Bjorken-y
122 * \return writer
123 */
124 friend inline JWriter& operator<<(JWriter& out, const JBjorkenY& bjorkeny)
125 {
126 out << bjorkeny.__BY;
127
128 return out;
129 }
130
131
132 protected:
133 double __BY;
134 };
135}
136
137#endif
I/O manipulators.
JFormat_t & getFormat()
Get format for given type.
Definition JManip.hh:682
double getBjY() const
Get Borken-y.
Definition JBjorkenY.hh:64
void setBjY(const double Y)
Set Bjorken-y.
Definition JBjorkenY.hh:53
JBjorkenY()
Default constructor.
Definition JBjorkenY.hh:33
friend JReader & operator>>(JReader &in, JBjorkenY &bjorkeny)
Read Bjorken-y from input.
Definition JBjorkenY.hh:109
JBjorkenY(const double Y)
Constructor.
Definition JBjorkenY.hh:43
friend std::ostream & operator<<(std::ostream &out, const JBjorkenY &bjorkeny)
Write Bjorken-y to output.
Definition JBjorkenY.hh:92
friend JWriter & operator<<(JWriter &out, const JBjorkenY &bjorkeny)
Write Bjorken-y to output.
Definition JBjorkenY.hh:124
friend std::istream & operator>>(std::istream &in, JBjorkenY &bjorkeny)
Read Bjorken-y from input.
Definition JBjorkenY.hh:77
Interface for binary input.
Interface for binary output.
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