MRootFileReader.hh

Go to the documentation of this file.
00001 
00050 #ifndef _M_ROOTFILE_READER_H_
00051 #define _M_ROOTFILE_READER_H_
00052 
00053 #include "QReader.hh"
00054 #include <string>
00055 #include <list>
00056 
00057 #include <TObjString.h>
00058 #include "QRootFileReaderCommon.hh"
00059 
00060 namespace Cuore {class QEvent;}
00061 class QChain;
00062 class QBaseEventR;
00063 class QObjectR;
00064 class TEventList;
00065 class TFile;
00066 
00067 class MRootFileReader : public QReader, public QRootFileReaderCommon {
00068 
00069         public:
00070                 MRootFileReader(QSequence *s);
00071 
00072                 virtual ~MRootFileReader();
00073 
00074                 // Init method is called before event loop
00075                 virtual void Init();
00076 
00077                 // Doit method is called for each event, getting the event as argument
00078                 virtual QEvent* Do( QEvent* ev);
00079         
00080         const QError& JumpToEvent(unsigned int event);
00081 
00082                 // Done method is called after event loop
00083                 virtual void Done();
00084 
00085         private:
00086         unsigned int fEvents;
00087         QChain* fChain;
00088         QBaseEventR* fEventR;
00089         int fFileUID;
00090         bool fDeleteInput;
00091         std::string fCutsFile;
00092         bool fUseCutsFile;
00093         TEventList *fEventList;
00094 
00095         template<class T> class Datum {
00096             public:
00097                 Datum(const std::string& name) { fName = name; }
00098                 std::string fName;
00099                 T fObj;
00100                 // used only for QObjects
00101                 QObject* fQObj;
00102         };
00103 
00104         void SetBranchesCache();
00105         void ClearBranchesCache();
00106         std::list<Datum<int> > fIntList;
00107         std::list<Datum<double> > fDoubleList;
00108         std::list<Datum<float> > fFloatList;
00109         std::list<Datum<bool> > fBoolList;
00110         std::list<Datum<TObjString*> > fStringList;
00111         std::list<Datum<QObjectR*> > fQObjectList;
00112         std::list<Datum<TObject*> > fTObjectList;
00113 
00114         friend class LRootGlobalReader;
00115         friend class MLightRootFileReader;
00116 
00117 };
00118 
00119 #endif

Generated on Tue Nov 16 10:49:59 2010 for CUORE Software by  doxygen 1.5.6