All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
lightana::FlashT0SelectedChannels Class Reference
Inheritance diagram for lightana::FlashT0SelectedChannels:
lightana::FlashT0Base

Classes

struct  Config
 

Public Member Functions

 FlashT0SelectedChannels (art::ToolConfigTable< Config > const &config)
 
double GetFlashT0 (double flash_peaktime, LiteOpHitArray_t ophit_list) override
 

Private Attributes

double fPDFraction
 
double fPreWindow
 
double fPostWindow
 
double fMinHitPE
 

Additional Inherited Members

- Private Member Functions inherited from lightana::FlashT0Base
virtual ~FlashT0Base () noexcept=default
 

Detailed Description

Definition at line 24 of file FlashT0SelectedChannels_tool.cc.

Constructor & Destructor Documentation

lightana::FlashT0SelectedChannels::FlashT0SelectedChannels ( art::ToolConfigTable< Config > const &  config)
explicit

Definition at line 69 of file FlashT0SelectedChannels_tool.cc.

70  : fPDFraction { config().PDFraction() },
71  fPreWindow { config().PreWindow() },
72  fPostWindow { config().PostWindow() },
73  fMinHitPE { config().MinHitPE() }
74  {
75  }

Member Function Documentation

double lightana::FlashT0SelectedChannels::GetFlashT0 ( double  flash_peaktime,
LiteOpHitArray_t  ophit_list 
)
overridevirtual

Implements lightana::FlashT0Base.

Definition at line 77 of file FlashT0SelectedChannels_tool.cc.

77  {
78 
79  std::vector< std::pair<double, double> > selected_hits;
80  double pe_sum = 0;
81 
82  // fill vector with selected hits in the specified window
83  for(auto const& hit : ophit_list) {
84  if( hit.peak_time<flash_time+fPostWindow && hit.peak_time>flash_time-fPreWindow && hit.pe>fMinHitPE){
85  selected_hits.push_back( std::make_pair(hit.pe, hit.peak_time));
86  pe_sum += hit.pe ;
87  }
88  }
89 
90  if(pe_sum>0){
91  // sort vector by number of #PE (ascending order)
92  std::sort( selected_hits.begin(), selected_hits.end(), std::greater< std::pair<double, double> >() );
93 
94  double flasht0_mean=0, pe_count=0;
95  int nophits=0;
96 
97  // loop over selected ophits
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;
101  nophits++;
102  if( pe_count/pe_sum>fPDFraction ) break;
103  }
104 
105  return flasht0_mean/nophits;
106  }
107  else
108  return flash_time;
109  }
process_name hit
Definition: cheaterreco.fcl:51

Member Data Documentation

double lightana::FlashT0SelectedChannels::fMinHitPE
private

Definition at line 65 of file FlashT0SelectedChannels_tool.cc.

double lightana::FlashT0SelectedChannels::fPDFraction
private

Definition at line 62 of file FlashT0SelectedChannels_tool.cc.

double lightana::FlashT0SelectedChannels::fPostWindow
private

Definition at line 64 of file FlashT0SelectedChannels_tool.cc.

double lightana::FlashT0SelectedChannels::fPreWindow
private

Definition at line 63 of file FlashT0SelectedChannels_tool.cc.


The documentation for this class was generated from the following file: