StHbtTTreeReader.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /***************************************************************************
  2. *
  3. * $Id: StHbtTTreeReader.h,v 1.3 2001/12/05 14:42:17 laue Exp $
  4. *
  5. * Author: Frank Laue, BNL, laue@bnl.gov
  6. ***************************************************************************/
  7. #ifndef StHbtTTreeReader_hh
  8. #define StHbtTTreeReader_hh
  9. #include "StHbtMaker/Base/StHbtEventReader.hh"
  10. #include "StHbtMaker/Infrastructure/StHbtEnumeration.hh"
  11. #include "StMaker.h"
  12. #include "StChain.h"
  13. #include "St_DataSetIter.h"
  14. #include "StEvent/StEnumerations.h"
  15. #include "StStrangeMuDstMaker/StStrangeMuDstMaker.h"
  16. #include <string>
  17. class StHbtEvent;
  18. class StHbtTTreeEvent;
  19. class StIOMaker;
  20. class TFile;
  21. class TTree;
  22. class TChain;
  23. class StHbtTTreeReader : public StHbtEventReader {
  24. private:
  25. StIOMaker* mIOMaker;
  26. StTrackType mTrackType;
  27. StHbtIOMode mIOMode;
  28. string mCurrentFileName;
  29. string mDir;
  30. string mFile;
  31. string mExtention;
  32. string mFilter;
  33. int mMaxFiles;
  34. int mDebug;
  35. TChain* mTChain; //!
  36. TFile* mCurrentFile; //!
  37. TTree* mTTree; //!
  38. int split; // by default split Event into sub branches
  39. int comp; // by default file is compressed
  40. int bufsize; // buffersize
  41. string mInputDir; //!
  42. StHbtTTreeEvent* mHbtTTreeEvent; //!
  43. StHbtEvent* mHbtEvent; //!
  44. unsigned int mEventIndex;
  45. StHbtEvent* read();
  46. int initRead(string dir, string file, string filter, string extention, int mMaxFiles);
  47. int uninitRead();
  48. StHbtEvent* write(StHbtEvent*);
  49. int initWrite(string, string);
  50. int uninitWrite();
  51. int fillChain(TChain* chain, const char* dir, const char* filter, const char* extention, const int maxFiles);
  52. int fillChain(TChain* chain, const char* list, const int maxFiles);
  53. protected:
  54. public:
  55. StHbtTTreeReader(StHbtIOMode mode, StIOMaker* io,
  56. const char* dirName, const char* fileName, const char* extention=".hbtTTreeMuDst",
  57. const char* filter=".", int maxFiles=99999);
  58. ~StHbtTTreeReader();
  59. StHbtEvent* ReturnHbtEvent();
  60. int WriteHbtEvent(StHbtEvent*);
  61. StHbtString Report();
  62. StTrackType TrackType();
  63. void SetTrackType(StTrackType);
  64. void SetDebug(int);
  65. ClassDef(StHbtTTreeReader, 1)
  66. };
  67. inline StTrackType StHbtTTreeReader::TrackType() { return mTrackType;}
  68. inline void StHbtTTreeReader::SetTrackType(StTrackType t) { mTrackType=t;}
  69. inline void StHbtTTreeReader::SetDebug(int debug) {mDebug=debug;}
  70. #endif
  71. /***************************************************************************
  72. *
  73. * $Log: StHbtTTreeReader.h,v $
  74. * Revision 1.3 2001/12/05 14:42:17 laue
  75. * updated for trigger(action)word and l3TriggerAlgorithm
  76. *
  77. * Revision 1.1 2001/06/21 19:18:42 laue
  78. * Modified Files: (to match the changed base classes)
  79. * StHbtAsciiReader.cxx StHbtAsciiReader.h
  80. * StHbtAssociationReader.cxx StHbtAssociationReader.h
  81. * StHbtBinaryReader.cxx StHbtBinaryReader.h
  82. * StHbtGstarTxtReader.cxx StHbtGstarTxtReader.h
  83. * StHbtStrangeMuDstEventReader.cxx
  84. * StHbtStrangeMuDstEventReader.h StStandardHbtEventReader.cxx
  85. * Added Files: new reader
  86. * StHbtTTreeReader.cxx StHbtTTreeReader.h
  87. *
  88. **************************************************************************/