CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 69 of file BeamSpotOnline.cc.

References BeamSpotOnline::bunchNumber(), BeamSpotOnline::collectionTime(), 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().

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