Changeset 18548
- Timestamp:
- 08/26/16 13:01:43 (8 years ago)
- Location:
- trunk/Mars/msim
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msim/MSimAtmosphere.cc
r9429 r18548 698 698 // 699 699 MSimAtmosphere::MSimAtmosphere(const char* name, const char *title) 700 : f Evt(0), fAtmosphere(0),700 : fRunHeader(0), fEvt(0), fAtmosphere(0), 701 701 fFileAerosols("resmc/atmosphere-aerosols.txt"), 702 fFileOzone("resmc/atmosphere-ozone.txt") 702 fFileOzone("resmc/atmosphere-ozone.txt"), 703 fForce(kFALSE) 703 704 { 704 705 fName = name ? name : "MSimAtmosphere"; … … 739 740 Bool_t MSimAtmosphere::ReInit(MParList *pList) 740 741 { 741 MCorsikaRunHeader *h= (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");742 if (! h)742 fRunHeader = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader"); 743 if (!fRunHeader) 743 744 { 744 745 *fLog << err << "MCorsikaRunHeader not found... aborting." << endl; 745 746 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; 746 753 } 747 754 … … 759 766 */ 760 767 761 fAtmosphere->Init(* h, fFileOzone, fFileAerosols);768 fAtmosphere->Init(*fRunHeader, fFileOzone, fFileAerosols); 762 769 763 770 if (!fAtmosphere->IsAllValid()) … … 767 774 } 768 775 769 if ( h->GetWavelengthMin()<fAtmosphere->GetWavelengthMin())776 if (fRunHeader->GetWavelengthMin()<fAtmosphere->GetWavelengthMin()) 770 777 *fLog << warn << "WARNING - Lower bound of wavelength bandwidth exceeds valid range of atmosphere." << endl; 771 778 772 if ( h->GetWavelengthMax()>fAtmosphere->GetWavelengthMax())779 if (fRunHeader->GetWavelengthMax()>fAtmosphere->GetWavelengthMax()) 773 780 *fLog << warn << "WARNING - Lower bound of wavelength bandwidth exceeds valid range of atmosphere." << endl; 774 781 775 if (! h->Has(MCorsikaRunHeader::kAtmext))782 if (!fRunHeader->Has(MCorsikaRunHeader::kAtmext)) 776 783 *fLog << warn << "WARNING - ATMEXT option not used for Corsika data." << endl; 777 784 778 if (! h->Has(MCorsikaRunHeader::kRefraction))785 if (!fRunHeader->Has(MCorsikaRunHeader::kRefraction)) 779 786 *fLog << warn << "WARNING - Refraction calculation disabled for Corsika data." << endl; 780 787 … … 786 793 Int_t MSimAtmosphere::Process() 787 794 { 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 788 800 // Get the number of photons in the list 789 801 const Int_t num = fEvt->GetNumPhotons(); … … 872 884 } 873 885 886 if (IsEnvDefined(env, prefix, "Force", print)) 887 { 888 rc = kTRUE; 889 fForce = GetEnvValue(env, prefix, "Force", fForce); 890 } 891 874 892 return rc; 875 893 } -
trunk/Mars/msim/MSimAtmosphere.h
r9378 r18548 9 9 class MAtmosphere; 10 10 class MPhotonEvent; 11 class MCorsikaRunHeader; 11 12 12 13 class MSimAtmosphere : public MTask 13 14 { 14 15 private: 15 MPhotonEvent *fEvt; //! Event stroing the photons 16 MCorsikaRunHeader *fRunHeader; //! Corsika run header 17 MPhotonEvent *fEvt; //! Event stroing the photons 16 18 17 19 MAtmosphere *fAtmosphere; //! Instance of class describing atmosphere … … 19 21 TString fFileAerosols; // Name of file with aersole absorption 20 22 TString fFileOzone; // Name of file with ozone absorption 23 24 Bool_t fForce; // Force execution in case efficiencies are already included (CEFFIC) 21 25 22 26 // MParContainer
Note:
See TracChangeset
for help on using the changeset viewer.