Changeset 18548


Ignore:
Timestamp:
08/26/16 13:01:43 (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/MSimAtmosphere.cc

    r9429 r18548  
    698698//
    699699MSimAtmosphere::MSimAtmosphere(const char* name, const char *title)
    700     : fEvt(0), fAtmosphere(0),
     700    : fRunHeader(0), fEvt(0), fAtmosphere(0),
    701701    fFileAerosols("resmc/atmosphere-aerosols.txt"),
    702     fFileOzone("resmc/atmosphere-ozone.txt")
     702    fFileOzone("resmc/atmosphere-ozone.txt"),
     703    fForce(kFALSE)
    703704{
    704705    fName  = name  ? name  : "MSimAtmosphere";
     
    739740Bool_t MSimAtmosphere::ReInit(MParList *pList)
    740741{
    741     MCorsikaRunHeader *h = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
    742     if (!h)
     742    fRunHeader = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");
     743    if (!fRunHeader)
    743744    {
    744745        *fLog << err << "MCorsikaRunHeader not found... aborting." << endl;
    745746        return kFALSE;
     747    }
     748
     749    if (fRunHeader->Has(MCorsikaRunHeader::kCeffic) && !fForce)
     750    {
     751        *fLog << inf << "CEFFIC enabled... task will be skipped." << endl;
     752        return kTRUE;
    746753    }
    747754
     
    759766    */
    760767
    761     fAtmosphere->Init(*h, fFileOzone, fFileAerosols);
     768    fAtmosphere->Init(*fRunHeader, fFileOzone, fFileAerosols);
    762769
    763770    if (!fAtmosphere->IsAllValid())
     
    767774    }
    768775
    769     if (h->GetWavelengthMin()<fAtmosphere->GetWavelengthMin())
     776    if (fRunHeader->GetWavelengthMin()<fAtmosphere->GetWavelengthMin())
    770777        *fLog << warn << "WARNING - Lower bound of wavelength bandwidth exceeds valid range of atmosphere." << endl;
    771778
    772     if (h->GetWavelengthMax()>fAtmosphere->GetWavelengthMax())
     779    if (fRunHeader->GetWavelengthMax()>fAtmosphere->GetWavelengthMax())
    773780        *fLog << warn << "WARNING - Lower bound of wavelength bandwidth exceeds  valid range of atmosphere." << endl;
    774781
    775     if (!h->Has(MCorsikaRunHeader::kAtmext))
     782    if (!fRunHeader->Has(MCorsikaRunHeader::kAtmext))
    776783        *fLog << warn << "WARNING - ATMEXT option not used for Corsika data." << endl;
    777784
    778     if (!h->Has(MCorsikaRunHeader::kRefraction))
     785    if (!fRunHeader->Has(MCorsikaRunHeader::kRefraction))
    779786        *fLog << warn << "WARNING - Refraction calculation disabled for Corsika data." << endl;
    780787
     
    786793Int_t MSimAtmosphere::Process()
    787794{
     795    // Skip the task if the CEFFIC option has been enabled and
     796    // its excution has not been forced by the user
     797    if (!fForce && fRunHeader->Has(MCorsikaRunHeader::kCeffic))
     798        return kTRUE;
     799
    788800    // Get the number of photons in the list
    789801    const Int_t num = fEvt->GetNumPhotons();
     
    872884    }
    873885
     886    if (IsEnvDefined(env, prefix, "Force", print))
     887    {
     888        rc = kTRUE;
     889        fForce = GetEnvValue(env, prefix, "Force", fForce);
     890    }
     891
    874892    return rc;
    875893}
  • trunk/Mars/msim/MSimAtmosphere.h

    r9378 r18548  
    99class MAtmosphere;
    1010class MPhotonEvent;
     11class MCorsikaRunHeader;
    1112
    1213class MSimAtmosphere : public MTask
    1314{
    1415private:
    15     MPhotonEvent *fEvt;        //! Event stroing the photons
     16    MCorsikaRunHeader *fRunHeader; //! Corsika run header
     17    MPhotonEvent *fEvt;            //! Event stroing the photons
    1618
    1719    MAtmosphere  *fAtmosphere; //! Instance of class describing atmosphere
     
    1921    TString fFileAerosols;     // Name of file with aersole absorption
    2022    TString fFileOzone;        // Name of file with ozone absorption
     23
     24    Bool_t fForce;             // Force execution in case efficiencies are already included (CEFFIC)
    2125
    2226    // MParContainer
Note: See TracChangeset for help on using the changeset viewer.