 |
Belle II Software
release-05-02-19
|
11 #include <generators/modules/BeamParametersModule.h>
12 #include <framework/database/Database.h>
28 setDescription(
"Setting of beam parameters. This module allows to set the "
29 "beamparameters to be used by generators and analyis. One can "
30 "either select from a list of predefined parameter sets or "
31 "manually set the parameters to use.");
34 addParam(
"energyHER", m_energyHER,
"Energy of the High Energy Ring", 7.0);
35 addParam(
"angleHER", m_angleHER,
"angle of the High Energy Ring. "
36 "Negative values are interpreted as pi - value", 0.0415);
37 addParam(
"covHER", m_covHER,
"covariance matrix of the High Energy Ring. This "
38 "can either be one value which is the squared energy spread, three "
39 "values corresponding to the variances of energy and the horizontal "
40 "and vertial spread (E, theta_x, theta_y) or a full covariance "
41 "matrix with 9 elements", std::vector<double>(1, 0));
42 addParam(
"energyLER", m_energyLER,
"Energy of the Low Energy Ring", 4.0);
43 addParam(
"angleLER", m_angleLER,
"angle of the Low Energy Ring. "
44 "Negative values are interpreted as pi - value", -0.0415);
45 addParam(
"covLER", m_covLER,
"covariance matrix of the Low Energy Ring. This "
46 "can either be one value which is the squared energy spread, three "
47 "values corresponding to the variances of energy and the horizontal "
48 "and vertial spread (E, theta_x, theta_y) or a full covariance "
49 "matrix with 9 elements", std::vector<double>(1, 0));
50 addParam(
"vertex", m_vertex,
"nominal vertex position", std::vector<double>(3, 0));
51 addParam(
"covVertex", m_covVertex,
"covariance matrix of the nominal vertex "
52 "position. Can be either one value which is the common variance for "
53 "all directions, three values for the variance of x, y and z or a "
54 "full covariance matrix", std::vector<double>(1, 0));
55 addParam(
"smearEnergy", m_smearEnergy,
"if true, smear energy when generating "
56 "initial events",
true);
57 addParam(
"smearDirection", m_smearDirection,
"if true, smear beam direction "
58 "when generating initial events",
true);
59 addParam(
"smearVertex", m_smearVertex,
"if true, smear vertex position when "
60 "generating initial events",
true);
61 addParam(
"generateCMS", m_generateCMS,
"if true, generate events in CMS, not "
63 addParam(
"createPayload", m_createPayload,
"if true create a database payload "
64 "with the iov given with the payloadIov parameter",
false);
65 addParam(
"payloadIov", m_payloadIov,
"iov of the payload to be created. List "
66 "of four numbers: first experiment, first run, last experiment, "
67 "last run", m_payloadIov);
78 B2ERROR(
"Vertex position needs to have 3 entries");
A class that describes the interval of experiments/runs for which an object in the database is valid.
BeamParameters m_beamParams
Copy of the beamparameters created from the parameters.
@ c_smearBeamEnergy
smear energy of HER and LER (but not direction)
void addConstantOverride(const std::string &name, TObject *obj, bool oneRun=false)
Add constant override payload.
Setting of beam parameters.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_smearBeamDirection
smear direction of HER and LER (but not energy)
bool storeData(const std::string &name, TObject *object, const IntervalOfValidity &iov)
Store an object in the database.
bool m_createPayload
if true create a new payload with the given parameters
std::vector< double > m_vertex
nominal vertex position
std::vector< double > m_covVertex
covariance matrix for the vertex position
virtual void initialize() override
Create the Beamparameters.
std::vector< int > m_payloadIov
iov when creating a database payload
void setGenerationFlags(int flags)
Set the generation flags to be used for event generation (ORed combination of EGenerationFlags)
@ c_smearVertex
smear vertex
double m_angleLER
theta angle of the Low Energy Ring
void setVertex(const TVector3 &vertex, const std::vector< double > &cov)
Set the vertex position and error matrix.
std::vector< double > m_covHER
Covariance matrix for the High Energy Ring.
@ c_generateCMS
generate initial event in CMS instead of lab
Abstract base class for different kinds of events.
double m_energyLER
Energy of the Low Energy Ring.
void setHER(double energy, double angle, const std::vector< double > &cov)
Set the HER FourVector and error matrix from beam energy, angle and covariance entries.
bool m_smearVertex
if true, smear vertex position when generating initial events
bool m_generateCMS
if true, generate events in CMS, not lab system
static DBStore & Instance()
Instance of a singleton DBStore.
bool m_smearEnergy
if true, smear energy when generating initial events
static Database & Instance()
Instance of a singleton Database.
void setLER(double energy, double angle, const std::vector< double > &cov)
Set the LER FourVector and error matrix from beam energy, angle and covariance entries.
std::vector< double > m_covLER
Covariance matrix for the Low Energy Ring.
bool m_smearDirection
if true, smear beam direction when generating initial events
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
double m_energyHER
Energy of the High Energy Ring.
double m_angleHER
theta angle of the High Energy Ring