LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
genFinder Struct Reference

Public Member Functions

void sort_now ()
 
void add (const int &track_id, const std::string &gname)
 
bool has_gen (std::string gname)
 
std::string get_gen (int tid)
 
void sort_now ()
 
void add (const int &track_id, const std::string &gname)
 
bool has_gen (std::string gname)
 
std::string get_gen (int tid)
 

Private Types

typedef std::pair< int, std::string > track_id_to_string
 
typedef std::pair< int, std::string > track_id_to_string
 

Private Attributes

std::vector< track_id_to_stringtrack_id_map
 
std::set< std::string > generator_names
 
bool isSorted = false
 

Detailed Description

Definition at line 149 of file RawWaveformClnSigDump_module.cc.

Member Typedef Documentation

typedef std::pair<int, std::string> genFinder::track_id_to_string
private

Definition at line 135 of file RawWaveformDump_module.cc.

typedef std::pair<int, std::string> genFinder::track_id_to_string
private

Definition at line 151 of file RawWaveformClnSigDump_module.cc.

Member Function Documentation

void genFinder::add ( const int &  track_id,
const std::string &  gname 
)
inline

Definition at line 148 of file RawWaveformDump_module.cc.

149  {
150  this->track_id_map.push_back(std::make_pair(track_id, gname));
151  generator_names.emplace(gname);
152  isSorted = false;
153  }
std::vector< track_id_to_string > track_id_map
std::set< std::string > generator_names
void genFinder::add ( const int &  track_id,
const std::string &  gname 
)
inline

Definition at line 164 of file RawWaveformClnSigDump_module.cc.

Referenced by nnet::RawWaveformDump::analyze(), and nnet::RawWaveformClnSigDump::analyze().

165  {
166  this->track_id_map.push_back(std::make_pair(track_id, gname));
167  generator_names.emplace(gname);
168  isSorted = false;
169  }
std::vector< track_id_to_string > track_id_map
std::set< std::string > generator_names
std::string genFinder::get_gen ( int  tid)
inline

Definition at line 155 of file RawWaveformDump_module.cc.

156  {
157  if (!isSorted) { this->sort_now(); }
158  return std::lower_bound(track_id_map.begin(),
159  track_id_map.end(),
160  tid,
161  [](const auto& a, const auto& b) { return (a.first < b); })
162  ->second;
163  };
std::vector< track_id_to_string > track_id_map
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:82
std::string genFinder::get_gen ( int  tid)
inline

Definition at line 171 of file RawWaveformClnSigDump_module.cc.

Referenced by nnet::RawWaveformDump::analyze(), and nnet::RawWaveformClnSigDump::analyze().

172  {
173  if (!isSorted) { this->sort_now(); }
174  return std::lower_bound(track_id_map.begin(),
175  track_id_map.end(),
176  tid,
177  [](const auto& a, const auto& b) { return (a.first < b); })
178  ->second;
179  };
std::vector< track_id_to_string > track_id_map
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:82
bool genFinder::has_gen ( std::string  gname)
inline

Definition at line 154 of file RawWaveformDump_module.cc.

154 { return static_cast<bool>(generator_names.count(gname)); };
std::set< std::string > generator_names
bool genFinder::has_gen ( std::string  gname)
inline

Definition at line 170 of file RawWaveformClnSigDump_module.cc.

170 { return static_cast<bool>(generator_names.count(gname)); };
std::set< std::string > generator_names
void genFinder::sort_now ( )
inline

Definition at line 141 of file RawWaveformDump_module.cc.

142  {
143  std::sort(this->track_id_map.begin(),
144  this->track_id_map.end(),
145  [](const auto& a, const auto& b) { return (a.first < b.first); });
146  isSorted = true;
147  }
std::vector< track_id_to_string > track_id_map
void genFinder::sort_now ( )
inline

Definition at line 157 of file RawWaveformClnSigDump_module.cc.

158  {
159  std::sort(this->track_id_map.begin(),
160  this->track_id_map.end(),
161  [](const auto& a, const auto& b) { return (a.first < b.first); });
162  isSorted = true;
163  }
std::vector< track_id_to_string > track_id_map

Member Data Documentation

std::set< std::string > genFinder::generator_names
private

Definition at line 153 of file RawWaveformClnSigDump_module.cc.

bool genFinder::isSorted = false
private

Definition at line 154 of file RawWaveformClnSigDump_module.cc.

std::vector< track_id_to_string > genFinder::track_id_map
private

Definition at line 152 of file RawWaveformClnSigDump_module.cc.


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