SIOVElectronicsCalibProvider.h
Go to the documentation of this file.
1 /**
2  * \file SIOVElectronicsCalibProvider.h
3  *
4  * \ingroup WebDBI
5  *
6  * \brief Class def header for a class SIOVElectronicsCalibProvider
7  *
8  * @author eberly@slac.stanford.edu
9  */
10 
11 #ifndef SIOVELECTRONICSCALIBPROVIDER_H
12 #define SIOVELECTRONICSCALIBPROVIDER_H
13 
18 #include "DatabaseRetrievalAlg.h"
19 
20 namespace lariov {
21 
22  /**
23  * @brief Retrieves information: electronics calibrations, specifically gain and shaping time
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  * - *DefaultShapingTime* (real, default: ): Shaping Time returned
38  * when /UseDB/ and /UseFile/ parameters are false
39  * - *DefaultShapingTimeErr* (real, default: ): Shaping Time uncertainty returned
40  * when /UseDB/ and /UseFile/ parameters are false
41  */
43 
44  public:
45 
46  /// Constructors
48 
49  /// Reconfigure function called by fhicl constructor
50  void Reconfigure(fhicl::ParameterSet const& p) override;
51 
52  /// Update event time stamp.
54 
55  /// Update Snapshot and inherited DBFolder if using database. Return true if updated
56  bool Update(DBTimeStamp_t ts);
57 
58  /// Retrieve electronics calibration information
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 
68  /// Do actual database updates.
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 
79 
81  };
82 }//end namespace lariov
83 
84 #endif
85 
float ShapingTimeErr(DBChannelID_t ch) const override
std::uint32_t DBChannelID_t
Class def header for a class Snapshot.
std::uint64_t DBTimeStamp_t
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
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.
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.
Class def header for a class ElectronicsCalib.
bool DBUpdate() const
Do actual database updates.