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"
20 meanX(
p.getParameter<
double>(
"BeamMeanX") * cm);
21 meanY(
p.getParameter<
double>(
"BeamMeanY") * cm);
22 beamPos(
p.getParameter<
double>(
"BeamPosition") * cm);
23 sigmaX(
p.getParameter<
double>(
"BeamSigmaX") * cm);
24 sigmaY(
p.getParameter<
double>(
"BeamSigmaY") * cm);
25 double fMinEta =
p.getParameter<
double>(
"MinEta");
26 double fMaxEta =
p.getParameter<
double>(
"MaxEta");
27 double fMinPhi =
p.getParameter<
double>(
"MinPhi");
28 double fMaxPhi =
p.getParameter<
double>(
"MaxPhi");
29 eta(0.5 * (fMinEta + fMaxEta));
30 phi(0.5 * (fMinPhi + fMaxPhi));
31 psi(
p.getParameter<
double>(
"Psi"));
32 nBinx =
p.getParameter<
int>(
"BinX");
33 nBiny =
p.getParameter<
int>(
"BinY");
34 ffile =
p.getParameter<
bool>(
"UseFile");
35 fTimeOffset =
p.getParameter<
double>(
"TimeOffset") * ns * c_light;
49 for (
unsigned int i = 0;
i <
fdistn.size();
i++) {
63 setType(
p.getParameter<
bool>(
"GaussianProfile"));
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;
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 <<
")";
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";