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"
31 eta(0.5*(fMinEta+fMaxEta));
32 phi(0.5*(fMinPhi+fMaxPhi));
51 for (
unsigned int i=0;
i<
fdistn.size();
i++) {
68 edm::LogInfo(
"VertexGenerator") <<
"BeamProfileVtxGenerator: with "
69 <<
"beam along eta = " <<
fEta
70 <<
" (Theta = " <<
fTheta/deg
71 <<
") phi = " <<
fPhi/deg
72 <<
") psi = " <<
fPsi/deg
73 <<
" centred at (" <<
fMeanX <<
", "
75 <<
"and spread (" <<
fSigmaX <<
", "
76 <<
fSigmaY <<
") of type Gaussian = "
80 <<
" along X and " << nBiny
92 double r1 = engine->flat();
94 for (
unsigned int i=0;
i<
fdistn.size();
i++) {
98 ix =
nBinx-1; iy = nBiny-1;
123 const HepGeom::Vector3D<double> av ( aX, aY,
fMeanZ ) ;
132 const HepGeom::RotateZ3D R1 (
fPhi -
M_PI ) ;
133 const HepGeom::Point3D<double> xUnit ( 0,1,0 ) ;
134 const HepGeom::Point3D<double> zUnit ( 0,0,1 ) ;
135 const HepGeom::Transform3D RXRZ ( HepGeom::Rotate3D( -
fTheta, R1*xUnit )*R1 ) ;
136 const HepGeom::Transform3D TRF ( HepGeom::Rotate3D(
fPsi,RXRZ*zUnit)*RXRZ ) ;
154 const HepGeom::Vector3D<double> pv ( TRF*av ) ;
165 LogDebug(
"VertexGenerator") <<
"BeamProfileVtxGenerator: Vertex created "
166 <<
"at (" << xp <<
", " << yp <<
", "
176 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
177 <<
" Illegal resolution in X " << s
178 <<
"- set to default value 0 cm";
188 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
189 <<
" Illegal resolution in Y " << s
190 <<
"- set to default value 0 cm";
void meanY(double m=0)
set mean in Y in cm
T getParameter(std::string const &) const
HepMC::FourVector * fVertex
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
virtual HepMC::FourVector * newVertex(CLHEP::HepRandomEngine *)
return a new event vertex
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(const edm::ParameterSet &p)
virtual ~BeamProfileVtxGenerator()
void sigmaY(double s=1.0)
set resolution in Y in cm