19 cout <<
"Contructing HepMCProduct" << endl;
29 delete evt_; evt_ = 0; isVtxGenApplied_ =
false;
30 isVtxBoostApplied_ =
false;
31 isPBoostApplied_ =
false;
50 if ( isVtxGenApplied() )
return ;
53 vt!=evt_->vertices_end(); ++vt )
56 double x = (*vt)->position().x() + vtxShift->x() ;
57 double y = (*vt)->position().y() + vtxShift->y() ;
58 double z = (*vt)->position().z() + vtxShift->z() ;
59 double t = (*vt)->position().t() + vtxShift->t() ;
61 (*vt)->set_position( HepMC::FourVector(x,y,z,t) ) ;
64 isVtxGenApplied_ =
true ;
84 TMatrixD tmplorentz(*lorentz);
87 if ( type ==
"vertex") {
89 if ( isVtxBoostApplied() ) {
95 vt!=evt_->vertices_end(); ++vt ) {
99 p4(0,0) = (*vt)->position().t();
100 p4(1,0) = (*vt)->position().x();
101 p4(2,0) = (*vt)->position().z();
102 p4(3,0) = (*vt)->position().y();
105 p4lab = tmplorentz *
p4;
107 (*vt)->set_position( HepMC::FourVector(p4lab(1,0),p4lab(3,0),p4lab(2,0), p4lab(0,0) ) ) ;
110 isVtxBoostApplied_ =
true ;
112 else if ( type ==
"momentum") {
114 if ( isPBoostApplied() ) {
119 for ( HepMC::GenEvent::particle_iterator
part=evt_->particles_begin();
120 part!=evt_->particles_end(); ++
part ) {
124 p4(0,0) = (*part)->momentum().e();
125 p4(1,0) = (*part)->momentum().x();
126 p4(2,0) = (*part)->momentum().z();
127 p4(3,0) = (*part)->momentum().y();
130 p4lab = tmplorentz *
p4;
132 (*part)->set_momentum( HepMC::FourVector(p4lab(1,0),p4lab(3,0),p4lab(2,0),p4lab(0,0) ) ) ;
135 isPBoostApplied_ =
true ;
138 std::cout <<
" no type found for boostToLab(std::string), options are vertex or momentum" << std::endl;
146 const HepMC::GenEvent&
void swap(HepMCProduct &other)
void addHepMCData(HepMC::GenEvent *evt)
void applyVtxGen(HepMC::FourVector *vtxShift) const
HepMCProduct & operator=(HepMCProduct const &other)
T x() const
Cartesian x coordinate.
const HepMC::GenEvent & getHepMCData() const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void boostToLab(TMatrixD *lorentz, std::string type) const
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection