Belle II Software  release-06-01-15
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 
14 using namespace std;
15 using namespace Belle2;
16 
17 void SectorFriendship::prepareCompatibilityTable()
18 {
19  m_compatibilityTable.clear();
20 
21  uint nHitsOnMainSector = m_mainSector->getMyActiveSector()->size();
22  uint nHitsOnFriendSector = m_friendSector->getMyActiveSector()->size();
23  std::vector<CompatibilityValue> compatibility(nHitsOnFriendSector,
24  0); // TODO: concept for compatibilityTable needed. shall the filters check for a threshold value or something else?
25  for (uint i = 0 ; i < nHitsOnMainSector; ++i) {
26  m_compatibilityTable.push_back(compatibility);
27  }
28 }
29 
30 
31 void SectorFriendship::applySegmentFilters()
32 {
33  prepareCompatibilityTable();
34 
35  for (FilterBase* aFilter : m_myFilters) {
36  aFilter->checkSpacePoints(this, m_compatibilityTable);
37  if (checkCombinationsAlive() == 0) { break; }
38  }
39 }
40 
41 unsigned int SectorFriendship::checkCombinationsAlive() const
42 {
43  unsigned int counter = 0;
44  for (const auto& aVector : m_compatibilityTable) {
45  for (const auto& aValue : aVector) {
46  counter += aValue;
47  }
48  }
49  return counter;
50 }
51 
FilterBase is the baseClass for filters applied on (chains of) spacepoints.
Definition: FilterBase.h:36
Abstract base class for different kinds of events.