CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 #include <iostream>
23 #include <sstream>
24 
26 
27 namespace cscdqm {
28 
30  typedef long long TimeType;
31 
33  enum DCSBoardType {
34  ANY = 0,
35  ALCT = 1,
36  CFEB = 2,
37  DMB = 3
38  };
39 
41  struct DCSBoardUtility {
42 
44  DCSBoardUtility(const DCSBoardType boardType_) : boardType(boardType_) { }
45 
51  static DCSBoardType getDCSBoard(const std::string board) {
52  if (board.compare("ALCT")) return ALCT;
53  if (board.compare("CFEB")) return CFEB;
54  if (board.compare("DMB")) return DMB;
55  return ANY;
56  }
57 
58  friend std::ostream& operator<<(std::ostream& out, const DCSBoardUtility& b) {
59  switch (b.boardType) {
60  case ANY:
61  return out << "ANY";
62  case ALCT:
63  return out << "ALCT";
64  case CFEB:
65  return out << "CFEB";
66  case DMB:
67  return out << "DMB";
68  }
69  return out << "?";
70  }
71 
72  };
73 
77  struct DCSAddressType {
78 
80  unsigned short iendcap;
81 
83  unsigned short istation;
84 
86  unsigned short iring;
87 
89  unsigned int ichamber;
90 
92  CSCDetId getDetId() const {
94  }
95 
98  iendcap = a.iendcap;
99  istation = a.istation;
100  iring = a.iring;
101  ichamber = a.ichamber;
102  return *this;
103  }
104 
106  friend std::ostream& operator<<(std::ostream& out, const DCSAddressType& a) {
107  std::ostringstream os;
108  os << "endcap = " << a.iendcap << " ";
109  os << "station = " << a.istation << " ";
110  os << "ring = " << a.iring << " ";
111  os << "chamber = " << a.ichamber;
112  return out << os.str();
113  }
114 
115  };
116 
117 }
118 
119 #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.
tuple out
Definition: dbtoconf.py:99
friend std::ostream & operator<<(std::ostream &out, const DCSBoardUtility &b)
DCSAddressType & operator=(const DCSAddressType &a)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
DCSBoardUtility(const DCSBoardType boardType_)
CSCDetId getDetId() const