#include <BaseEvtVtxGenerator.h>
Public Member Functions | |
BaseEvtVtxGenerator (const edm::ParameterSet &) | |
virtual TMatrixD * | GetInvLorentzBoost ()=0 |
virtual HepMC::FourVector * | lastVertex () |
virtual HepMC::FourVector * | newVertex ()=0 |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
virtual | ~BaseEvtVtxGenerator () |
Protected Member Functions | |
CLHEP::HepRandomEngine & | getEngine () |
Protected Attributes | |
TMatrixD * | boost_ |
double | fTimeOffset |
HepMC::FourVector * | fVertex |
Private Attributes | |
CLHEP::HepRandomEngine * | fEngine |
edm::InputTag | sourceLabel |
Definition at line 28 of file BaseEvtVtxGenerator.h.
BaseEvtVtxGenerator::BaseEvtVtxGenerator | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 31 of file BaseEvtVtxGenerator.cc.
References Exception, fEngine, and edm::Service< T >::isAvailable().
: fVertex(0), boost_(0), fTimeOffset(0), fEngine(0), sourceLabel(pset.getParameter<edm::InputTag>("src")) { /* No longer needed... // 1st of all, check on module_label - must be VtxSmeared ! if ( pset.getParameter<string>("@module_label") != "VtxSmeared" ) { throw cms::Exception("Configuration") << "Module has an invalid module label. " "The label of this module MUST be VtxSmeared."; } */ Service<RandomNumberGenerator> rng; if ( ! rng.isAvailable()) { throw cms::Exception("Configuration") << "The BaseEvtVtxGenerator requires the RandomNumberGeneratorService\n" "which is not present in the configuration file. You must add the service\n" "in the configuration file or remove the modules that require it."; } CLHEP::HepRandomEngine& engine = rng->getEngine(); fEngine = &engine; produces<bool>(); }
BaseEvtVtxGenerator::~BaseEvtVtxGenerator | ( | ) | [virtual] |
CLHEP::HepRandomEngine & BaseEvtVtxGenerator::getEngine | ( | ) | [protected] |
Definition at line 96 of file BaseEvtVtxGenerator.cc.
References fEngine.
Referenced by BetafuncEvtVtxGenerator::BetafuncEvtVtxGenerator(), FlatEvtVtxGenerator::FlatEvtVtxGenerator(), GaussEvtVtxGenerator::GaussEvtVtxGenerator(), and BeamProfileVtxGenerator::setType().
{ return *fEngine; }
virtual TMatrixD* BaseEvtVtxGenerator::GetInvLorentzBoost | ( | ) | [pure virtual] |
Implemented in BeamProfileVtxGenerator, BetafuncEvtVtxGenerator, FlatEvtVtxGenerator, and GaussEvtVtxGenerator.
Referenced by produce().
virtual HepMC::FourVector* BaseEvtVtxGenerator::lastVertex | ( | ) | [inline, virtual] |
This method - and the comment - is a left-over from COBRA-OSCAR time : return the last generated event vertex. If no vertex has been generated yet, a NULL pointer is returned.
Definition at line 44 of file BaseEvtVtxGenerator.h.
References fVertex.
{ return fVertex; }
virtual HepMC::FourVector* BaseEvtVtxGenerator::newVertex | ( | ) | [pure virtual] |
Implemented in BeamProfileVtxGenerator, BetafuncEvtVtxGenerator, FlatEvtVtxGenerator, and GaussEvtVtxGenerator.
Referenced by produce().
void BaseEvtVtxGenerator::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 72 of file BaseEvtVtxGenerator.cc.
References edm::Event::getByLabel(), GetInvLorentzBoost(), newVertex(), edm::Event::put(), and sourceLabel.
{ Handle<HepMCProduct> HepMCEvt ; evt.getByLabel( sourceLabel, HepMCEvt ) ; // generate new vertex & apply the shift // HepMCEvt->applyVtxGen( newVertex() ) ; //HepMCEvt->LorentzBoost( 0., 142.e-6 ); HepMCEvt->boostToLab( GetInvLorentzBoost(), "vertex" ); HepMCEvt->boostToLab( GetInvLorentzBoost(), "momentum" ); // OK, create a (pseudo)product and put in into edm::Event // auto_ptr<bool> NewProduct(new bool(true)) ; evt.put( NewProduct ) ; return ; }
TMatrixD* BaseEvtVtxGenerator::boost_ [protected] |
Definition at line 59 of file BaseEvtVtxGenerator.h.
Referenced by BetafuncEvtVtxGenerator::GetInvLorentzBoost(), and ~BaseEvtVtxGenerator().
CLHEP::HepRandomEngine* BaseEvtVtxGenerator::fEngine [private] |
Definition at line 64 of file BaseEvtVtxGenerator.h.
Referenced by BaseEvtVtxGenerator(), and getEngine().
double BaseEvtVtxGenerator::fTimeOffset [protected] |
Reimplemented in BeamProfileVtxGenerator, BetafuncEvtVtxGenerator, FlatEvtVtxGenerator, and GaussEvtVtxGenerator.
Definition at line 60 of file BaseEvtVtxGenerator.h.
HepMC::FourVector* BaseEvtVtxGenerator::fVertex [protected] |
Definition at line 58 of file BaseEvtVtxGenerator.h.
Referenced by lastVertex(), BeamProfileVtxGenerator::newVertex(), BetafuncEvtVtxGenerator::newVertex(), FlatEvtVtxGenerator::newVertex(), GaussEvtVtxGenerator::newVertex(), and ~BaseEvtVtxGenerator().
Definition at line 65 of file BaseEvtVtxGenerator.h.
Referenced by produce().