CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
LaserAlignmentProducer Class Reference

#include <LaserAlignmentProducer.h>

Inheritance diagram for LaserAlignmentProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 LaserAlignmentProducer (const edm::ParameterSet &)
 constructor More...
 
 ~LaserAlignmentProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDProducer
typedef EDProducer 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::EDProducer
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

Implements edm::EDProducer.

Definition at line 39 of file LaserAlignmentProducer.cc.

References edm::EventID::event(), GenParticle::GenParticle, edm::EventBase::id(), 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  std::auto_ptr<edm::HepMCProduct> theOutput(new edm::HepMCProduct());
63  theOutput->addHepMCData(theEvent);
64 
65  // put the output to the event
66  iEvent.put(theOutput);
67 }
EventNumber_t event() const
Definition: EventID.h:41
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
edm::EventID id() const
Definition: EventBase.h:60

Member Data Documentation

HepMC::GenEvent* LaserAlignmentProducer::theEvent
private

Definition at line 39 of file LaserAlignmentProducer.h.

Referenced by produce().