LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
DetPedestalRetrievalAlg.h
Go to the documentation of this file.
1 
14 #ifndef WEBDBI_DETPEDESTALRETRIEVALALG_H
15 #define WEBDBI_DETPEDESTALRETRIEVALALG_H
16 
17 // C/C++ standard libraries
18 #include <string>
19 
20 // LArSoft libraries
24 #include "larevt/CalibrationDBI/Interface/CalibrationDBIFwd.h"
25 #include "larevt/CalibrationDBI/Interface/DetPedestalProvider.h"
27 
28 namespace fhicl {
29  class ParameterSet;
30 }
31 
32 namespace lariov {
33 
58  class DetPedestalRetrievalAlg : public DatabaseRetrievalAlg, public DetPedestalProvider {
59 
60  public:
62  DetPedestalRetrievalAlg(const std::string& foldername,
63  const std::string& url,
64  const std::string& tag = "");
65 
67 
69  void Reconfigure(fhicl::ParameterSet const& p) override;
70 
72  void UpdateTimeStamp(DBTimeStamp_t ts);
73 
75  bool Update(DBTimeStamp_t ts);
76 
78  const DetPedestal& Pedestal(DBChannelID_t ch) const;
79  float PedMean(DBChannelID_t ch) const override;
80  float PedRms(DBChannelID_t ch) const override;
81  float PedMeanErr(DBChannelID_t ch) const override;
82  float PedRmsErr(DBChannelID_t ch) const override;
83 
84  //hardcoded information about database folder - useful for debugging cross checks
85  static constexpr unsigned int NCOLUMNS = 5;
86  static constexpr const char* FIELD_NAMES[NCOLUMNS] = {"channel",
87  "mean",
88  "mean_err",
89  "rms",
90  "rms_err"};
91  static constexpr const char* FIELD_TYPES[NCOLUMNS] = {"unsigned int",
92  "float",
93  "float",
94  "float",
95  "float"};
96 
97  private:
99 
100  bool DBUpdate() const; // Uses current event time.
101  bool DBUpdate(DBTimeStamp_t ts) const;
102 
103  // Time stamps.
104 
105  DBTimeStamp_t fEventTimeStamp; // Most recently seen time stamp.
106  mutable DBTimeStamp_t fCurrentTimeStamp; // Time stamp of cached data.
107 
110  };
111 } //end namespace lariov
112 
113 #endif
114  // end of doxygen group
Class def header for a class Snapshot.
bool Update(detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, PFPStruct &pfp)
Definition: PFPUtils.cxx:1055
Class def header for a class DetPedestal.
parameter set interface
Retrieves channel information: pedestal and RMS.
Class def header for a class DatabaseRetrievalAlg.
Filters for channels, events, etc.