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

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

Pretty-print operator for DCSRecord.

Definition at line 36 of file DCSRecord.cc.

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

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