8 #include "Photos/Photos.h"
11 #include "Photos/PhotosHepMC3Event.h"
13 using PhotosHepMCEvent=PhotosHepMC3Event;
16 #include "Photos/PhotosHepMCEvent.h"
18 #include "Photos/Log.h"
23 #include "CLHEP/Random/RandFlat.h"
27 using namespace Photospp;
49 p_rndmEngine = getRandomEngineDuringInitialize(
"PHOTOSPP_INIT", m_randomSeed, m_dsid);
51 if(!m_delayInitialisation) setupPhotos();
53 return StatusCode::SUCCESS;
59 Photos::setAlphaQED(m_alphaQED);
60 Photos::setInterference(
true);
61 Photos::setCorrectionWtForW(
true);
62 Photos::maxWtInterference(m_maxWtInterference);
63 Photos::setMeCorrectionWtForW(m_WMECorrection);
64 Photos::setMeCorrectionWtForZ(m_ZMECorrection);
65 Photos::setPairEmission(m_photonSplitting);
66 Photos::forceMassFrom4Vector(
true);
67 Photos::forceMassFromEventRecord(13);
68 Photos::forceMassFromEventRecord(15);
70 Photos::forceMassFromEventRecord(211);
71 Photos::setTopProcessRadiation(
false);
73 Photos::createHistoryEntries(m_createHistory, 0);
75 Photos::createHistoryEntries(m_createHistory, 3);
78 if(m_exponentiation) {
79 Photos::setExponentiation(
true);
81 Photos::setInfraredCutOff(0.01);
82 Photos::setDoubleBrem(
true);
83 Photos::setQuatroBrem(
false);
88 if(m_infraRedCutOff > 0.) {
89 Photos::setInfraredCutOff(m_infraRedCutOff);
92 Photospp::Log::LogWarning(
false);
93 Photospp::Photos::setStopAtCriticalError(m_stopCritical);
105 p_rndmEngine->setSeeds(seeds, 0);
110 const EventContext& ctx)
const
113 rngWrapper->
setSeed(
streamName, ctx.slot(), randomSeedOffset, ctx.eventID().run_number() );
123 ctx.setEventID (EventIDBase (conditionsRun,
124 EventIDBase::UNDEFEVT,
125 EventIDBase::UNDEFNUM,
126 EventIDBase::UNDEFNUM,
131 return getRandomEngine(
streamName, randomSeedOffset, ctx);
139 if(m_delayInitialisation) {
141 m_delayInitialisation =
false;
145 const EventContext& ctx = Gaudi::Hive::currentContext();
146 reseedRandomEngine(
"PHOTOSPP", ctx);
151 StatusCode sc = evtStore()->retrieve(eventCollection, m_genEventKey);
152 if (
sc.isFailure() || eventCollection == 0) {
153 ATH_MSG_ERROR(
"Unable to retrieve event collection from StoreGate with key " << m_genEventKey);
154 return StatusCode::FAILURE;
156 ATH_MSG_DEBUG(
"Retrieved event collection from StoreGate with key " << m_genEventKey);
160 HepMC::GenEvent *
event = eventCollection->back();
163 return StatusCode::FAILURE;
165 switch(
event->momentum_unit()) {
171 case HepMC3::Units::MomentumUnit::MEV:
172 Photos::setMomentumUnit(Photos::MEV);
180 case HepMC::Units::MEV:
181 Photos::setMomentumUnit(Photos::MEV);
186 ATH_MSG_ERROR(
"Photospp_i received a event with unknown units.");
187 Photos::setMomentumUnit(Photos::DEFAULT_MOMENTUM);
190 PhotosHepMCEvent photosEvent(
event);
191 photosEvent.process();
193 return StatusCode::SUCCESS;