 |
Belle II Software
release-05-02-19
|
13 #include <framework/logging/Logger.h>
14 #include <tracking/dataobjects/FullSecID.h>
36 return idA.getVxdID() == idB.getVxdID() and idA.getSecID() == idB.getSecID();
45 if (b.size() != chainsize) {
return false; }
47 for (
unsigned i = 0; i < chainsize; i++) {
48 if (b.m_idChain[i] !=
m_idChain[i]) {
return false; }
60 for (
unsigned i = 0 ; i < chainsize; i++) {
61 if (
m_idChain[i] < b.m_idChain[i])
return true;
62 if (
m_idChain[i] == b.m_idChain[i])
continue;
72 if (
m_idChain.empty()) { B2FATAL(
"SubGraphID-Constructor, given idChain is empty - illegal usage!"); }
81 std::vector<unsigned>::const_iterator
begin()
const {
return m_idChain.begin(); }
85 std::vector<unsigned>::const_iterator
end()
const {
return m_idChain.end(); }
92 if (b.size() != chainsize) {
return false; }
94 for (
unsigned i = 0; i < chainsize - 1; i++) {
95 if (b.m_idChain[i] !=
m_idChain[i]) {
return false; }
103 std::string
print()
const
119 unsigned isElementOf(
const std::vector<unsigned>& b)
const
121 if (
size() < b.size())
return 0;
123 unsigned nIdentical = 0;
125 for (
unsigned idB : b) {
146 if (
size() != b.size())
return false;
147 for (
unsigned i = 0; i <
size(); i++) {
157 B2DEBUG(1,
"hasSharedLayer-start with iD " <<
print() <<
":");
158 std::vector<unsigned> outerOnes;
159 for (
unsigned i = 0; i <
size() - 1; i++) {
164 B2DEBUG(1,
"hasSharedLayer good combi found with inner: " <<
FullSecID(
m_idChain[i + 1]).getFullSecString() <<
", storing outer: "
177 FullSecID tempID(secID);
178 secID = FullSecID(tempID.getVxdID(),
true, tempID.getSecID()).getFullSecID();
189 std::vector<FullSecID> ids;
204 template <>
struct hash<
Belle2::SubGraphID> {
211 std::size_t hashVal = 0;
212 for (
unsigned iD : graphID) {
213 hashVal = std::hash<unsigned>()(iD) ^ hashVal;
unsigned isElementOf(const SubGraphID &b) const
checks if given sectorPack ( >= 1 sector) is part of this, ignores subLayerID.
std::vector< unsigned >::const_iterator end() const
returns last entry of IDchain.
SubGraphID(const std::vector< unsigned > &idChain)
constructor, mandatory iDChain musst at least contain one iD.
bool hasElement(unsigned b) const
checks if given raw secID is part of this, ignores subLayerID.
std::size_t operator()(const Belle2::SubGraphID &graphID) const
Create Hash value from graphID.
bool updateID(unsigned newID)
if newID is element of this (ignoring subLayerID), oldID will be replaced by newID....
std::vector< unsigned > hasSharedLayer() const
returns raw IDs of entries being outer friend of sectors on same layer.
bool checkSharesTrunk(const SubGraphID &b) const
if both graphs have got the same IDs except the last one, they share a trunk.
bool operator==(const SubGraphID &b) const
overloaded '=='-operator
bool areTheSameSectors(const SubGraphID &b) const
checks if sectors are identical (while ignoring the subLayerID)
std::vector< unsigned > m_idChain
ids of this SubGraphID.
Class to identify a sector inside of the VXD.
Abstract base class for different kinds of events.
std::vector< FullSecID > getFullSecIDs() const
returns SecIDs coded as FullSecIDs:
unsigned size() const
returns chainLength of this id.
bool areTheSameSector(unsigned a, unsigned b) const
checks if two given ids are the same sector (while ignoring the sublayerID).
bool operator<(const SubGraphID &b) const
overloaded '<'-operator for sorting algorithms
std::string getFullSecString() const
returns the FullSecID coded as string compatible to secIDs stored in the xml-sectormaps
std::string print() const
returns string of entries.
stores the ID of a subgraph, which is basically a chain of FullSecID coded as unsigned ints.
std::vector< unsigned >::const_iterator begin() const
returns first entry of IDchain.