CMS 3D CMS Logo

DcsStatus.h
Go to the documentation of this file.
1 /*X
2  * File: DataFormats/Scalers/interface/DcsStatus.h (W.Badgett)
3  *
4  * The online computed DcsStatus flag values
5  *
6  */
7 
8 #ifndef DATAFORMATS_SCALERS_DCSSTATUS_H
9 #define DATAFORMATS_SCALERS_DCSSTATUS_H
10 
12 
13 #include <ctime>
14 #include <iosfwd>
15 #include <vector>
16 #include <string>
17 
25 
28 class DcsStatus {
29 public:
30  static const int partitionList[];
31  static const char* const partitionName[];
32 
33  enum {
34  EBp = 0,
35  EBm = 1,
36  EEp = 2,
37  EEm = 3,
38  HBHEa = 5,
39  HBHEb = 6,
40  HBHEc = 7,
41  HF = 8,
42  HO = 9,
43  RPC = 12,
44  DT0 = 13,
45  DTp = 14,
46  DTm = 15,
47  CSCp = 16,
48  CSCm = 17,
49  CASTOR = 20,
50  ZDC = 22,
51  TIBTID = 24,
52  TOB = 25,
53  TECp = 26,
54  TECm = 27,
55  BPIX = 28,
56  FPIX = 29,
57  ESp = 30,
58  ESm = 31,
60  };
61 
62  DcsStatus();
63  DcsStatus(const unsigned char* rawData);
64  virtual ~DcsStatus();
65 
67  std::string name() const { return "DcsStatus"; }
68 
70  bool empty() const { return false; }
71 
72  unsigned int trigType() const { return (trigType_); }
73  unsigned int eventID() const { return (eventID_); }
74  unsigned int sourceID() const { return (sourceID_); }
75  unsigned int bunchNumber() const { return (bunchNumber_); }
76 
77  int version() const { return (version_); }
78  timespec collectionTime() const { return (collectionTime_.get_timespec()); }
79 
80  unsigned int ready() const { return (ready_); }
81 
82  bool ready(int partitionNumber) const { return ((ready_ & (1 << partitionNumber)) != 0); }
83 
84  float magnetCurrent() const { return (magnetCurrent_); }
85  float magnetTemperature() const { return (magnetTemperature_); }
86 
88  int operator==(const DcsStatus& e) const { return false; }
89 
91  int operator!=(const DcsStatus& e) const { return false; }
92 
93 protected:
94  unsigned int trigType_;
95  unsigned int eventID_;
96  unsigned int sourceID_;
97  unsigned int bunchNumber_;
98 
99  int version_;
100 
102  unsigned int ready_;
105 };
106 
108 std::ostream& operator<<(std::ostream& s, const DcsStatus& c);
109 
110 typedef std::vector<DcsStatus> DcsStatusCollection;
111 
112 #endif
float magnetTemperature() const
Definition: DcsStatus.h:85
std::string name() const
name method
Definition: DcsStatus.h:67
unsigned int bunchNumber_
Definition: DcsStatus.h:97
virtual ~DcsStatus()
Definition: DcsStatus.cc:48
timespec collectionTime() const
Definition: DcsStatus.h:78
unsigned int eventID_
Definition: DcsStatus.h:95
int operator!=(const DcsStatus &e) const
inequality operator
Definition: DcsStatus.h:91
unsigned int bunchNumber() const
Definition: DcsStatus.h:75
bool empty() const
empty method (= false)
Definition: DcsStatus.h:70
int version_
Definition: DcsStatus.h:99
unsigned int sourceID() const
Definition: DcsStatus.h:74
int operator==(const DcsStatus &e) const
equality operator
Definition: DcsStatus.h:88
static const char *const partitionName[]
Definition: DcsStatus.h:31
std::ostream & operator<<(std::ostream &s, const DcsStatus &c)
Pretty-print operator for DcsStatus.
Definition: DcsStatus.cc:51
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:110
unsigned int trigType_
Definition: DcsStatus.h:94
unsigned int trigType() const
Definition: DcsStatus.h:72
unsigned int ready_
Definition: DcsStatus.h:102
unsigned int eventID() const
Definition: DcsStatus.h:73
float magnetCurrent() const
Definition: DcsStatus.h:84
timespec get_timespec() const
Definition: TimeSpec.cc:4
TimeSpec collectionTime_
Definition: DcsStatus.h:101
unsigned int sourceID_
Definition: DcsStatus.h:96
int version() const
Definition: DcsStatus.h:77
bool ready(int partitionNumber) const
Definition: DcsStatus.h:82
float magnetTemperature_
Definition: DcsStatus.h:104
unsigned int ready() const
Definition: DcsStatus.h:80
float magnetCurrent_
Definition: DcsStatus.h:103
static const int partitionList[]
Definition: DcsStatus.h:30