10 #include "CLHEP/Geometry/Transform3D.h"
11 #include "CLHEP/Random/RandFlat.h"
12 #include "CLHEP/Random/RandGaussQ.h"
13 #include "CLHEP/Units/GlobalSystemOfUnits.h"
14 #include "CLHEP/Units/GlobalPhysicalConstants.h"
15 #include "HepMC/SimpleVector.h"
32 eta(0.5*(fMinEta+fMaxEta));
33 phi(0.5*(fMinPhi+fMaxPhi));
52 for (
unsigned int i=0;
i<
fdistn.size();
i++) {
69 edm::LogInfo(
"VertexGenerator") <<
"BeamProfileVtxGenerator: with "
70 <<
"beam along eta = " <<
fEta
71 <<
" (Theta = " <<
fTheta/deg
72 <<
") phi = " <<
fPhi/deg
73 <<
") psi = " <<
fPsi/deg
74 <<
" centred at (" <<
fMeanX <<
", "
76 <<
"and spread (" <<
fSigmaX <<
", "
77 <<
fSigmaY <<
") of type Gaussian = "
81 <<
" along X and " << nBiny
94 double r1 = (
dynamic_cast<CLHEP::RandFlat*
>(
fRandom))->fire();
96 for (
unsigned int i=0;
i<
fdistn.size();
i++) {
100 ix =
nBinx-1; iy = nBiny-1;
125 const HepGeom::Vector3D<double> av ( aX, aY,
fMeanZ ) ;
134 const HepGeom::RotateZ3D R1 (
fPhi -
M_PI ) ;
135 const HepGeom::Point3D<double> xUnit ( 0,1,0 ) ;
136 const HepGeom::Point3D<double> zUnit ( 0,0,1 ) ;
137 const HepGeom::Transform3D RXRZ ( HepGeom::Rotate3D( -
fTheta, R1*xUnit )*R1 ) ;
138 const HepGeom::Transform3D TRF ( HepGeom::Rotate3D(
fPsi,RXRZ*zUnit)*RXRZ ) ;
156 const HepGeom::Vector3D<double> pv ( TRF*av ) ;
167 LogDebug(
"VertexGenerator") <<
"BeamProfileVtxGenerator: Vertex created "
168 <<
"at (" << xp <<
", " << yp <<
", "
178 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
179 <<
" Illegal resolution in X " << s
180 <<
"- set to default value 0 cm";
190 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
191 <<
" Illegal resolution in Y " << s
192 <<
"- set to default value 0 cm";
void meanY(double m=0)
set mean in Y in cm
T getParameter(std::string const &) const
virtual HepMC::FourVector * newVertex()
return a new event vertex
CLHEP::HepRandomEngine & getEngine()
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
CLHEP::HepRandom * fRandom
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