64 double the = 2.*atan(
exp(-eta));
70 double pp = pt /
sin(the);
71 double ee =
sqrt( pp*pp + mass*mass );
73 double px = pt *
cos(phi);
74 double py = pt *
sin(phi);
75 double pz = pp *
cos(the);
77 if ( !((
fMasterGen->particleData).isParticle( particleID )) )
79 particleID = std::fabs(particleID) ;
81 if( 1<= fabs(particleID) && fabs(particleID) <= 6)
83 else if (fabs(particleID) == 21)
84 (
fMasterGen->event).append( 21, 23, 101, 102, px, py, pz, ee, mass );
94 if( 1 <= fabs(particleID) && fabs(particleID) <= 6){
95 (
fMasterGen->event).
append( -particleID, 23, 0, 101, -px, -py, -pz, ee, mass );
97 else if (fabs(particleID) == 21){
100 else if ( (
fMasterGen->particleData).isParticle( -particleID ) )
102 (
fMasterGen->event).
append( -particleID, 1, 0, 0, -px, -py, -pz, ee, mass );
115 event().reset(
new HepMC::GenEvent);
edm::GeneratorFilter< gen::Py8PtGun, gen::ExternalDecayDriver > Pythia8PtGun
T getParameter(std::string const &) const
std::auto_ptr< Pythia8::Pythia > fMasterGen
CLHEP::HepRandomEngine * randomEngine
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
std::vector< int > fPartIDs
std::auto_ptr< HepMC::GenEvent > & event()
const char * classname() const
Py8PtGun(edm::ParameterSet const &)
HepMC::Pythia8ToHepMC toHepMC
bool generatePartonsAndHadronize()