File indexing completed on 2024-04-06 11:56:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "FWCore/Framework/interface/Event.h"
0013
0014
0015 #include "Alignment/LaserAlignmentSimulation/plugins/LaserAlignmentProducer.h"
0016 #include "FWCore/Framework/interface/MakerMacros.h"
0017
0018 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0019
0020
0021
0022
0023 LaserAlignmentProducer::LaserAlignmentProducer(const edm::ParameterSet &) : EDProducer(), theEvent(nullptr) {
0024
0025 produces<edm::HepMCProduct>("unsmeared");
0026
0027
0028 }
0029
0030 LaserAlignmentProducer::~LaserAlignmentProducer() {
0031
0032 }
0033
0034
0035 void LaserAlignmentProducer::produce(edm::Event &iEvent, const edm::EventSetup &) {
0036
0037 theEvent = new HepMC::GenEvent();
0038
0039
0040 HepMC::GenVertex *theVtx = new HepMC::GenVertex(HepMC::FourVector(0., 0., 0.));
0041
0042
0043
0044 HepMC::GenParticle *theParticle = new HepMC::GenParticle(HepMC::FourVector(0., 0., 0., 0.), 12, 1);
0045
0046 theVtx->add_particle_out(theParticle);
0047
0048
0049 theEvent->add_vertex(theVtx);
0050
0051
0052 theEvent->set_event_number(iEvent.id().event());
0053
0054 theEvent->set_signal_process_id(20);
0055
0056
0057 auto theOutput = std::make_unique<edm::HepMCProduct>();
0058 theOutput->addHepMCData(theEvent);
0059
0060
0061 iEvent.put(std::move(theOutput));
0062 }
0063
0064
0065
0066 DEFINE_FWK_MODULE(LaserAlignmentProducer);