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 
92  friend std::ostream& operator<<(std::ostream& out, const DCSAddressType& a) {
93  std::ostringstream os;
94  os << "endcap = " << a.iendcap << " ";
95  os << "station = " << a.istation << " ";
96  os << "ring = " << a.iring << " ";
97  os << "chamber = " << a.ichamber;
98  return out << os.str();
99  }
100 
102  };
103 
104 } // namespace cscdqm
105 
106 #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)
double b
Definition: hdecay.h:120
#define COND_SERIALIZABLE
Definition: Serializable.h:39
double a
Definition: hdecay.h:121
DCSBoardUtility(const DCSBoardType boardType_)
CSCDetId getDetId() const