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"
26 using namespace Photospp;
48 p_rndmEngine = getRandomEngineDuringInitialize(
"PHOTOSPP_INIT", m_randomSeed, m_dsid);
50 if(!m_delayInitialisation) setupPhotos();
52 return StatusCode::SUCCESS;
58 Photos::setAlphaQED(m_alphaQED);
59 Photos::setInterference(
true);
60 Photos::setCorrectionWtForW(
true);
61 Photos::maxWtInterference(m_maxWtInterference);
62 Photos::setMeCorrectionWtForW(m_WMECorrection);
63 Photos::setMeCorrectionWtForZ(m_ZMECorrection);
64 Photos::setPairEmission(m_photonSplitting);
65 Photos::forceMassFrom4Vector(
true);
66 Photos::forceMassFromEventRecord(13);
67 Photos::forceMassFromEventRecord(15);
68 Photos::forceMass(11, 0.510998910);
69 Photos::forceMassFromEventRecord(211);
70 Photos::setTopProcessRadiation(
false);
71 Photos::createHistoryEntries(m_createHistory, 3);
73 if(m_exponentiation) {
74 Photos::setExponentiation(
true);
76 Photos::setInfraredCutOff(0.01);
77 Photos::setDoubleBrem(
true);
78 Photos::setQuatroBrem(
false);
83 if(m_infraRedCutOff > 0.) {
84 Photos::setInfraredCutOff(m_infraRedCutOff);
87 Photospp::Log::LogWarning(
false);
88 Photospp::Photos::setStopAtCriticalError(m_stopCritical);
100 p_rndmEngine->setSeeds(seeds, 0);
105 const EventContext& ctx)
const
108 rngWrapper->
setSeed(
streamName, ctx.slot(), randomSeedOffset, ctx.eventID().run_number() );
118 ctx.setEventID (EventIDBase (conditionsRun,
119 EventIDBase::UNDEFEVT,
120 EventIDBase::UNDEFNUM,
121 EventIDBase::UNDEFNUM,
126 return getRandomEngine(
streamName, randomSeedOffset, ctx);
134 if(m_delayInitialisation) {
136 m_delayInitialisation =
false;
140 const EventContext& ctx = Gaudi::Hive::currentContext();
141 reseedRandomEngine(
"PHOTOSPP", ctx);
146 StatusCode sc = evtStore()->retrieve(eventCollection, m_genEventKey);
147 if (
sc.isFailure() || eventCollection == 0) {
148 ATH_MSG_ERROR(
"Unable to retrieve event collection from StoreGate with key " << m_genEventKey);
149 return StatusCode::FAILURE;
151 ATH_MSG_DEBUG(
"Retrieved event collection from StoreGate with key " << m_genEventKey);
155 HepMC::GenEvent *
event = eventCollection->back();
158 return StatusCode::FAILURE;
160 switch(
event->momentum_unit()) {
164 Photos::forceMass(11, 0.000510998910);
166 case HepMC3::Units::MomentumUnit::MEV:
167 Photos::setMomentumUnit(Photos::MEV);
168 Photos::forceMass(11, 0.510998910);
173 Photos::forceMass(11, 0.000510998910);
175 case HepMC::Units::MEV:
176 Photos::setMomentumUnit(Photos::MEV);
177 Photos::forceMass(11, 0.510998910);
181 ATH_MSG_ERROR(
"Photospp_i received a event with unknown units.");
182 Photos::setMomentumUnit(Photos::DEFAULT_MOMENTUM);
185 PhotosHepMCEvent photosEvent(
event);
186 photosEvent.process();
188 return StatusCode::SUCCESS;