Changeset 18547 for trunk/Mars


Ignore:
Timestamp:
08/26/16 12:59:59 (8 years ago)
Author:
tbretz
Message:
If the CEFFIC option is enables and the user has not requested execution explicitly, it is skipped.
Location:
trunk/Mars/msim
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msim/MSimAbsorption.cc

    r9425 r18547  
    6666//
    6767MSimAbsorption::MSimAbsorption(const char* name, const char *title)
    68     : fEvt(0), fHeader(0), fSpline(0), fParName("MParSpline"), fUseTheta(kFALSE)
     68    : fEvt(0), fRunHeader(0), fHeader(0), fSpline(0), fParName("MParSpline"), fUseTheta(kFALSE), fForce(kFALSE)
    6969{
    7070    fName  = name  ? name  : "MSimAbsorption";
     
    118118        return kTRUE;
    119119
    120     MCorsikaRunHeader *h = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
    121     if (!h)
     120    fRunHeader = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
     121    if (!fRunHeader)
    122122    {
    123123        *fLog << err << "MCorsikaRunHeader not found... aborting." << endl;
     
    125125    }
    126126
    127     if (h->GetWavelengthMin()<fSpline->GetXmin())
     127    if (fRunHeader->Has(MCorsikaRunHeader::kCeffic) && !fForce)
     128        *fLog << inf << "CEFFIC enabled... task will be skipped." << endl;
     129
     130    if (fRunHeader->GetWavelengthMin()<fSpline->GetXmin())
    128131        *fLog << warn << "WARNING - Lower bound of wavelength bandwidth exceeds lower bound of spline." << endl;
    129132
    130     if (h->GetWavelengthMax()>fSpline->GetXmax())
     133    if (fRunHeader->GetWavelengthMax()>fSpline->GetXmax())
    131134        *fLog << warn << "WARNING - Upper bound of wavelength bandwidth exceeds upper bound of spline." << endl;
    132135
     
    142145Int_t MSimAbsorption::Process()
    143146{
     147    // Skip the task if the CEFFIC option has been enabled and
     148    // its excution has not been forced by the user
     149    if (!fForce && !fUseTheta && fRunHeader->Has(MCorsikaRunHeader::kCeffic))
     150        return kTRUE;
     151
    144152    // Get the number of photons in the list
    145153    const Int_t num = fEvt->GetNumPhotons();
     
    194202    }
    195203
     204    if (IsEnvDefined(env, prefix, "Force", print))
     205    {
     206        rc = kTRUE;
     207        SetForce(GetEnvValue(env, prefix, "Force", fForce));
     208    }
     209
    196210    return rc;
    197211}
  • trunk/Mars/msim/MSimAbsorption.h

    r9425 r18547  
    99class MParSpline;
    1010class MPhotonEvent;
     11class MCorsikaRunHeader;
    1112class MCorsikaEvtHeader;
    1213
     
    1415{
    1516private:
    16     MPhotonEvent      *fEvt;     //! Event stroing the photons
    17     MCorsikaEvtHeader *fHeader;  //! Header storing event information
     17    MPhotonEvent      *fEvt;       //! Event stroing the photons
     18    MCorsikaRunHeader *fRunHeader; //! Corsika run header
     19    MCorsikaEvtHeader *fHeader;    //! Header storing event information
    1820
    19     MParSpline        *fSpline;  //! Spline to interpolate wavelength or incident angle
     21    MParSpline        *fSpline;    //! Spline to interpolate wavelength or incident angle
    2022
    2123    TString fParName;            // Container name of the spline containing the curve
    2224    Bool_t  fUseTheta;           // Switches between using wavelength or incident angle
     25    Bool_t  fForce;              // Force execution even if corsika already simulated the efficiencies
    2326
    2427    // MParContainer
     
    3740
    3841    void SetUseTheta(Bool_t b=kTRUE) { fUseTheta = b; }
     42    void SetForce(Bool_t b=kTRUE) { fForce = b; }
    3943
    4044    ClassDef(MSimAbsorption, 0) // Task to calculate wavelength or incident angle dependent absorption
Note: See TracChangeset for help on using the changeset viewer.