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