CMS 3D CMS Logo

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

◆ operator<<()

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

Pretty-print operator for DCSRecord.

Definition at line 24 of file DCSRecord.cc.

24  {
25  const time_t ts = dcs.timestamp().unixTime();
26 
27  s << "timeStamp: " << asctime(localtime(&ts));
28 
29  std::streamsize ss = s.precision();
30  s.setf(std::ios::fixed);
31  s.precision(3);
32  s << "Magnet current (A): " << std::fixed << std::setprecision(3) << dcs.magnetCurrent() << std::endl;
33  s.unsetf(std::ios::fixed);
34  s.precision(ss);
35 
36  s << "HV state per partition:" << std::endl;
37 
38  for (unsigned int i = 0; i < DCSRecord::Partition::Last; ++i) {
39  s << " " << std::setw(7) << std::left << dcs.partitionName(i) << ": "
40  << (dcs.highVoltageReady(i) ? "READY" : "OFF") << std::endl;
41  }
42 
43  return s;
44 }

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

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:355
edm::Timestamp::unixTime
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:40
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DCSRecord::highVoltageReady
bool highVoltageReady(const uint8_t partitionNumber) const
Return true if the high voltage of the given parition is ready.
Definition: DCSRecord.h:66
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DCSRecord::magnetCurrent
float magnetCurrent() const
Return the current of the CMS magnet in A.
Definition: DCSRecord.h:69
DCSRecord::partitionName
const std::string & partitionName(const uint8_t partitionNumber) const
Return the name of the high voltage of the given parition.
Definition: DCSRecord.h:63
DCSRecord::timestamp
const edm::Timestamp & timestamp() const
Return the time of the last change.
Definition: DCSRecord.h:56