CMS 3D CMS Logo

Classes | Functions
DCSRecord.h File Reference
#include <array>
#include <bitset>
#include <cstdint>
#include <ostream>
#include <string>
#include "DataFormats/OnlineMetaData/interface/OnlineMetaDataRaw.h"
#include "DataFormats/Provenance/interface/Timestamp.h"

Go to the source code of this file.

Classes

class  DCSRecord
 Class to contain DCS information from soft FED 1022. More...
 

Functions

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

Function Documentation

◆ operator<<()

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

Pretty-print operator for DCSRecord.

Definition at line 36 of file DCSRecord.cc.

References alignBH_cfg::fixed, 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 }