CMS 3D CMS Logo

LaserAlignmentSource Class Reference

Source to be used for the Simulation of the Laser Alignment System an empty MCHepEvent will be generated (needed by OscarProducer). More...

#include <Alignment/LaserAlignmentSimulation/plugins/LaserAlignmentSource.h>

Inheritance diagram for LaserAlignmentSource:

edm::GeneratedInputSource edm::ConfigurableInputSource edm::InputSource edm::ProductRegistryHelper

List of all members.

Public Member Functions

 LaserAlignmentSource (const edm::ParameterSet &, const edm::InputSourceDescription &)
 constructor
 ~LaserAlignmentSource ()
 destructor

Private Member Functions

virtual bool produce (edm::Event &)
 produce the HepMCProduct

Private Attributes

HepMC::GenEvent * theEvent


Detailed Description

Source 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 LaserAlignmentSource.h.


Constructor & Destructor Documentation

LaserAlignmentSource::LaserAlignmentSource ( const edm::ParameterSet iConfig,
const edm::InputSourceDescription iDescription 
) [explicit]

constructor

Definition at line 22 of file LaserAlignmentSource.cc.

00023                                                                                           :
00024   GeneratedInputSource(iConfig, iDescription)
00025 {
00026   //register your products
00027   produces<edm::HepMCProduct>();
00028 
00029   //now do what ever other initialization is needed
00030 }

LaserAlignmentSource::~LaserAlignmentSource (  ) 

destructor

Definition at line 33 of file LaserAlignmentSource.cc.

00034 {
00035   // no need to cleanup theEvent since it's done in HepMCProduct
00036 }


Member Function Documentation

bool LaserAlignmentSource::produce ( edm::Event iEvent  )  [private, virtual]

produce the HepMCProduct

Implements edm::ConfigurableInputSource.

Definition at line 39 of file LaserAlignmentSource.cc.

References edm::ConfigurableInputSource::event(), edm::Event::put(), and theEvent.

00040 {
00041   // create the event
00042   theEvent = new HepMC::GenEvent();
00043 
00044   // create a primary vertex
00045   HepMC::GenVertex * theVtx = new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
00046 
00047   // add a particle to the vertex; this is needed to avoid crashes in OscarProducer. Use a 
00048   // electron neutrino, with zero energy and mass
00049   HepMC::GenParticle * theParticle = new HepMC::GenParticle(HepMC::FourVector(0.,0.,0.,0.),12,1);
00050   
00051   theVtx->add_particle_out(theParticle);
00052 
00053   // add the vertex to the event
00054   theEvent->add_vertex(theVtx);
00055 
00056   // set the event number
00057   theEvent->set_event_number(event());
00058   // set the signal process id
00059   theEvent->set_signal_process_id(20);
00060 
00061   // create an empty output collection
00062   std::auto_ptr<edm::HepMCProduct> theOutput(new edm::HepMCProduct());
00063   theOutput->addHepMCData(theEvent);
00064    
00065   // put the output to the event
00066   iEvent.put(theOutput);
00067 
00068   return true;
00069 }


Member Data Documentation

HepMC::GenEvent* LaserAlignmentSource::theEvent [private]

Definition at line 39 of file LaserAlignmentSource.h.

Referenced by produce().


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