11#include <framework/logging/Logger.h>
12#include <tracking/dataobjects/FullSecID.h>
43 if (b.size() != chainsize) {
return false; }
45 for (
unsigned i = 0; i < chainsize; i++) {
46 if (b.m_idChain[i] !=
m_idChain[i]) {
return false; }
58 for (
unsigned i = 0 ; i < chainsize; i++) {
59 if (
m_idChain[i] < b.m_idChain[i])
return true;
60 if (
m_idChain[i] == b.m_idChain[i])
continue;
70 if (
m_idChain.empty()) { B2FATAL(
"SubGraphID-Constructor, given idChain is empty - illegal usage!"); }
79 std::vector<unsigned>::const_iterator
begin()
const {
return m_idChain.begin(); }
83 std::vector<unsigned>::const_iterator
end()
const {
return m_idChain.end(); }
90 if (b.size() != chainsize) {
return false; }
92 for (
unsigned i = 0; i < chainsize - 1; i++) {
93 if (b.m_idChain[i] !=
m_idChain[i]) {
return false; }
119 if (
size() < b.size())
return 0;
121 unsigned nIdentical = 0;
123 for (
unsigned idB : b) {
144 if (
size() != b.size())
return false;
145 for (
unsigned i = 0; i <
size(); i++) {
155 B2DEBUG(20,
"hasSharedLayer-start with iD " <<
print() <<
":");
156 std::vector<unsigned> outerOnes;
157 for (
unsigned i = 0; i <
size() - 1; i++) {
162 B2DEBUG(20,
"hasSharedLayer good combi found with inner: " <<
FullSecID(
m_idChain[i + 1]).getFullSecString() <<
", storing outer: "
187 std::vector<FullSecID> ids;
202 template <>
struct hash<
Belle2::SubGraphID> {
209 std::size_t hashVal = 0;
210 for (
unsigned iD : graphID) {
211 hashVal = std::hash<unsigned>()(iD) ^ hashVal;
Class to identify a sector inside of the VXD.
std::string getFullSecString() const
returns the FullSecID coded as string compatible to secIDs stored in the xml-sectormaps
VxdID getVxdID() const
returns VxdID of sensor.
unsigned int getFullSecID() const
returns the FullSecID coded as integer for further use (can be reconverted to FullSecID by using Full...
short int getSecID() const
returns SecID of current FullSecID (only unique for each sensor).
stores the ID of a subgraph, which is basically a chain of FullSecID coded as unsigned ints.
unsigned size() const
returns chainLength of this id.
bool hasElement(unsigned b) const
checks if given raw secID is part of this, ignores subLayerID.
bool updateID(unsigned newID)
if newID is element of this (ignoring subLayerID), oldID will be replaced by newID....
bool areTheSameSector(unsigned a, unsigned b) const
checks if two given ids are the same sector (while ignoring the sublayerID).
unsigned isElementOf(const SubGraphID &b) const
checks if given sectorPack ( >= 1 sector) is part of this, ignores subLayerID.
SubGraphID(const std::vector< unsigned > &idChain)
constructor, mandatory iDChain musst at least contain one iD.
std::vector< unsigned > hasSharedLayer() const
returns raw IDs of entries being outer friend of sectors on same layer.
bool operator<(const SubGraphID &b) const
overloaded '<'-operator for sorting algorithms
std::vector< unsigned >::const_iterator end() const
returns last entry of IDchain.
std::vector< FullSecID > getFullSecIDs() const
returns SecIDs coded as FullSecIDs:
bool checkSharesTrunk(const SubGraphID &b) const
if both graphs have got the same IDs except the last one, they share a trunk.
bool areTheSameSectors(const SubGraphID &b) const
checks if sectors are identical (while ignoring the subLayerID)
std::string print() const
returns string of entries.
std::vector< unsigned >::const_iterator begin() const
returns first entry of IDchain.
unsigned isElementOf(const std::vector< unsigned > &b) const
checks if given sectorPack ( >= 1 sector) is part of this, ignores subLayerID.
bool operator==(const SubGraphID &b) const
overloaded '=='-operator
std::vector< unsigned > m_idChain
ids of this SubGraphID.
Abstract base class for different kinds of events.
std::size_t operator()(const Belle2::SubGraphID &graphID) const
Create Hash value from graphID.