#include <BaseFlatGunProducer.h>
Public Member Functions | |
BaseFlatGunProducer (const ParameterSet &) | |
void | beginRun (edm::Run &r, const edm::EventSetup &) |
void | endRun (edm::Run &r, const edm::EventSetup &) |
virtual | ~BaseFlatGunProducer () |
Protected Attributes | |
bool | fAddAntiParticle |
HepMC::GenEvent * | fEvt |
double | fMaxEta |
double | fMaxPhi |
double | fMinEta |
double | fMinPhi |
std::vector< int > | fPartIDs |
ESHandle < HepPDT::ParticleDataTable > | fPDGTable |
CLHEP::HepRandomEngine & | fRandomEngine |
CLHEP::RandFlat * | fRandomGenerator |
int | fVerbosity |
Definition at line 31 of file BaseFlatGunProducer.h.
BaseFlatGunProducer::BaseFlatGunProducer | ( | const ParameterSet & | pset | ) |
Definition at line 49 of file BaseFlatGunProducer.cc.
References fAddAntiParticle, fMaxEta, fMaxPhi, fMinEta, fMinPhi, fPartIDs, fRandomEngine, fRandomGenerator, fVerbosity, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
: fEvt(0), fRandomEngine(getEngineReference()), fRandomGenerator(0) // fPDGTable( new DefaultConfig::ParticleDataTable("PDG Table") ) { ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters") ; // although there's the method ParameterSet::empty(), // it looks like it's NOT even necessary to check if it is, // before trying to extract parameters - if it is empty, // the default values seem to be taken fPartIDs = pgun_params.getParameter< vector<int> >("PartID"); fMinEta = pgun_params.getParameter<double>("MinEta"); fMaxEta = pgun_params.getParameter<double>("MaxEta"); fMinPhi = pgun_params.getParameter<double>("MinPhi"); fMaxPhi = pgun_params.getParameter<double>("MaxPhi"); // //fPDGTablePath = "/afs/cern.ch/sw/lcg/external/clhep/1.9.2.1/slc3_ia32_gcc323/data/HepPDT/" ; /* string HepPDTBase( getenv("HEPPDT_PARAM_PATH") ) ; fPDGTablePath = HepPDTBase + "/data/" ; fPDGTableName = "PDG_mass_width_2004.mc"; // should it be 2004 table ? string TableFullName = fPDGTablePath + fPDGTableName ; ifstream PDFile( TableFullName.c_str() ) ; if( !PDFile ) { throw cms::Exception("FileNotFound", "BaseFlatGunProducer::BaseFlatGunProducer()") << "File " << TableFullName << " cannot be opened.\n"; } HepPDT::TableBuilder tb(*fPDGTable) ; if ( !addPDGParticles( PDFile, tb ) ) { cout << " Error reading PDG !" << endl; } // the tb dtor fills fPDGTable */ fVerbosity = pset.getUntrackedParameter<int>( "Verbosity",0 ) ; // The Service has already instantiated an engine. Use it. fRandomGenerator = new CLHEP::RandFlat(fRandomEngine) ; fAddAntiParticle = pset.getParameter<bool>("AddAntiParticle") ; produces<GenRunInfoProduct, InRun>(); }
BaseFlatGunProducer::~BaseFlatGunProducer | ( | ) | [virtual] |
Definition at line 97 of file BaseFlatGunProducer.cc.
{ //if ( fRandomGenerator != NULL ) delete fRandomGenerator; // do I need to delete the Engine, too ? // no need to cleanup GenEvent memory - done in HepMCProduct // if (fEvt != NULL) delete fEvt ; // double check // delete fPDGTable; }
void BaseFlatGunProducer::beginRun | ( | edm::Run & | r, |
const edm::EventSetup & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 110 of file BaseFlatGunProducer.cc.
References fPDGTable, and edm::EventSetup::getData().
void BaseFlatGunProducer::endRun | ( | edm::Run & | r, |
const edm::EventSetup & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 118 of file BaseFlatGunProducer.cc.
References edm::Run::put().
{ // just create an empty product // to keep the EventContent definitions happy // later on we might put the info into the run info that this is a PGun auto_ptr<GenRunInfoProduct> genRunInfo( new GenRunInfoProduct() ); run.put( genRunInfo ); }
bool edm::BaseFlatGunProducer::fAddAntiParticle [protected] |
Definition at line 72 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
HepMC::GenEvent* edm::BaseFlatGunProducer::fEvt [protected] |
double edm::BaseFlatGunProducer::fMaxEta [protected] |
Definition at line 51 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
double edm::BaseFlatGunProducer::fMaxPhi [protected] |
Definition at line 53 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
double edm::BaseFlatGunProducer::fMinEta [protected] |
Definition at line 50 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
double edm::BaseFlatGunProducer::fMinPhi [protected] |
Definition at line 52 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
std::vector<int> edm::BaseFlatGunProducer::fPartIDs [protected] |
Definition at line 49 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
Definition at line 65 of file BaseFlatGunProducer.h.
Referenced by beginRun(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
CLHEP::HepRandomEngine& edm::BaseFlatGunProducer::fRandomEngine [protected] |
Definition at line 69 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), and edm::ExpoRandomPtGunProducer::ExpoRandomPtGunProducer().
CLHEP::RandFlat* edm::BaseFlatGunProducer::fRandomGenerator [protected] |
Definition at line 70 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().
int edm::BaseFlatGunProducer::fVerbosity [protected] |
Definition at line 67 of file BaseFlatGunProducer.h.
Referenced by BaseFlatGunProducer(), edm::ExpoRandomPtGunProducer::produce(), edm::FlatRandomOneOverPtGunProducer::produce(), edm::FlatRandomPtGunProducer::produce(), edm::FlatRandomEGunProducer::produce(), and edm::MultiParticleInConeGunProducer::produce().