CMS 3D CMS Logo

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

#include <LaserAlignmentProducer.h>

Inheritance diagram for LaserAlignmentProducer:
edm::one::EDProducer<> edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 LaserAlignmentProducer (const edm::ParameterSet &)
 constructor More...
 
 ~LaserAlignmentProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::one::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 produce the HepMCProduct More...
 

Private Attributes

HepMC::GenEvent * theEvent
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Producer to be used for the Simulation of the Laser Alignment System an empty MCHepEvent will be generated (needed by OscarProducer). The actual simulation of the laser beams is done in the SimWatcher attached to OscarProducer

Date
2007/12/04 23:53:06
Revision
1.3
Author
Maarten Thomas

Definition at line 26 of file LaserAlignmentProducer.h.

Constructor & Destructor Documentation

LaserAlignmentProducer::LaserAlignmentProducer ( const edm::ParameterSet )
explicit

constructor

Definition at line 22 of file LaserAlignmentProducer.cc.

22  :
23  EDProducer(),
24  theEvent(0)
25 {
26  //register your products
27  produces<edm::HepMCProduct>("unsmeared");
28 
29  //now do what ever other initialization is needed
30 }
LaserAlignmentProducer::~LaserAlignmentProducer ( )

destructor

Definition at line 33 of file LaserAlignmentProducer.cc.

34 {
35  // no need to cleanup theEvent since it's done in HepMCProduct
36 }

Member Function Documentation

void LaserAlignmentProducer::produce ( edm::Event iEvent,
const edm::EventSetup  
)
privatevirtual

produce the HepMCProduct

Definition at line 39 of file LaserAlignmentProducer.cc.

References DEFINE_FWK_MODULE, edm::EventID::event(), GenParticle::GenParticle, edm::EventBase::id(), eostools::move(), edm::Event::put(), and theEvent.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

40 {
41  // create the event
42  theEvent = new HepMC::GenEvent();
43 
44  // create a primary vertex
45  HepMC::GenVertex * theVtx = new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
46 
47  // add a particle to the vertex; this is needed to avoid crashes in OscarProducer. Use a
48  // electron neutrino, with zero energy and mass
49  HepMC::GenParticle * theParticle = new HepMC::GenParticle(HepMC::FourVector(0.,0.,0.,0.),12,1);
50 
51  theVtx->add_particle_out(theParticle);
52 
53  // add the vertex to the event
54  theEvent->add_vertex(theVtx);
55 
56  // set the event number
57  theEvent->set_event_number(iEvent.id().event());
58  // set the signal process id
59  theEvent->set_signal_process_id(20);
60 
61  // create an empty output collection
62  auto theOutput = std::make_unique<edm::HepMCProduct>();
63  theOutput->addHepMCData(theEvent);
64 
65  // put the output to the event
66  iEvent.put(std::move(theOutput));
67 }
EventNumber_t event() const
Definition: EventID.h:41
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
edm::EventID id() const
Definition: EventBase.h:60
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

HepMC::GenEvent* LaserAlignmentProducer::theEvent
private

Definition at line 39 of file LaserAlignmentProducer.h.

Referenced by produce().