1 #ifndef OPT0FINDER_MAXNPEWINDOW_CXX
2 #define OPT0FINDER_MAXNPEWINDOW_CXX
15 , _time_lower_bound(-0.1)
16 , _time_upper_bound(8.)
30 std::multimap<double,ID_t> npe_map;
32 for(
size_t index=0; index<flash_v.size(); ++index) {
34 auto const& flash = flash_v[index];
36 double npe = std::accumulate(flash.pe_v.begin(),flash.pe_v.end(),0.0);
40 npe_map.emplace( 1./npe, index );
46 ordered_index_v.reserve(npe_map.size());
49 for(
auto const& npe_index : npe_map) {
51 auto const& flash = flash_v[npe_index.second];
53 if(trs.
Overlap(flash.time))
continue;
55 ordered_index_v.push_back(npe_index.second);
62 return ordered_index_v;
Class def header for a class MaxNPEWindow.
fhicl::ParameterSet Config_t
Configuration object.
static MaxNPEWindowFactory __global_MaxNPEWindowFactory__
double _time_upper_bound
T2 [us]: the upper edge of the opened time window.
Class def header for a class TimeRange.
double _npe_threshold
threshold [p.e.]: to ignore any flash below this value
IDArray_t Filter(const FlashArray_t &)
Implementation of a virtual function.
double _time_lower_bound
T1 [us]: the lower edge of the opened time window.
MaxNPEWindow(const std::string name="MaxNPEWindow")
Default constructor.
void Insert(const flashmatch::TimeRange &range)
std::vector< flashmatch::ID_t > IDArray_t
Index collection.
void _Configure_(const Config_t &pset)
std::vector< flashmatch::Flash_t > FlashArray_t
Collection of Flash objects.
bool Overlap(const flashmatch::TimeRange &range) const