9 #include "CLHEP/Geometry/Transform3D.h"
10 #include "CLHEP/Random/RandFlat.h"
11 #include "CLHEP/Random/RandGaussQ.h"
12 #include "CLHEP/Units/GlobalSystemOfUnits.h"
13 #include "CLHEP/Units/GlobalPhysicalConstants.h"
14 #include "HepMC/SimpleVector.h"
29 eta(0.5 * (fMinEta + fMaxEta));
30 phi(0.5 * (fMinPhi + fMaxPhi));
49 for (
unsigned int i = 0;
i <
fdistn.size();
i++) {
66 edm::LogInfo(
"VertexGenerator") <<
"BeamProfileVtxGenerator: with "
67 <<
"beam along eta = " <<
fEta <<
" (Theta = " <<
fTheta / deg
68 <<
") phi = " <<
fPhi / deg <<
") psi = " <<
fPsi / deg <<
" centred at (" <<
fMeanX
71 <<
" use file " <<
ffile;
74 <<
" along X and " << nBiny <<
" bins along Y";
83 double r1 = engine->flat();
85 for (
unsigned int i = 0;
i <
fdistn.size();
i++) {
94 iy = (ixy - ix) /
nBinx;
97 aY = 0.5 * (2 * iy - nBiny + 2 * engine->flat()) *
fSigmaY +
fMeanY;
115 const HepGeom::Vector3D<double> av(aX, aY,
fMeanZ);
124 const HepGeom::RotateZ3D R1(
fPhi -
M_PI);
125 const HepGeom::Point3D<double> xUnit(0, 1, 0);
126 const HepGeom::Point3D<double> zUnit(0, 0, 1);
127 const HepGeom::Transform3D RXRZ(HepGeom::Rotate3D(-
fTheta, R1 * xUnit) * R1);
128 const HepGeom::Transform3D TRF(HepGeom::Rotate3D(
fPsi, RXRZ * zUnit) * RXRZ);
146 const HepGeom::Vector3D<double>
pv(TRF * av);
153 LogDebug(
"VertexGenerator") <<
"BeamProfileVtxGenerator: Vertex created "
154 <<
"at (" << xp <<
", " << yp <<
", " << zp <<
", " <<
fTimeOffset <<
")";
155 return HepMC::FourVector(xp, yp, zp, fTimeOffset);
163 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
164 <<
" Illegal resolution in X " << s <<
"- set to default value 0 cm";
173 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
174 <<
" 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
Exp< T >::type exp(const T &t)
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
BeamProfileVtxGenerator(const edm::ParameterSet &p)
T getParameter(std::string const &) const
void sigmaY(double s=1.0)
set resolution in Y in cm
Log< level::Warning, false > LogWarning