9#include <framework/modules/core/PrintBeamParametersModule.h>
10#include <framework/logging/Logger.h>
35 std::stringstream out;
36 const ROOT::Math::PxPyPzEVector& her =
m_beamparams->getHER();
37 const ROOT::Math::PxPyPzEVector& ler =
m_beamparams->getLER();
38 const ROOT::Math::PxPyPzEVector& cms = her + ler;
39 const ROOT::Math::XYZVector& vtx =
m_beamparams->getVertex();
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 ?
", " :
")");
void setDescription(const std::string &description)
Sets the description of the module.
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
PrintBeamParametersModule()
Constructor: Sets the description, the properties and the parameters of the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.