Skip to content

Commit b71f619

Browse files
committed
Added a method to get detector effeciencies without creating an event
1 parent b3e635b commit b71f619

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

cpp/helpers/include/petsird_helpers.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ make_detection_bin(const ScannerInformation& scanner, const TypeOfModule& type_o
101101

102102
inline float
103103
get_detection_efficiency(const ScannerInformation& scanner, const TypeOfModulePair& type_of_module_pair,
104-
const CoincidenceEvent& event)
104+
const DetectionBin& detection_bin_1, const DetectionBin& detection_bin_2)
105105
{
106106
float eff = 1.0F;
107107
const auto& detection_bin_efficiencies = scanner.detection_efficiencies.detection_bin_efficiencies;
108108
if (detection_bin_efficiencies)
109109
{
110-
eff *= ((*detection_bin_efficiencies)[type_of_module_pair[0]](event.detection_bins[0])
111-
* (*detection_bin_efficiencies)[type_of_module_pair[1]](event.detection_bins[1]));
110+
eff *= ((*detection_bin_efficiencies)[type_of_module_pair[0]](detection_bin_1)
111+
* (*detection_bin_efficiencies)[type_of_module_pair[1]](detection_bin_2));
112112
if (eff == 0.F)
113113
return 0.F;
114114
}
@@ -119,8 +119,8 @@ get_detection_efficiency(const ScannerInformation& scanner, const TypeOfModulePa
119119
const auto& module_pair_SGID_LUT
120120
= (*scanner.detection_efficiencies.module_pair_sgidlut)[type_of_module_pair[0]][type_of_module_pair[1]];
121121

122-
const auto expanded_det_bin0 = expand_detection_bin(scanner, type_of_module_pair[0], event.detection_bins[0]);
123-
const auto expanded_det_bin1 = expand_detection_bin(scanner, type_of_module_pair[1], event.detection_bins[1]);
122+
const auto expanded_det_bin0 = expand_detection_bin(scanner, type_of_module_pair[0], detection_bin_1);
123+
const auto expanded_det_bin1 = expand_detection_bin(scanner, type_of_module_pair[1], detection_bin_2);
124124
const int SGID = module_pair_SGID_LUT(expanded_det_bin0.module_index, expanded_det_bin1.module_index);
125125
if (SGID < 0)
126126
{
@@ -139,6 +139,13 @@ get_detection_efficiency(const ScannerInformation& scanner, const TypeOfModulePa
139139
return eff;
140140
}
141141

142+
inline float
143+
get_detection_efficiency(const ScannerInformation& scanner, const TypeOfModulePair& type_of_module_pair,
144+
const CoincidenceEvent& event)
145+
{
146+
return get_detection_efficiency(scanner, type_of_module_pair, event.detection_bins[0], event.detection_bins[1]);
147+
}
148+
142149
} // namespace petsird_helpers
143150

144151
#endif

0 commit comments

Comments
 (0)