/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RootInputFile.h
Go to the documentation of this file.
00001 
00015 #ifndef ROOTINPUTFILE_H
00016 #define ROOTINPUTFILE_H
00017 
00018 #include "DybKernel/MsgStreamMember.h"
00019 
00020 #include <string>
00021 #include <vector>
00022 
00023 class TFile;
00024 class TTree;
00025 
00026 class RootInputFile {
00027     std::string m_filename;
00028     std::string m_treepath;
00029     std::string m_branchname;
00030     int m_pruneSimHits;
00031     TFile* m_file;
00032     TTree* m_tree;
00033     int m_entry, m_entries;
00034     void* m_addr;
00035 
00036     Dyb::MsgStreamMember log;
00037 
00038 public:
00039     // Return list of all treepaths found in given file.
00040     static std::vector<std::string> TreePaths(const std::string& filename);
00041 
00042     // Return non zero if a branch of the given name at the given
00043     // treepath in the given file is found and is a subclass of
00044     // RootIOBaseObject.  The non zero return value is the object's
00045     // class ID.
00046     static int TestForObject(const std::string& filename,
00047                              const std::string& treepath,
00048                              const std::string& branchname,
00049                              bool ignore_missing=false);
00050                        
00051 
00052     RootInputFile(const std::string& filename, 
00053                   const std::string& treepath,
00054                   const std::string& branchname);
00055     ~RootInputFile();
00056 
00057     const std::string& treepath() { return m_treepath; }
00058     const std::string& branchname() { return m_branchname; }
00059     const std::string& filename() { return m_filename; }
00060 
00062     bool open();
00063 
00065     bool leave();
00066 
00068     int entry();
00069 
00071     bool setEntry(int entry);
00072 
00075     bool read(void* addr);
00076 
00078     bool read(void* addr, int& nbytes);
00079 
00081     bool setAddr(void* addr);
00082 
00084     int entries();
00085 
00087     bool next(int steps = 1);
00088 
00090     bool beginning();
00092     bool ending();
00093 
00095     bool prev(int steps = 1);
00096 
00097 };
00098 
00099 class RootInputFileList : public std::vector<RootInputFile*> {
00100     int m_index;                // current
00101     Dyb::MsgStreamMember log;
00102 public:
00103     RootInputFileList();
00104     ~RootInputFileList();
00105 
00107     int index();
00108 
00110     RootInputFile* current();
00111 
00113     bool next();
00114 
00116     bool prev();
00117     
00119     bool last();
00120 
00122     bool first();
00123 
00125     bool jump(int index);
00126 
00129     int entriesBefore(int index);
00130 
00131 };
00132 
00133 #endif  // ROOTINPUTFILE_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:58:18 for RootIOSvc by doxygen 1.7.4