CMS 3D CMS Logo

Classes | Typedefs | Functions

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/Scalers/interface/DcsStatus.h File Reference

#include "DataFormats/Scalers/interface/TimeSpec.h"
#include <ctime>
#include <iosfwd>
#include <vector>
#include <string>

Go to the source code of this file.

Classes

class  DcsStatus

Typedefs

typedef std::vector< DcsStatusDcsStatusCollection

Functions

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

Detailed Description

file for online DcsStatus value

Author:
: William Badgett

Definition in file DcsStatus.h.


Typedef Documentation

typedef std::vector<DcsStatus> DcsStatusCollection

Definition at line 116 of file DcsStatus.h.


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(), asciidump::s, DcsStatus::sourceID(), DcsStatus::trigType(), and DcsStatus::version().

{
  char zeit[128];
  char line[128];
  struct tm * hora;

  s << "DcsStatus    Version: " << c.version() << 
    "   SourceID: "<< c.sourceID() << std::endl;

  timespec ts = c.collectionTime();
  hora = gmtime(&ts.tv_sec);
  strftime(zeit, sizeof(zeit), "%Y.%m.%d %H:%M:%S", hora);
  sprintf(line, " CollectionTime: %s.%9.9d", zeit, 
          (int)ts.tv_nsec);
  s << line << std::endl;

  sprintf(line, " TrigType: %d   EventID: %d    BunchNumber: %d", 
          c.trigType(), c.eventID(), c.bunchNumber());
  s << line << std::endl;

  sprintf(line," MagnetCurrent: %e    MagnetTemperature: %e", 
          c.magnetCurrent(), c.magnetTemperature());
  s << line << std::endl;

  sprintf(line," Ready: %d  0x%8.8X", c.ready(), c.ready());
  s << line << std::endl;

  for ( int i=0; i<DcsStatus::nPartitions; i++)
  {
    if ( c.ready(DcsStatus::partitionList[i]))
    {
      sprintf(line,"  %2d %6s: READY", i, DcsStatus::partitionName[i]);
    }
    else
    {
      sprintf(line,"  %2d %6s: NOT READY", i, DcsStatus::partitionName[i]);
    }
  s << line << std::endl;
  }
  return s;
}