9 #include <framework/modules/core/PrintBeamParametersModule.h>
10 #include <framework/logging/Logger.h>
27 setDescription(
"Print the BeamParameters everytime they change");
35 std::stringstream out;
38 const TLorentzVector& cms = her + ler;
40 out <<
"BeamParameters: cms Energy=" <<
m_beamparams->getMass() <<
" GeV, flags="
42 <<
" HER=(" << her.X() <<
", " << her.Y() <<
", " << her.Z() <<
", " << her.E() <<
"), " << std::endl
43 <<
" LER=(" << ler.X() <<
", " << ler.Y() <<
", " << ler.Z() <<
", " << ler.E() <<
"), " << std::endl
44 <<
" CMS=(" << cms.X() <<
", " << cms.Y() <<
", " << cms.Z() <<
", " << cms.E() <<
"), " << std::endl
45 <<
" VTX=(" << vtx.X() <<
", " << vtx.Y() <<
", " << vtx.Z() <<
"), " << std::endl
48 out << std::endl <<
" CovLER=";
50 out << std::endl <<
" CovVTX=";
58 bool offdiag = cov(0, 1) != 0 || cov(0, 2) != 0 || cov(1, 2) != 0;
62 for (
int i = 0; i < 3; ++i) {
63 out << (i > 0 ?
", " :
"") <<
"(";
64 for (
int j = 0; j < 3; ++j) {
65 out << cov(i, j) << (j < 2 ?
", " :
")");
72 for (
int i = 0; i < 3; ++i) {
73 out << cov(i, i) << (i < 2 ?
", " :
")");
Print the BeamParameters everytime they change.
static void printCovMatrix(std::ostream &out, const TMatrixDSym &cov)
print a covariance matrix and simplify it to three elements if the off diagonals are zero
DBObjPtr< BeamParameters > m_beamparams
Pointer to the BeamParameters.
void event() override
print the Beam Parameters if they changed
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.