CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
DCSRecord.cc File Reference
#include <iomanip>
#include <ctime>
#include "DataFormats/OnlineMetaData/interface/DCSRecord.h"
#include "DataFormats/OnlineMetaData/interface/OnlineMetaDataRaw.h"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &s, const DCSRecord &dcs)
 Pretty-print operator for DCSRecord. More...
 

Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const DCSRecord dcs 
)

Pretty-print operator for DCSRecord.

Definition at line 36 of file DCSRecord.cc.

References DCSRecord::highVoltageReady(), DCSRecord::highVoltageValid(), mps_fire::i, DCSRecord::magnetCurrent(), DCSRecord::partitionName(), alignCSCRings::s, contentValuesCheck::ss, DCSRecord::timestamp(), and edm::Timestamp::unixTime().

36  {
37  const time_t ts = dcs.timestamp().unixTime();
38 
39  s << "timeStamp: " << asctime(localtime(&ts));
40 
41  std::streamsize ss = s.precision();
42  s.setf(std::ios::fixed);
43  s.precision(3);
44  s << "Magnet current (A): " << std::fixed << std::setprecision(3) << dcs.magnetCurrent() << std::endl;
45  s.unsetf(std::ios::fixed);
46  s.precision(ss);
47 
48  s << "HV state per partition:" << std::endl;
49 
50  for (unsigned int i = 0; i < DCSRecord::Partition::Last; ++i) {
51  s << " " << std::setw(7) << std::left << dcs.partitionName(i) << ": "
52  << (!dcs.highVoltageValid(i) ? "N/A" : (dcs.highVoltageReady(i) ? "READY" : "OFF")) << std::endl;
53  }
54 
55  return s;
56 }
float magnetCurrent() const
Return the current of the CMS magnet in A.
Definition: DCSRecord.h:77
bool highVoltageValid(const uint8_t partitionNumber) const
Return true if the high voltage bit of the given partition is valid.
Definition: DCSRecord.h:74
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:40
const std::string & partitionName(const uint8_t partitionNumber) const
Return the name of the high voltage of the given parition.
Definition: DCSRecord.h:68
const edm::Timestamp & timestamp() const
Return the time of the last change.
Definition: DCSRecord.h:61
bool highVoltageReady(const uint8_t partitionNumber) const
Return true if the high voltage of the given parition is ready.
Definition: DCSRecord.h:71