Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:49

0001 #include "SimMuon/Neutron/src/EDMNeutronWriter.h"
0002 
0003 #include <memory>
0004 
0005 #include "FWCore/Framework/interface/Event.h"
0006 
0007 EDMNeutronWriter::EDMNeutronWriter() : theEvent(nullptr), theHits(nullptr) {}
0008 
0009 EDMNeutronWriter::~EDMNeutronWriter() {}
0010 
0011 void EDMNeutronWriter::writeCluster(int detType, const edm::PSimHitContainer& simHits) {
0012   theHits->insert(theHits->end(), simHits.begin(), simHits.end());
0013 }
0014 
0015 void EDMNeutronWriter::beginEvent(edm::Event& e, const edm::EventSetup& es) {
0016   theEvent = &e;
0017   theHits = std::make_unique<edm::PSimHitContainer>();
0018 }
0019 
0020 void EDMNeutronWriter::endEvent() { theEvent->put(std::move(theHits)); }