Public Member Functions | Private Types | Private Attributes | List of all members
CalibrationTreeBuilder::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)
 

Private Types

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 22 of file CalibrationTreeBuilder_module.cc.

Member Typedef Documentation

Definition at line 24 of file CalibrationTreeBuilder_module.cc.

Member Function Documentation

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

Definition at line 38 of file CalibrationTreeBuilder_module.cc.

38  {
39  this->track_id_map.push_back(std::make_pair(track_id, gname));
40  generator_names.emplace(gname);
41  isSorted=false;
42  }
std::vector< track_id_to_string > track_id_map
std::string CalibrationTreeBuilder::genFinder::get_gen ( int  tid)
inline

Definition at line 46 of file CalibrationTreeBuilder_module.cc.

46  {
47  if( !isSorted ){
48  this->sort_now();
49  }
50  return std::lower_bound(track_id_map.begin(), track_id_map.end(), tid,[](const auto &a, const auto &b){return (a.first < b) ; } )->second;
51  };
const double a
static bool * b
Definition: config.cpp:1043
std::vector< track_id_to_string > track_id_map
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
bool CalibrationTreeBuilder::genFinder::has_gen ( std::string  gname)
inline

Definition at line 43 of file CalibrationTreeBuilder_module.cc.

43  {
44  return static_cast<bool>(generator_names.count(gname));
45  };
void CalibrationTreeBuilder::genFinder::sort_now ( )
inline

Definition at line 33 of file CalibrationTreeBuilder_module.cc.

33  {
34  std::sort(this->track_id_map.begin(), this->track_id_map.end(), [](const auto &a, const auto &b){return (a.first < b.first) ; } );
35 // std::sort(this->track_id_map.begin(), this->track_id_map.end(), pairsort);
36  isSorted=true;
37  }
const double a
static bool * b
Definition: config.cpp:1043
std::vector< track_id_to_string > track_id_map

Member Data Documentation

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

Definition at line 26 of file CalibrationTreeBuilder_module.cc.

bool CalibrationTreeBuilder::genFinder::isSorted =false
private

Definition at line 27 of file CalibrationTreeBuilder_module.cc.

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

Definition at line 25 of file CalibrationTreeBuilder_module.cc.


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