StHbtBinaryReader.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. #ifndef StHbtBinaryReader_hh
  45. #define StHbtBinaryReader_hh
  46. class StFlowMaker;
  47. class StFlowEvent;
  48. class StFlowAnalysisMaker;
  49. class StHbtIOBinary;
  50. #include "StHbtMaker/Base/StHbtEventReader.hh"
  51. #include "StHbtMaker/Infrastructure/StHbtIOBinary.hh"
  52. #ifdef __ROOT__
  53. #include "StMaker.h"
  54. #include "StIOMaker/StIOMaker.h"
  55. #include "StIOInterFace.h"
  56. #endif
  57. #include <list>
  58. #if !defined(ST_NO_NAMESPACES)
  59. using std::list;
  60. #endif
  61. #ifdef ST_NO_TEMPLATE_DEF_ARGS
  62. typedef list<StHbtString*, allocator<StHbtString*> > fileCollection;
  63. typedef list<StHbtString*, allocator<StHbtString*> >::iterator fileIterator;
  64. #else
  65. typedef list<StHbtString*> fileCollection;
  66. typedef list<StHbtString*>::iterator fileIterator;
  67. #endif
  68. class StHbtBinaryReader : public StHbtEventReader{
  69. private:
  70. StHbtIOBinary* binaryIO;
  71. unsigned short mStHbtEventVersion;
  72. unsigned short mStHbtTrackVersion;
  73. unsigned short mStHbtV0Version;
  74. StFlowMaker* mFlowMaker; //!
  75. StFlowAnalysisMaker* mFlowAnalysisMaker; //!
  76. // int mReaderStatus; //!
  77. const char* mFileName; //!
  78. const char* mDirName; //!
  79. const char* mAppendix; //!
  80. fileCollection* mFileList; //!
  81. int mRetrieve;
  82. StHbtString mTheMessage;
  83. StHbtString mCurrentFile;
  84. void FillFileList(char* fileList);
  85. int NextFile();
  86. #ifdef __ROOT__
  87. StIOMaker* mIOMaker; //!
  88. #endif
  89. public:
  90. StHbtBinaryReader(const char* dir=0, const char* file="test", const char* appendix=0);
  91. #ifdef __ROOT__
  92. StHbtBinaryReader(StIOMaker* ioMaker, const char* dir="./", const char* file="test", const char* appendix=".microDst");
  93. #endif
  94. ~StHbtBinaryReader();
  95. // generic StHbtEventReader methods
  96. StHbtEvent* ReturnHbtEvent();
  97. int WriteHbtEvent(StHbtEvent*);
  98. int Init(const char* ReadWrite, StHbtString& Message);
  99. void Finish();
  100. StHbtString Report();
  101. // methods special to this Reader
  102. void SetDirName(const char*);
  103. void SetFileName(const char*);
  104. void SetAppendix(const char*);
  105. void AddFileList(const char*);
  106. void SetFlowMaker(StFlowMaker* flowMaker);
  107. void SetFlowAnalysisMaker(StFlowAnalysisMaker* flowAnal);
  108. private:
  109. void init(const char* dir, const char* file, const char* appendix);
  110. #ifdef __ROOT__
  111. ClassDef(StHbtBinaryReader, 0)
  112. #endif
  113. };
  114. inline void StHbtBinaryReader::SetFlowMaker(StFlowMaker* flowMaker){mFlowMaker = flowMaker;}
  115. inline void StHbtBinaryReader::SetFlowAnalysisMaker(StFlowAnalysisMaker* flowAnal) {
  116. mFlowAnalysisMaker = flowAnal;
  117. }
  118. #endif