CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
gen::Pythia6PartonEGun Class Reference

#include <Pythia6PartonEGun.h>

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

Public Member Functions

 Pythia6PartonEGun (const edm::ParameterSet &)
 
virtual ~Pythia6PartonEGun ()
 
- Public Member Functions inherited from gen::Pythia6PartonGun
 Pythia6PartonGun (const edm::ParameterSet &)
 
virtual ~Pythia6PartonGun ()
 
- Public Member Functions inherited from gen::Pythia6Gun
void beginJob ()
 
void beginRun (edm::Run &, edm::EventSetup const &)
 
void endJob ()
 
void endRun (edm::Run &, edm::EventSetup const &)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 Pythia6Gun (const edm::ParameterSet &)
 
virtual ~Pythia6Gun ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Protected Member Functions

void generateEvent ()
 
- Protected Member Functions inherited from gen::Pythia6PartonGun
void joinPartons (double qmax)
 
- Protected Member Functions inherited from gen::Pythia6Gun
HepMC::GenParticle * addAntiParticle (int &, int &, double &, double &, double &)
 
void attachPy6DecaysToGenEvent ()
 
void loadEvent (edm::Event &)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Private Attributes

double fMaxE
 
double fMaxEta
 
double fMinE
 
double fMinEta
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from gen::Pythia6PartonGun
int fPartonID
 
- Protected Attributes inherited from gen::Pythia6Gun
HepMC::GenEvent * fEvt
 
bool fHepMCVerbosity
 
int fMaxEventsToPrint
 
double fMaxPhi
 
double fMinPhi
 
std::vector< int > fPartIDs
 
Pythia6ServicefPy6Service
 
int fPylistVerbosity
 

Detailed Description

Definition at line 8 of file Pythia6PartonEGun.h.

Constructor & Destructor Documentation

Pythia6PartonEGun::Pythia6PartonEGun ( const edm::ParameterSet pset)

Definition at line 18 of file Pythia6PartonEGun.cc.

References fMaxE, fMaxEta, fMinE, fMinEta, and edm::ParameterSet::getParameter().

18  :
19  Pythia6PartonGun(pset)
20 {
21 
22  // ParameterSet defpset ;
23  ParameterSet pgun_params =
24  pset.getParameter<ParameterSet>("PGunParameters"); //, defpset ) ;
25  fMinEta = pgun_params.getParameter<double>("MinEta"); // ,-2.2);
26  fMaxEta = pgun_params.getParameter<double>("MaxEta"); // , 2.2);
27  fMinE = pgun_params.getParameter<double>("MinE"); // , 20.);
28  fMaxE = pgun_params.getParameter<double>("MaxE"); // , 420.);
29 
30 }
T getParameter(std::string const &) const
Pythia6PartonGun(const edm::ParameterSet &)
Pythia6PartonEGun::~Pythia6PartonEGun ( )
virtual

Definition at line 32 of file Pythia6PartonEGun.cc.

33 {
34 }

Member Function Documentation

void Pythia6PartonEGun::generateEvent ( )
protectedvirtual

Implements gen::Pythia6Gun.

Definition at line 36 of file Pythia6PartonEGun.cc.

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

37 {
38 
39  Pythia6Service::InstanceWrapper guard(fPy6Service); // grab Py6 instance
40 
41  // now actualy, start cooking up the event gun
42  //
43 
44  // 1st, primary vertex
45  //
46  HepMC::GenVertex* Vtx = new HepMC::GenVertex( HepMC::FourVector(0.,0.,0.));
47 
48  // here re-create fEvt (memory)
49  //
50  fEvt = new HepMC::GenEvent() ;
51 
52  int ip=1;
53 
54  int py6PID = HepPID::translatePDTtoPythia( fPartonID );
55  int dum = 0;
56  double ee=0, the=0, eta=0;
57  double mass = pymass_(py6PID);
58 
59  // fill p(ip,5) (in PYJETS) with mass value right now,
60  // because the (hardcoded) mstu(10)=1 will make py1ent
61  // pick the mass from there
62  pyjets.p[4][ip-1]=mass;
63 
64  double phi = (fMaxPhi-fMinPhi)*pyr_(&dum)+fMinPhi;
65  ee = (fMaxE-fMinE)*pyr_(&dum)+fMinE;
66  eta = (fMaxEta-fMinEta)*pyr_(&dum)+fMinEta;
67  the = 2.*atan(exp(-eta));
68 
69  py1ent_(ip, py6PID, ee, the, phi);
70 
71  double px = pyjets.p[0][ip-1]; // pt*cos(phi) ;
72  double py = pyjets.p[1][ip-1]; // pt*sin(phi) ;
73  double pz = pyjets.p[2][ip-1]; // mom*cos(the) ;
74 
75  HepMC::FourVector p(px,py,pz,ee) ;
77  Part->suggest_barcode( ip ) ;
78  Vtx->add_particle_out(Part);
79 
80  // now add anti-quark
81  ip = ip + 1;
82  HepMC::GenParticle* APart = addAntiParticle( ip, fPartonID, ee, eta, phi );
83  if ( APart )
84  {
85  Vtx->add_particle_out(APart) ;
86  }
87  else
88  {
89  // otherwise it should throw !
90  }
91 
92  // this should probably be configurable...
93  //
94  double qmax = 2.*ee;
95 
96  joinPartons( qmax );
97 
98  fEvt->add_vertex(Vtx);
99 
100  // run pythia
101  pyexec_();
102 
103  return;
104 }
HepMC::GenParticle * addAntiParticle(int &, int &, double &, double &, double &)
Definition: Pythia6Gun.cc:242
HepMC::GenEvent * fEvt
Definition: Pythia6Gun.h:62
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
T eta() const
double p[5][pyjets_maxn]
double fMinPhi
Definition: Pythia6Gun.h:57
double pymass_(int &)
double fMaxPhi
Definition: Pythia6Gun.h:58
void joinPartons(double qmax)
void py1ent_(int &ip, int &kf, double &pe, double &the, double &phi)
Pythia6Service * fPy6Service
Definition: Pythia6Gun.h:52
double pyr_(int *idummy)
void pyexec_()
Definition: DDAxes.h:10

Member Data Documentation

double gen::Pythia6PartonEGun::fMaxE
private

Definition at line 25 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().

double gen::Pythia6PartonEGun::fMaxEta
private

Definition at line 23 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().

double gen::Pythia6PartonEGun::fMinE
private

Definition at line 24 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().

double gen::Pythia6PartonEGun::fMinEta
private

Definition at line 22 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().