Public Member Functions | Private Types | Private Attributes | List of all members
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)
 
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::stringtrack_id_to_string
 
typedef std::pair< int, std::stringtrack_id_to_string
 
typedef std::pair< int, std::stringtrack_id_to_string
 

Private Attributes

std::vector< track_id_to_stringtrack_id_map
 
std::set< std::stringgenerator_names
 
bool isSorted = false
 

Detailed Description

Definition at line 139 of file RawWaveformClnSigDump_module.cc.

Member Typedef Documentation

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

Definition at line 103 of file RawWaveformDump_module.cc.

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

Definition at line 126 of file RawWaveformDump_module.cc.

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

Definition at line 141 of file RawWaveformClnSigDump_module.cc.

Member Function Documentation

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

Definition at line 113 of file RawWaveformDump_module.cc.

113  {
114  this->track_id_map.push_back(std::make_pair(track_id, gname));
115  generator_names.emplace(gname);
116  isSorted=false;
117  }
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 141 of file RawWaveformDump_module.cc.

142  {
143  this->track_id_map.push_back(std::make_pair(track_id, gname));
144  generator_names.emplace(gname);
145  isSorted = false;
146  }
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 156 of file RawWaveformClnSigDump_module.cc.

157  {
158  this->track_id_map.push_back(std::make_pair(track_id, gname));
159  generator_names.emplace(gname);
160  isSorted = false;
161  }
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 121 of file RawWaveformDump_module.cc.

121  {
122  if( !isSorted ){
123  this->sort_now();
124  }
125  return std::lower_bound(track_id_map.begin(), track_id_map.end(), tid,[](const auto &a, const auto &b){return (a.first < b) ; } )->second;
126  };
const double a
std::vector< track_id_to_string > track_id_map
static bool * b
Definition: config.cpp:1043
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
std::string genFinder::get_gen ( int  tid)
inline

Definition at line 153 of file RawWaveformDump_module.cc.

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

Definition at line 168 of file RawWaveformClnSigDump_module.cc.

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

Definition at line 118 of file RawWaveformDump_module.cc.

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

Definition at line 148 of file RawWaveformDump_module.cc.

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

Definition at line 163 of file RawWaveformClnSigDump_module.cc.

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

Definition at line 109 of file RawWaveformDump_module.cc.

109  {
110  std::sort(this->track_id_map.begin(), this->track_id_map.end(), [](const auto &a, const auto &b){return (a.first < b.first) ; } );
111  isSorted=true;
112  }
const double a
std::vector< track_id_to_string > track_id_map
static bool * b
Definition: config.cpp:1043
void genFinder::sort_now ( )
inline

Definition at line 133 of file RawWaveformDump_module.cc.

134  {
135  std::sort(this->track_id_map.begin(),
136  this->track_id_map.end(),
137  [](const auto& a, const auto& b) { return (a.first < b.first); });
138  isSorted = true;
139  }
const double a
std::vector< track_id_to_string > track_id_map
static bool * b
Definition: config.cpp:1043
void genFinder::sort_now ( )
inline

Definition at line 148 of file RawWaveformClnSigDump_module.cc.

149  {
150  std::sort(this->track_id_map.begin(),
151  this->track_id_map.end(),
152  [](const auto& a, const auto& b) { return (a.first < b.first); });
153  isSorted = true;
154  }
const double a
std::vector< track_id_to_string > track_id_map
static bool * b
Definition: config.cpp:1043

Member Data Documentation

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

Definition at line 143 of file RawWaveformClnSigDump_module.cc.

bool genFinder::isSorted = false
private

Definition at line 144 of file RawWaveformClnSigDump_module.cc.

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

Definition at line 142 of file RawWaveformClnSigDump_module.cc.


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