Belle II Software  release-08-01-10
SubGraph< FilterType > Class Template Reference

contains all relevant stuff needed for dealing with a subGraph. More...

#include <SubGraph.h>

Collaboration diagram for SubGraph< FilterType >:

Public Types

using Iterator = typename std::unordered_map< FilterType, MinMax >::iterator
 for better readability.
 

Public Member Functions

bool operator== (const SubGraph< FilterType > &b) const
 overloaded '=='-operator
 
 SubGraph (SubGraphID &id, const std::vector< FilterType > &fIDs)
 constructor, mandatory iDChain musst at least contain one iD.
 
 ~SubGraph ()
 destructor
 
bool checkAndReplaceIfMinMax (FilterType fID, double value)
 add filter, if not added yet, checks value and replaces old ones if new one is better. More...
 
void wasFound ()
 increases found-counter.
 
unsigned getFound () const
 returns found-counter.
 
bool checkSharesTrunk (const SubGraph< FilterType > &b) const
 if both graphs have got the same IDs except the last one, they share a trunk.
 
std::string print () const
 "print" debugging information to a string
 
const SubGraphIDgetID () const
 returns iD of this graph
 
void prepareDataCollection (std::pair< double, double > quantiles)
 takes care of being able to use the data collector. please use for quantiles [min, max] min ~0 & max ~1 (range 0-1)
 
void addValue (FilterType fID, double value)
 adds value to rawDataCollector
 
const std::unordered_map< FilterType, MinMax > & getFinalQuantileValues ()
 this deletes the old min and max values stored and replaces them with the quantiles to be found.
 
unsigned idCheckAndUpdate (const std::vector< unsigned > &ids)
 for given vector of ids check if any of them is part of subGraphID. If yes, update their SubLayerID. returns number of updated secIDs
 
std::vector< FullSecIDgetSectorsOfSensor (const VxdID &sensor)
 returns vector containing all sectors for given sensor (if any) and empty vector if no sector of that sensor is here.
 

Protected Member Functions

void updateID (const SubGraphID &newID)
 set newID for this subgraph.
 

Protected Attributes

SubGraphID m_id
 contains the IDs in the correct order (from outer to inner) as a unique identifier for this graph.
 
std::unordered_map< FilterType, MinMaxm_minMaxValues
 contains all min- and max-values found so far for all filters relevant for this Graph. *‍/
 
unsigned m_found
 counts number of times this subgraph was found.
 
std::unordered_map< FilterType, RawDataCollectedMinMax > * m_rawDataCollected
 takes care of collecting the raw data.
 

Detailed Description

template<class FilterType>
class Belle2::SubGraph< FilterType >

contains all relevant stuff needed for dealing with a subGraph.

~ 404 bytes per subGraph.

Definition at line 30 of file SubGraph.h.

Member Function Documentation

◆ checkAndReplaceIfMinMax()

bool checkAndReplaceIfMinMax ( FilterType  fID,
double  value 
)
inline

add filter, if not added yet, checks value and replaces old ones if new one is better.

returns true if minMax was updated.

Definition at line 65 of file SubGraph.h.

66  {
67  Iterator pos = m_minMaxValues.find(fID);
68  if (pos == m_minMaxValues.end()) {
69  B2WARNING("FilterID " << fID << " not known to this subgraph " << m_id.print() << " - nothing added!");
70  return false;
71  }
72  return pos->second.checkAndReplaceIfMinMax(value);
73  }
std::string print() const
returns string of entries.
Definition: SubGraphID.h:101
SubGraphID m_id
contains the IDs in the correct order (from outer to inner) as a unique identifier for this graph.
Definition: SubGraph.h:32
typename std::unordered_map< FilterType, MinMax >::iterator Iterator
for better readability.
Definition: SubGraph.h:51
std::unordered_map< FilterType, MinMax > m_minMaxValues
contains all min- and max-values found so far for all filters relevant for this Graph....
Definition: SubGraph.h:35

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