CMS 3D CMS Logo

CSCDQM_DCSBase.h
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: CSCDQM_DCSBase.h
5  *
6  * Description: CSCDQM DCS Base Objects
7  *
8  * Version: 1.0
9  * Created: 05/04/2009 11:10:14 AM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius (VR), valdas.rapsevicius@cern.ch
14  * Company: CERN, CH
15  *
16  * =====================================================================================
17  */
18 
19 #ifndef CSCDQM_DCSBASE_H
20 #define CSCDQM_DCSBASE_H
21 
23 
24 #include <iostream>
25 #include <sstream>
26 
28 
29 namespace cscdqm {
30 
32  typedef long long TimeType;
33 
35  enum DCSBoardType { ANY = 0, ALCT = 1, CFEB = 2, DMB = 3 };
36 
38  struct DCSBoardUtility {
40  DCSBoardUtility(const DCSBoardType boardType_) : boardType(boardType_) {}
41 
47  static DCSBoardType getDCSBoard(const std::string board) {
48  if (board.compare("ALCT"))
49  return ALCT;
50  if (board.compare("CFEB"))
51  return CFEB;
52  if (board.compare("DMB"))
53  return DMB;
54  return ANY;
55  }
56 
57  friend std::ostream& operator<<(std::ostream& out, const DCSBoardUtility& b) {
58  switch (b.boardType) {
59  case ANY:
60  return out << "ANY";
61  case ALCT:
62  return out << "ALCT";
63  case CFEB:
64  return out << "CFEB";
65  case DMB:
66  return out << "DMB";
67  }
68  return out << "?";
69  }
70  };
71 
75  struct DCSAddressType {
77  unsigned short iendcap;
78 
80  unsigned short istation;
81 
83  unsigned short iring;
84 
86  unsigned int ichamber;
87 
90 
93  iendcap = a.iendcap;
94  istation = a.istation;
95  iring = a.iring;
96  ichamber = a.ichamber;
97  return *this;
98  }
99 
101  friend std::ostream& operator<<(std::ostream& out, const DCSAddressType& a) {
102  std::ostringstream os;
103  os << "endcap = " << a.iendcap << " ";
104  os << "station = " << a.istation << " ";
105  os << "ring = " << a.iring << " ";
106  os << "chamber = " << a.ichamber;
107  return out << os.str();
108  }
109 
111  };
112 
113 } // namespace cscdqm
114 
115 #endif
unsigned short iendcap
long long TimeType
friend std::ostream & operator<<(std::ostream &out, const DCSAddressType &a)
unsigned short istation
unsigned short iring
static DCSBoardType getDCSBoard(const std::string board)
Get DCSBoardType from string.
friend std::ostream & operator<<(std::ostream &out, const DCSBoardUtility &b)
DCSAddressType & operator=(const DCSAddressType &a)
double b
Definition: hdecay.h:118
#define COND_SERIALIZABLE
Definition: Serializable.h:39
double a
Definition: hdecay.h:119
DCSBoardUtility(const DCSBoardType boardType_)
CSCDetId getDetId() const