![]() |
![]() |
#include <GeneratorFilter.h>
Public Types | |
typedef DEC | Decayer |
typedef HAD | Hadronizer |
Public Member Functions | |
virtual bool | beginLuminosityBlock (LuminosityBlock &, EventSetup const &) |
virtual bool | beginRun (Run &, EventSetup const &) |
virtual void | endJob () |
virtual bool | endLuminosityBlock (LuminosityBlock &, EventSetup const &) |
virtual bool | endRun (Run &, EventSetup const &) |
virtual bool | filter (Event &e, EventSetup const &es) |
GeneratorFilter (ParameterSet const &ps) | |
virtual void | respondToCloseInputFile (FileBlock const &fb) |
virtual void | respondToCloseOutputFiles (FileBlock const &fb) |
virtual void | respondToOpenInputFile (FileBlock const &fb) |
virtual void | respondToOpenOutputFiles (FileBlock const &fb) |
virtual | ~GeneratorFilter () |
Private Attributes | |
Decayer * | decayer_ |
Hadronizer | hadronizer_ |
Definition at line 33 of file GeneratorFilter.h.
typedef DEC edm::GeneratorFilter< HAD, DEC >::Decayer |
Definition at line 37 of file GeneratorFilter.h.
typedef HAD edm::GeneratorFilter< HAD, DEC >::Hadronizer |
Definition at line 36 of file GeneratorFilter.h.
edm::GeneratorFilter< HAD, DEC >::GeneratorFilter | ( | ParameterSet const & | ps | ) | [explicit] |
Definition at line 68 of file GeneratorFilter.h.
References edm::GeneratorFilter< HAD, DEC >::decayer_, edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().
: EDFilter(), hadronizer_(ps), decayer_(0) { // TODO: // Put the list of types produced by the filters here. // The current design calls for: // * GenRunInfoProduct // * HepMCProduct // // other maybe added as needs be // if ( ps.exists("ExternalDecays") ) { //decayer_ = new gen::ExternalDecayDriver(ps.getParameter<ParameterSet>("ExternalDecays")); ParameterSet ps1 = ps.getParameter<ParameterSet>("ExternalDecays"); decayer_ = new Decayer(ps1); } produces<edm::HepMCProduct>(); produces<GenEventInfoProduct>(); produces<GenRunInfoProduct, edm::InRun>(); }
edm::GeneratorFilter< HAD, DEC >::~GeneratorFilter | ( | ) | [virtual] |
Definition at line 95 of file GeneratorFilter.h.
bool edm::GeneratorFilter< HAD, DEC >::beginLuminosityBlock | ( | LuminosityBlock & | , |
EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDFilter.
Definition at line 224 of file GeneratorFilter.h.
References edm::errors::Configuration, and Exception.
{ if ( !hadronizer_.initializeForInternalPartons() ) throw edm::Exception(errors::Configuration) << "Failed to initialize hadronizer " << hadronizer_.classname() << " for internal parton generation\n"; if ( decayer_ ) { decayer_->init(es); if ( !hadronizer_.declareStableParticles( decayer_->operatesOnParticles() ) ) throw edm::Exception(errors::Configuration) << "Failed to declare stable particles in hadronizer " << hadronizer_.classname() << "\n"; if ( !hadronizer_.declareSpecialSettings( decayer_->specialSettings() ) ) throw edm::Exception(errors::Configuration) << "Failed to declare special settings in hadronizer " << hadronizer_.classname() << "\n"; } return true; }
bool edm::GeneratorFilter< HAD, DEC >::beginRun | ( | Run & | , |
EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDFilter.
Definition at line 169 of file GeneratorFilter.h.
{ /* // we init external decay tools first, to mimic how it was in beginRun // in principle, in a big picture it shouldn't matter but in practice // the output is not identical if we change the order - the reason is // that RANMAR is overriden with PYR, thus the order of calls shifts // the state of the random engine // if ( decayer_ ) decayer_->init(es); // Create the LHEGeneratorInfo product describing the run // conditions here, and insert it into the Run object. if ( !hadronizer_.initializeForInternalPartons() ) throw edm::Exception(errors::Configuration) << "Failed to initialize hadronizer " << hadronizer_.classname() << " for internal parton generation\n"; if ( decayer_ ) { if ( !hadronizer_.declareStableParticles( decayer_->operatesOnParticles() ) ) throw edm::Exception(errors::Configuration) << "Failed to declare stable particles in hadronizer " << hadronizer_.classname() << "\n"; } */ return true; }
void edm::GeneratorFilter< HAD, DEC >::endJob | ( | void | ) | [virtual] |
bool edm::GeneratorFilter< HAD, DEC >::endLuminosityBlock | ( | LuminosityBlock & | , |
EventSetup const & | |||
) | [virtual] |
Reimplemented from edm::EDFilter.
Definition at line 254 of file GeneratorFilter.h.
{ // If relevant, record the integration luminosity of this // luminosity block here. To do so, we would need a standard // function to invoke on the contained hadronizer that would // report the integrated luminosity. return true; }
bool edm::GeneratorFilter< HAD, DEC >::endRun | ( | Run & | r, |
EventSetup const & | |||
) | [virtual] |
Reimplemented from edm::EDFilter.
Definition at line 205 of file GeneratorFilter.h.
References edm::Run::put().
{ // If relevant, record the integrated luminosity for this run // here. To do so, we would need a standard function to invoke on // the contained hadronizer that would report the integrated // luminosity. hadronizer_.statistics(); if ( decayer_ ) decayer_->statistics(); std::auto_ptr<GenRunInfoProduct> griproduct(new GenRunInfoProduct(hadronizer_.getGenRunInfo())); r.put(griproduct); return true; }
bool edm::GeneratorFilter< HAD, DEC >::filter | ( | Event & | e, |
EventSetup const & | es | ||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 100 of file GeneratorFilter.h.
References edm::EventID::event(), event(), edm::EventBase::id(), and edm::Event::put().
{ hadronizer_.setEDMEvent(ev); if ( !hadronizer_.generatePartonsAndHadronize() ) return false; // this is "fake" stuff // in principle, decays are done as part of full event generation, // except for particles that are marked as to be kept stable // but we currently keep in it the design, because we might want // to use such feature for other applications // if ( !hadronizer_.decay() ) return false; std::auto_ptr<HepMC::GenEvent> event(hadronizer_.getGenEvent()); if ( !event.get() ) return false; // The external decay driver is being added to the system, // it should be called here // if ( decayer_ ) { event.reset( decayer_->decay( event.get() ) ); } if ( !event.get() ) return false; // check and perform if there're any unstable particles after // running external decay packages // // fisrt of all, put back modified event tree (after external decay) // hadronizer_.resetEvent( event.release() ); // // now run residual decays // if ( !hadronizer_.residualDecay() ) return false; hadronizer_.finalizeEvent(); event.reset( hadronizer_.getGenEvent() ); if ( !event.get() ) return false; event->set_event_number( ev.id().event() ); // // tutto bene - finally, form up EDM products ! // std::auto_ptr<GenEventInfoProduct> genEventInfo(hadronizer_.getGenEventInfo()); if (!genEventInfo.get()) { // create GenEventInfoProduct from HepMC event in case hadronizer didn't provide one genEventInfo.reset(new GenEventInfoProduct(event.get())); } ev.put(genEventInfo); std::auto_ptr<HepMCProduct> bare_product(new HepMCProduct()); bare_product->addHepMCData( event.release() ); ev.put(bare_product); return true; }
void edm::GeneratorFilter< HAD, DEC >::respondToCloseInputFile | ( | FileBlock const & | fb | ) | [virtual] |
void edm::GeneratorFilter< HAD, DEC >::respondToCloseOutputFiles | ( | FileBlock const & | fb | ) | [virtual] |
void edm::GeneratorFilter< HAD, DEC >::respondToOpenInputFile | ( | FileBlock const & | fb | ) | [virtual] |
void edm::GeneratorFilter< HAD, DEC >::respondToOpenOutputFiles | ( | FileBlock const & | fb | ) | [virtual] |
Decayer* edm::GeneratorFilter< HAD, DEC >::decayer_ [private] |
Definition at line 59 of file GeneratorFilter.h.
Referenced by edm::GeneratorFilter< HAD, DEC >::GeneratorFilter().
Hadronizer edm::GeneratorFilter< HAD, DEC >::hadronizer_ [private] |
Definition at line 57 of file GeneratorFilter.h.