8 #include "CLHEP/Random/RandGaussQ.h" 9 #include "CLHEP/Units/GlobalSystemOfUnits.h" 10 #include "CLHEP/Units/GlobalPhysicalConstants.h" 12 #include "HepMC/SimpleVector.h" 15 readDB_ =
p.getParameter<
bool>(
"readDB");
17 fMeanX =
p.getParameter<
double>(
"MeanX") * cm;
18 fMeanY =
p.getParameter<
double>(
"MeanY") * cm;
19 fMeanZ =
p.getParameter<
double>(
"MeanZ") * cm;
20 fSigmaX =
p.getParameter<
double>(
"SigmaX") * cm;
21 fSigmaY =
p.getParameter<
double>(
"SigmaY") * cm;
22 fSigmaZ =
p.getParameter<
double>(
"SigmaZ") * cm;
23 fTimeOffset =
p.getParameter<
double>(
"TimeOffset") * ns * c_light;
26 throw cms::Exception(
"Configuration") <<
"Error in GaussEvtVtxGenerator: " 27 <<
"Illegal resolution in X (SigmaX is negative)";
30 throw cms::Exception(
"Configuration") <<
"Error in GaussEvtVtxGenerator: " 31 <<
"Illegal resolution in Y (SigmaY is negative)";
34 throw cms::Exception(
"Configuration") <<
"Error in GaussEvtVtxGenerator: " 35 <<
"Illegal resolution in Z (SigmaZ is negative)";
41 beamToken_ = esConsumes<SimBeamSpotObjects, SimBeamSpotObjectsRcd, edm::Transition::BeginLuminosityBlock>();
69 return HepMC::FourVector(
X,
Y,
Z,
T);
76 throw cms::Exception(
"LogicError") <<
"Error in GaussEvtVtxGenerator::sigmaX: " 77 <<
"Illegal resolution in X (negative)";
85 throw cms::Exception(
"LogicError") <<
"Error in GaussEvtVtxGenerator::sigmaY: " 86 <<
"Illegal resolution in Y (negative)";
94 throw cms::Exception(
"LogicError") <<
"Error in GaussEvtVtxGenerator::sigmaZ: " 95 <<
"Illegal resolution in Z (negative)";
double sigmaX() const
get sigmaX, sigmaY, sigmaZ
void sigmaY(double s=1.0)
set resolution in Y in cm
edm::ESGetToken< SimBeamSpotObjects, SimBeamSpotObjectsRcd > beamToken_
double meanX() const
get meanX, meanY, meanZ position
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void sigmaX(double s=1.0)
set resolution in X in cm
void update(const edm::EventSetup &iEventSetup)
edm::ESWatcher< SimBeamSpotObjectsRcd > parameterWatcher_
GaussEvtVtxGenerator(const edm::ParameterSet &p)
HepMC::FourVector newVertex(CLHEP::HepRandomEngine *) const override
return a new event vertex
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
double timeOffset() const
bool check(const edm::EventSetup &iSetup)
void sigmaZ(double s=1.0)
set resolution in Z in cm