Belle II Software development
SimpleSegmentPairRelationFilter.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#include <tracking/trackFindingCDC/filters/segmentPairRelation/SimpleSegmentPairRelationFilter.h>
9
10#include <tracking/trackingUtilities/eventdata/tracks/CDCSegmentPair.h>
11#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
12
13using namespace Belle2;
14using namespace TrackFindingCDC;
15using namespace TrackingUtilities;
16
18 const CDCSegmentPair& toSegmentPair)
19{
20 // Just let all found neighbors pass since we have the same to -> from segment
21 // and let the cellular automaton figure auto which is longest
22
23 // neighbor weight is a penalty for the overlap of the segments since we would
24 // count it two times
25
26 size_t fromOverlapSize = fromSegmentPair.getToSegment()->size();
27 size_t fromSize = fromOverlapSize + fromSegmentPair.getFromSegment()->size();
28 Weight fromWeight = fromSegmentPair.getAutomatonCell().getCellWeight();
29
30 size_t toOverlapSize = toSegmentPair.getFromSegment()->size();
31 size_t toSize = toOverlapSize + toSegmentPair.getToSegment()->size();
32 Weight toWeight = toSegmentPair.getAutomatonCell().getCellWeight();
33
34 return -(fromWeight * fromOverlapSize / fromSize + toWeight * toOverlapSize / toSize) / 2.0;
35}
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCSegmentPair &fromSegmentPair, const TrackingUtilities::CDCSegmentPair &toSegmentPair) final
Main filter method weighting the relation between the segment pairs.
Weight getCellWeight() const
Getter for the cell weight.
Class representing a pair of one reconstructed axial segment and one stereo segment in adjacent super...
const CDCSegment2D * getToSegment() const
Getter for the to segment.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Abstract base class for different kinds of events.