Index: trunk/Mars/msimreflector/MFresnelLens.cc
===================================================================
--- trunk/Mars/msimreflector/MFresnelLens.cc	(revision 19674)
+++ trunk/Mars/msimreflector/MFresnelLens.cc	(revision 19675)
@@ -289,5 +289,5 @@
         const double lambda = transmission.GetX()[i];;
 
-        double trans = transmission.GetY()[i]/100;
+        double trans = transmission.GetY()[i];
         if (trans>1)
         {
@@ -322,4 +322,24 @@
 
     return fAbsorptionLength.GetNp();
+}
+
+Int_t MFresnelLens::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
+{
+    const int correction  = GetEnvValue(env, prefix, "Transmission.FresnelCorrection", -1);
+    const float thickness = GetEnvValue(env, prefix, "Transmission.Thickness", -1.0); // [cm]
+    const TString fname   = GetEnvValue(env, prefix, "Transmission.FileName", "");
+
+    const bool correction_valid = correction>=0;
+    const bool thickness_valid  = thickness>0;
+    const bool fname_valid      = !fname.IsNull();
+
+    if (!correction_valid && !thickness_valid && !fname_valid)
+        return kFALSE;
+
+    if (correction_valid && thickness_valid && fname_valid)
+        return ReadTransmission(fname, thickness, correction) >= 0;
+
+    *fLog << err << "Reading transmission file required FileName, Thickness and FresnelCorrection." << endl;
+    return kERROR;
 }
 
@@ -1391,5 +1411,5 @@
     try
     {
-        int last_surface = EnterGroove(kEntrySurface, n0, p, u);
+        int last_surface = kEntrySurface;//EnterGroove(kEntrySurface, n0, p, u);
 
         // last_surface that was hit (photon originates from)
@@ -1401,9 +1421,9 @@
         // nagative: photon is inside  of material  -->  Try to leave
 
-        double T0 = 0;
+        double T0 = 0;//last_surface<0 ? p.T() : 0;
 
         // The general assumption is: no surface can be hit twice in a row
 
-        int cnt = 0;
+        int cnt = -1;
         while (last_surface!=0)
         {
@@ -1413,5 +1433,5 @@
             if (last_surface>0)
             {
-                last_surface = EnterGroove( last_surface, n0, p, u);
+                last_surface = EnterGroove(last_surface, n0, p, u);
 
                 // successfully entered --> remember time of entrance to calculate transimission
@@ -1509,6 +1529,5 @@
     try
     {
-        int last_surface = EnterGroove(kEntrySurface, n0, p, u);
-        //cout << "enter1 = " << last_surface << endl;
+        int last_surface = kEntrySurface;//EnterGroove(kEntrySurface, n0, p, u);
 
         // last_surface that was hit (photon originates from)
@@ -1524,5 +1543,5 @@
         // The general assumption is: no surface can be hit twice in a row
 
-        int cnt = 0;
+        int cnt = -1;
         while (last_surface!=0)
         {
Index: trunk/Mars/msimreflector/MFresnelLens.h
===================================================================
--- trunk/Mars/msimreflector/MFresnelLens.h	(revision 19674)
+++ trunk/Mars/msimreflector/MFresnelLens.h	(revision 19675)
@@ -101,4 +101,7 @@
     int LeavePeak(int surface, double n0, MQuaternion &pos, MQuaternion &dir, double T0) const;
 
+    // MParContainer
+    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
+
 public:
     MFresnelLens(const char *name=NULL, const char *title=NULL);
