LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
SIOVElectronicsCalibProvider.h
Go to the documentation of this file.
1 
11 #ifndef SIOVELECTRONICSCALIBPROVIDER_H
12 #define SIOVELECTRONICSCALIBPROVIDER_H
13 
14 #include "larevt/CalibrationDBI/IOVData/ElectronicsCalib.h"
15 #include "larevt/CalibrationDBI/IOVData/Snapshot.h"
16 #include "larevt/CalibrationDBI/IOVData/IOVDataConstants.h"
17 #include "larevt/CalibrationDBI/Interface/ElectronicsCalibProvider.h"
18 #include "DatabaseRetrievalAlg.h"
19 
20 namespace lariov {
21 
42  class SIOVElectronicsCalibProvider : public DatabaseRetrievalAlg, public ElectronicsCalibProvider {
43 
44  public:
45 
48 
50  void Reconfigure(fhicl::ParameterSet const& p) override;
51 
53  void UpdateTimeStamp(DBTimeStamp_t ts);
54 
56  bool Update(DBTimeStamp_t ts);
57 
59  const ElectronicsCalib& ElectronicsCalibObject(DBChannelID_t ch) const;
60  float Gain(DBChannelID_t ch) const override;
61  float GainErr(DBChannelID_t ch) const override;
62  float ShapingTime(DBChannelID_t ch) const override;
63  float ShapingTimeErr(DBChannelID_t ch) const override;
64  CalibrationExtraInfo const& ExtraInfo(DBChannelID_t ch) const override;
65 
66  private:
67 
69 
70  bool DBUpdate() const; // Uses current event time.
71  bool DBUpdate(DBTimeStamp_t ts) const;
72 
73  // Time stamps.
74 
75  DBTimeStamp_t fEventTimeStamp; // Most recently seen time stamp.
76  mutable DBTimeStamp_t fCurrentTimeStamp; // Time stamp of cached data.
77 
78  DataSource::ds fDataSource;
79 
80  mutable Snapshot<ElectronicsCalib> fData;
81  };
82 }//end namespace lariov
83 
84 #endif
85 
float ShapingTimeErr(DBChannelID_t ch) const override
Retrieves information: electronics calibrations, specifically gain and shaping time.
CalibrationExtraInfo const & ExtraInfo(DBChannelID_t ch) const override
float GainErr(DBChannelID_t ch) const override
const ElectronicsCalib & ElectronicsCalibObject(DBChannelID_t ch) const
Retrieve electronics calibration information.
float ShapingTime(DBChannelID_t ch) const override
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.
Class def header for a class DatabaseRetrievalAlg.
Filters for channels, events, etc.
float Gain(DBChannelID_t ch) const override
bool Update(DBTimeStamp_t ts)
Update Snapshot and inherited DBFolder if using database. Return true if updated. ...
SIOVElectronicsCalibProvider(fhicl::ParameterSet const &p)
Constructors.
void Reconfigure(fhicl::ParameterSet const &p) override
Reconfigure function called by fhicl constructor.
bool DBUpdate() const
Do actual database updates.