DetPedestalDUNE.h
Go to the documentation of this file.
1 /**
2  *
3  *
4  * \brief Pedestal provider class for DUNE
5  *
6  * @author jpaley@fnal.gov
7  */
8 
9 #ifndef DETPEDESTALDUNE_H
10 #define DETPEDESTALDUNE_H
11 
16 #include "lbne-raw-data/Services/ChannelMap/ChannelMapService.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include <unordered_map>
19 #include <map>
20 
21 namespace dune {
22 
24  {
25  public:
26 
27  DetPedestalDUNE(std::string detName="");
29 
30  virtual float PedMean(raw::ChannelID_t ch) const;
31  virtual float PedRms(raw::ChannelID_t ch) const;
32  virtual float PedMeanErr(raw::ChannelID_t ch) const;
33  virtual float PedRmsErr(raw::ChannelID_t ch) const;
34 
35  bool Configure(fhicl::ParameterSet const& pset);
36  bool Update(uint64_t ts);
37 
38  void SetUseDefaults(bool f) { fUseDefaults = f; }
39  void SetUseDB(bool f) { fUseDB = f;}
40  void PrintAllValues();
41 
42  void SetDetName(std::string detName) { fDetName = detName;}
44 
45  void SetDefaults(geo::View_t v, float mean, float meanerr, float rms, float rmserr)
46  {
47  fDefaultMean[v] = mean; fDefaultMeanErr[v] = meanerr;
48  fDefaultRms[v] = rms ; fDefaultRmsErr[v] = rmserr;
49  }
50  float DefaultMean(geo::View_t v) const;
51  float DefaultMeanErr(geo::View_t v) const;
52  float DefaultRms(geo::View_t v) const;
53  float DefaultRmsErr(geo::View_t v) const;
54 
57 
58  uint64_t VldTimeUsed() const { return fVldTimeUsed; }
59 
60  private:
61  void LoadFromCSV();
62 
63  bool fUseDB;
66  std::map<geo::View_t,float> fDefaultMean;
67  std::map<geo::View_t,float> fDefaultMeanErr;
68  std::map<geo::View_t,float> fDefaultRms;
69  std::map<geo::View_t,float> fDefaultRmsErr;
74  int fLogLevel;
75  std::unordered_map<raw::ChannelID_t,float> fMeanMap;
76  std::unordered_map<raw::ChannelID_t,float> fRmsMap;
77  std::unordered_map<raw::ChannelID_t,float> fMeanErrMap;
78  std::unordered_map<raw::ChannelID_t,float> fRmsErrMap;
79 
81  };
82 
83 } // end namespace dune
84 
85 #endif
Pedestal provider class for DUNE.
std::map< geo::View_t, float > fDefaultRmsErr
void SetUseDefaults(bool f)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:39
void SetDefaults(geo::View_t v, float mean, float meanerr, float rms, float rmserr)
std::unordered_map< raw::ChannelID_t, float > fRmsMap
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::string string
Definition: nybbler.cc:12
std::unordered_map< raw::ChannelID_t, float > fRmsErrMap
std::unordered_map< raw::ChannelID_t, float > fMeanMap
uint64_t VldTimeUsed() const
virtual float PedRmsErr(raw::ChannelID_t ch) const
float DefaultRms(geo::View_t v) const
virtual float PedMean(raw::ChannelID_t ch) const
Retrieve pedestal information.
void SetCSVFileName(std::string fname)
Class def header for a class DetPedestal.
virtual float PedRms(raw::ChannelID_t ch) const
DetPedestalDUNE(std::string detName="")
std::map< geo::View_t, float > fDefaultMeanErr
unsigned __int64 uint64_t
Definition: stdint.h:136
float DefaultRmsErr(geo::View_t v) const
bool Configure(fhicl::ParameterSet const &pset)
Definition of data types for geometry description.
std::map< geo::View_t, float > fDefaultRms
std::string CSVFileName() const
float DefaultMean(geo::View_t v) const
std::unordered_map< raw::ChannelID_t, float > fMeanErrMap
std::map< geo::View_t, float > fDefaultMean
art::ServiceHandle< lbne::ChannelMapService > fChannelMap
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
float DefaultMeanErr(geo::View_t v) const
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:15
virtual float PedMeanErr(raw::ChannelID_t ch) const
bool Update(uint64_t ts)
void SetDetName(std::string detName)