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/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 size_t fromOverlapSize = fromSegmentPair.getToSegment()->size();
21 size_t fromSize = fromOverlapSize + fromSegmentPair.getFromSegment()->size();
22 Weight fromWeight = fromSegmentPair.getAutomatonCell().getCellWeight();
23
24 size_t toOverlapSize = toSegmentPair.getFromSegment()->size();
25 size_t toSize = toOverlapSize + toSegmentPair.getToSegment()->size();
26 Weight toWeight = toSegmentPair.getAutomatonCell().getCellWeight();
27
28 return (fromWeight * fromOverlapSize / fromSize + toWeight * toOverlapSize / toSize) / 2.0;
29}
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCSegmentPair &fromSegmentPair, const TrackingUtilities::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.