@@ -384,17 +384,10 @@ class PeakDef
384384 Mean,
385385 Sigma,
386386 GaussAmplitude,
387- LandauAmplitude, // multiplies peak ampliture (so is between 0.0 and ~0.2)
387+ LandauAmplitude, // multiplies peak amplitude (so is between 0.0 and ~0.2)
388388 LandauMode,
389389 LandauSigma,
390- // OffsetPolynomial0,
391- // OffsetPolynomial1,
392- // OffsetPolynomial2,
393- // OffsetPolynomial3,
394- // OffsetPolynomial4,
395- // RangeStartEnergy,
396- // RangeEndEnergy,
397- Chi2DOF, // for peaks that share a ROI/Continuum, this values is for entire ROI/Continuum
390+ Chi2DOF, // for peaks that share a ROI/Continuum, this values is for entire ROI/Continuum
398391 NumCoefficientTypes
399392 };// enum CoefficientType
400393
@@ -485,28 +478,22 @@ class PeakDef
485478 inline void setAmplitudeUncert ( const double a );
486479
487480
488- inline bool useForCalibration () const ;
489- inline void useForCalibration ( const bool use );
481+ inline bool useForEnergyCalibration () const ;
482+ inline void useForEnergyCalibration ( const bool use );
490483
491484 inline bool useForShieldingSourceFit () const ;
492485 inline void useForShieldingSourceFit ( const bool use );
493-
494- /* * Returns if should use for DRF fit. If has not been explicitly set, will
495- return true if their is a nuclide and transition defined, and the source
496- gamma type is SourceGammaType::NormalGamma.
497- \sa MakeDrf
498- */
499- inline bool useForDrfFit () const ;
500486
501- /* * Sets if the peak should be used or not for DRF fit.
502- \sa MakeDrf
487+ /* * Returns if should use for DRF intrinsic efficiency fit. Note that this does not check that the nuclide and transition has actually
488+ been defined.
503489 */
504- inline void useForDrfFit ( const bool use );
490+ inline bool useForDrfIntrinsicEffFit () const ;
491+ inline void setUseForDrfIntrinsicEffFit ( const bool use );
492+ inline bool useForDrfFwhmFit () const ;
493+ inline void setUseForDrfFwhmFit ( const bool use );
494+ inline bool useForDrfDepthOfInteractionFit () const ;
495+ inline void setUseForDrfDepthOfInteractionFit ( const bool use );
505496
506- /* * Resets if the peak should be used for DRF fit.
507- \sa MakeDrf
508- */
509- inline void resetUseForDrfFit ();
510497
511498 inline double chi2dof () const ;
512499 inline bool chi2Defined () const ;
@@ -824,7 +811,13 @@ class PeakDef
824811
825812 std::shared_ptr<PeakContinuum> m_continuum;
826813
827- static const int sm_xmlSerializationVersion;
814+ /* * For versioning the XML we will use a major.minor notation.
815+ Changes made to the XML that are backward compatible (e.g., will read into older version of InterSpec just fine - so this is like if you
816+ just add a field), increment the minor version. Breaking changes (e.x., a change to the name of a XML tag) increment the major version
817+ and will cause older versions of InterSpec to not read in the peak.
818+ */
819+ static const int sm_xmlSerializationMajorVersion;
820+ static const int sm_xmlSerializationMinorVersion;
828821
829822 // A maximum of one of the following will be valid: m_parentNuclide,
830823 // m_xrayElement, or m_reaction
@@ -843,23 +836,18 @@ class PeakDef
843836 const ReactionGamma::Reaction *m_reaction;
844837 float m_reactionEnergy;
845838
846- bool m_useForCalibration ;
839+ bool m_useForEnergyCal ;
847840 bool m_useForShieldingSourceFit;
841+
848842
849- /* * Variable to tell if this peak should be used in the detector response
850- model fit; currently the MakeDRF widget only sets this when saving a N42
851- fit.
852- Can only take on the values {-1,0,1}.
853- -1 means it has not been set and so some simple heuristics will be used to
854- determine if it should be set
855- 0 means do not use
856- 1 means do use
857-
858- ///ToDo: Implement logic similar to #PeakModel::kUseForShieldingSourceFit
859- for this variable, and maybe make it a bool. Also have MakeDrf
860- widget update it as the user changes it in the widget.
861- */
862- int m_useForDetectorResponseFit;
843+ /* * Fif this peak should be used in the detector response function model fit for intrinsic efficiency */
844+ bool m_useForDrfIntrinsicEffFit;
845+ bool m_useForDrfFwhmFit;
846+ bool m_useForDrfDepthOfInteractionFit;
847+
848+ static const bool sm_defaultUseForDrfIntrinsicEffFit;
849+ static const bool sm_defaultUseForDrfFwhmFit;
850+ static const bool sm_defaultUseForDrfDepthOfInteractionFit;
863851
864852 /* * Line color of the peak. Will also (currently) be used to set the fill of
865853 the peak, just with the alpha channel lowered.
@@ -1042,21 +1030,21 @@ void PeakDef::setAmplitudeUncert( const double a )
10421030}
10431031
10441032
1045- bool PeakDef::useForCalibration () const
1033+ bool PeakDef::useForEnergyCalibration () const
10461034{
1047- return ( m_useForCalibration &&
1035+ return ( m_useForEnergyCal &&
10481036 ( (m_radparticleIndex>=0 && m_transition && m_parentNuclide)
10491037 || (m_parentNuclide && (m_sourceGammaType==PeakDef::AnnihilationGamma))
10501038 || (m_xrayElement && m_xrayEnergy>0.0 )
10511039 || (m_reaction && m_reactionEnergy>0.0 )
10521040 ) );
1053- }// void useForCalibration () const
1041+ }// void useForEnergyCalibration () const
10541042
10551043
1056- void PeakDef::useForCalibration ( const bool use )
1044+ void PeakDef::useForEnergyCalibration ( const bool use )
10571045{
1058- m_useForCalibration = use;
1059- }// void useForCalibration ( const bool use )
1046+ m_useForEnergyCal = use;
1047+ }// void useForEnergyCalibration ( const bool use )
10601048
10611049
10621050bool PeakDef::useForShieldingSourceFit () const
@@ -1086,27 +1074,42 @@ void PeakDef::useForShieldingSourceFit( const bool use )
10861074}// void useForShieldingSourceFit( const bool use )
10871075
10881076
1089- bool PeakDef::useForDrfFit () const
1077+ bool PeakDef::useForDrfIntrinsicEffFit () const
10901078{
1091- if ( m_useForDetectorResponseFit == 1 )
1092- return true ;
1093- if ( m_useForDetectorResponseFit == 0 )
1094- return false ;
1095-
1096- if ( m_parentNuclide && m_transition && m_sourceGammaType==SourceGammaType::NormalGamma )
1097- return true ;
1079+ // if( !m_parentNuclide || !m_transition || (m_sourceGammaType != SourceGammaType::NormalGamma) )
1080+ // return false;
10981081
1099- return false ;
1082+ return m_useForDrfIntrinsicEffFit ;
11001083}
11011084
1102- void PeakDef::useForDrfFit ( const bool use )
1085+
1086+ void PeakDef::setUseForDrfIntrinsicEffFit ( const bool use )
11031087{
1104- m_useForDetectorResponseFit = ( use ? 1 : 0 ) ;
1088+ m_useForDrfIntrinsicEffFit = use;
11051089}
11061090
1107- void PeakDef::resetUseForDrfFit ()
1091+
1092+ bool PeakDef::useForDrfFwhmFit () const
1093+ {
1094+ return m_useForDrfFwhmFit;
1095+ }
1096+
1097+
1098+ void PeakDef::setUseForDrfFwhmFit ( const bool use )
1099+ {
1100+ m_useForDrfFwhmFit = use;
1101+ }
1102+
1103+
1104+ bool PeakDef::useForDrfDepthOfInteractionFit () const
1105+ {
1106+ return m_useForDrfDepthOfInteractionFit;
1107+ }
1108+
1109+
1110+ void PeakDef::setUseForDrfDepthOfInteractionFit ( const bool use )
11081111{
1109- m_useForDetectorResponseFit = - 1 ;
1112+ m_useForDrfDepthOfInteractionFit = use ;
11101113}
11111114
11121115#endif
0 commit comments