22 #include <CLHEP/Random/RandGauss.h> 53 <<
"The BeamDivergenceVtxGenerator requires the RandomNumberGeneratorService\n" 54 "which is not present in the configuration file. \n" 55 "You must add the service\n" 56 "in the configuration file or remove the modules that require it.";
58 produces<edm::HepMCProduct>();
89 HepMC::FourVector
shift(vtx_x*1E1, vtx_y*1E1, vtx_z*1E1, 0.);
90 pEvent->applyVtxGen(&shift);
101 for (HepMC::GenEvent::particle_iterator
part = genevt->particles_begin();
part != genevt->particles_end(); ++
part) {
102 const HepMC::FourVector mom = (*part)->momentum();
107 double th_x = mom.x() / mom.z();
108 double th_y = mom.y() / mom.z();
120 const double sign = (mom.z() > 0.) ? 1. : -1.;
121 const double p_z = sign * mom.rho() /
sqrt(1. + th_x*th_x + th_y*th_y);
124 (*part)->set_momentum(HepMC::FourVector(p_z * th_x, p_z * th_y, p_z, mom.e()));
139 ->setComment(
"input collection where to retrieve outgoing particles kinematics to be smeared");
140 desc.
add<
bool>(
"simulateBeamDivergence",
true)->setComment(
"account for the beam angular divergence?");
141 desc.
add<
bool>(
"simulateVertex",
true)->setComment(
"account for the vertex transverse smearing?");
143 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