11#include <framework/logging/Logger.h>
12#include <tracking/trackFindingVXD/sectorMapTools/RawDataCollectedMinMax.h>
13#include <tracking/trackFindingVXD/sectorMapTools/MinMax.h>
14#include <tracking/trackFindingVXD/sectorMapTools/SubGraphID.h>
15#include <tracking/dataobjects/FullSecID.h>
19#include <unordered_map>
48 {
return (
m_id == b.m_id); }
51 using Iterator =
typename std::unordered_map<FilterType, MinMax>::iterator;
56 for (
auto& iD : fIDs) {
69 B2WARNING(
"FilterID " << fID <<
" not known to this subgraph " <<
m_id.print() <<
" - nothing added!");
72 return pos->second.checkAndReplaceIfMinMax(value);
85 std::string out =
"id: " +
m_id.print() +
" was found " + std::to_string(
m_found) +
" times. Filters with values collected:\n";
87 out += entry.first +
" " + entry.second.print() +
" _||_ ";
109 if (
m_rawDataCollected ==
nullptr) { B2FATAL(
"SubGraph::addValue: attempt to add data before prepareDataCollection(...) was executed! Aborting illegal procedure."); }
112 B2WARNING(
"addValue: FilterID " << fID <<
" not known to this subgraph " <<
m_id.print() <<
" - nothing added!");
115 pos->second.add(value);
123 std::pair<double, double> results = entry.second.getMinMax();
130 out += entry.first +
" " + entry.second.print() +
" ";
132 B2DEBUG(20,
"SubGraph::getFinalQuantileValues: minMaxFound:\n" << out);
139 unsigned nUpdated = 0;
140 for (
unsigned id : ids) {
142 if (
m_id.hasElement(
id)) {
153 std::vector<FullSecID> foundIDs;
155 for (
auto& sector :
m_id) {
156 if (sensor !=
FullSecID(sector).getVxdID())
continue;
Class to identify a sector inside of the VXD.
small class for storing min and max.
takes care of collecting raw data and staying below RAM-threshold.
stores the ID of a subgraph, which is basically a chain of FullSecID coded as unsigned ints.
std::unordered_map< FilterType, RawDataCollectedMinMax > * m_rawDataCollected
takes care of collecting the raw data.
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.
bool checkSharesTrunk(const SubGraph< FilterType > &b) const
if both graphs have got the same IDs except the last one, they share a trunk.
unsigned getFound() const
returns found-counter.
const SubGraphID & getID() 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,...
SubGraphID m_id
contains the IDs in the correct order (from outer to inner) as a unique identifier for this graph.
void updateID(const SubGraphID &newID)
set newID for this subgraph.
bool operator==(const SubGraph< FilterType > &b) const
overloaded '=='-operator
bool checkAndReplaceIfMinMax(FilterType fID, double value)
add filter, if not added yet, checks value and replaces old ones if new one is better.
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....
SubGraph(SubGraphID &id, const std::vector< FilterType > &fIDs)
constructor, mandatory iDChain musst at least contain one iD.
typename std::unordered_map< FilterType, MinMax >::iterator Iterator
for better readability.
std::unordered_map< FilterType, MinMax > m_minMaxValues
contains all min- and max-values found so far for all filters relevant for this Graph....
std::vector< FullSecID > getSectorsOfSensor(const VxdID &sensor)
returns vector containing all sectors for given sensor (if any) and empty vector if no sector of that...
void wasFound()
increases found-counter.
unsigned m_found
counts number of times this subgraph was found.
std::string print() const
"print" debugging information to a string
void addValue(FilterType fID, double value)
adds value to rawDataCollector
Class to uniquely identify a any structure of the PXD and SVD.
Abstract base class for different kinds of events.