FdUpTimeSQLManager.h
Go to the documentation of this file.
1 #ifndef _fdet_FdUpTimeSQLManager_h_
2 #define _fdet_FdUpTimeSQLManager_h_
3 
4 #include <utl/config.h>
5 #include <det/ValidityStamp.h>
6 
7 #ifdef AUGER_SQLITE_ENABLED
8 # include <det/VSQLManager_SQLite.h>
9 #else
10 # include <det/VSQLManager_MySQL.h>
11 #endif
12 
13 namespace utl {
14  class Reader;
15  class Branch;
16  class TabulatedFunction;
17 }
18 
19 namespace fdet {
20 
31 
32  public:
34  virtual ~FdUpTimeSQLManager() { }
35 
37  //VMANAGER_GETDATA_NOTFOUND(unsigned long long int)
38  VMANAGER_GETDATA_DENIED(std::string)
39  VMANAGER_GETDATA_DENIED(std::vector<double>)
40  VMANAGER_GETDATA_DENIED(std::vector<int>)
41  VMANAGER_GETDATA_DENIED(std::vector<std::string>)
42  VMANAGER_GETDATA_DENIED(std::list<double>)
43  VMANAGER_GETDATA_DENIED(std::list<int>)
44  VMANAGER_GETDATA_DENIED(std::list<std::string>)
45  VMANAGER_GETDATA_DENIED(utl::TabulatedFunction)
46  VMANAGER_GETDATA_DENIED(utl::TabulatedFunctionComplexLgAmpPhase)
47  VMANAGER_GETDATA_DENIED(std::list<std::pair<int, int> >)
48  VMANAGER_GETDATA_DENIED(std::map<int, utl::TabulatedFunction>)
49  VMANAGER_GETDATA_NOTFOUND(std::map<std::string, double>)
50  VMANAGER_GETDATA_DENIED(std::vector<bool>)
51 
52  virtual Status GetData(double& returnData,
53  const std::string& componentProperty,
54  const std::string& componentName,
55  const IndexMap& componentIndex) const;
56 
57  void Init(const std::string& configLink);
58 
59  private:
60  Status GetOnTimeFraction(double& returnData,
61  const std::string& componentProperty,
62  const std::string& componentName,
63  const IndexMap& componentIndex) const;
64 
65  Status GetChannelData(double& returnData,
66  const std::string& componentProperty,
67  const std::string& componentName,
68  const IndexMap& componentIndex) const;
69 
70  int GetEyeIndex(const IndexMap& componentIndex) const;
71  int GetTelIndex(const IndexMap& componentIndex) const;
72  int GetChannelIndex(const IndexMap& componentIndex) const;
73  bool ReadData() const;
74 
76 
78  //std::string fServerName, fUsernameName, fPassword, fDatabaseName;
79 
80  //TTree* fDataTree;
81 
82  // number of pixels per telescope (as used in AugerOnTime-tree)
83  static const unsigned int kNPixelPerTel = 440;
84 
85  // data cache
86  mutable det::ValidityStamp fDataValidity;
87  mutable std::map<int, int> fEyeStatus;
88  mutable std::map<int, int> fTelescopeStatus;
89  mutable std::map<int, double> fEyeOnTimeFraction;
90  mutable std::map<int, double> fTelescopeOnTimeFraction;
91  struct ChannelInfo {
92  ChannelInfo(unsigned int v, unsigned int t, unsigned int b)
93  : Variance(v), Threshold(t), Baseline(b) { }
94  unsigned short Variance;
95  unsigned short Threshold;
96  unsigned short Baseline;
97  };
98  mutable std::map<int, std::vector<ChannelInfo> > fChannelInfo;
99  mutable int fCDASStatus;
100  mutable double fCDASOnTimeFraction;
101 
102  // index map
103  static const double fgSearchMapBinning;
104  typedef std::pair<unsigned int, unsigned int> IndexEntry;
105  typedef std::map<unsigned int, IndexEntry> Index;
106  typedef std::map<unsigned int, IndexEntry>::iterator IndexIterator;
107  typedef std::map<unsigned int, IndexEntry>::const_iterator ConstIndexIterator;
109 
110  };
111 
112 }
113 
114 
115 #endif
116 
117 // Configure (x)emacs for this file ...
118 // Local Variables:
119 // mode: c++
120 // compile-command: "make -C .. FdUpTimeSQLManager.o -k"
121 // End:
std::map< unsigned int, IndexEntry >::iterator IndexIterator
std::map< int, double > fTelescopeOnTimeFraction
std::map< int, double > fEyeOnTimeFraction
std::pair< unsigned int, unsigned int > IndexEntry
std::map< unsigned int, IndexEntry > Index
Status const
Fetch first item from first row and optionally free query result.
VMANAGER_GETDATA_HANDLE_DENIED int fVerbosity
static const double fgSearchMapBinning
int GetChannelIndex(const IndexMap &componentIndex) const
std::map< int, int > fTelescopeStatus
int GetEyeIndex(const IndexMap &componentIndex) const
Interface for detector managers that use MySQL.
#define VMANAGER_GETDATA_DENIED(_T_...)
Definition: VManager.h:21
#define VMANAGER_GETDATA_HANDLE_DENIED
Definition: VManager.h:75
static const unsigned int kNPixelPerTel
std::map< int, std::vector< ChannelInfo > > fChannelInfo
Status GetChannelData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
void Init(const std::string &configLink)
Manager Initialization. configLink is the CentralConfig hook for the configuration file...
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
Status GetOnTimeFraction(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
det::ValidityStamp fDataValidity
int GetTelIndex(const IndexMap &componentIndex) const
std::map< unsigned int, IndexEntry >::const_iterator ConstIndexIterator
ChannelInfo(unsigned int v, unsigned int t, unsigned int b)
#define VMANAGER_GETDATA_NOTFOUND(_T_...)
Definition: VManager.h:41
Status
Specifies success or (eventually) various possible failure modes.
Definition: VManager.h:127
std::map< int, int > fEyeStatus

, generated on Tue Sep 26 2023.