LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
DatabaseRetrievalAlg.h
Go to the documentation of this file.
1 
14 #ifndef DATABASERETRIEVALALG_H
15 #define DATABASERETRIEVALALG_H
16 
17 #include <string>
18 #include <vector>
19 #include "larevt/CalibrationDBI/IOVData/IOVTimeStamp.h"
20 #include "DBFolder.h"
21 #include "fhiclcpp/ParameterSet.h"
22 
23 namespace lariov {
24 
31 
32  public:
33 
35  DatabaseRetrievalAlg(const std::string& foldername, const std::string& url, const std::string& tag="") :
36  fFolder(new DBFolder(foldername, url, tag)) {}
37 
39  this->Reconfigure(p);
40  }
41 
44 
46  virtual void Reconfigure(fhicl::ParameterSet const& p);
47 
49  bool UpdateFolder(DBTimeStamp_t ts) {
50  return fFolder->UpdateData(ts);
51  }
52 
54  const std::string& URL() const {return fFolder->URL();}
55  const std::string& FolderName() const {return fFolder->FolderName();}
56  const std::string& Tag() const {return fFolder->Tag();}
57 
59  const IOVTimeStamp& Begin() const {return fFolder->CachedStart();}
60  const IOVTimeStamp& End() const {return fFolder->CachedEnd();}
61 
62 
63  protected:
64 
65  std::unique_ptr<DBFolder> fFolder;
66  };
67 }
68 
69 
70 #endif
71  // end of doxygen group
72 
std::unique_ptr< DBFolder > fFolder
virtual void Reconfigure(fhicl::ParameterSet const &p)
Configure using fhicl::ParameterSet.
DatabaseRetrievalAlg(fhicl::ParameterSet const &p)
const std::string & URL() const
Get connection information.
bool UpdateFolder(DBTimeStamp_t ts)
Return true if fFolder is successfully updated.
const IOVTimeStamp & End() const
virtual ~DatabaseRetrievalAlg()
Default destructor.
const std::string & Tag() const
Filters for channels, events, etc.
const IOVTimeStamp & Begin() const
Get Timestamp information.
DatabaseRetrievalAlg(const std::string &foldername, const std::string &url, const std::string &tag="")
Constructors.
const std::string & FolderName() const