Changeset 19753


Ignore:
Timestamp:
10/10/19 19:56:28 (5 years ago)
Author:
tbretz
Message:
Allow setting SurfaceRoughness (note that this is DANGEROUS to use) and fixed some compiler warnings.
File:
1 edited

Legend:

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

    r19675 r19753  
    205205    fGrooves.resize(num);
    206206
    207     for (int i=0; i<num; i++)
     207    for (uint32_t i=0; i<num; i++)
    208208    {
    209209        const double r0 = i*width;
     
    326326Int_t MFresnelLens::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
    327327{
     328    Bool_t rc = kFALSE;
     329
     330    if (IsEnvDefined(env, prefix, "SurfaceRoughness", print))
     331    {
     332        rc = kTRUE;
     333        if (!GetEnvValue(env, prefix, "SurfaceRoughness", fPSF))
     334            return kERROR;
     335    }
     336
    328337    const int correction  = GetEnvValue(env, prefix, "Transmission.FresnelCorrection", -1);
    329338    const float thickness = GetEnvValue(env, prefix, "Transmission.Thickness", -1.0); // [cm]
     
    335344
    336345    if (!correction_valid && !thickness_valid && !fname_valid)
    337         return kFALSE;
     346        return rc;
    338347
    339348    if (correction_valid && thickness_valid && fname_valid)
    340         return ReadTransmission(fname, thickness, correction) >= 0;
     349        return ReadTransmission(fname, thickness, correction) >= 0 || rc;
    341350
    342351    *fLog << err << "Reading transmission file required FileName, Thickness and FresnelCorrection." << endl;
     
    12351244
    12361245    // Calculate the ordinal number of the groove correpsonding to rx
    1237     const int ix = TMath::FloorNint(rx/fW);
     1246    const uint32_t ix = TMath::FloorNint(rx/fW);
    12381247
    12391248    // FIXME: The Z-coordinate (cone.h) is actually a line through two points!!!
     
    14751484        p.fVectorPart.SetZ(0);//fH/2); Found by try-and-error
    14761485
    1477         return cnt>=fMinHits && (fMaxHits==0 || cnt<=fMaxHits) ? cnt : -1;;
     1486        return uint32_t(cnt)>=fMinHits && (fMaxHits==0 || uint32_t(cnt)<=fMaxHits) ? cnt : -1;;
    14781487    }
    14791488    catch (const raytrace_exception &e)
Note: See TracChangeset for help on using the changeset viewer.