Changeset 19646 for trunk/Mars


Ignore:
Timestamp:
09/15/19 22:20:35 (5 years ago)
Author:
tbretz
Message:
Replaces gLog by *fLog, try-and-error debugging (using d=10 and d=20) what the correct focal distance is, fixed a bug in FindPeak (accessing fGroove[-1] does not work)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msimreflector/MFresnelLens.cc

    r19644 r19646  
    244244
    245245        if (z<-fH)
    246             gLog << warn << "Groove " << i << " deeper (" << z << ") than thickness of lens material (" << fH << ")." << endl;
     246            *fLog << warn << "Groove " << i << " deeper (" << z << ") than thickness of lens material (" << fH << ")." << endl;
    247247    }
    248248
     
    292292        if (trans>1)
    293293        {
    294             gLog << err << "Transmission larger than 1." << endl;
     294            *fLog << err << "Transmission larger than 1." << endl;
    295295            return -1;
    296296        }
     
    310310            if (trans>1)
    311311            {
    312                 gLog << warn << "Transmission at " << lambda << "nm (" << trans << ") after Fresnel correction larger than 1." << endl;
     312                *fLog << warn << "Transmission at " << lambda << "nm (" << trans << ") after Fresnel correction larger than 1." << endl;
    313313                trans = 1;
    314314            }
     
    377377    // from the entrance of the lens => FIXME: To be checked
    378378    const double rn = n1/n0;
    379     const double c = (rn - 1) * (F + d/rn); // FIXME
     379    const double c = (rn - 1) * (F + d/rn); // FIXME: try and error with a large d
    380380    return -atan(r/c);
     381
     382    // F = 50.21
     383    //       d= 10        d=20
     384    // -:    47           43.7
     385    // 0:    53.5         57.0
     386    // +:    60.3         70.3
    381387}
    382388
     
    693699        const int step = outgoing ^ !first ? 1 : -1;
    694700        const int end  = outgoing ^ !first ? fGrooves.size() : 1;
    695         const int beg  = j==0 ? ix : ix+(step);
     701        const int beg  = j==0 ? ix : ix+step;
     702
     703        if (step==-1 && ix==1) // can not count downwards from here
     704            continue;
    696705
    697706        for (int i=beg; i!=end; i+=step)
     
    13771386        (lambda<fAbsorptionLength.GetXmin() || lambda>fAbsorptionLength.GetXmax()))
    13781387        {
    1379             gLog << err << "Wavelength " << lambda << "nm out of absorption range [" << fAbsorptionLength.GetXmin() << "nm;" << fAbsorptionLength.GetXmax() << "nm]" << endl;
     1388            *fLog << err << "Wavelength " << lambda << "nm out of absorption range [" << fAbsorptionLength.GetXmin() << "nm;" << fAbsorptionLength.GetXmax() << "nm]" << endl;
    13801389            return -1;
    13811390        }
     
    14441453        // from the entrance of the lens => FIXME: To be checked
    14451454        // (Propagating to F means not propagating a distance of F-H from the exit)
    1446         p.fVectorPart.SetZ(fH/2);
     1455        //p.fVectorPart.SetZ(fH-fH/2/fN);//fH/2); Found by try-and-error
     1456
     1457        // We are already at -H, adding F and setting Z=0 means going to -(F+H)
     1458        p.fVectorPart.SetZ(0);//fH/2); Found by try-and-error
    14471459
    14481460        return cnt>=fMinHits && (fMaxHits==0 || cnt<=fMaxHits) ? cnt : -1;;
     
    14881500        (lambda<fAbsorptionLength.GetXmin() || lambda>fAbsorptionLength.GetXmax()))
    14891501        {
    1490             gLog << err << "Wavelength " << lambda << "nm out of absorption range [" << fAbsorptionLength.GetXmin() << "nm;" << fAbsorptionLength.GetXmax() << "nm]" << endl;
     1502            *fLog << err << "Wavelength " << lambda << "nm out of absorption range [" << fAbsorptionLength.GetXmin() << "nm;" << fAbsorptionLength.GetXmax() << "nm]" << endl;
    14911503            return -1;
    14921504        }
     
    15581570    {
    15591571        if (verbose)
    1560             gLog << all << e.id() << ": " << e.what() << endl;
     1572            *fLog << all << e.id() << ": " << e.what() << endl;
    15611573
    15621574        // Hit point at bottom surface beyond allowed range
Note: See TracChangeset for help on using the changeset viewer.