15 #include "fhiclcpp/types/Atom.h"
16 #include "art/Utilities/ToolMacros.h"
17 #include "art/Utilities/make_tool.h"
18 #include "art/Utilities/ToolConfigTable.h"
34 fhicl::Comment(
"Consider PDs containg a PDFraction of the signal.")
39 fhicl::Comment(
"Consider OpHits in the interval [FlashPeakTime-PreWindow, FlashPeakTime-PostWindow]")
44 fhicl::Comment(
"Consider OpHits in the interval [FlashPeakTime-PreWindow, FlashPeakTime-PostWindow]")
49 fhicl::Comment(
"Minimum number of reconstructed PE to consider the OpHit for the t0 calculation")
70 : fPDFraction { config().PDFraction() },
71 fPreWindow { config().PreWindow() },
72 fPostWindow { config().PostWindow() },
73 fMinHitPE { config().MinHitPE() }
79 std::vector< std::pair<double, double> > selected_hits;
83 for(
auto const&
hit : ophit_list) {
85 selected_hits.push_back( std::make_pair(
hit.pe,
hit.peak_time));
92 std::sort( selected_hits.begin(), selected_hits.end(), std::greater< std::pair<double, double> >() );
94 double flasht0_mean=0, pe_count=0;
98 for (
size_t ix=0; ix<selected_hits.size(); ix++) {
99 pe_count += selected_hits[ix].first;
100 flasht0_mean += selected_hits[ix].second;
105 return flasht0_mean/nophits;
fhicl::Atom< double > PreWindow
double GetFlashT0(double flash_peaktime, LiteOpHitArray_t ophit_list) override
fhicl::Atom< double > PostWindow
fhicl::Atom< double > PDFraction
std::vector< lightana::LiteOpHit_t > LiteOpHitArray_t
BEGIN_PROLOG vertical distance to the surface Name
FlashT0SelectedChannels(art::ToolConfigTable< Config > const &config)
fhicl::Atom< double > MinHitPE