CMS 3D CMS Logo

DCSRecord.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_ONLINEMETADATA_DCSRECORD_H
2 #define DATAFORMATS_ONLINEMETADATA_DCSRECORD_H
3 
4 //---------------------------------------------------------------------------
9 //---------------------------------------------------------------------------
10 
11 
12 #include <array>
13 #include <bitset>
14 #include <cstdint>
15 #include <ostream>
16 #include <string>
17 
20 
21 
22 class DCSRecord
23 {
24 public:
25 
26  enum Partition {
31  };
32 
33  DCSRecord();
34  explicit DCSRecord(const online::DCS_v1&);
35  virtual ~DCSRecord();
36 
38  const edm::Timestamp& timestamp() const { return timestamp_; }
39 
41  typedef std::array<std::string,Last> ParitionNames;
42  const ParitionNames& paritionNames() const { return partitionNames_; }
43 
45  const std::string& partitionName(const uint8_t partitionNumber) const { return partitionNames_.at(partitionNumber); }
46 
48  bool highVoltageReady(const uint8_t partitionNumber) const { return highVoltageReady_.test(partitionNumber); }
49 
51  float magnetCurrent() const { return magnetCurrent_; }
52 
53 
54 private:
55 
57  std::bitset<Partition::Last> highVoltageReady_;
59  static const ParitionNames partitionNames_;
60 
61 };
62 
64 std::ostream& operator<<(std::ostream&, const DCSRecord&);
65 
66 #endif // DATAFORMATS_ONLINEMETADATA_DCSRECORD_H
std::bitset< Partition::Last > highVoltageReady_
Definition: DCSRecord.h:57
float magnetCurrent() const
Return the current of the CMS magnet in A.
Definition: DCSRecord.h:51
Class to contain DCS information from soft FED 1022.
Definition: DCSRecord.h:22
static const ParitionNames partitionNames_
Definition: DCSRecord.h:59
const ParitionNames & paritionNames() const
Definition: DCSRecord.h:42
std::array< std::string, Last > ParitionNames
Get the names of all high-voltage partitions.
Definition: DCSRecord.h:41
float magnetCurrent_
Definition: DCSRecord.h:58
virtual ~DCSRecord()
Definition: DCSRecord.cc:33
const std::string & partitionName(const uint8_t partitionNumber) const
Return the name of the high voltage of the given parition.
Definition: DCSRecord.h:45
const edm::Timestamp & timestamp() const
Return the time of the last change.
Definition: DCSRecord.h:38
std::ostream & operator<<(std::ostream &, const DCSRecord &)
Pretty-print operator for DCSRecord.
Definition: DCSRecord.cc:36
bool highVoltageReady(const uint8_t partitionNumber) const
Return true if the high voltage of the given parition is ready.
Definition: DCSRecord.h:48
edm::Timestamp timestamp_
Definition: DCSRecord.h:56