Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JShower3E.hh
Go to the documentation of this file.
1#ifndef __JSHOWER3E__
2#define __JSHOWER3E__
3
4#include <istream>
5#include <ostream>
6
8
11
12
13/**
14 * \author mdejong
15 */
16
17namespace JGEOMETRY3D {}
18namespace JPP { using namespace JGEOMETRY3D; }
19
20namespace JGEOMETRY3D {
21
22 using JIO::JReader;
23 using JIO::JWriter;
24
25 /**
26 * 3D shower with energy.
27 */
28 class JShower3E :
29 public JShower3D,
30 public JEnergy
31 {
32 public:
33 /**
34 * Default constructor.
35 */
37 JShower3D(),
38 JEnergy()
39 {}
40
41
42 /**
43 * Constructor.
44 *
45 * \param shower shower
46 * \param E energy at vertex
47 */
48 JShower3E(const JShower3D& shower,
49 const JEnergy& E) :
50 JShower3D(shower),
51 JEnergy(E)
52 {}
53
54
55 /**
56 * Read shower from input.
57 *
58 * \param in input stream
59 * \param shower shower
60 * \return input stream
61 */
62 friend inline std::istream& operator>>(std::istream& in, JShower3E& shower)
63 {
64 in >> static_cast<JShower3D&>(shower);
65 in >> static_cast<JEnergy&> (shower);
66
67 return in;
68 }
69
70
71 /**
72 * Write shower to output.
73 *
74 * \param out output stream
75 * \param shower shower
76 * \return output stream
77 */
78 friend inline std::ostream& operator<<(std::ostream& out, const JShower3E& shower)
79 {
80 out << static_cast<const JShower3D&>(shower);
81 out << ' ';
82 out << static_cast<const JEnergy&> (shower);
83
84 return out;
85 }
86
87
88 /**
89 * Read shower from input.
90 *
91 * \param in reader
92 * \param shower shower
93 * \return reader
94 */
95 friend inline JReader& operator>>(JReader& in, JShower3E& shower)
96 {
97 in >> static_cast<JShower3D&>(shower);
98 in >> static_cast<JEnergy&> (shower);
99
100 return in;
101 }
102
103
104 /**
105 * Write shower to output.
106 *
107 * \param out writer
108 * \param shower shower
109 * \return writer
110 */
111 friend inline JWriter& operator<<(JWriter& out, const JShower3E& shower)
112 {
113 out << static_cast<const JShower3D&>(shower);
114 out << static_cast<const JEnergy&> (shower);
115
116 return out;
117 }
118 };
119}
120
121#endif
3D shower with energy.
Definition JShower3E.hh:31
JShower3E(const JShower3D &shower, const JEnergy &E)
Constructor.
Definition JShower3E.hh:48
friend JWriter & operator<<(JWriter &out, const JShower3E &shower)
Write shower to output.
Definition JShower3E.hh:111
friend JReader & operator>>(JReader &in, JShower3E &shower)
Read shower from input.
Definition JShower3E.hh:95
friend std::ostream & operator<<(std::ostream &out, const JShower3E &shower)
Write shower to output.
Definition JShower3E.hh:78
friend std::istream & operator>>(std::istream &in, JShower3E &shower)
Read shower from input.
Definition JShower3E.hh:62
JShower3E()
Default constructor.
Definition JShower3E.hh:36
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).