CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

gen::Pythia6PartonPtGun Class Reference

#include <Pythia6PartonPtGun.h>

Inheritance diagram for gen::Pythia6PartonPtGun:
gen::Pythia6PartonGun gen::Pythia6Gun edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 Pythia6PartonPtGun (const edm::ParameterSet &)
virtual ~Pythia6PartonPtGun ()

Protected Member Functions

void generateEvent ()

Private Attributes

double fMaxEta
double fMaxPt
double fMinEta
double fMinPt

Detailed Description

Definition at line 8 of file Pythia6PartonPtGun.h.


Constructor & Destructor Documentation

Pythia6PartonPtGun::Pythia6PartonPtGun ( const edm::ParameterSet pset)

Definition at line 18 of file Pythia6PartonPtGun.cc.

References fMaxEta, fMaxPt, fMinEta, fMinPt, and edm::ParameterSet::getParameter().

                                                                 :
   Pythia6PartonGun(pset)
{
   
   // ParameterSet defpset ;
   ParameterSet pgun_params = 
      pset.getParameter<ParameterSet>("PGunParameters"); //, defpset ) ;
   fMinEta     = pgun_params.getParameter<double>("MinEta"); // ,-2.2);
   fMaxEta     = pgun_params.getParameter<double>("MaxEta"); // , 2.2);
   fMinPt       = pgun_params.getParameter<double>("MinPt"); // ,  20.);
   fMaxPt       = pgun_params.getParameter<double>("MaxPt"); // , 420.);

}
Pythia6PartonPtGun::~Pythia6PartonPtGun ( ) [virtual]

Definition at line 32 of file Pythia6PartonPtGun.cc.

{
}

Member Function Documentation

void Pythia6PartonPtGun::generateEvent ( ) [protected, virtual]

Implements gen::Pythia6Gun.

Definition at line 36 of file Pythia6PartonPtGun.cc.

References gen::Pythia6Gun::addAntiParticle(), eta(), funct::exp(), gen::Pythia6Gun::fEvt, fMaxEta, gen::Pythia6Gun::fMaxPhi, fMaxPt, fMinEta, gen::Pythia6Gun::fMinPhi, fMinPt, gen::Pythia6PartonGun::fPartonID, gen::Pythia6Gun::fPy6Service, configurableAnalysis::GenParticle, gen::Pythia6PartonGun::joinPartons(), gen::p, phi, gen::py1ent_(), gen::pyexec_(), gen::pymass_(), gen::pyr_(), funct::sin(), and mathSSE::sqrt().

{
   
   Pythia6Service::InstanceWrapper guard(fPy6Service);  // grab Py6 instance

   // now actualy, start cooking up the event gun 
   //

   // 1st, primary vertex
   //
   HepMC::GenVertex* Vtx = new HepMC::GenVertex( HepMC::FourVector(0.,0.,0.));

   // here re-create fEvt (memory)
   //
   fEvt = new HepMC::GenEvent() ;
     
   int ip=1;
   
   int py6PID = HepPID::translatePDTtoPythia( fPartonID );
   int dum = 0;
   double pt=0, mom=0, ee=0, the=0, eta=0;
   double mass = pymass_(py6PID);
         
   // fill p(ip,5) (in PYJETS) with mass value right now, 
   // because the (hardcoded) mstu(10)=1 will make py1ent
   // pick the mass from there
   pyjets.p[4][ip-1]=mass; 
                 
   double phi = (fMaxPhi-fMinPhi)*pyr_(&dum)+fMinPhi;

   eta  = (fMaxEta-fMinEta)*pyr_(&dum)+fMinEta;                                                      

   the  = 2.*atan(exp(-eta));                                                                          
         
   pt = (fMaxPt-fMinPt)*pyr_(&dum)+fMinPt;
         
   mom = pt/sin(the);
   ee = sqrt(mom*mom+mass*mass);

   py1ent_(ip, py6PID, ee, the, phi);
         
   double px     = pyjets.p[0][ip-1]; // pt*cos(phi) ;
   double py     = pyjets.p[1][ip-1]; // pt*sin(phi) ;
   double pz     = pyjets.p[2][ip-1]; // mom*cos(the) ;
         
   HepMC::FourVector p(px,py,pz,ee) ;
   HepMC::GenParticle* Part = new HepMC::GenParticle(p,fPartonID,1);
   Part->suggest_barcode( ip ) ;
   Vtx->add_particle_out(Part);
         
   // now add anti-quark
   ip = ip + 1;   
   HepMC::GenParticle* APart = addAntiParticle( ip, fPartonID, ee, eta, phi );   
   if ( APart ) 
   {
      Vtx->add_particle_out(APart) ;
   }
   else
   {
      // otherwise it should throw !
   }        

   // this should probably be configurable...
   //
   double qmax = 2.*ee;
   
   joinPartons( qmax );
         
   fEvt->add_vertex(Vtx);
     
   // run pythia
   pyexec_();
   
   return;
}

Member Data Documentation

Definition at line 23 of file Pythia6PartonPtGun.h.

Referenced by generateEvent(), and Pythia6PartonPtGun().

Definition at line 25 of file Pythia6PartonPtGun.h.

Referenced by generateEvent(), and Pythia6PartonPtGun().

Definition at line 22 of file Pythia6PartonPtGun.h.

Referenced by generateEvent(), and Pythia6PartonPtGun().

Definition at line 24 of file Pythia6PartonPtGun.h.

Referenced by generateEvent(), and Pythia6PartonPtGun().