11#include <framework/dataobjects/MCInitialParticles.h>
12#include <framework/logging/Logger.h>
13#include <TMatrixDSym.h>
14#include <Math/Vector4D.h>
43 std::copy_n(b.m_covHER, 6,
m_covHER);
44 std::copy_n(b.m_covLER, 6,
m_covLER);
52 std::copy_n(b.m_covHER, 6,
m_covHER);
53 std::copy_n(b.m_covLER, 6,
m_covLER);
63 auto floatcmp = [](
double dbl_a,
double dbl_b) {
return (
float)dbl_a == (float)dbl_b; };
77 B2WARNING(R
"RAW(The generation flags are not set to the default value.
79 The default value for the generation flags is 14: a different value means
80 that some smearings (beam energy, vertex position, etc.) may be turned off.
82 This is fine only for local tests or for special MC productions, but not
83 for default MC productions.)RAW");
118 void setHER(
double energy,
double angleX,
double angleY,
const std::vector<double>& cov);
136 void setLER(
double energy,
double angleX,
double angleY,
const std::vector<double>& cov);
152 void setVertex(
const ROOT::Math::XYZVector& vertex,
const std::vector<double>& cov);
175 static ROOT::Math::PxPyPzEVector
getFourVector(
double energy,
double angleX,
double angleY,
bool isHER);
198 static void setCovMatrix(Double32_t* member,
const std::vector<double>& cov,
bool common);
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
void setHER(double energy, double angleX, double angleY, const std::vector< double > &cov)
Set the HER FourVector and error matrix from beam energy, angle and covariance entries.
Double32_t m_covLER[6]
Covariance matrix of the low energy beam at the IP.
TMatrixDSym getCovVertex() const
Get the covariance matrix of the vertex position.
static ROOT::Math::PxPyPzEVector getFourVector(double energy, double angleX, double angleY, bool isHER)
Calculate FourVector of a beam from energy and angles in xz and yz planes.
Double32_t m_covHER[6]
Covariance matrix of the high energy beam at the IP.
void setLER(double energy, double angleX, double angleY, const std::vector< double > &cov)
Set the LER FourVector and error matrix from beam energy, angle and covariance entries.
static void setCovMatrix(Double32_t *member, const TMatrixDSym &cov)
Set covariance matrix from ROOT Matrix object.
BeamParameters(const BeamParameters &b)
Copy constructor.
void setCovLER(const TMatrixDSym &cov)
Set the covariance matrix for LER (E, theta_x, theta_y) where E is the energy, theta_x is the horizon...
static TMatrixDSym getCovMatrix(const Double32_t *member)
Obtain covariance matrix from a given float array.
Double32_t m_covVertex[6]
Covariance matrix of the vertex position.
void setCovHER(const TMatrixDSym &cov)
Set the covariance matrix for HER (E, theta_x, theta_y) where E is the energy, theta_x is the horizon...
BeamParameters & operator=(const BeamParameters &b)
Assignment operator.
static void setCovMatrix(Double32_t *member, const std::vector< double > &cov, bool common)
Set covariance matrix from vector of entries.
TMatrixDSym getCovLER() const
Get the covariance matrix of LER (E, theta_x, theta_y) where E is the energy, theta_x is the horizont...
ClassDefOverride(BeamParameters, 3)
ClassDef.
TMatrixDSym getCovHER() const
Get the covariance matrix of HER (E, theta_x, theta_y) where E is the energy, theta_x is the horizont...
bool operator==(const BeamParameters &b) const
Equality operator.
BeamParameters()
Default constructor.
void setVertex(const ROOT::Math::XYZVector &vertex, const std::vector< double > &cov)
Set the vertex position and error matrix.
void setGenerationFlags(int flags) override
Set the generation flags to be used for event generation (ORed combination of EGenerationFlags).
void setCovVertex(const TMatrixDSym &cov)
Set the covariance matrix of the vertex position.
This class contains the initial state for the given event.
int m_generationFlags
Flags to be used when generating events.
bool operator==(const MCInitialParticles &b) const
Equality operator.
void setVertex(const ROOT::Math::XYZVector &vertex)
Set the vertex position.
MCInitialParticles & operator=(const MCInitialParticles &b)
Assignment operator.
void setHER(const ROOT::Math::PxPyPzEVector &her)
Set the High Energy Beam 4-momentum.
void setLER(const ROOT::Math::PxPyPzEVector &ler)
Set the Low Energy Beam 4-momentum.
Abstract base class for different kinds of events.