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
93 double r1 = (
dynamic_cast<CLHEP::RandFlat*
>(
fRandom))->fire();
95 for (
unsigned int i=0;
i<
fdistn.size();
i++) {
99 ix =
nBinx-1; iy = nBiny-1;
124 const HepGeom::Vector3D<double> av ( aX, aY,
fMeanZ ) ;
133 const HepGeom::RotateZ3D R1 (
fPhi -
M_PI ) ;
134 const HepGeom::Point3D<double> xUnit ( 0,1,0 ) ;
135 const HepGeom::Point3D<double> zUnit ( 0,0,1 ) ;
136 const HepGeom::Transform3D RXRZ ( HepGeom::Rotate3D( -
fTheta, R1*xUnit )*R1 ) ;
137 const HepGeom::Transform3D TRF ( HepGeom::Rotate3D(
fPsi,RXRZ*zUnit)*RXRZ ) ;
155 const HepGeom::Vector3D<double> pv ( TRF*av ) ;
166 LogDebug(
"VertexGenerator") <<
"BeamProfileVtxGenerator: Vertex created "
167 <<
"at (" << xp <<
", " << yp <<
", "
177 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
178 <<
" Illegal resolution in X " << s
179 <<
"- set to default value 0 cm";
189 edm::LogWarning(
"VertexGenerator") <<
"Warning BeamProfileVtxGenerator:"
190 <<
" Illegal resolution in Y " << s
191 <<
"- 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