CMS 3D CMS Logo

Functions
BeamSpotOnline.cc File Reference
#include "DataFormats/Scalers/interface/BeamSpotOnline.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 BeamSpotOnline &c)
 Pretty-print operator for BeamSpotOnline. More...
 

Function Documentation

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

Pretty-print operator for BeamSpotOnline.

Definition at line 75 of file BeamSpotOnline.cc.

References BeamSpotOnline::bunchNumber(), BeamSpotOnline::collectionTime(), constexpr, BeamSpotOnline::dxdz(), BeamSpotOnline::dydz(), BeamSpotOnline::err_dxdz(), BeamSpotOnline::err_dydz(), BeamSpotOnline::err_sigma_z(), BeamSpotOnline::err_width_x(), BeamSpotOnline::err_width_y(), BeamSpotOnline::err_x(), BeamSpotOnline::err_y(), BeamSpotOnline::err_z(), BeamSpotOnline::eventID(), geometryCSVtoXML::line, alignCSCRings::s, BeamSpotOnline::sigma_z(), BeamSpotOnline::sourceID(), BeamSpotOnline::trigType(), BeamSpotOnline::version(), BeamSpotOnline::width_x(), BeamSpotOnline::width_y(), BeamSpotOnline::x(), BeamSpotOnline::y(), and BeamSpotOnline::z().

76 {
77  char zeit[128];
78  constexpr size_t kLineBufferSize = 157;
79  char line[kLineBufferSize];
80  struct tm * hora;
81 
82  s << "BeamSpotOnline Version: " << c.version() <<
83  " SourceID: "<< c.sourceID() << std::endl;
84 
85  timespec ts = c.collectionTime();
86  hora = gmtime(&ts.tv_sec);
87  strftime(zeit, sizeof(zeit), "%Y.%m.%d %H:%M:%S", hora);
88  snprintf(line, kLineBufferSize,
89  " CollectionTime: %s.%9.9d", zeit,
90  (int)ts.tv_nsec);
91  s << line << std::endl;
92 
93  snprintf(line, kLineBufferSize,
94  " TrigType: %d EventID: %d BunchNumber: %d",
95  c.trigType(), c.eventID(), c.bunchNumber());
96  s << line << std::endl;
97 
98  snprintf(line, kLineBufferSize,
99  " x: %e +/- %e width: %e +/- %e",
100  c.x(), c.err_x(), c.width_x(), c.err_width_x());
101  s << line << std::endl;
102 
103  snprintf(line, kLineBufferSize,
104  " y: %e +/- %e width: %e +/- %e",
105  c.y(), c.err_y(), c.width_y(), c.err_width_y());
106  s << line << std::endl;
107 
108  snprintf(line, kLineBufferSize,
109  " z: %e +/- %e sigma: %e +/- %e",
110  c.z(), c.err_z(), c.sigma_z(), c.err_sigma_z());
111  s << line << std::endl;
112 
113  snprintf(line, kLineBufferSize,
114  " dxdy: %e +/- %e dydz: %e +/- %e",
115  c.dxdz(), c.err_dxdz(), c.dydz(), c.err_dydz());
116  s << line << std::endl;
117  return s;
118 }
float err_y() const
float dxdz() const
float err_x() const
float dydz() const
float sigma_z() const
float y() const
float x() const
float err_dydz() const
float z() const
float width_y() const
float err_width_y() const
#define constexpr
unsigned int sourceID() const
unsigned int bunchNumber() const
int version() const
float err_dxdz() const
float err_width_x() const
float err_z() const
timespec collectionTime() const
unsigned int eventID() const
float width_x() const
unsigned int trigType() const
float err_sigma_z() const