Belle II Software  release-05-02-19
SectorFriendship.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2011 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jakob Lettenbichler *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include "tracking/trackFindingVXD/sectorMapTools/SectorFriendship.h"
12 #include "tracking/trackFindingVXD/sectorMapTools/ActivatedSector.h"
13 
14 #include "tracking/trackFindingVXD/trackSegmentTools/FilterBase.h"
15 
16 using namespace std;
17 using namespace Belle2;
18 
19 void SectorFriendship::prepareCompatibilityTable()
20 {
21  m_compatibilityTable.clear();
22 
23  uint nHitsOnMainSector = m_mainSector->getMyActiveSector()->size();
24  uint nHitsOnFriendSector = m_friendSector->getMyActiveSector()->size();
25  std::vector<CompatibilityValue> compatibility(nHitsOnFriendSector,
26  0); // TODO: concept for compatibilityTable needed. shall the filters check for a threshold value or something else?
27  for (uint i = 0 ; i < nHitsOnMainSector; ++i) {
28  m_compatibilityTable.push_back(compatibility);
29  }
30 }
31 
32 
33 void SectorFriendship::applySegmentFilters()
34 {
35  prepareCompatibilityTable();
36 
37  for (FilterBase* aFilter : m_myFilters) {
38  aFilter->checkSpacePoints(this, m_compatibilityTable);
39  if (checkCombinationsAlive() == 0) { break; }
40  }
41 }
42 
43 unsigned int SectorFriendship::checkCombinationsAlive() const
44 {
45  unsigned int counter = 0;
46  for (const auto& aVector : m_compatibilityTable) {
47  for (const auto& aValue : aVector) {
48  counter += aValue;
49  }
50  }
51  return counter;
52 }
53 
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::FilterBase
FilterBase is the baseClass for filters applied on (chains of) spacepoints.
Definition: FilterBase.h:46