16 #include "HepMC/GenEvent.h" 26 #include <CLHEP/Random/RandomEngine.h> 36 tok_pdt_ = esConsumes<HepPDT::ParticleDataTable, PDTRecord>();
42 produces<edm::HepMCProduct>();
43 produces<edm::LHCTransportLinkContainer>();
45 usesResource(
"Hector");
49 if (!rng.isAvailable()) {
50 throw cms::Exception(
"Configuration") <<
"LHCTransport (HectorProducer) requires the " 51 "RandomNumberGeneratorService\n" 52 "which is not present in the configuration file. You must add the " 54 "in the configuration file or remove the modules that require it.";
64 if (engine->name() !=
"TRandom3") {
65 throw cms::Exception(
"Configuration") <<
"The TRandom3 engine type must be used with HectorProducer, " 66 <<
"Random Number Generator Service not correctly configured!";
78 throw cms::Exception(
"InvalidReference") <<
"Invalid reference to HepMCProduct\n";
82 throw cms::Exception(
"LogicError") <<
"HectorTrasported HepMCProduce already exists\n";
101 evt =
m_Hector->addPartToHepMC(evt);
108 NewProduct->addHepMCData(evt);
112 edm::LogVerbatim(
"SimTransportHectorProducer") <<
"new LHCTransportLinkContainer ";
115 (*NewCorrespondenceMap).swap(thisLink);
118 for (
unsigned int i = 0;
i < (*NewCorrespondenceMap).size(); ++
i)
119 edm::LogVerbatim(
"HectorEventProcessing") <<
"Hector correspondence table: " << (*NewCorrespondenceMap)[
i];
Log< level::Info, true > LogVerbatim
int m_evtAnalysed
just to count events that have been analysed
edm::EDGetTokenT< edm::HepMCProduct > m_HepMC
HectorProducer(edm::ParameterSet const &p)
Provenance const * provenance() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
#define DEFINE_FWK_MODULE(type)
const HepMC::GenEvent * GetEvent() const
edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > tok_pdt_
~HectorProducer() override
std::vector< LHCTransportLink > LHCTransportLinkContainer
std::unique_ptr< Hector > m_Hector
std::string const & moduleLabel() const
void produce(edm::Event &e, const edm::EventSetup &c) override