Index: trunk/Mars/Changelog
===================================================================
--- trunk/Mars/Changelog	(revision 9931)
+++ trunk/Mars/Changelog	(revision 9932)
@@ -25,4 +25,7 @@
      - call SetAllowEmpty for the three ContEmpty filters
      - changed binning of camera histograms
+
+   * msimcamera/MSimRandomPhotons.cc:
+     - improved output in case of failure
 
 
Index: trunk/Mars/msimcamera/MSimRandomPhotons.cc
===================================================================
--- trunk/Mars/msimcamera/MSimRandomPhotons.cc	(revision 9931)
+++ trunk/Mars/msimcamera/MSimRandomPhotons.cc	(revision 9932)
@@ -332,26 +332,34 @@
 
     // Check if the photon flux is zero at both ends of the NSB
-    if (nsb.GetSpline()->Eval(min)>1e-5)
-    {
-        *fLog << warn << "WARNING - Transmitted NSB spectrum at detector at ";
-        *fLog << wmin << "nm is not zero, but " << nsb.GetSpline()->Eval(wmin) << "... abort." << endl;
-    }
-    if (nsb.GetSpline()->Eval(max)>1e-5)
-    {
-        *fLog << warn << "WARNING - Transmitted NSB spectrum at detector at ";
-        *fLog << wmax << "nm is not zero, but " << nsb.GetSpline()->Eval(wmax) << "... abort." << endl;
+    if (eff.GetSpline()->Eval(min)>1e-5)
+    {
+        *fLog << warn << "WARNING - Total transmission efficiency at detector at ";
+        *fLog << min << "nm is not zero, but " << nsb.GetSpline()->Eval(min) << "... abort." << endl;
+    }
+    if (eff.GetSpline()->Eval(max)>1e-5)
+    {
+        *fLog << warn << "WARNING - Total transmission efficiency at detector at ";
+        *fLog << max << "nm is not zero, but " << nsb.GetSpline()->Eval(max) << "... abort." << endl;
     }
 
     // Check if the photon flux is zero at both ends of the simulated region
-    if (nsb.GetSpline()->Eval(fRunHeader->GetWavelengthMin())>1e-5)
-    {
-        *fLog << err << "ERROR - Transmitted NSB spectrum at detector at minimum simulated wavelength ";
-        *fLog << fRunHeader->GetWavelengthMin() << "nm is not zero... abort." << endl;
-        return kFALSE;
-    }
-    if (nsb.GetSpline()->Eval(fRunHeader->GetWavelengthMax())>1e-5)
-    {
-        *fLog << err << "ERROR - Transmitted NSB spectrum at detector at maximum simulated wavelength ";
-        *fLog << fRunHeader->GetWavelengthMax() << "nm is not zero... abort." << endl;
+    if (eff.GetSpline()->Eval(wmin)>1e-5)
+    {
+        *fLog << err << "ERROR - Total transmission efficiency at detector at minimum simulated wavelength ";
+        *fLog << wmin << "nm is not zero... abort." << endl;
+        *fLog << "        PhotonDetectionEfficency: " << s1->GetSpline()->Eval(wmin) << endl;
+        *fLog << "        ConeTransmission:         " << s2->GetSpline()->Eval(wmin) << endl;
+        *fLog << "        MirrorReflectivity:       " << s3->GetSpline()->Eval(wmin) << endl;
+        *fLog << "        TotalEfficiency:          " << eff.GetSpline()->Eval(wmin) << endl;
+        return kFALSE;
+    }
+    if (eff.GetSpline()->Eval(wmax)>1e-5)
+    {
+        *fLog << err << "ERROR - Total transmission efficiency at detector at maximum simulated wavelength ";
+        *fLog << wmax << "nm is not zero... abort." << endl;
+        *fLog << "        PhotonDetectionEfficency: " << s1->GetSpline()->Eval(wmax) << endl;
+        *fLog << "        ConeTransmission:         " << s2->GetSpline()->Eval(wmax) << endl;
+        *fLog << "        MirrorReflectivity:       " << s3->GetSpline()->Eval(wmax) << endl;
+        *fLog << "        TotalEfficiency:          " << eff.GetSpline()->Eval(wmax) << endl;
         return kFALSE;
     }
