Print

Print


Dear developers,

When using gevgen_atmo ( GENIE 2.12.4 ), we found the app hangs at:
  NOTICE GMCJDriver : [n] <GMCJDriver.cxx::GenerateFluxNeutrino (1045)> : Generating a flux neutrino

We have a look at the code, and found the problem is due to an invalid fMaxEv.
Because fMaxEv is initialized before fNumEnergyBins is initialized, fMaxEv is always the value in the first bin.

Thank you!

Tao Lin


Following is our patch:
Index: src/FluxDrivers/GFLUKAAtmoFlux.cxx
===================================================================
--- src/FluxDrivers/GFLUKAAtmoFlux.cxx  (revision 6939)
+++ src/FluxDrivers/GFLUKAAtmoFlux.cxx  (working copy)
@@ -23,6 +23,7 @@
 */
 //____________________________________________________________________________

+#include <iostream>
 #include <cassert>
 #include <fstream>

@@ -115,11 +116,13 @@
          << ": bin centre = " << (fEnergyBins[i] + fEnergyBins[i+1])/2.;
   }

-  fMaxEv = fEnergyBins[fNumEnergyBins];

   fNumPhiBins      = 1;
   fNumCosThetaBins = kGFlk3DNumCosThetaBins;
   fNumEnergyBins   = kGFlk3DNumLogEvBins;
+
+  std::cout << "fNumEnergyBins:" << fNumEnergyBins << std::endl;
+  fMaxEv = fEnergyBins[fNumEnergyBins];
 }