|
|
◆ BeamDivergenceVtxGenerator()
BeamDivergenceVtxGenerator::BeamDivergenceVtxGenerator |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
◆ ~BeamDivergenceVtxGenerator()
BeamDivergenceVtxGenerator::~BeamDivergenceVtxGenerator |
( |
| ) |
|
|
overridedefault |
◆ addSmearedGenParticle()
Definition at line 203 of file BeamDivergenceVtxGenerator.cc.
208 HepMC::GenVertex *
vtx =
new HepMC::GenVertex(HepMC::FourVector(
209 (
gp.vx() + sp.vtx_x) * 1E1,
210 (
gp.vy() + sp.vtx_y) * 1E1,
211 (
gp.vz() + sp.vtx_z) * 1E1,
212 ( +sp.vtx_t) * 1E1));
217 vtx->add_particle_out(particle);
References TtGenEvtProducer_cfi::genEvt, GenParticle::GenParticle, runTauDisplay::gp, smearMomentum(), extraflags_cff::vtx, BeamDivergenceVtxGenerator::SmearingParameters::vtx_t, BeamDivergenceVtxGenerator::SmearingParameters::vtx_x, BeamDivergenceVtxGenerator::SmearingParameters::vtx_y, and BeamDivergenceVtxGenerator::SmearingParameters::vtx_z.
Referenced by produce().
◆ applySmearingHepMC()
Definition at line 184 of file BeamDivergenceVtxGenerator.cc.
188 const auto &
pos = (*vit)->position();
189 (*vit)->set_position(HepMC::FourVector(
pos.x() + sp.vtx_x * 1E1,
190 pos.y() + sp.vtx_y * 1E1,
191 pos.z() + sp.vtx_z * 1E1,
192 pos.t() + sp.vtx_t * 1E1));
198 (*part)->set_momentum(
smearMomentum((*part)->momentum(), sp));
References TtGenEvtProducer_cfi::genEvt, simulateBeamDivergence_, simulateVertex_, smearMomentum(), BeamDivergenceVtxGenerator::SmearingParameters::vtx_t, BeamDivergenceVtxGenerator::SmearingParameters::vtx_x, BeamDivergenceVtxGenerator::SmearingParameters::vtx_y, and BeamDivergenceVtxGenerator::SmearingParameters::vtx_z.
Referenced by produce().
◆ fillDescriptions()
◆ produce()
Definition at line 101 of file BeamDivergenceVtxGenerator.cc.
125 SmearingParameters sp;
149 for (
const auto &
gp : *hGPCollection)
References addSmearedGenParticle(), applySmearingHepMC(), BeamDivergenceVtxGenerator::SmearingParameters::bd_x_45, BeamDivergenceVtxGenerator::SmearingParameters::bd_x_56, BeamDivergenceVtxGenerator::SmearingParameters::bd_y_45, BeamDivergenceVtxGenerator::SmearingParameters::bd_y_56, beamParametersToken_, TtGenEvtProducer_cfi::genEvt, genParticleTokens_, CTPPSBeamParameters::getBeamDivergenceX45(), CTPPSBeamParameters::getBeamDivergenceX56(), CTPPSBeamParameters::getBeamDivergenceY45(), CTPPSBeamParameters::getBeamDivergenceY56(), edm::RandomNumberGenerator::getEngine(), edm::HepMCProduct::GetEvent(), edm::EventSetup::getHandle(), CTPPSBeamParameters::getVtxOffsetT45(), CTPPSBeamParameters::getVtxOffsetX45(), CTPPSBeamParameters::getVtxOffsetY45(), CTPPSBeamParameters::getVtxOffsetZ45(), CTPPSBeamParameters::getVtxStddevT(), CTPPSBeamParameters::getVtxStddevX(), CTPPSBeamParameters::getVtxStddevY(), CTPPSBeamParameters::getVtxStddevZ(), runTauDisplay::gp, iEvent, edm::EDGetTokenT< T >::isUninitialized(), eostools::move(), convertSQLitetoXML_cfg::output, simulateBeamDivergence_, simulateVertex_, sourceToken_, unpackBuffers-CaloStage2::token, BeamDivergenceVtxGenerator::SmearingParameters::vtx_t, BeamDivergenceVtxGenerator::SmearingParameters::vtx_x, BeamDivergenceVtxGenerator::SmearingParameters::vtx_y, and BeamDivergenceVtxGenerator::SmearingParameters::vtx_z.
◆ smearMomentum()
template<typename T >
HepMC::FourVector BeamDivergenceVtxGenerator::smearMomentum |
( |
const T & |
mom, |
|
|
const SmearingParameters & |
sp |
|
) |
| |
|
staticprivate |
Definition at line 159 of file BeamDivergenceVtxGenerator.cc.
164 double th_x = mom.x() / mom.z();
165 double th_y = mom.y() / mom.z();
176 const double sign = (mom.z() > 0.) ? 1. : -1.;
177 const double p =
sqrt(mom.x() * mom.x() + mom.y() * mom.y() + mom.z() * mom.z());
178 const double p_z =
sign *
p /
sqrt(1. + th_x * th_x + th_y * th_y);
180 return HepMC::FourVector(p_z * th_x, p_z * th_y, p_z, mom.e());
References BeamDivergenceVtxGenerator::SmearingParameters::bd_x_45, BeamDivergenceVtxGenerator::SmearingParameters::bd_x_56, BeamDivergenceVtxGenerator::SmearingParameters::bd_y_45, BeamDivergenceVtxGenerator::SmearingParameters::bd_y_56, AlCaHLTBitMon_ParallelJobs::p, Validation_hcalonly_cfi::sign, and mathSSE::sqrt().
Referenced by addSmearedGenParticle(), and applySmearingHepMC().
◆ beamParametersToken_
◆ genParticleTokens_
◆ simulateBeamDivergence_
bool BeamDivergenceVtxGenerator::simulateBeamDivergence_ |
|
private |
◆ simulateVertex_
bool BeamDivergenceVtxGenerator::simulateVertex_ |
|
private |
◆ sourceToken_
double getVtxStddevY() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
constexpr bool isUninitialized() const noexcept
double getBeamDivergenceY45() const
double getVtxOffsetZ45() const
double getBeamDivergenceY56() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double getBeamDivergenceX45() const
edm::ESGetToken< CTPPSBeamParameters, CTPPSBeamParametersRcd > beamParametersToken_
static HepMC::FourVector smearMomentum(const T &mom, const SmearingParameters &sp)
edm::EDGetTokenT< edm::HepMCProduct > sourceToken_
double getBeamDivergenceX56() const
double getVtxOffsetY45() const
void addSmearedGenParticle(const reco::GenParticle &gp, const SmearingParameters &sp, HepMC::GenEvent *genEvt)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const HepMC::GenEvent * GetEvent() const
void applySmearingHepMC(const SmearingParameters &sp, HepMC::GenEvent *genEvt)
double getVtxOffsetX45() const
double getVtxStddevZ() const
double getVtxOffsetT45() const
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::GenParticleCollection > > genParticleTokens_
double getVtxStddevT() const
double getVtxStddevX() const
bool simulateBeamDivergence_
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection