CMS 3D CMS Logo

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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Pythia6PartonEGun (const edm::ParameterSet &)
 
 ~Pythia6PartonEGun () override
 
- Public Member Functions inherited from gen::Pythia6PartonGun
 Pythia6PartonGun (const edm::ParameterSet &)
 
 ~Pythia6PartonGun () override
 
- Public Member Functions inherited from gen::Pythia6Gun
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 Pythia6Gun (const edm::ParameterSet &)
 
 ~Pythia6Gun () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void generateEvent (CLHEP::HepRandomEngine *) override
 
- 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::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

double fMaxE
 
double fMaxEta
 
double fMinE
 
double fMinEta
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Attributes inherited from gen::Pythia6PartonGun
int fPartonID
 
- Protected Attributes inherited from gen::Pythia6Gun
HepMC::GenEventfEvt
 
bool fHepMCVerbosity
 
int fMaxEventsToPrint
 
double fMaxPhi
 
double fMinPhi
 
std::vector< int > fPartIDs
 
Pythia6ServicefPy6Service
 
int fPylistVerbosity
 

Detailed Description

Definition at line 12 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  : Pythia6PartonGun(pset) {
19  // ParameterSet defpset ;
20  ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters"); //, defpset ) ;
21  fMinEta = pgun_params.getParameter<double>("MinEta"); // ,-2.2);
22  fMaxEta = pgun_params.getParameter<double>("MaxEta"); // , 2.2);
23  fMinE = pgun_params.getParameter<double>("MinE"); // , 20.);
24  fMaxE = pgun_params.getParameter<double>("MaxE"); // , 420.);
25 }
T getParameter(std::string const &) const
Pythia6PartonGun(const edm::ParameterSet &)
Pythia6PartonEGun::~Pythia6PartonEGun ( )
override

Definition at line 27 of file Pythia6PartonEGun.cc.

27 {}

Member Function Documentation

void Pythia6PartonEGun::generateEvent ( CLHEP::HepRandomEngine *  )
overrideprotectedvirtual

Implements gen::Pythia6Gun.

Definition at line 29 of file Pythia6PartonEGun.cc.

References gen::Pythia6Gun::addAntiParticle(), DEFINE_FWK_MODULE, PVValHelper::eta, JetChargeProducer_cfi::exp, gen::Pythia6Gun::fEvt, fMaxE, fMaxEta, gen::Pythia6Gun::fMaxPhi, fMinE, fMinEta, gen::Pythia6Gun::fMinPhi, gen::Pythia6PartonGun::fPartonID, gen::Pythia6Gun::fPy6Service, GenParticle::GenParticle, gen::Pythia6PartonGun::joinPartons(), EgHLTOffHistBins_cfi::mass, gen::p, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, gen::py1ent_(), gen::pyexec_(), gen::pymass_(), and gen::pyr_().

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

Member Data Documentation

double gen::Pythia6PartonEGun::fMaxE
private

Definition at line 24 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().

double gen::Pythia6PartonEGun::fMaxEta
private

Definition at line 22 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().

double gen::Pythia6PartonEGun::fMinE
private

Definition at line 23 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().

double gen::Pythia6PartonEGun::fMinEta
private

Definition at line 21 of file Pythia6PartonEGun.h.

Referenced by generateEvent(), and Pythia6PartonEGun().