5 #include "CLHEP/Random/RandGaussQ.h" 6 #include "CLHEP/Units/GlobalSystemOfUnits.h" 7 #include "CLHEP/Units/GlobalPhysicalConstants.h" 8 #include "HepMC/SimpleVector.h" 11 readDB_ =
p.getParameter<
bool>(
"readDB");
13 fMeanX =
p.getParameter<
double>(
"MeanX") * cm;
14 fMeanY =
p.getParameter<
double>(
"MeanY") * cm;
15 fMeanZ =
p.getParameter<
double>(
"MeanZ") * cm;
16 fSigmaX =
p.getParameter<
double>(
"SigmaX") * cm;
17 fSigmaY =
p.getParameter<
double>(
"SigmaY") * cm;
18 fSigmaZ =
p.getParameter<
double>(
"SigmaZ") * cm;
19 fTimeOffset =
p.getParameter<
double>(
"TimeOffset") * ns * c_light;
22 throw cms::Exception(
"Configuration") <<
"Error in GaussEvtVtxGenerator: " 23 <<
"Illegal resolution in X (SigmaX is negative)";
26 throw cms::Exception(
"Configuration") <<
"Error in GaussEvtVtxGenerator: " 27 <<
"Illegal resolution in Y (SigmaY is negative)";
30 throw cms::Exception(
"Configuration") <<
"Error in GaussEvtVtxGenerator: " 31 <<
"Illegal resolution in Z (SigmaZ is negative)";
37 beamToken_ = esConsumes<SimBeamSpotObjects, SimBeamSpotObjectsRcd, edm::Transition::BeginLuminosityBlock>();
65 return HepMC::FourVector(
X,
Y,
Z,
T);
72 throw cms::Exception(
"LogicError") <<
"Error in GaussEvtVtxGenerator::sigmaX: " 73 <<
"Illegal resolution in X (negative)";
81 throw cms::Exception(
"LogicError") <<
"Error in GaussEvtVtxGenerator::sigmaY: " 82 <<
"Illegal resolution in Y (negative)";
90 throw cms::Exception(
"LogicError") <<
"Error in GaussEvtVtxGenerator::sigmaZ: " 91 <<
"Illegal resolution in Z (negative)";
97 desc.add<
double>(
"MeanX", 0.0)->setComment(
"in cm");
98 desc.add<
double>(
"MeanY", 0.0)->setComment(
"in cm");
99 desc.add<
double>(
"MeanZ", 0.0)->setComment(
"in cm");
100 desc.add<
double>(
"SigmaX", 0.0)->setComment(
"in cm");
101 desc.add<
double>(
"SigmaY", 0.0)->setComment(
"in cm");
102 desc.add<
double>(
"SigmaZ", 0.0)->setComment(
"in cm");
103 desc.add<
double>(
"TimeOffset", 0.0)->setComment(
"in ns");
105 desc.add<
bool>(
"readDB");
106 descriptions.
add(
"GaussEvtVtxGenerator",
desc);
double sigmaX() const
get sigmaX, sigmaY, sigmaZ
void sigmaY(double s=1.0)
set resolution in Y in cm
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
void sigmaZ(double s=1.0)
set resolution in Z in cm