42 const double infraredCutOff,
43 const double maxWtInterference ) :
58 <<
"Error in EvtPHOTOS. Do not recognise the photon type "
59 <<
m_photonType <<
". Setting this to \"gamma\". " << endl;
72 <<
"Using EvtGen random number engine also for Photos++" << endl;
77 Photospp::Photos::initialize();
79 Photospp::Photos::setExponentiation(
true );
88 Photospp::Photos::setInterference(
true );
95#ifdef EVTGEN_PHOTOS_NEWLIBS
98 Photospp::Photos::setPairEmission(
false );
106 if ( !theParticle ) {
114 const int nDaughters( theParticle->
getNDaug() );
115 if ( nDaughters == 0 || nDaughters >= 10 ) {
127 auto theEvent = std::make_unique<GenEvent>( Units::GEV, Units::MM );
131 theEvent->add_vertex( theVertex );
136 theVertex->add_particle_in( hepMCMother );
141 int iDaug( 0 ), nGamma( 0 );
142 for ( iDaug = 0; iDaug < nDaughters; iDaug++ ) {
146 theVertex->add_particle_out( hepMCDaughter );
158 Photospp::PhotosHepMC3Event photosEvent( theEvent.get() );
160 Photospp::PhotosHepMCEvent photosEvent( theEvent.get() );
164 photosEvent.process();
172 if ( nPhotons > nGamma ) {
178 for (
const auto& outParticle : theVertex->particles_out() ) {
180 HepMC::GenVertex::particles_out_const_iterator outIter;
181 for ( outIter = theVertex->particles_out_const_begin();
182 outIter != theVertex->particles_out_const_end(); ++outIter ) {
184 const HepMC::GenParticle* outParticle = *outIter;
188 const FourVector HepMCP4 = outParticle->momentum();
189 const double px = HepMCP4.px();
190 const double py = HepMCP4.py();
191 const double pz = HepMCP4.pz();
192 const double energy = HepMCP4.e();
193 const int pdgId = outParticle->pdg_id();
196 if ( iLoop < nDaughters ) {
202 if ( daugParticle ) {
233 bool incoming )
const
240 : theParticle.
getP4();
243 const double E = p4.
get( 0 );
244 const double px = p4.
get( 1 );
245 const double py = p4.
get( 2 );
246 const double pz = p4.
get( 3 );
254 const int status = incoming ? Photospp::PhotosParticle::HISTORY
255 : Photospp::PhotosParticle::STABLE;
276 for (
const auto& outParticle : theVertex->particles_out() ) {
278 HepMC::GenVertex::particles_out_const_iterator outIter;
279 for ( outIter = theVertex->particles_out_const_begin();
280 outIter != theVertex->particles_out_const_end(); ++outIter ) {
282 const HepMC::GenParticle* outParticle = *outIter;
287 if ( outParticle !=
nullptr ) {
288 pdgId = outParticle->pdg_id();
HepMC3::GenVertexPtr GenVertexPtr
GenVertexPtr newGenVertexPtr(const FourVector &pos=FourVector::ZERO_VECTOR())
GenParticlePtr newGenParticlePtr(const FourVector &mom=FourVector::ZERO_VECTOR(), int pid=0, int status=0)
HepMC3::GenParticlePtr GenParticlePtr
HepMC3::FourVector FourVector
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
static int getStdHep(EvtId id)
static EvtId getId(const std::string &name)
static std::mutex m_photos_mutex
GenParticlePtr createGenParticle(const EvtParticle &theParticle, bool incoming) const
double m_maxWtInterference
static bool m_initialised
int getNumberOfPhotons(const GenVertexPtr theVertex) const
void doRadCorr(EvtParticle *theParticle) override
void initialise() override
EvtPHOTOS(const std::string &photonType="gamma", const bool useEvtGenRandom=true, const double infraredCutOff=1.0e-7, const double maxWtInterference=64.0)
EvtVector4R getP4Restframe() const
void setAttribute(std::string attName, int attValue)
const EvtVector4R & getP4() const
EvtParticle * getDaug(const int i)
void setP4WithFSR(const EvtVector4R &p4)
void addDaug(EvtParticle *node)
void init(EvtId part_n, double e, double px, double py, double pz)