Public Member Functions | Public Attributes | Protected Attributes | List of all members
opdet::FocusList Class Reference

Public Member Functions

 FocusList (int nSamples, int padding)
 
void AddRange (int from, int to)
 
 FocusList (int nSamples, int padding)
 
void AddRange (int from, int to)
 
 FocusList (int nSamples, int padding)
 
void AddRange (int from, int to)
 
 FocusList (size_t nSamples, size_t padding)
 
void AddRange (size_t from, size_t to)
 
void everything ()
 

Public Attributes

std::vector< std::pair< int, int > > ranges
 
Ranges_t ranges
 

Protected Attributes

int fNSamples
 
int fPadding
 
size_t fNSamples
 
size_t fPadding
 

Detailed Description

Definition at line 69 of file OpDetDigitizerDUNE_module.cc.

Constructor & Destructor Documentation

opdet::FocusList::FocusList ( int  nSamples,
int  padding 
)
inline

Definition at line 72 of file OpDetDigitizerDUNE_module.cc.

opdet::FocusList::FocusList ( int  nSamples,
int  padding 
)
inline

Definition at line 67 of file OpDetDigitizerDUNEDP_module.cc.

opdet::FocusList::FocusList ( int  nSamples,
int  padding 
)
inline

Definition at line 74 of file OpDetDigitizerProtoDUNE_module.cc.

opdet::FocusList::FocusList ( size_t  nSamples,
size_t  padding 
)
inline

Definition at line 80 of file WaveformDigitizerSim_module.cc.

Member Function Documentation

void opdet::FocusList::AddRange ( int  from,
int  to 
)
inline

Definition at line 72 of file OpDetDigitizerDUNEDP_module.cc.

73  {
74  from -= fPadding;
75  to += fPadding;
76  if(from < 0) from = 0;
77  if(to >= fNSamples) to = fNSamples-1;
78 
79  for(unsigned int i = 0; i < ranges.size(); ++i){
80  std::pair<int, int>& r = ranges[i];
81  // Completely nested, discard
82  if(from >= r.first && to <= r.second) return;
83  // Extend end
84  if(from >= r.first && from <= r.second){
85  r.second = to;
86  return;
87  }
88  // Extend front
89  if(to >= r.first && to <= r.second){
90  r.first = from;
91  return;
92  }
93  }
94  // Discontiguous, add
95  ranges.emplace_back(from, to);
96  }
void opdet::FocusList::AddRange ( int  from,
int  to 
)
inline

Definition at line 75 of file OpDetDigitizerDUNE_module.cc.

76  {
77  from -= fPadding;
78  to += fPadding;
79 
80  if(from < 0) from = 0;
81  if(to >= fNSamples) to = fNSamples-1;
82 
83  for(unsigned int i = 0; i < ranges.size(); ++i){
84  std::pair<int, int>& r = ranges[i];
85  // Completely nested, discard
86  if(from >= r.first && to <= r.second) return;
87  // Extend end
88  if(from >= r.first && from <= r.second){
89  r.second = to;
90  return;
91  }
92  // Extend front
93  if(to >= r.first && to <= r.second){
94  r.first = from;
95  return;
96  }
97  }
98  // Discontiguous, add
99  ranges.emplace_back(from, to);
100  }
void opdet::FocusList::AddRange ( int  from,
int  to 
)
inline

Definition at line 77 of file OpDetDigitizerProtoDUNE_module.cc.

78  {
79  from -= fPadding;
80  to += fPadding;
81 
82  if(from < 0) from = 0;
83  if(to >= fNSamples) to = fNSamples-1;
84 
85  for(unsigned int i = 0; i < ranges.size(); ++i){
86  std::pair<int, int>& r = ranges[i];
87  // Completely nested, discard
88  if(from >= r.first && to <= r.second) return;
89  // Extend end
90  if(from >= r.first && from <= r.second){
91  r.second = to;
92  return;
93  }
94  // Extend front
95  if(to >= r.first && to <= r.second){
96  r.first = from;
97  return;
98  }
99  }
100  // Discontiguous, add
101  ranges.emplace_back(from, to);
102  }
void opdet::FocusList::AddRange ( size_t  from,
size_t  to 
)
inline

Definition at line 84 of file WaveformDigitizerSim_module.cc.

85  {
86  from -= std::min(from, fPadding);
87  to = std::min(to+fPadding, fNSamples-1);
88 
89  for(size_t i = 0; i < ranges.size(); ++i){
90  pair<size_t, size_t>& r = ranges[i];
91  // Completely nested, discard
92  if(from >= r.first && to <= r.second) return;
93  // Extend end
94  if(from >= r.first && from <= r.second){
95  r.second = to;
96  return;
97  }
98  // Extend front
99  if(to >= r.first && to <= r.second){
100  r.first = from;
101  return;
102  }
103  }
104  // Discontiguous, add
105  ranges.emplace_back(from, to);
106  }
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
void opdet::FocusList::everything ( )
inline

Definition at line 108 of file WaveformDigitizerSim_module.cc.

109  {
110  ranges.clear();
111  ranges.emplace_back(0, fNSamples-1);
112  }

Member Data Documentation

int opdet::FocusList::fNSamples
protected

Definition at line 105 of file OpDetDigitizerDUNE_module.cc.

size_t opdet::FocusList::fNSamples
protected

Definition at line 118 of file WaveformDigitizerSim_module.cc.

int opdet::FocusList::fPadding
protected

Definition at line 106 of file OpDetDigitizerDUNE_module.cc.

size_t opdet::FocusList::fPadding
protected

Definition at line 119 of file WaveformDigitizerSim_module.cc.

std::vector< std::pair< int, int > > opdet::FocusList::ranges

Definition at line 102 of file OpDetDigitizerDUNE_module.cc.

Ranges_t opdet::FocusList::ranges

Definition at line 115 of file WaveformDigitizerSim_module.cc.


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