Class Reference for E1039 Core & Analysis Software
ChanMapTaiwan.h
Go to the documentation of this file.
1 #ifndef __CHAN_MAP_TAIWAN_H__
2 #define __CHAN_MAP_TAIWAN_H__
3 #include <unordered_map>
4 #include "RunParamBase.h"
5 
6 class ChanMapTaiwan : public ChanMapBase {
7  struct MapItem {
8  short roc;
9  short board;
10  short chan;
11  std::string det_name;
12  short det;
13  short ele;
14  };
15  typedef std::vector<MapItem> List_t;
16  List_t m_list;
17 
18  typedef std::pair<short, short> DetEle_t;
19  typedef std::unordered_map<RocBoardChan_t, DetEle_t, RocBoardChanHash> Map_t;
20  Map_t m_map;
21 
22  public:
23  ChanMapTaiwan();
24  virtual ~ChanMapTaiwan() {;}
25 
26  void Add(const short roc, const short board, const short chan, const std::string det, const short ele);
27  void Add(const short roc, const short board, const short chan, const std::string det_name, const short det_id, const short ele);
28 
29  //bool Find(const short roc, const short board, const short chan, std::string& det, short& ele);
30  bool Find(const short roc, const short board, const short chan, short& det, short& ele);
31  void Print(std::ostream& os);
32 
33  protected:
34  int ReadFileCont(LineList& lines);
35  int WriteFileCont(std::ostream& os);
36 
37  void ReadDbTable(DbSvc& db);
38  void WriteDbTable(DbSvc& db);
39 };
40 
41 #endif // __CHAN_MAP_TAIWAN_H__
void WriteDbTable(DbSvc &db)
void ReadDbTable(DbSvc &db)
int ReadFileCont(LineList &lines)
int WriteFileCont(std::ostream &os)
void Add(const short roc, const short board, const short chan, const std::string det, const short ele)
virtual ~ChanMapTaiwan()
Definition: ChanMapTaiwan.h:24
void Print(std::ostream &os)
bool Find(const short roc, const short board, const short chan, short &det, short &ele)
Standard interface with SQL database.
Definition: DbSvc.h:15
std::vector< std::string > LineList
Definition: RunParamBase.h:51