All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
43  SIOVPmtGainProvider(fhicl::ParameterSet const& p);
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.
pdgs p
Definition: selectors.fcl:22
Class def header for a class PmtGain.
std::uint64_t DBTimeStamp_t
SIOVPmtGainProvider(fhicl::ParameterSet const &p)
Constructors.
float Gain(DBChannelID_t ch) const override
Retrieves information: pmt gain.
void UpdateTimeStamp(DBTimeStamp_t ts)
Update event time stamp.
Class def header for a class DatabaseRetrievalAlg.
void Reconfigure(fhicl::ParameterSet const &p) override
Reconfigure function called by fhicl constructor.
CalibrationExtraInfo const & ExtraInfo(DBChannelID_t ch) const override
float GainErr(DBChannelID_t ch) const override