CMS 3D CMS Logo

BaseEvtVtxGenerator Class Reference

#include <IOMC/EventVertexGenerators/interface/BaseEvtVtxGenerator.h>

Inheritance diagram for BaseEvtVtxGenerator:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper BeamProfileVtxGenerator BetafuncEvtVtxGenerator FlatEvtVtxGenerator GaussEvtVtxGenerator

List of all members.

Public Member Functions

 BaseEvtVtxGenerator (const edm::ParameterSet &)
virtual TMatrixD * GetInvLorentzBoost ()=0
virtual HepMC::FourVector * lastVertex ()
 This method - and the comment - is a left-over from COBRA-OSCAR time : return the last generated event vertex.
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


Detailed Description

Definition at line 28 of file BaseEvtVtxGenerator.h.


Constructor & Destructor Documentation

BaseEvtVtxGenerator::BaseEvtVtxGenerator ( const edm::ParameterSet pset  )  [explicit]

Definition at line 31 of file BaseEvtVtxGenerator.cc.

References Exception, fEngine, and edm::Service< T >::isAvailable().

00032         : fVertex(0), boost_(0), fTimeOffset(0), fEngine(0),
00033           sourceLabel(pset.getParameter<edm::InputTag>("src"))
00034 {
00035    
00036 /* No longer needed...
00037 
00038    // 1st of all, check on module_label - must be VtxSmeared !
00039    if ( pset.getParameter<string>("@module_label") != "VtxSmeared" )
00040    {
00041       throw cms::Exception("Configuration")
00042         << "Module has an invalid module label. "
00043            "The label of this module MUST be VtxSmeared.";
00044    }
00045 */
00046       
00047    Service<RandomNumberGenerator> rng;
00048 
00049    if ( ! rng.isAvailable()) {
00050 
00051      throw cms::Exception("Configuration")
00052        << "The BaseEvtVtxGenerator requires the RandomNumberGeneratorService\n"
00053           "which is not present in the configuration file.  You must add the service\n"
00054           "in the configuration file or remove the modules that require it.";
00055    }
00056 
00057    HepRandomEngine& engine = rng->getEngine();
00058    fEngine = &engine;
00059 
00060       
00061    produces<bool>(); 
00062 }

BaseEvtVtxGenerator::~BaseEvtVtxGenerator (  )  [virtual]

Definition at line 64 of file BaseEvtVtxGenerator.cc.

References boost_, and fVertex.

00065 {
00066    delete fVertex ;
00067    if (boost_ != 0 ) delete boost_;
00068    // no need since now it's done in HepMCProduct
00069    // delete fEvt ;
00070 }


Member Function Documentation

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().

00097 {
00098    return *fEngine;
00099 }

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.

00044 { 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.

00073 {
00074    
00075    
00076    Handle<HepMCProduct> HepMCEvt ;
00077    
00078    evt.getByLabel( sourceLabel, HepMCEvt ) ;
00079    
00080    // generate new vertex & apply the shift 
00081    //
00082    HepMCEvt->applyVtxGen( newVertex() ) ;
00083 
00084    //HepMCEvt->LorentzBoost( 0., 142.e-6 );
00085    HepMCEvt->boostToLab( GetInvLorentzBoost(), "vertex" );
00086    HepMCEvt->boostToLab( GetInvLorentzBoost(), "momentum" );
00087    
00088    // OK, create a (pseudo)product and put in into edm::Event
00089    //
00090    auto_ptr<bool> NewProduct(new bool(true)) ;      
00091    evt.put( NewProduct ) ;
00092       
00093    return ;
00094 }


Member Data Documentation

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().

edm::InputTag BaseEvtVtxGenerator::sourceLabel [private]

Definition at line 65 of file BaseEvtVtxGenerator.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:51 2009 for CMSSW by  doxygen 1.5.4