SIOVPmtGainProvider.h
Go to the documentation of this file.
1 /**
2  * \file SIOVPmtGainProvider.h
3  *
4  * \ingroup WebDBI
5  *
6  * \brief Class def header for a class SIOVPmtGainProvider
7  *
8  * @author eberly@slac.stanford.edu
9  */
10 
11 #ifndef SIOVPMTGAINPROVIDER_H
12 #define SIOVPMTGAINPROVIDER_H
13 
18 #include "DatabaseRetrievalAlg.h"
19 
20 namespace lariov {
21 
22  /**
23  * @brief Retrieves information: pmt gain
24  *
25  * Configuration parameters
26  * =========================
27  *
28  * - *DatabaseRetrievalAlg* (parameter set, mandatory): configuration for the
29  * database; see lariov::DatabaseRetrievalAlg
30  * - *UseDB* (boolean, default: false): retrieve information from the database
31  * - *UseFile* (boolean, default: false): retrieve information from a file;
32  * not implemented yet
33  * - *DefaultGain* (real, default: ): Gain returned
34  * when /UseDB/ and /UseFile/ parameters are false
35  * - *DefaultGainErr* (real, default: ): Gain uncertainty returned
36  * when /UseDB/ and /UseFile/ parameters are false
37  */
39 
40  public:
41 
42  /// Constructors
44 
45  /// Reconfigure function called by fhicl constructor
46  void Reconfigure(fhicl::ParameterSet const& p) override;
47 
48  /// Update event time stamp.
50 
51  /// Update Snapshot and inherited DBFolder if using database. Return true if updated
52  bool Update(DBTimeStamp_t ts);
53 
54  /// Retrieve gain information
55  const PmtGain& PmtGainObject(DBChannelID_t ch) const;
56  float Gain(DBChannelID_t ch) const override;
57  float GainErr(DBChannelID_t ch) const override;
58  CalibrationExtraInfo const& ExtraInfo(DBChannelID_t ch) const override;
59 
60  private:
61 
62  /// Do actual database updates.
63 
64  bool DBUpdate() const; // Uses current event time.
65  bool DBUpdate(DBTimeStamp_t ts) const;
66 
67  // Time stamps.
68 
69  DBTimeStamp_t fEventTimeStamp; // Most recently seen time stamp.
70  mutable DBTimeStamp_t fCurrentTimeStamp; // Time stamp of cached data.
71 
73 
75  };
76 }//end namespace lariov
77 
78 #endif
79 
bool DBUpdate() const
Do actual database updates.
const PmtGain & PmtGainObject(DBChannelID_t ch) const
Retrieve gain information.
bool Update(DBTimeStamp_t ts)
Update Snapshot and inherited DBFolder if using database. Return true if updated. ...
std::uint32_t DBChannelID_t
Class def header for a class Snapshot.
Class def header for a class PmtGain.
std::uint64_t DBTimeStamp_t
SIOVPmtGainProvider(fhicl::ParameterSet const &p)
Constructors.
CalibrationExtraInfo const & ExtraInfo(DBChannelID_t ch) const override
Retrieves information: pmt gain.
p
Definition: test.py:223
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.
Class def header for a class DatabaseRetrievalAlg.
Filters for channels, events, etc.
void Reconfigure(fhicl::ParameterSet const &p) override
Reconfigure function called by fhicl constructor.
float Gain(DBChannelID_t ch) const override
float GainErr(DBChannelID_t ch) const override