#include <BaseFlatGunSource.h>
Public Member Functions | |
BaseFlatGunSource (const ParameterSet &, const InputSourceDescription &) | |
void | beginRun (edm::Run &r, const edm::EventSetup &) |
virtual | ~BaseFlatGunSource () |
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 32 of file BaseFlatGunSource.h.
BaseFlatGunSource::BaseFlatGunSource | ( | const ParameterSet & | pset, |
const InputSourceDescription & | desc | ||
) |
Definition at line 47 of file BaseFlatGunSource.cc.
References fAddAntiParticle, fMaxEta, fMaxPhi, fMinEta, fMinPhi, fPartIDs, fRandomEngine, fRandomGenerator, fVerbosity, and edm::ParameterSet::getUntrackedParameter().
: GeneratedInputSource (pset, desc), fEvt(0), fRandomEngine(getEngineReference()), fRandomGenerator(0) // fPDGTable( new DefaultConfig::ParticleDataTable("PDG Table") ) { ParameterSet defpset ; //ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters") ; ParameterSet pgun_params = pset.getUntrackedParameter<ParameterSet>("PGunParameters", defpset ) ; // 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 vector<int> defids ; defids.push_back(13) ; fPartIDs = pgun_params.getUntrackedParameter< vector<int> >("PartID",defids); fMinEta = pgun_params.getUntrackedParameter<double>("MinEta",-5.5); fMaxEta = pgun_params.getUntrackedParameter<double>("MaxEta",5.5); fMinPhi = pgun_params.getUntrackedParameter<double>("MinPhi",-3.14159265358979323846); fMaxPhi = pgun_params.getUntrackedParameter<double>("MaxPhi", 3.14159265358979323846); // //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", "BaseFlatGunSource::BaseFlatGunSource()") << "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.getUntrackedParameter<bool>("AddAntiParticle",false); }
BaseFlatGunSource::~BaseFlatGunSource | ( | ) | [virtual] |
Definition at line 101 of file BaseFlatGunSource.cc.
References fRandomGenerator, and NULL.
{ if ( fRandomGenerator != NULL ) delete fRandomGenerator; // no need to cleanup GenEvent memory - done in HepMCProduct // if (fEvt != NULL) delete fEvt ; // double check // delete fPDGTable; }
void BaseFlatGunSource::beginRun | ( | edm::Run & | r, |
const edm::EventSetup & | es | ||
) |
Definition at line 113 of file BaseFlatGunSource.cc.
References fPDGTable, and edm::EventSetup::getData().
bool edm::BaseFlatGunSource::fAddAntiParticle [protected] |
Definition at line 72 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
HepMC::GenEvent* edm::BaseFlatGunSource::fEvt [protected] |
Definition at line 56 of file BaseFlatGunSource.h.
Referenced by edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
double edm::BaseFlatGunSource::fMaxEta [protected] |
Definition at line 51 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
double edm::BaseFlatGunSource::fMaxPhi [protected] |
Definition at line 53 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
double edm::BaseFlatGunSource::fMinEta [protected] |
Definition at line 50 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
double edm::BaseFlatGunSource::fMinPhi [protected] |
Definition at line 52 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
std::vector<int> edm::BaseFlatGunSource::fPartIDs [protected] |
Definition at line 49 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
Definition at line 65 of file BaseFlatGunSource.h.
Referenced by beginRun(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().
CLHEP::HepRandomEngine& edm::BaseFlatGunSource::fRandomEngine [protected] |
Definition at line 69 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), and edm::ExpoRandomPtGunSource::ExpoRandomPtGunSource().
CLHEP::RandFlat* edm::BaseFlatGunSource::fRandomGenerator [protected] |
Definition at line 70 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), edm::MultiParticleInConeGunSource::produce(), and ~BaseFlatGunSource().
int edm::BaseFlatGunSource::fVerbosity [protected] |
Definition at line 67 of file BaseFlatGunSource.h.
Referenced by BaseFlatGunSource(), edm::FlatRandomEGunSource::produce(), edm::ExpoRandomPtGunSource::produce(), edm::FlatRandomPtGunSource::produce(), and edm::MultiParticleInConeGunSource::produce().