StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtBinaryReader.h
1 /***************************************************************************
2  *
3  * $Id: StHbtBinaryReader.h,v 1.15 2001/09/05 20:42:18 laue Exp $
4  *
5  * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * This is the HbtEventReader class to be used when reading/writing
10  * BINARY files.
11  *
12  ***************************************************************************
13  *
14  * $Log: StHbtBinaryReader.h,v $
15  * Revision 1.15 2001/09/05 20:42:18 laue
16  * Updates of the hbtMuDstTree microDSTs
17  *
18  * Revision 1.13 2001/06/21 19:18:42 laue
19  * Modified Files: (to match the changed base classes)
20  * StHbtAsciiReader.cxx StHbtAsciiReader.h
21  * StHbtAssociationReader.cxx StHbtAssociationReader.h
22  * StHbtBinaryReader.cxx StHbtBinaryReader.h
23  * StHbtGstarTxtReader.cxx StHbtGstarTxtReader.h
24  * StHbtStrangeMuDstEventReader.cxx
25  * StHbtStrangeMuDstEventReader.h StStandardHbtEventReader.cxx
26  * Added Files: new reader
27  * StHbtTTreeReader.cxx StHbtTTreeReader.h
28  *
29  * Revision 1.12 2001/06/04 19:09:53 rcwells
30  * Adding B-field, run number, and improved reaction plane functionality
31  *
32  * Revision 1.11 2001/05/10 21:01:30 laue
33  * reduced output via new member 'mDebug' in StHbtEventReader (base)
34  *
35  * Revision 1.10 2000/08/25 15:12:58 laue
36  * Bux-fix. Private copy of mReaderStatus deleted. Now mReaderStatus from base
37  * is used. This will lead to termination of the event loop if no more
38  * files/events are left to read.
39  *
40  * Revision 1.9 2000/05/25 21:04:30 laue
41  * StStandarsHbtEventReader updated for the new StStrangMuDstMaker
42  *
43  **************************************************************************/
44 
45 #ifndef StHbtBinaryReader_hh
46 #define StHbtBinaryReader_hh
47 
48 
49 class StFlowMaker;
50 class StFlowEvent;
52 class StHbtIOBinary;
53 
54 #include "StHbtMaker/Base/StHbtEventReader.hh"
55 #include "StHbtMaker/Infrastructure/StHbtIOBinary.hh"
56 
57 #ifdef __ROOT__
58 #include "StMaker.h"
59 #include "StIOMaker/StIOMaker.h"
60 #include "StIOInterFace.h"
61 #endif
62 
63 #include <list>
64 #if !defined(ST_NO_NAMESPACES)
65 using std::list;
66 #endif
67 #ifdef ST_NO_TEMPLATE_DEF_ARGS
68 typedef list<StHbtString*, allocator<StHbtString*> > fileCollection;
69 typedef list<StHbtString*, allocator<StHbtString*> >::iterator fileIterator;
70 #else
71 typedef list<StHbtString*> fileCollection;
72 typedef list<StHbtString*>::iterator fileIterator;
73 #endif
74 
75 
77 
78 private:
79  StHbtIOBinary* binaryIO;
80 
81  unsigned short mStHbtEventVersion;
82  unsigned short mStHbtTrackVersion;
83  unsigned short mStHbtV0Version;
84 
85  StFlowMaker* mFlowMaker;
86  StFlowAnalysisMaker* mFlowAnalysisMaker;
87 
88  // int mReaderStatus; //!
89 
90  const char* mFileName;
91  const char* mDirName;
92  const char* mAppendix;
93  fileCollection* mFileList;
94  int mRetrieve;
95  StHbtString mTheMessage;
96  StHbtString mCurrentFile;
97 
98  void FillFileList(char* fileList);
99  int NextFile();
100 
101 #ifdef __ROOT__
102  StIOMaker* mIOMaker;
103 #endif
104 
105 public:
106  StHbtBinaryReader(const char* dir=0, const char* file="test", const char* appendix=0);
107 #ifdef __ROOT__
108  StHbtBinaryReader(StIOMaker* ioMaker, const char* dir="./", const char* file="test", const char* appendix=".microDst");
109 #endif
111 
112  // generic StHbtEventReader methods
113  StHbtEvent* ReturnHbtEvent();
114  int WriteHbtEvent(StHbtEvent*);
115  int Init(const char* ReadWrite, StHbtString& Message);
116  void Finish();
117  StHbtString Report();
118 
119  // methods special to this Reader
120  void SetDirName(const char*);
121  void SetFileName(const char*);
122  void SetAppendix(const char*);
123  void AddFileList(const char*);
124  void SetFlowMaker(StFlowMaker* flowMaker);
125  void SetFlowAnalysisMaker(StFlowAnalysisMaker* flowAnal);
126 
127  private:
128  void init(const char* dir, const char* file, const char* appendix);
129 
130 #ifdef __ROOT__
131  ClassDef(StHbtBinaryReader, 0)
132 #endif
133 
134 
135 };
136 inline void StHbtBinaryReader::SetFlowMaker(StFlowMaker* flowMaker){mFlowMaker = flowMaker;}
137 inline void StHbtBinaryReader::SetFlowAnalysisMaker(StFlowAnalysisMaker* flowAnal) {
138  mFlowAnalysisMaker = flowAnal;
139 }
140 
141 #endif