00001
00002 #ifndef LHCBEVENT_CLHEPSTREAMS_H
00003 #define LHCBEVENT_CLHEPSTREAMS_H 1
00004
00005
00006
00007 #include "GaudiKernel/StreamBuffer.h"
00008 #include "GlastEvent/TopLevel/Definitions.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "CLHEP/Geometry/Point3D.h"
00027
00028
00029 inline StreamBuffer& operator<< ( StreamBuffer& s, const HepPoint3D& value) {
00030 return s << value.x() << value.y() << value.z();
00031 }
00032
00033 inline StreamBuffer& operator>> ( StreamBuffer& s, HepPoint3D& value ) {
00034 HepDouble x, y, z;
00035 s >> x >> y >> z;
00036 value.setX(x);
00037 value.setY(y);
00038 value.setZ(z);
00039 return s;
00040 }
00041
00042
00043
00044
00045 #include "CLHEP/Geometry/Vector3D.h"
00046
00047
00048 inline StreamBuffer& operator<< ( StreamBuffer& s, const HepVector3D& value) {
00049 return s << value.x() << value.y() << value.z();
00050 }
00051
00052 inline StreamBuffer& operator>> ( StreamBuffer& s, HepVector3D& value ) {
00053 HepDouble x, y, z;
00054 s >> x >> y >> z;
00055 value.setX(x);
00056 value.setY(y);
00057 value.setZ(z);
00058 return s;
00059 }
00060
00061
00062
00063
00064 #include "CLHEP/Vector/LorentzVector.h"
00065
00066
00067 inline StreamBuffer& operator<< ( StreamBuffer& s, const HepLorentzVector& value) {
00068 return s << HepDouble(value.px())
00069 << HepDouble(value.py())
00070 << HepDouble(value.pz())
00071 << HepDouble(value.e());
00072 }
00073
00074 inline StreamBuffer& operator>> ( StreamBuffer& s, HepLorentzVector& value ) {
00075 HepDouble px, py, pz, E;
00076 s >> px >> py >> pz >> E;
00077 value.setPx(px);
00078 value.setPy(py);
00079 value.setPz(pz);
00080 value.setE(E);
00081 return s;
00082 }
00083
00084
00085
00086
00087 #include "CLHEP/Matrix/SymMatrix.h"
00088
00089
00090 inline StreamBuffer& operator<< ( StreamBuffer& s, const HepSymMatrix& value ) {
00091 int nrow = value.num_row();
00092 for( int i=1; i<=nrow; i++ ) {
00093 for( int j=1; j<=i; j++ ) {
00094 s << value(i,j);
00095 }
00096 }
00097 return s;
00098 }
00099
00100 inline StreamBuffer& operator>> ( StreamBuffer& s, HepSymMatrix& value ) {
00101 int nrow = value.num_row();
00102 for( int i=1; i<=nrow; i++ ) {
00103 for( int j=1; j<=i; j++ ) {
00104 s >> value(i,j);
00105 }
00106 }
00107 return s;
00108 }
00109
00110
00111 #endif // LHCBEVENT_CLHEPSTREAMS_H