Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19309547
D114.1759206500.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D114.1759206500.diff
View Options
diff --git a/EvtGenExternal/EvtPHOTOS.hh b/EvtGenExternal/EvtPHOTOS.hh
--- a/EvtGenExternal/EvtPHOTOS.hh
+++ b/EvtGenExternal/EvtPHOTOS.hh
@@ -18,6 +18,7 @@
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
+#ifdef EVTGEN_PHOTOS
#ifndef EVTPHOTOS_HH
#define EVTPHOTOS_HH
@@ -27,7 +28,6 @@
#include "EvtGenBase/EvtParticle.hh"
#include "EvtGenBase/EvtVector4R.hh"
-#ifdef EVTGEN_PHOTOS
#ifdef EVTGEN_HEPMC3
#include "HepMC3/Units.h"
@@ -38,7 +38,6 @@
#include "Photos/PhotosHepMCParticle.h"
#include "Photos/PhotosParticle.h"
#endif
-#endif
#include <mutex>
#include <string>
@@ -63,7 +62,6 @@
void doRadCorr( EvtParticle* theParticle ) override;
private:
-#ifdef EVTGEN_PHOTOS
GenParticlePtr createGenParticle( const EvtParticle& theParticle,
bool incoming ) const;
@@ -78,8 +76,8 @@
bool m_initialised = false;
static std::mutex photos_mutex;
+};
#endif
-};
#endif
diff --git a/History.md b/History.md
--- a/History.md
+++ b/History.md
@@ -11,6 +11,9 @@
===
## R02-0X-00
+17 Apr 2024 Fernando Abudinen
+* D114: Simplified pre-processor behaviour for PHOTOS.
+
12 Apr 2024 Fernando Abudinen
* D113: Introduced new FSR flag and deprecated PHOTOS flag.
Implemented proper use of neverRadCorr.
diff --git a/src/EvtGenExternal/EvtExternalGenList.cpp b/src/EvtGenExternal/EvtExternalGenList.cpp
--- a/src/EvtGenExternal/EvtExternalGenList.cpp
+++ b/src/EvtGenExternal/EvtExternalGenList.cpp
@@ -20,6 +20,8 @@
#include "EvtGenExternal/EvtExternalGenList.hh"
+#include "EvtGenModels/EvtNoRadCorr.hh"
+
#include "EvtGenExternal/EvtExternalGenFactory.hh"
#include "EvtGenExternal/EvtPHOTOS.hh"
#include "EvtGenExternal/EvtPythia.hh"
@@ -54,6 +56,7 @@
{
}
+#ifdef EVTGEN_PHOTOS
EvtAbsRadCorr* EvtExternalGenList::getPhotosModel( const double infraredCutOff,
const double maxWtInterference )
{
@@ -62,6 +65,20 @@
infraredCutOff, maxWtInterference );
return photosModel;
}
+#else
+EvtAbsRadCorr* EvtExternalGenList::getPhotosModel(
+ const double /*infraredCutOff*/, const double /*maxWtInterference*/ )
+{
+ EvtGenReport( EVTGEN_ERROR, "EvtGen" )
+ << " PHOTOS generator has been called for FSR simulation, but it was not switched on during compilation."
+ << std::endl;
+
+ EvtGenReport( EVTGEN_ERROR, "EvtGen" )
+ << " The simulation will be generated without FSR." << std::endl;
+
+ return new EvtNoRadCorr{};
+}
+#endif
std::list<EvtDecayBase*> EvtExternalGenList::getListOfModels()
{
diff --git a/src/EvtGenExternal/EvtPHOTOS.cpp b/src/EvtGenExternal/EvtPHOTOS.cpp
--- a/src/EvtGenExternal/EvtPHOTOS.cpp
+++ b/src/EvtGenExternal/EvtPHOTOS.cpp
@@ -18,6 +18,8 @@
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
***********************************************************************/
+#ifdef EVTGEN_PHOTOS
+
#include "EvtGenExternal/EvtPHOTOS.hh"
#include "EvtGenBase/EvtPDL.hh"
@@ -32,8 +34,6 @@
using std::endl;
-#ifdef EVTGEN_PHOTOS
-
// Mutex PHOTOS as it is not thread safe.
std::mutex EvtPHOTOS::photos_mutex;
@@ -79,22 +79,27 @@
photos_mutex.unlock();
}
-#else
-EvtPHOTOS::EvtPHOTOS( const std::string& /*photonType*/,
- const bool /*useEvtGenRandom*/,
- const double /*infraredCutOff*/,
- const double /*maxWtInterference*/ )
+
+void EvtPHOTOS::initialise()
{
- EvtGenReport( EVTGEN_WARNING, "EvtGen" )
- << " PHOTOS has been called for FSR simulation, but it was not switched on during compilation."
- << endl;
+ if ( m_initialised ) {
+ return;
+ }
+ m_gammaId = EvtPDL::getId( m_photonType );
+
+ if ( m_gammaId == EvtId( -1, -1 ) ) {
+ EvtGenReport( EVTGEN_INFO, "EvtGen" )
+ << "Error in EvtPHOTOS. Do not recognise the photon type "
+ << m_photonType << ". Setting this to \"gamma\". " << endl;
+ m_gammaId = EvtPDL::getId( "gamma" );
+ }
+
+ m_gammaPDG = EvtPDL::getStdHep( m_gammaId );
+ m_mPhoton = EvtPDL::getMeanMass( m_gammaId );
- EvtGenReport( EVTGEN_WARNING, "EvtGen" )
- << " The simulation will be generated without FSR." << endl;
+ m_initialised = true;
}
-#endif
-#ifdef EVTGEN_PHOTOS
void EvtPHOTOS::doRadCorr( EvtParticle* theParticle )
{
if ( !theParticle ) {
@@ -224,39 +229,7 @@
return;
}
-#else
-void EvtPHOTOS::doRadCorr( EvtParticle* /*theParticle*/ )
-{
-}
-#endif
-#ifdef EVTGEN_PHOTOS
-void EvtPHOTOS::initialise()
-{
- if ( m_initialised ) {
- return;
- }
- m_gammaId = EvtPDL::getId( m_photonType );
-
- if ( m_gammaId == EvtId( -1, -1 ) ) {
- EvtGenReport( EVTGEN_INFO, "EvtGen" )
- << "Error in EvtPHOTOS. Do not recognise the photon type "
- << m_photonType << ". Setting this to \"gamma\". " << endl;
- m_gammaId = EvtPDL::getId( "gamma" );
- }
-
- m_gammaPDG = EvtPDL::getStdHep( m_gammaId );
- m_mPhoton = EvtPDL::getMeanMass( m_gammaId );
-
- m_initialised = true;
-}
-#else
-void EvtPHOTOS::initialise()
-{
-}
-#endif
-
-#ifdef EVTGEN_PHOTOS
GenParticlePtr EvtPHOTOS::createGenParticle( const EvtParticle& theParticle,
bool incoming ) const
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 30, 5:28 AM (18 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6571765
Default Alt Text
D114.1759206500.diff (5 KB)
Attached To
Mode
D114: Simplified pre-processor behaviour for PHOTOS.
Attached
Detach File
Event Timeline
Log In to Comment