22 #include <CLHEP/Random/RandGauss.h> 51 <<
"The BeamDivergenceVtxGenerator requires the RandomNumberGeneratorService\n" 52 "which is not present in the configuration file. \n" 53 "You must add the service\n" 54 "in the configuration file or remove the modules that require it.";
56 produces<edm::HepMCProduct>();
88 HepMC::FourVector
shift(vtx_x * 1E1, vtx_y * 1E1, vtx_z * 1E1, 0.);
89 pEvent->applyVtxGen(&shift);
100 for (HepMC::GenEvent::particle_iterator
part = genevt->particles_begin();
part != genevt->particles_end(); ++
part) {
101 const HepMC::FourVector mom = (*part)->momentum();
106 double th_x = mom.x() / mom.z();
107 double th_y = mom.y() / mom.z();
118 const double sign = (mom.z() > 0.) ? 1. : -1.;
119 const double p_z = sign * mom.rho() /
sqrt(1. + th_x * th_x + th_y * th_y);
122 (*part)->set_momentum(HepMC::FourVector(p_z * th_x, p_z * th_y, p_z, mom.e()));
135 ->setComment(
"input collection where to retrieve outgoing particles kinematics to be smeared");
136 desc.
add<
bool>(
"simulateBeamDivergence",
true)->setComment(
"account for the beam angular divergence?");
137 desc.
add<
bool>(
"simulateVertex",
true)->setComment(
"account for the vertex transverse smearing?");
139 descriptions.
add(
"beamDivergenceVtxGenerator", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static void fillDescriptions(edm::ConfigurationDescriptions &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double getBeamDivergenceX56() const
double getVtxStddevZ() const
double getVtxOffsetX45() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
double getBeamDivergenceX45() const
double getBeamDivergenceY56() const
#define DEFINE_FWK_MODULE(type)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< edm::HepMCProduct > sourceToken_
double getVtxStddevX() const
double getBeamDivergenceY45() const
const HepMC::GenEvent * GetEvent() const
BeamDivergenceVtxGenerator(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~BeamDivergenceVtxGenerator() override=default
double getVtxOffsetZ45() const
double getVtxOffsetY45() const
StreamID streamID() const
bool simulateBeamDivergence_
static unsigned int const shift
double getVtxStddevY() const
void produce(edm::Event &, const edm::EventSetup &) override