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
cscdqm::DCSBoardUtility::getDCSBoard
static DCSBoardType getDCSBoard(const std::string board)
Get DCSBoardType from string.
Definition: CSCDQM_DCSBase.h:47
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
cscdqm::DCSBoardUtility
Definition: CSCDQM_DCSBase.h:38
cscdqm::DCSAddressType::iendcap
unsigned short iendcap
Definition: CSCDQM_DCSBase.h:77
CSCDetId.h
cscdqm::DCSBoardType
DCSBoardType
Definition: CSCDQM_DCSBase.h:35
cscdqm::TimeType
long long TimeType
Definition: CSCDQM_DCSBase.h:32
b
double b
Definition: hdecay.h:118
cscdqm::DCSAddressType::ichamber
unsigned int ichamber
Definition: CSCDQM_DCSBase.h:86
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
a
double a
Definition: hdecay.h:119
cscdqm::ALCT
Definition: CSCDQM_DCSBase.h:35
cscdqm::DCSAddressType::operator<<
friend std::ostream & operator<<(std::ostream &out, const DCSAddressType &a)
Definition: CSCDQM_DCSBase.h:101
cscdqm
Definition: CSCDQM_DCSBase.h:29
CSCDetId
Definition: CSCDetId.h:26
cscdqm::DCSBoardUtility::boardType
DCSBoardType boardType
Definition: CSCDQM_DCSBase.h:39
Serializable.h
cscdqm::DCSAddressType::operator=
DCSAddressType & operator=(const DCSAddressType &a)
Definition: CSCDQM_DCSBase.h:92
cscdqm::ANY
Definition: CSCDQM_DCSBase.h:35
cscdqm::DCSBoardUtility::operator<<
friend std::ostream & operator<<(std::ostream &out, const DCSBoardUtility &b)
Definition: CSCDQM_DCSBase.h:57
cscdqm::CFEB
Definition: CSCDQM_DCSBase.h:35
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cscdqm::DCSAddressType::istation
unsigned short istation
Definition: CSCDQM_DCSBase.h:80
cscdqm::DCSAddressType::iring
unsigned short iring
Definition: CSCDQM_DCSBase.h:83
cscdqm::DCSBoardUtility::DCSBoardUtility
DCSBoardUtility(const DCSBoardType boardType_)
Definition: CSCDQM_DCSBase.h:40
cscdqm::DCSAddressType::getDetId
CSCDetId getDetId() const
Definition: CSCDQM_DCSBase.h:89
cscdqm::DMB
Definition: CSCDQM_DCSBase.h:35
cscdqm::DCSAddressType
Definition: CSCDQM_DCSBase.h:75