Belle II Software development
SectorFriendship.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include "tracking/trackFindingVXD/sectorMapTools/SectorFriendship.h"
10#include "tracking/trackFindingVXD/sectorMapTools/ActivatedSector.h"
11
12#include "tracking/trackFindingVXD/trackSegmentTools/FilterBase.h"
13
14using namespace Belle2;
15
17{
19
20 uint nHitsOnMainSector = m_mainSector->getMyActiveSector()->size();
21 uint nHitsOnFriendSector = m_friendSector->getMyActiveSector()->size();
22 std::vector<CompatibilityValue> compatibility(nHitsOnFriendSector,
23 0); // TODO: concept for compatibilityTable needed. shall the filters check for a threshold value or something else?
24 for (uint i = 0 ; i < nHitsOnMainSector; ++i) {
25 m_compatibilityTable.push_back(compatibility);
26 }
27}
28
29
31{
33
34 for (FilterBase* aFilter : m_myFilters) {
35 aFilter->checkSpacePoints(this, m_compatibilityTable);
36 if (checkCombinationsAlive() == 0) { break; }
37 }
38}
39
41{
42 unsigned int counter = 0;
43 for (const auto& aVector : m_compatibilityTable) {
44 for (const auto& aValue : aVector) {
45 counter += aValue;
46 }
47 }
48 return counter;
49}
50
unsigned int size()
returns number of spacePoint inhabiting this ActivatedSector
FilterBase is the baseClass for filters applied on (chains of) spacepoints.
Definition: FilterBase.h:36
Sector * m_friendSector
The friendSector is stored once per run and is a link to a compatible inner sector.
std::vector< std::vector< CompatibilityValue > > m_compatibilityTable
This table carries the compatibility for each combination of hits or segments.
void applySegmentFilters()
applies SegmentFilters on each spacepoint of this sector-sector-combination
Sector * m_mainSector
The mainSector is stored once per run and is a link to a compatible outer sector.
void prepareCompatibilityTable()
creates a compatibility-table so that the filters can use it
std::vector< FilterBase * > m_myFilters
This vector carries a pointer to all filters allowed for this sector-combination.
unsigned int checkCombinationsAlive() const
iterates through each combination of spacepoints and counts the number of combinations which are stil...
ActivatedSector * getMyActiveSector() const
getter - returns a pointer to the currently connected activatedSector
Definition: Sector.h:126
Abstract base class for different kinds of events.