LCCD  1.5.0
DBFileHandler.hh
1 #ifndef DBFileHandler_h
2 #define DBFileHandler_h
3 
4 //#include "lccd.h"
5 #include "ConditionsHandlerBase.hh"
6 
7 using namespace lcio ;
8 
9 namespace lccd {
10 
11 
12  // some convenient typedefs
13  typedef std::pair<LCCDTimeStamp,LCCDTimeStamp> ValidityInterval ;
14  typedef std::vector< ValidityInterval > ValidityVector ;
15 
16 
53 
54  public:
55 
56  DBFileHandler( const DBFileHandler& ) = delete ;
57  DBFileHandler& operator=( const DBFileHandler& ) = delete ;
58 
67  DBFileHandler(const std::string& fileName,
68  const std::string& name,
69  const std::string& inputCollection="" ) ;
70 
71 
72  virtual ~DBFileHandler() ;
73 
74 
78  virtual void registerDefaultCollection( lcio::LCCollection* col);
79 
80 
83  virtual lcio::LCCollection* defaultCollection() { return _defaultCollection; } ;
84 
85 
88  virtual lcio::LCCollection* lastValidCollection() { return _lastValidCollection; } ;
89 
102  virtual void update( LCCDTimeStamp timestamp ) ;
103 
104 
105  protected :
106 
107  DBFileHandler() {}
108 
110  void init() ;
111 
113  int findEventNumber( LCCDTimeStamp timeStamp ) ;
114 
115  // ---- data members ------
116 
118  std::string _fileName{} ;
119 
121  std::string _inputCollection{} ;
122 
124  ValidityVector _valVec{} ;
125 
127  LCReader* _lcReader = nullptr ;
128 
130  lcio::LCCollection* _defaultCollection = nullptr ;
131 
133  lcio::LCCollection* _lastValidCollection = nullptr ;
134 
135  };
136 } //end namespace
137 
138 #endif // DBFileHandler_h
Base implementation of IConditionsHandler.
Definition: ConditionsHandlerBase.hh:27
virtual lcio::LCCollection * lastValidCollection()
The last valid collection held by the handler.
Definition: DBFileHandler.hh:88
virtual lcio::LCCollection * defaultCollection()
The default collection registered with the handler.
Definition: DBFileHandler.hh:83
lcio::long64 LCCDTimeStamp
The timestamp in LCCD is a 64bit int as defined in LCIO.
Definition: lccd.h:24
Implementation of ConditionsHandlerBase that reads the conditions data from a special LCIO file...
Definition: DBFileHandler.hh:52