test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
DcsStatus.cc File Reference
#include "DataFormats/Scalers/interface/DcsStatus.h"
#include "DataFormats/Scalers/interface/ScalersRaw.h"
#include <cstdio>
#include <ostream>

Go to the source code of this file.

Functions

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

Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const DcsStatus c 
)

Pretty-print operator for DcsStatus.

Definition at line 103 of file DcsStatus.cc.

References DcsStatus::bunchNumber(), DcsStatus::collectionTime(), DcsStatus::eventID(), i, geometryCSVtoXML::line, DcsStatus::magnetCurrent(), DcsStatus::magnetTemperature(), DcsStatus::nPartitions, DcsStatus::partitionList, DcsStatus::partitionName, DcsStatus::ready(), alignCSCRings::s, DcsStatus::sourceID(), DcsStatus::trigType(), and DcsStatus::version().

104 {
105  char zeit[128];
106  char line[128];
107  struct tm * hora;
108 
109  s << "DcsStatus Version: " << c.version() <<
110  " SourceID: "<< c.sourceID() << std::endl;
111 
112  timespec ts = c.collectionTime();
113  hora = gmtime(&ts.tv_sec);
114  strftime(zeit, sizeof(zeit), "%Y.%m.%d %H:%M:%S", hora);
115  sprintf(line, " CollectionTime: %s.%9.9d", zeit,
116  (int)ts.tv_nsec);
117  s << line << std::endl;
118 
119  sprintf(line, " TrigType: %d EventID: %d BunchNumber: %d",
120  c.trigType(), c.eventID(), c.bunchNumber());
121  s << line << std::endl;
122 
123  sprintf(line," MagnetCurrent: %e MagnetTemperature: %e",
125  s << line << std::endl;
126 
127  sprintf(line," Ready: %d 0x%8.8X", c.ready(), c.ready());
128  s << line << std::endl;
129 
130  for ( int i=0; i<DcsStatus::nPartitions; i++)
131  {
133  {
134  sprintf(line," %2d %6s: READY", i, DcsStatus::partitionName[i]);
135  }
136  else
137  {
138  sprintf(line," %2d %6s: NOT READY", i, DcsStatus::partitionName[i]);
139  }
140  s << line << std::endl;
141  }
142  return s;
143 }
unsigned int trigType() const
Definition: DcsStatus.h:76
int i
Definition: DBlmapReader.cc:9
timespec collectionTime() const
Definition: DcsStatus.h:82
unsigned int bunchNumber() const
Definition: DcsStatus.h:79
float magnetTemperature() const
Definition: DcsStatus.h:90
int version() const
Definition: DcsStatus.h:81
unsigned int ready() const
Definition: DcsStatus.h:84
unsigned int sourceID() const
Definition: DcsStatus.h:78
static const char *const partitionName[]
Definition: DcsStatus.h:33
float magnetCurrent() const
Definition: DcsStatus.h:89
unsigned int eventID() const
Definition: DcsStatus.h:77
static const int partitionList[]
Definition: DcsStatus.h:32