|
|
Go to the documentation of this file.
25 #include "CLHEP/Random/RandGaussQ.h"
26 #include "CLHEP/Units/GlobalSystemOfUnits.h"
27 #include "CLHEP/Units/GlobalPhysicalConstants.h"
29 #include "HepMC/SimpleVector.h"
37 readDB_ =
p.getParameter<
bool>(
"readDB");
39 fX0 =
p.getParameter<
double>(
"X0") * cm;
40 fY0 =
p.getParameter<
double>(
"Y0") * cm;
41 fZ0 =
p.getParameter<
double>(
"Z0") * cm;
42 fSigmaZ =
p.getParameter<
double>(
"SigmaZ") * cm;
43 fbetastar =
p.getParameter<
double>(
"BetaStar") * cm;
44 femittance =
p.getParameter<
double>(
"Emittance") * cm;
45 fTimeOffset =
p.getParameter<
double>(
"TimeOffset") * ns * c_light;
47 setBoost(
p.getParameter<
double>(
"Alpha") * radian,
p.getParameter<
double>(
"Phi") * radian);
49 throw cms::Exception(
"Configuration") <<
"Error in BetafuncEvtVtxGenerator: "
50 <<
"Illegal resolution in Z (SigmaZ is negative)";
82 double tmp_sigz = CLHEP::RandGaussQ::shoot(engine, 0.,
fSigmaZ);
87 tmp_sigx /=
sqrt(2.0);
88 X = CLHEP::RandGaussQ::shoot(engine, 0., tmp_sigx) +
fX0;
92 tmp_sigy /=
sqrt(2.0);
93 Y = CLHEP::RandGaussQ::shoot(engine, 0., tmp_sigy) +
fY0;
95 double tmp_sigt = CLHEP::RandGaussQ::shoot(engine, 0.,
fSigmaZ);
98 return HepMC::FourVector(
X,
Y,
Z,
T);
108 TMatrixD tmpboost(4, 4);
116 tmpboost(0, 0) = 1. /
cos(
phi);
126 tmpboost(2, 2) =
cos(
phi);
142 throw cms::Exception(
"LogicError") <<
"Error in BetafuncEvtVtxGenerator::sigmaZ: "
143 <<
"Illegal resolution in Z (negative)";
bool check(const edm::EventSetup &iSetup)
BetafuncEvtVtxGenerator(const edm::ParameterSet &p)
~BetafuncEvtVtxGenerator() override
void sigmaZ(double s=1.0)
set resolution in Z in cm
alpha
zGenParticlesMatch = cms.InputTag(""),
double BetaFunction(double z, double z0) const
beta function
Sin< T >::type sin(const T &t)
void beginRun(const edm::Run &, const edm::EventSetup &) override
Cos< T >::type cos(const T &t)
void setBoost(double alpha, double phi)
HepMC::FourVector newVertex(CLHEP::HepRandomEngine *) const override
return a new event vertex
edm::ESWatcher< SimBeamSpotObjectsRcd > parameterWatcher_
TMatrixD const * GetInvLorentzBoost() const override
Tan< T >::type tan(const T &t)
void update(const edm::EventSetup &iEventSetup)
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override