CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

LaserAlignmentSource Class Reference

#include <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.

                                                                                          :
  GeneratedInputSource(iConfig, iDescription),
  theEvent(0)
{
  //register your products
  produces<edm::HepMCProduct>();

  //now do what ever other initialization is needed
}
LaserAlignmentSource::~LaserAlignmentSource ( )

destructor

Definition at line 34 of file LaserAlignmentSource.cc.

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

Member Function Documentation

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

produce the HepMCProduct

Implements edm::ConfigurableInputSource.

Definition at line 40 of file LaserAlignmentSource.cc.

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

{
  // create the event
  theEvent = new HepMC::GenEvent();

  // create a primary vertex
  HepMC::GenVertex * theVtx = new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));

  // add a particle to the vertex; this is needed to avoid crashes in OscarProducer. Use a 
  // electron neutrino, with zero energy and mass
  HepMC::GenParticle * theParticle = new HepMC::GenParticle(HepMC::FourVector(0.,0.,0.,0.),12,1);
  
  theVtx->add_particle_out(theParticle);

  // add the vertex to the event
  theEvent->add_vertex(theVtx);

  // set the event number
  theEvent->set_event_number(event());
  // set the signal process id
  theEvent->set_signal_process_id(20);

  // create an empty output collection
  std::auto_ptr<edm::HepMCProduct> theOutput(new edm::HepMCProduct());
  theOutput->addHepMCData(theEvent);
   
  // put the output to the event
  iEvent.put(theOutput);

  return true;
}

Member Data Documentation

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

Definition at line 39 of file LaserAlignmentSource.h.

Referenced by produce().