7 #ifndef StHbtIOBinary_hh
8 #define StHbtIOBinary_hh
11 #include "StHbtMaker/Infrastructure/StHbtV0.hh"
12 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
13 #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
14 #include "StarClassLibrary/StPhysicalHelix.hh"
20 typedef unsigned int colSizeType;
29 enum ioStatus { ioOK=0, ioERR, ioEOF, ioEOL, ioERROpen };
40 StHbtIOBinary(
const char* dirName,
const char* fileName,
const char* appendix,
const char* readWrite);
44 template<
class T>
int read(T& x);
45 template<
class T>
int write(
const T& x);
47 int read(
unsigned short x) {
return 0;}
49 int read(
const StHbtV0) {
return 0;};
51 int write(
unsigned short x) {
return 0;}
52 int write(
const StHbtV0) {
return 0;}
60 int read(
StHbtEvent& event,
unsigned short evVersion,
unsigned short trVersion,
unsigned short v0Version );
61 int write(
const StHbtEvent& event,
unsigned short evVersion,
unsigned short trVersion,
unsigned short v0Version );
66 int read(
StHbtV0&,
unsigned short);
67 int write(
const StHbtV0&,
unsigned short);
69 int readString(StHbtString&);
70 int writeString(
const StHbtString&);
71 int readHeader(StHbtString&);
72 int writeHeader(
const StHbtString&);
77 int read_V0(
StHbtEvent& event,
unsigned short trVersion,
unsigned short v0Version );
78 int read_V1(
StHbtEvent& event,
unsigned short trVersion,
unsigned short v0Version );
79 int read_V2(
StHbtEvent& event,
unsigned short trVersion,
unsigned short v0Version );
80 int write_V0(
const StHbtEvent& event,
unsigned short trVersion,
unsigned short v0Version );
81 int write_V1(
const StHbtEvent& event,
unsigned short trVersion,
unsigned short v0Version );
82 int write_V2(
const StHbtEvent& event,
unsigned short trVersion,
unsigned short v0Version );
96 int outputStreamStatus();
97 int inputStreamStatus();
99 int readTrackList(
StHbtEvent&,
unsigned short trVersion);
100 int readV0List(
StHbtEvent&,
unsigned short v0Version);
101 int writeTrackList(
const StHbtEvent&,
unsigned short trVersion);
102 int writeV0List(
const StHbtEvent&,
unsigned short v0Version);
104 const char* parseDirFile(
const char*,
const char*,
const char*);
106 void wait(
int n,
const char* c) {
107 for (
int i = 0; i< 1e6*n; i++) {
113 inline int StHbtIOBinary::outputStreamStatus() {
114 if (mOStream)
return !mOStream->good();
117 inline int StHbtIOBinary::inputStreamStatus() {
118 if (mIStream)
return !mIStream->good();
124 inline int StHbtIOBinary::read(T& x){
125 mIStream->read( (
char*)&x,
sizeof(x) );
126 byteCounterEvent +=
sizeof(x);
127 return (!mIStream->good());
130 inline int StHbtIOBinary::write(
const T& x){
131 mOStream->write( (
char*)&x,
sizeof(x) );
132 byteCounterEvent +=
sizeof(x);
133 return (!mOStream->good());
144 return (!mIStream->good());
150 a = x.x(); b = x.y(); c = x.z();
154 return (!mOStream->good());
158 double c, dip, phase;
167 return (!mIStream->good());
172 double c, dip, phase;
185 return (!mOStream->good());
int h() const
y-center of circle in xy-plane
const StThreeVector< double > & origin() const
-sign(q*B);
double phase() const
1/R in xy-plane