10 #include <HepMC/GenEvent.h> 11 #include <HepMC/SimpleVector.h> 18 : evt_(evt), isVtxGenApplied_(
false), isVtxBoostApplied_(
false), isPBoostApplied_(
false) {}
45 double x = (*vt)->position().x() + vtxShift.x();
46 double y = (*vt)->position().y() + vtxShift.y();
47 double z = (*vt)->position().z() + vtxShift.z();
48 double t = (*vt)->position().t() + vtxShift.t();
50 (*vt)->set_position(HepMC::FourVector(
x, y, z,
t));
61 if (lorentz ==
nullptr) {
68 TMatrixD tmplorentz(*lorentz);
71 if (
type ==
"vertex") {
80 p4(0, 0) = (*vt)->position().t();
81 p4(1, 0) = (*vt)->position().x();
82 p4(2, 0) = (*vt)->position().z();
83 p4(3, 0) = (*vt)->position().y();
86 p4lab = tmplorentz * p4;
88 (*vt)->set_position(HepMC::FourVector(p4lab(1, 0), p4lab(3, 0), p4lab(2, 0), p4lab(0, 0)));
92 }
else if (
type ==
"momentum") {
98 for (HepMC::GenEvent::particle_iterator
part =
evt_->particles_begin();
part !=
evt_->particles_end(); ++
part) {
101 p4(0, 0) = (*part)->momentum().e();
102 p4(1, 0) = (*part)->momentum().x();
103 p4(2, 0) = (*part)->momentum().z();
104 p4(3, 0) = (*part)->momentum().y();
106 TMatrixD p4lab(4, 1);
107 p4lab = tmplorentz * p4;
109 (*part)->set_momentum(HepMC::FourVector(p4lab(1, 0), p4lab(3, 0), p4lab(2, 0), p4lab(0, 0)));
114 std::cout <<
" no type found for boostToLab(std::string), options are vertex or momentum" << std::endl;
bool isVtxGenApplied() const
void swap(HepMCProduct &other)
const HepMC::GenEvent & getHepMCData() const
void addHepMCData(HepMC::GenEvent *evt)
HepMCProduct & operator=(HepMCProduct const &other)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void applyVtxGen(HepMC::FourVector const *vtxShift)
void boostToLab(TMatrixD const *lorentz, std::string const &type)
bool isPBoostApplied() const
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection
bool isVtxBoostApplied() const