10 #include "GENIE/Framework/Messenger/Messenger.h" 13 using namespace genie;
28 const double kkpcPerCm = 3.086e21;
29 const double kLumiMag = 1e50;
30 const double kSphereSolidAngle = 4 * TMath::Pi();
31 const double kWindowArea = 1;
33 const double norm = (kLumiMag / (kkpcPerCm * kkpcPerCm)) * kWindowArea / kSphereSolidAngle;
44 TFile
f(filename.data(),
"READ");
46 throw std::runtime_error(
"Error opening SN model file " + filename);
49 std::map<int, std::string> histMap = {
58 for(
auto& histMapEntry: histMap){
59 histPDG = histMapEntry.first;
60 histName = histMapEntry.second;
62 TH2* hFlux = (TH2*)
f.Get(histName.data());
64 throw std::runtime_error(
"Failed to read histogram \'" 89 LOG(
"GSNovaModel",
pNOTICE) <<
"Add generator for pdg=" << generator.
PDG()
111 if (this->
End())
return;
118 LOG(
"GSNovaModel",
pDEBUG) <<
"Using generator [" << gen.PDG() <<
"]," 123 gen.FillParticle(particle);
128 LOG(
"GSNovaModel",
pNOTICE) <<
"Finishing generator #" << gen.PDG();
154 LOG(
"GSNovaModel",
pDEBUG) <<
"Reloading generator " << gen.PDG();
183 return g1.
T() < g2.
T();
bool End()
Check if there are no active generators left.
genie::PDGCodeList fPdgList
THE MAIN GENIE PROJECT NAMESPACE
const Limits< double > & LimsT() const
void SetEmin(double Emin)
std::list< GFluxGenerator > fGeneratorsDead
std::list< GFluxGenerator >::iterator SelectGenerator()
const Limits< double > & LimsE() const
const std::list< GFluxGenerator > ActiveGenerators()
Access to generators.
const double GetIntegral() const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
std::list< GFluxGenerator > fGeneratorsActive
list of particles
const genie::PDGCodeList & PdgList()
Get model features.
Limits< double > fLimsE
Total flux integral.
void GenerateNext(GenParticle &)
Generate next particle.
Limits< double > fLimsT
Energy range.
void Update(const Limits< T > &other)
void Reload()
Reactivate all generators.
TH2 * ScaleHist(TH2 *hist)
bool compare(const GFluxGenerator &g1, const GFluxGenerator &g2)
void AddGenerator(GFluxGenerator)
Populate model with generators.
assert(nhit_max >=nhit_nbins)
void SetProbScale(double Scale)
void ReadModel(std::string filename)
void push_back(int pdg_code)
GSNovaModel(std::string filename)