Skip to content

Commit

Permalink
Fix a bug where multiple atmospheric flux is not handled properly
Browse files Browse the repository at this point in the history
The value s0 and s1 is the CDF for the weight of bins, thus when `p.beam_atmo_files` has multiple lines (usually seen when different flavors of neutrino being present), the value should not be reset after each file. Otherwise only the flux specified in first file will acually show up in the final results.
  • Loading branch information
karuboniru authored and cjusz committed Aug 18, 2024
1 parent 81b37a6 commit cf1d497
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/beam_atmo.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class beam_atmo: public beam
stringstream in(p.beam_atmo_files);
int pdg=0;
string fname;
double s0=0,s1=0;
while(in >> pdg >> fname)
{
if(abs(pdg)==12 || abs(pdg)== 14 || abs(pdg)==16)
Expand All @@ -66,7 +67,7 @@ class beam_atmo: public beam
bin b;
b.pdg=pdg;
string line;
double s0=0,s1=0,w,E;
double w,E;
while(getline(atmo,line))
if(line[0]!='#')
{
Expand Down Expand Up @@ -112,4 +113,4 @@ class beam_atmo: public beam
};


#endif
#endif

0 comments on commit cf1d497

Please sign in to comment.