CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PassThroughEvtVtxGenerator Class Reference

#include <PassThroughEvtVtxGenerator.h>

Inheritance diagram for PassThroughEvtVtxGenerator:
BaseEvtVtxGenerator edm::stream::EDProducer<>

Public Member Functions

TMatrixD const * GetInvLorentzBoost () const override
 
HepMC::FourVector newVertex (CLHEP::HepRandomEngine *) const override
 
 PassThroughEvtVtxGenerator (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PassThroughEvtVtxGenerator () override
 
- Public Member Functions inherited from BaseEvtVtxGenerator
 BaseEvtVtxGenerator (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~BaseEvtVtxGenerator () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

edm::EDGetTokenT< edm::HepMCProductsourceToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 24 of file PassThroughEvtVtxGenerator.h.

Constructor & Destructor Documentation

PassThroughEvtVtxGenerator::PassThroughEvtVtxGenerator ( const edm::ParameterSet pset)
explicit

Definition at line 30 of file PassThroughEvtVtxGenerator.cc.

References Exception, edm::ParameterSet::getParameter(), edm::Service< T >::isAvailable(), and sourceToken.

31  : BaseEvtVtxGenerator(pset)
32 {
34  if ( ! rng.isAvailable()) {
35  throw cms::Exception("Configuration")
36  << "The PassThroughEvtVtxGenerator requires the RandomNumberGeneratorService\n"
37  "which is not present in the configuration file. \n"
38  "You must add the service\n"
39  "in the configuration file or remove the modules that require it.";
40  }
41  sourceToken=consumes<edm::HepMCProduct>(pset.getParameter<edm::InputTag>("src"));
42 }
T getParameter(std::string const &) const
BaseEvtVtxGenerator(const edm::ParameterSet &)
bool isAvailable() const
Definition: Service.h:40
edm::EDGetTokenT< edm::HepMCProduct > sourceToken
PassThroughEvtVtxGenerator::~PassThroughEvtVtxGenerator ( )
override

Definition at line 44 of file PassThroughEvtVtxGenerator.cc.

45 {
46 }

Member Function Documentation

TMatrixD const* PassThroughEvtVtxGenerator::GetInvLorentzBoost ( ) const
inlineoverridevirtual

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.

Implements BaseEvtVtxGenerator.

Definition at line 36 of file PassThroughEvtVtxGenerator.h.

36 { return nullptr;};
HepMC::FourVector PassThroughEvtVtxGenerator::newVertex ( CLHEP::HepRandomEngine *  ) const
overridevirtual

Implements BaseEvtVtxGenerator.

Definition at line 48 of file PassThroughEvtVtxGenerator.cc.

48  {
49  return HepMC::FourVector(0.,0.,0.,0);
50 }
void PassThroughEvtVtxGenerator::produce ( edm::Event evt,
const edm::EventSetup  
)
override

Definition at line 52 of file PassThroughEvtVtxGenerator.cc.

References edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), eostools::move(), edm::Event::put(), mathSSE::return(), and sourceToken.

53 {
55 
56  Handle<HepMCProduct> HepUnsmearedMCEvt ;
57 
58  evt.getByToken( sourceToken, HepUnsmearedMCEvt ) ;
59 
60  // Copy the HepMC::GenEvent
61  HepMC::GenEvent* genevt = new HepMC::GenEvent(*HepUnsmearedMCEvt->GetEvent());
62  std::unique_ptr<edm::HepMCProduct> HepMCEvt(new edm::HepMCProduct(genevt));
63 
64  evt.put(std::move(HepMCEvt)) ;
65 
66  return ;
67 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
return((rh^lh)&mask)
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
edm::EDGetTokenT< edm::HepMCProduct > sourceToken
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::EDGetTokenT<edm::HepMCProduct> PassThroughEvtVtxGenerator::sourceToken
private

Definition at line 36 of file PassThroughEvtVtxGenerator.h.

Referenced by PassThroughEvtVtxGenerator(), and produce().