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

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

Pretty-print operator for DCSRecord.

Definition at line 24 of file DCSRecord.cc.

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

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 }