8#include "Photos/Photos.h"
11#include "Photos/PhotosHepMC3Event.h"
13using PhotosHepMCEvent=PhotosHepMC3Event;
16#include "Photos/PhotosHepMCEvent.h"
18#include "Photos/Log.h"
23#include "CLHEP/Random/RandFlat.h"
27using namespace Photospp;
53 return StatusCode::SUCCESS;
60 Photos::setInterference(
true);
61 Photos::setCorrectionWtForW(
true);
66 Photos::forceMassFrom4Vector(
true);
67 Photos::forceMassFromEventRecord(13);
68 Photos::forceMassFromEventRecord(15);
70 Photos::forceMassFromEventRecord(211);
71 Photos::setTopProcessRadiation(
false);
79 Photos::setExponentiation(
true);
81 Photos::setInfraredCutOff(0.01);
82 Photos::setDoubleBrem(
true);
83 Photos::setQuatroBrem(
false);
92 Photospp::Log::LogWarning(
false);
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,
145 const EventContext& ctx = Gaudi::Hive::currentContext();
152 if (
sc.isFailure() || eventCollection == 0) {
154 return StatusCode::FAILURE;
160 HepMC::GenEvent *
event = eventCollection->
back();
163 return StatusCode::FAILURE;
165 switch(event->momentum_unit()) {
167 case HepMC3::Units::MomentumUnit::GEV:
168 Photos::setMomentumUnit(Photos::GEV);
171 case HepMC3::Units::MomentumUnit::MEV:
172 Photos::setMomentumUnit(Photos::MEV);
176 case HepMC::Units::GEV:
177 Photos::setMomentumUnit(Photos::GEV);
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;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
A number of constexpr particle constants to avoid hardcoding them directly in various places.
void ignore_unused_variable_warning(int *)
double phoranc_(int *idum)
A wrapper class for event-slot-local random engines.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
const T * back() const
Access the last element in the collection as an rvalue.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
BooleanProperty m_createHistory
Whether to create history entries (default = yes)
BooleanProperty m_photonSplitting
Whether to include photon splitting.
StatusCode execute()
Run Photos on one event Will require a pre-existing HepMC event in Storegate.
void setupPhotos()
Set up the Photos class This may be called in the initialize method or directly before the generation...
BooleanProperty m_stopCritical
Whether to stop on critical error (default = no)
Photospp_i(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena algorithm constructor.
BooleanProperty m_delayInitialisation
Delay initialisation until just before first event execution (default = no)
ServiceHandle< IAthRNGSvc > m_rndmSvc
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize(const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
BooleanProperty m_WMECorrection
Whether to apply ME correction to W decays (default = no, until validated)
IntegerProperty m_randomSeed
Seed for random number engine.
DoubleProperty m_maxWtInterference
void reseedRandomEngine(const std::string &streamName, const EventContext &ctx)
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, unsigned long int randomSeedOffset, const EventContext &ctx) const
DoubleProperty m_infraRedCutOff
StringProperty m_genEventKey
The GenEvent StoreGate key - FIXME should be using Read/WriteHandles here.
BooleanProperty m_ZMECorrection
Whether to apply ME correction to Z decays (default = no, until validated)
static CLHEP::HepRandomEngine * p_rndmEngine
BooleanProperty m_exponentiation
Whether to use exponentiation mode (default = yes)
StatusCode initialize()
Initialise the Photospp_i algorithm and required services.
DoubleProperty m_alphaQED
Value of alpha_QED.
void calculateSeedsMC21(long *seeds, const std::string &algName, uint64_t ev, uint64_t run, uint64_t offset=0)
Set the random seed using a string (e.g.
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
constexpr double electronMassInMeV
the mass of the electron (in MeV)