CMS 3D CMS Logo

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

List of all members.

Public Member Functions

 LaserAlignmentProducer (const edm::ParameterSet &)
 constructor
 ~LaserAlignmentProducer ()
 destructor

Private Member Functions

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

Private Attributes

HepMC::GenEvent * theEvent

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:
2012/11/02 19:05:24
Revision:
1.1
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.

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

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

destructor

Definition at line 33 of file LaserAlignmentProducer.cc.

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

Member Function Documentation

void LaserAlignmentProducer::produce ( edm::Event iEvent,
const edm::EventSetup  
) [private, virtual]

produce the HepMCProduct

Implements edm::EDProducer.

Definition at line 39 of file LaserAlignmentProducer.cc.

References edm::EventID::event(), configurableAnalysis::GenParticle, edm::EventBase::id(), 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(iEvent.id().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);
}

Member Data Documentation

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

Definition at line 39 of file LaserAlignmentProducer.h.

Referenced by produce().