Belle II Software development
AllSegmentPairRelationFilter.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/AllSegmentPairRelationFilter.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 size_t fromOverlapSize = fromSegmentPair.getToSegment()->size();
20 size_t fromSize = fromOverlapSize + fromSegmentPair.getFromSegment()->size();
21 Weight fromWeight = fromSegmentPair.getAutomatonCell().getCellWeight();
22
23 size_t toOverlapSize = toSegmentPair.getFromSegment()->size();
24 size_t toSize = toOverlapSize + toSegmentPair.getToSegment()->size();
25 Weight toWeight = toSegmentPair.getAutomatonCell().getCellWeight();
26
27 return (fromWeight * fromOverlapSize / fromSize + toWeight * toOverlapSize / toSize) / 2.0;
28}
Weight operator()(const CDCSegmentPair &fromSegmentPair, const CDCSegmentPair &toSegmentPair) final
Implementation accepting all possible neighbors. Weight subtracts the overlap penalty.
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.