41 #include "CLHEP/Random/RandomEngine.h"
80 : theTransporter(iConfig, consumesCollector()) {
88 produces<edm::HepMCProduct>();
89 produces<edm::LHCTransportLinkContainer>();
92 if (!rng.isAvailable()) {
94 <<
"LHCTransport (ProtonTransport) requires the RandomNumberGeneratorService\n"
95 "which is not present in the configuration file. You must add the service\n"
96 "in the configuration file or remove the modules that require it.";
111 if (engine->name() !=
"TRandom3") {
112 throw cms::Exception(
"Configuration") <<
"The TRandom3 engine type must be used with ProtonTransport, Random "
113 "Number Generator Service not correctly configured!";
120 if (!HepMCEvt.isValid()) {
121 throw cms::Exception(
"InvalidReference") <<
"Invalid reference to HepMCProduct\n";
124 if (HepMCEvt.provenance()->moduleLabel() ==
"LHCTransport") {
125 throw cms::Exception(
"LogicError") <<
"LHCTrasport HepMCProduce already exists\n";
129 evt =
new HepMC::GenEvent(HepMCEvt->GetEvent()->signal_process_id(), HepMCEvt->GetEvent()->event_number());
138 newProduct->addHepMCData(evt);
144 (*NewCorrespondenceMap).swap(thisLink);
147 for (
unsigned int i = 0;
i < (*NewCorrespondenceMap).size(); ++
i)
148 LogDebug(
"ProtonTransportEventProcessing")
149 <<
"ProtonTransport correspondence table: " << (*NewCorrespondenceMap)[
i];
Log< level::Info, true > LogVerbatim
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void addPartToHepMC(const HepMC::GenEvent *iev, HepMC::GenEvent *ev)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
~PPSSimTrackProducer() override=default
ProtonTransport theTransporter
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void produce(edm::Event &, const edm::EventSetup &) override
int m_eventsAnalysed
just to count events that have been analysed
edm::EDGetTokenT< edm::HepMCProduct > m_InTagToken
std::vector< LHCTransportLink > & getCorrespondenceMap()
std::string m_transportMethod
PPSSimTrackProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
StreamID streamID() const
std::vector< LHCTransportLink > LHCTransportLinkContainer
void process(const HepMC::GenEvent *ev, const edm::EventSetup &es, CLHEP::HepRandomEngine *engine)