TimingCache.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Hold timing constants
3 /// \author bckhouse@caltech.edu
4 /// \date
5 ////////////////////////////////////////////////////////////////////////
6 #ifndef CALIB_TIMECACHE_H
7 #define CALIB_TIMECACHE_H
8 
9 #include <map>
10 
11 #include "NovaDAQConventions/DAQConventions.h"
12 
13 namespace calib
14 {
16  {
17  public:
18 
19  TimingCache();
20  virtual ~TimingCache();
21 
22  void SetCSVSource(const std::string& src){fCSVSource = src;}
23  void UseCSVsFromUPS(bool use = true){fUseCSVsFromUPS = use;}
24  void SetTag(const std::string& tag){fTag = tag;}
25 
26  void SetUseEpochs(bool use=true) {fUseEpochs = use;}
27  bool UseEpochs() {return fUseEpochs; }
28  void SetEpoch(const std::string& epoch) {fEpoch = epoch; }
30  std::string Epoch() {return fEpoch;}
32  void SetRun(int run) {fRun = run;}
33  int Run() { return fRun; }
34 
35  void GetEpochFromDB(int idet, bool isData);
36 
37  void ReadEpochsFromCSV(bool readEpochs=true) {fReadEpochsFromCSV=readEpochs;}
38 
39  double GetOffset(int dcm, int diblock, std::uint32_t time, bool isData);
40  double GetSigma(int dcm, int diblock, std::uint32_t time, bool isData);
41 
42  void SetVldTime(novadaq::cnv::DetId det, std::uint32_t minTime, std::uint32_t maxTime);
43 
44  protected:
45  struct DelayRec
46  {
47  DelayRec() : dcmoffset(0), sigma(0), stats(0) {}
48  // The values from the DB
49  double dcmoffset, sigma, stats;
50  };
51 
52  void LoadFromDatabase(bool isData);
53 
56 
60  bool fUseEpochs;
63  int fRun;
64 
66 
68  std::uint32_t fMinTime, fMaxTime;
69 
70  std::map<int, DelayRec> fMapData;
71  std::map<int, DelayRec> fMapMC;
72 
73  };
74 
75 } // end namespace calib
76 
77 #endif
78 ////////////////////////////////////////////////////////////////////////
void GetEpochFromDB(int idet, bool isData)
void LoadFromDatabase(bool isData)
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
novadaq::cnv::DetId fCurDet
Definition: TimingCache.h:67
std::map< int, DelayRec > fMapData
Definition: TimingCache.h:70
void SetVldTime(novadaq::cnv::DetId det, std::uint32_t minTime, std::uint32_t maxTime)
void ReadEpochsFromCSV(bool readEpochs=true)
Definition: TimingCache.h:37
std::string fCSVSource
Definition: TimingCache.h:57
virtual ~TimingCache()
Definition: TimingCache.cxx:35
void SetEpoch(const std::string &epoch)
Definition: TimingCache.h:28
CDPStorage service.
void SetUseEpochs(bool use=true)
Definition: TimingCache.h:26
void SetCSVSource(const std::string &src)
Definition: TimingCache.h:22
void SetEpochTag(const std::string &tag)
Definition: TimingCache.h:29
std::string fEpochTag
Definition: TimingCache.h:62
Definition: run.py:1
std::string Epoch()
Definition: TimingCache.h:30
std::string fTag
Definition: TimingCache.h:59
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void UseCSVsFromUPS(bool use=true)
Definition: TimingCache.h:23
std::uint32_t fMinTime
Definition: TimingCache.h:68
std::string fEpoch
Definition: TimingCache.h:61
std::map< int, DelayRec > fMapMC
Definition: TimingCache.h:71
double GetOffset(int dcm, int diblock, std::uint32_t time, bool isData)
Definition: TimingCache.cxx:40
std::string EpochTag()
Definition: TimingCache.h:31
std::uint32_t fMaxTime
Definition: TimingCache.h:68
double GetSigma(int dcm, int diblock, std::uint32_t time, bool isData)
Definition: TimingCache.cxx:74
void SetRun(int run)
Definition: TimingCache.h:32
void SetTag(const std::string &tag)
Definition: TimingCache.h:24