9 #include <CLHEP/Geometry/Transform3D.h> 10 #include <CLHEP/Random/RandFlat.h> 11 #include <CLHEP/Random/RandGaussQ.h> 12 #include <CLHEP/Units/SystemOfUnits.h> 13 #include <CLHEP/Units/GlobalPhysicalConstants.h> 14 #include "HepMC/SimpleVector.h" 24 meanX(
p.getParameter<
double>(
"BeamMeanX") * cm);
25 meanY(
p.getParameter<
double>(
"BeamMeanY") * cm);
26 beamPos(
p.getParameter<
double>(
"BeamPosition") * cm);
27 sigmaX(
p.getParameter<
double>(
"BeamSigmaX") * cm);
28 sigmaY(
p.getParameter<
double>(
"BeamSigmaY") * cm);
29 double fMinEta =
p.getParameter<
double>(
"MinEta");
30 double fMaxEta =
p.getParameter<
double>(
"MaxEta");
31 double fMinPhi =
p.getParameter<
double>(
"MinPhi");
32 double fMaxPhi =
p.getParameter<
double>(
"MaxPhi");
33 eta(0.5 * (fMinEta + fMaxEta));
34 phi(0.5 * (fMinPhi + fMaxPhi));
35 psi(
p.getParameter<
double>(
"Psi"));
36 nBinx =
p.getParameter<
int>(
"BinX");
37 nBiny =
p.getParameter<
int>(
"BinY");
38 ffile =
p.getParameter<
bool>(
"UseFile");
39 fTimeOffset =
p.getParameter<
double>(
"TimeOffset") * ns * c_light;
53 for (
unsigned int i = 0;
i <
fdistn.size();
i++) {
67 setType(
p.getParameter<
bool>(
"GaussianProfile"));
70 edm::LogInfo(
"VertexGenerator") <<
"BeamProfileVtxGenerator: with " 71 <<
"beam along eta = " <<
fEta <<
" (Theta = " <<
fTheta / deg
72 <<
") phi = " <<
fPhi / deg <<
") psi = " <<
fPsi / deg <<
" centred at (" <<
fMeanX 75 <<
" use file " <<
ffile;
78 <<
" along X and " <<
nBiny <<
" bins along Y";
87 double r1 = engine->flat();
89 for (
unsigned int i = 0;
i <
fdistn.size();
i++) {
119 const HepGeom::Vector3D<double> av(aX, aY,
fMeanZ);
128 const HepGeom::RotateZ3D R1(
fPhi -
M_PI);
129 const HepGeom::Point3D<double> xUnit(0, 1, 0);
130 const HepGeom::Point3D<double> zUnit(0, 0, 1);
131 const HepGeom::Transform3D RXRZ(HepGeom::Rotate3D(-
fTheta, R1 * xUnit) * R1);
132 const HepGeom::Transform3D TRF(HepGeom::Rotate3D(
fPsi, RXRZ * zUnit) * RXRZ);
150 const HepGeom::Vector3D<double>
pv(TRF * av);
157 LogDebug(
"VertexGenerator") <<
"BeamProfileVtxGenerator: Vertex created " 158 <<
"at (" << xp <<
", " << yp <<
", " << zp <<
", " <<
fTimeOffset <<
")";
167 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:" 168 <<
" Illegal resolution in X " <<
s <<
"- set to default value 0 cm";
177 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:" 178 <<
" Illegal resolution in Y " <<
s <<
"- set to default value 0 cm";
void meanY(double m=0)
set mean in Y in cm
void setType(bool m=true)
set type
Sin< T >::type sin(const T &t)
void meanX(double m=0)
set mean in X in cm
void psi(double m=999)
set psi in radian
std::vector< double > fdistn
void sigmaX(double s=1.0)
set resolution in X in cm
Cos< T >::type cos(const T &t)
void beamPos(double m=0)
set mean in Z in cm
void phi(double m=0)
set phi in radian
void eta(double m=0)
set eta
~BeamProfileVtxGenerator() override
HepMC::FourVector newVertex(CLHEP::HepRandomEngine *) const override
return a new event vertex
Log< level::Info, false > LogInfo
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
BeamProfileVtxGenerator(const edm::ParameterSet &p)
void sigmaY(double s=1.0)
set resolution in Y in cm
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
Log< level::Warning, false > LogWarning