Changeset 18547 for trunk/Mars/msim
- Timestamp:
- 08/26/16 12:59:59 (8 years ago)
- Location:
- trunk/Mars/msim
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msim/MSimAbsorption.cc
r9425 r18547 66 66 // 67 67 MSimAbsorption::MSimAbsorption(const char* name, const char *title) 68 : fEvt(0), f Header(0), fSpline(0), fParName("MParSpline"), fUseTheta(kFALSE)68 : fEvt(0), fRunHeader(0), fHeader(0), fSpline(0), fParName("MParSpline"), fUseTheta(kFALSE), fForce(kFALSE) 69 69 { 70 70 fName = name ? name : "MSimAbsorption"; … … 118 118 return kTRUE; 119 119 120 MCorsikaRunHeader *h= (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader");121 if (! h)120 fRunHeader = (MCorsikaRunHeader*)pList->FindObject("MCorsikaRunHeader"); 121 if (!fRunHeader) 122 122 { 123 123 *fLog << err << "MCorsikaRunHeader not found... aborting." << endl; … … 125 125 } 126 126 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()) 128 131 *fLog << warn << "WARNING - Lower bound of wavelength bandwidth exceeds lower bound of spline." << endl; 129 132 130 if ( h->GetWavelengthMax()>fSpline->GetXmax())133 if (fRunHeader->GetWavelengthMax()>fSpline->GetXmax()) 131 134 *fLog << warn << "WARNING - Upper bound of wavelength bandwidth exceeds upper bound of spline." << endl; 132 135 … … 142 145 Int_t MSimAbsorption::Process() 143 146 { 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 144 152 // Get the number of photons in the list 145 153 const Int_t num = fEvt->GetNumPhotons(); … … 194 202 } 195 203 204 if (IsEnvDefined(env, prefix, "Force", print)) 205 { 206 rc = kTRUE; 207 SetForce(GetEnvValue(env, prefix, "Force", fForce)); 208 } 209 196 210 return rc; 197 211 } -
trunk/Mars/msim/MSimAbsorption.h
r9425 r18547 9 9 class MParSpline; 10 10 class MPhotonEvent; 11 class MCorsikaRunHeader; 11 12 class MCorsikaEvtHeader; 12 13 … … 14 15 { 15 16 private: 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 18 20 19 MParSpline *fSpline; //! Spline to interpolate wavelength or incident angle21 MParSpline *fSpline; //! Spline to interpolate wavelength or incident angle 20 22 21 23 TString fParName; // Container name of the spline containing the curve 22 24 Bool_t fUseTheta; // Switches between using wavelength or incident angle 25 Bool_t fForce; // Force execution even if corsika already simulated the efficiencies 23 26 24 27 // MParContainer … … 37 40 38 41 void SetUseTheta(Bool_t b=kTRUE) { fUseTheta = b; } 42 void SetForce(Bool_t b=kTRUE) { fForce = b; } 39 43 40 44 ClassDef(MSimAbsorption, 0) // Task to calculate wavelength or incident angle dependent absorption
Note:
See TracChangeset
for help on using the changeset viewer.