00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef StHbtBinaryReader_hh
00046 #define StHbtBinaryReader_hh
00047
00048
00049 class StFlowMaker;
00050 class StFlowEvent;
00051 class StFlowAnalysisMaker;
00052 class StHbtIOBinary;
00053
00054 #include "StHbtMaker/Base/StHbtEventReader.hh"
00055 #include "StHbtMaker/Infrastructure/StHbtIOBinary.hh"
00056
00057 #ifdef __ROOT__
00058 #include "StMaker.h"
00059 #include "StIOMaker/StIOMaker.h"
00060 #include "StIOInterFace.h"
00061 #endif
00062
00063 #include <list>
00064 #if !defined(ST_NO_NAMESPACES)
00065 using std::list;
00066 #endif
00067 #ifdef ST_NO_TEMPLATE_DEF_ARGS
00068 typedef list<StHbtString*, allocator<StHbtString*> > fileCollection;
00069 typedef list<StHbtString*, allocator<StHbtString*> >::iterator fileIterator;
00070 #else
00071 typedef list<StHbtString*> fileCollection;
00072 typedef list<StHbtString*>::iterator fileIterator;
00073 #endif
00074
00075
00076 class StHbtBinaryReader : public StHbtEventReader{
00077
00078 private:
00079 StHbtIOBinary* binaryIO;
00080
00081 unsigned short mStHbtEventVersion;
00082 unsigned short mStHbtTrackVersion;
00083 unsigned short mStHbtV0Version;
00084
00085 StFlowMaker* mFlowMaker;
00086 StFlowAnalysisMaker* mFlowAnalysisMaker;
00087
00088
00089
00090 const char* mFileName;
00091 const char* mDirName;
00092 const char* mAppendix;
00093 fileCollection* mFileList;
00094 int mRetrieve;
00095 StHbtString mTheMessage;
00096 StHbtString mCurrentFile;
00097
00098 void FillFileList(char* fileList);
00099 int NextFile();
00100
00101 #ifdef __ROOT__
00102 StIOMaker* mIOMaker;
00103 #endif
00104
00105 public:
00106 StHbtBinaryReader(const char* dir=0, const char* file="test", const char* appendix=0);
00107 #ifdef __ROOT__
00108 StHbtBinaryReader(StIOMaker* ioMaker, const char* dir="./", const char* file="test", const char* appendix=".microDst");
00109 #endif
00110 ~StHbtBinaryReader();
00111
00112
00113 StHbtEvent* ReturnHbtEvent();
00114 int WriteHbtEvent(StHbtEvent*);
00115 int Init(const char* ReadWrite, StHbtString& Message);
00116 void Finish();
00117 StHbtString Report();
00118
00119
00120 void SetDirName(const char*);
00121 void SetFileName(const char*);
00122 void SetAppendix(const char*);
00123 void AddFileList(const char*);
00124 void SetFlowMaker(StFlowMaker* flowMaker);
00125 void SetFlowAnalysisMaker(StFlowAnalysisMaker* flowAnal);
00126
00127 private:
00128 void init(const char* dir, const char* file, const char* appendix);
00129
00130 #ifdef __ROOT__
00131 ClassDef(StHbtBinaryReader, 0)
00132 #endif
00133
00134
00135 };
00136 inline void StHbtBinaryReader::SetFlowMaker(StFlowMaker* flowMaker){mFlowMaker = flowMaker;}
00137 inline void StHbtBinaryReader::SetFlowAnalysisMaker(StFlowAnalysisMaker* flowAnal) {
00138 mFlowAnalysisMaker = flowAnal;
00139 }
00140
00141 #endif