Skip to content

Commit 51227e3

Browse files
committed
Slightly improve math formula based DRF input.
Add min/max energy inputs, and also extend the information users can copy/paste from an Excel sheet, a bit.
1 parent 0542b34 commit 51227e3

File tree

5 files changed

+470
-109
lines changed

5 files changed

+470
-109
lines changed

InterSpec/DetectorPeakResponse.h

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ namespace rapidxml
6666
/** TODO:
6767
- Add a "fixed" geometry option - then distances in like shielding/source display are not shown/used
6868
- Add a "setback" option
69+
- There are a couple commented-out functions where this is started, but will need to
70+
- Add `m_setback` member variable
71+
- Modify the "DetectorPeakResponse" DB class - need to use DB upgrade mechanism
72+
- Make sure that everywhere that gets a fractional solid angle, accounts for the setback.
73+
- At the same time, add a "fixed geometry" option, where distances then disapear everywhere
6974
*/
7075

7176

@@ -404,18 +409,31 @@ class DetectorPeakResponse
404409
*/
405410
std::function<float( float )> intrinsicEfficiencyFcn() const;
406411

407-
//fractionalSolidAngle(...) returns the fraction of gamma rays from a point
408-
// source that would strike the detector face of a detector with diameter
409-
// 'detectorDiameter' at a distance from source of distance.
410-
// Note: For a detector diameter of 5cm, you might start running into numerical accuracy
411-
// issues for distances around 100 km.
412+
/** Gives the fraction of gammas or x-rays from a point source that would strike the detector crystal.
413+
414+
@param detector_diameter The diameter of the detector, in units of PhysicalUnits.
415+
@param observation_distance The distance from the face of the detector, to the point source.
416+
if the detector has a setback, you should add this to the distance of the detector face to
417+
the point source
418+
419+
Note: For a detector diameter of 5cm, you might start running into numerical accuracy
420+
issues for distances around 100 km.
421+
*/
412422
static double fractionalSolidAngle( const double detector_diameter,
413423
const double observation_distance ) noexcept;
414424

415-
416-
//fractionalSolidAngle(...): similar to the above, but takes into account
417-
// the source radius (assumed to be flat round plane); see pg 119 in Knoll
418-
// for details on approxiation used.
425+
/** Returns approximate fraction of gammas or x-rays from a extended disk-source, that would strick
426+
the detector crystal.
427+
428+
@param detector_diameter The diameter of the detector, in units of PhysicalUnits.
429+
@param observation_distance The distance from the face of the detector, to the point source.
430+
if the detector has a setback, you should add this to the distance of the detector face to
431+
the point source
432+
@param source_radius The radius of the flat, round plane, source, in units of PhysicalUnits.
433+
434+
Note: Source is assumed to be flat round plane.
435+
Note: see pg 119 in Knoll for details on approxiation used.
436+
*/
419437
static double fractionalSolidAngle( const double detector_diameter,
420438
const double observation_distance,
421439
const double source_radius );
@@ -476,6 +494,19 @@ class DetectorPeakResponse
476494
*/
477495
double upperEnergy() const;
478496

497+
/** The distance the detector crystal is setback from the face of the detector.
498+
499+
Must be zero, or a positive number.
500+
*/
501+
//void setDetectorSetback( const double distance );
502+
503+
/** The setback distance of the detector.
504+
Distances are usually given from the face of the detector, to the item of interest,
505+
however, there is typically a small distance between the face of the detector, and
506+
the detection element surface - this is the setback distance.
507+
*/
508+
//double detectorSetback() const;
509+
479510
/** Updated the #m_lastUsedUtc member variable to current time. Does not
480511
save to database.
481512
*/

InterSpec/DrfSelect.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class InterSpecUser;
6262
class RelEffDetSelect;
6363
class GadrasDetSelect;
6464
class SpectraFileModel;
65+
class NativeFloatSpinBox;
6566
class DetectorPeakResponse;
6667
namespace DataBaseUtils
6768
{
@@ -142,7 +143,7 @@ class DrfSelect : public Wt::WContainerWidget
142143
void verifyManualDefinition();
143144

144145
//User defined detector in functional form
145-
void setDefineDetector();
146+
void setFormulaDefineDetector();
146147

147148
//Action when the user clicks on the ButtonGroup to select
148149
//defined/upload/functional form definition for the detector
@@ -367,6 +368,8 @@ class DrfSelect : public Wt::WContainerWidget
367368
Wt::WLineEdit *m_detectorManualDiameterText;
368369
Wt::WLineEdit *m_detectorManualDistText;
369370
Wt::WLabel *m_detectorManualDistLabel;
371+
NativeFloatSpinBox *m_detectorManualMinEnergy;
372+
NativeFloatSpinBox *m_detectorManualMaxEnergy;
370373
Wt::WPushButton *m_manualSetButton;
371374

372375
GadrasDetSelect *m_gadrasDetSelect;

InterSpec_resources/DrfSelect.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,31 @@
99
overflow-y: auto;
1010
}
1111

12-
.FormulaDrfTbl {
12+
table.FormulaDrfTbl {
1313
width: 95%;
1414
}
1515

16-
.FormulaDrfTbl td
16+
table.FormulaDrfTbl tr > td
1717
{
1818
white-space: nowrap;
19+
vertical-align: middle;
20+
padding-top: 3px;
1921
}
2022

23+
table.FormulaDrfTbl tr
24+
{
25+
}
2126

2227
table.FormulaDrfTbl tr td:first-child
2328
{
2429
width: 1%;
2530
}
2631

32+
table.FormulaDrfTbl label
33+
{
34+
padding-right: 4px;
35+
}
36+
2737

2838
.DrfSelectFunctionalFormText
2939
{

0 commit comments

Comments
 (0)