9#include <framework/dataobjects/MCInitialParticles.h>
15 std::string flags =
"";
16 const std::vector<std::pair<int, std::string>> flagvalues{
22 for (
auto& i : flagvalues) {
24 if (flags.size() > 0) flags += separator;
34 ROOT::Math::LorentzRotation boost(ROOT::Math::Boost(-1.*ROOT::Math::XYZVector(bX, bY, bZ)));
38 ROOT::Math::XYZVector zaxis(0., 0., 1.);
40 double tanAngleXZ = tan(angleXZ);
41 double tanAngleYZ = tan(angleYZ);
42 double Norm = 1 /
sqrt(1 + pow(tanAngleXZ, 2) + pow(tanAngleYZ, 2));
43 ROOT::Math::XYZVector electronCMS(Norm * tanAngleXZ, Norm * tanAngleYZ, Norm);
45 ROOT::Math::XYZVector rotAxis = zaxis.Cross(electronCMS);
46 double rotangle = asin(rotAxis.R());
48 ROOT::Math::LorentzRotation rotation(ROOT::Math::AxisAngle(rotAxis, -rotangle));
51 ROOT::Math::LorentzRotation trans = rotation * boost;
52 ROOT::Math::LorentzRotation transI = trans.Inverse();
@ c_smearVertex
smear vertex
@ c_generateCMS
generate initial event in CMS instead of lab
@ c_smearBeamEnergy
smear energy of HER and LER (but not direction)
@ c_smearBeamDirection
smear direction of HER and LER (but not energy)
std::string getGenerationFlagString(const std::string &separator=" ") const
Return string representation of all active flags for printing.
static ROOT::Math::LorentzRotation cmsToLab(double bX, double bY, double bZ, double angleXZ, double angleYZ)
Return the LorentzRotation from CMS to LAB based on the following parameters.
bool hasGenerationFlags(int flags) const
Check if a certain set of EGenerationFlags is set.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.