00001
00002
00003
00004
00005
00006
00007
00008 #ifndef StHbtTTreeReader_hh
00009 #define StHbtTTreeReader_hh
00010
00011 #include "StHbtMaker/Base/StHbtEventReader.hh"
00012 #include "StHbtMaker/Infrastructure/StHbtEnumeration.hh"
00013
00014 #include "StMaker.h"
00015 #include "StChain.h"
00016 #include "St_DataSetIter.h"
00017
00018 #include "StEvent/StEnumerations.h"
00019 #include "StStrangeMuDstMaker/StStrangeMuDstMaker.h"
00020
00021
00022 #include <string>
00023
00024 class StHbtEvent;
00025 class StHbtTTreeEvent;
00026 class StIOMaker;
00027 class TFile;
00028 class TTree;
00029 class TChain;
00030
00031 class StHbtTTreeReader : public StHbtEventReader {
00032
00033 private:
00034 StIOMaker* mIOMaker;
00035
00036 StTrackType mTrackType;
00037
00038 StHbtIOMode mIOMode;
00039 string mCurrentFileName;
00040 string mDir;
00041 string mFile;
00042 string mExtention;
00043 string mFilter;
00044
00045 int mMaxFiles;
00046
00047 int mDebug;
00048 TChain* mTChain;
00049 TFile* mCurrentFile;
00050 TTree* mTTree;
00051 int split;
00052 int comp;
00053 int bufsize;
00054 string mInputDir;
00055 StHbtTTreeEvent* mHbtTTreeEvent;
00056 StHbtEvent* mHbtEvent;
00057 unsigned int mEventIndex;
00058
00059 StHbtEvent* read();
00060 int initRead(string dir, string file, string filter, string extention, int mMaxFiles);
00061 int uninitRead();
00062 StHbtEvent* write(StHbtEvent*);
00063 int initWrite(string, string);
00064 int uninitWrite();
00065 int fillChain(TChain* chain, const char* dir, const char* filter, const char* extention, const int maxFiles);
00066 int fillChain(TChain* chain, const char* list, const int maxFiles);
00067
00068 protected:
00069
00070 public:
00071 StHbtTTreeReader(StHbtIOMode mode, StIOMaker* io,
00072 const char* dirName, const char* fileName, const char* extention=".hbtTTreeMuDst",
00073 const char* filter=".", int maxFiles=99999);
00074
00075 ~StHbtTTreeReader();
00076
00077 StHbtEvent* ReturnHbtEvent();
00078 int WriteHbtEvent(StHbtEvent*);
00079 StHbtString Report();
00080
00081 StTrackType TrackType();
00082 void SetTrackType(StTrackType);
00083 void SetDebug(int);
00084
00085
00086 ClassDef(StHbtTTreeReader, 1)
00087 };
00088
00089 inline StTrackType StHbtTTreeReader::TrackType() { return mTrackType;}
00090 inline void StHbtTTreeReader::SetTrackType(StTrackType t) { mTrackType=t;}
00091 inline void StHbtTTreeReader::SetDebug(int debug) {mDebug=debug;}
00092
00093 #endif
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112