Commit 7c596e0f authored by Enrico Bothmann's avatar Enrico Bothmann

Warn if using reweighting with non-hadronic beams

This is because it has only been tested for (anti-)protonic beams
parent 22373918
......@@ -10,6 +10,7 @@
#include "ATOOLS/Org/Smart_Pointer.C"
#include "ATOOLS/Phys/Blob.H"
#include "MODEL/Main/Running_AlphaS.H"
#include "BEAM/Main/Beam_Spectra_Handler.H"
#include "PDF/Main/PDF_Base.H"
#if defined USING__LHAPDF && defined USING__LHAPDF6
#include "LHAPDF/LHAPDF.h"
......@@ -57,6 +58,24 @@ bool Variations::NeedsLHAPDF6Interface(std::string inputpath)
return false;
}
void Variations::CheckConsistencyWithBeamSpectra(BEAM::Beam_Spectra_Handler *beamspectra)
{
// make sure we deal with (anti-)protonic beam, otherwise warn
bool shouldwarn(false);
for (int beam(0); beam <= 1; ++beam) {
if (beamspectra->GetBeam(beam)->Bunch().Kfcode() != kf_p_plus) {
shouldwarn = true;
break;
}
}
if (shouldwarn) {
msg_Error()<<"WARNING in "<<METHOD<<": "<<std::endl
<<" The internal reweighting is only tested"<<std::endl
<<" for hadronic beams of (anti-)protons."<<std::endl
<<" Will continue and hope for the best."<<std::endl;
}
}
Variations::Variations(Data_Reader * const reader):
m_includecentralvaluevariation(reader->GetValue<int>("VARIATIONS_INCLUDE_CV", 1)),
m_reweightsplittingalphasscales(reader->GetValue<int>("REWEIGHT_SPLITTING_ALPHAS_SCALES", 0)),
......
......@@ -17,6 +17,7 @@
namespace PDF { class PDF_Base; }
namespace MODEL { class Running_AlphaS; }
namespace BEAM { class Beam_Spectra_Handler; }
namespace ATOOLS {
......@@ -40,6 +41,7 @@ namespace ATOOLS {
class Variations {
public:
static bool NeedsLHAPDF6Interface(std::string inputpath);
static void CheckConsistencyWithBeamSpectra(BEAM::Beam_Spectra_Handler *);
Variations(ATOOLS::Data_Reader * const);
~Variations();
......
......@@ -856,7 +856,9 @@ bool Initialization_Handler::InitializeTheReweighting()
dataread.AddComment("#");
dataread.AddWordSeparator("\t");
dataread.SetInputPath(m_path);
Variations::CheckConsistencyWithBeamSpectra(p_beamspectra);
p_variations = new Variations(&dataread);
msg_Info()<<"Initialized the Reweighting."<<endl;
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment