Belle II Software  release-05-01-25
AllSegmentPairRelationFilter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/filters/segmentPairRelation/AllSegmentPairRelationFilter.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
13 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
19  const CDCSegmentPair& toSegmentPair)
20 {
21  size_t fromOverlapSize = fromSegmentPair.getToSegment()->size();
22  size_t fromSize = fromOverlapSize + fromSegmentPair.getFromSegment()->size();
23  Weight fromWeight = fromSegmentPair.getAutomatonCell().getCellWeight();
24 
25  size_t toOverlapSize = toSegmentPair.getFromSegment()->size();
26  size_t toSize = toOverlapSize + toSegmentPair.getToSegment()->size();
27  Weight toWeight = toSegmentPair.getAutomatonCell().getCellWeight();
28 
29  return (fromWeight * fromOverlapSize / fromSize + toWeight * toOverlapSize / toSize) / 2.0;
30 }
Belle2::TrackFindingCDC::CDCSegmentPair
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
Definition: CDCSegmentPair.h:44
Belle2::TrackFindingCDC::CDCSegmentPair::getAutomatonCell
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCSegmentPair.h:243
Belle2::TrackFindingCDC::AutomatonCell::getCellWeight
Weight getCellWeight() const
Getter for the cell weight.
Definition: AutomatonCell.h:126
Belle2::TrackFindingCDC::CDCSegmentPair::getToSegment
const CDCSegment2D * getToSegment() const
Getter for the to segment.
Definition: CDCSegmentPair.h:132
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::AllSegmentPairRelationFilter::operator()
Weight operator()(const CDCSegmentPair &fromSegmentPair, const CDCSegmentPair &toSegmentPair) final
Implementation accepting all possible neighbors. Weight subtracts the overlap penalty.
Definition: AllSegmentPairRelationFilter.cc:18
Belle2::TrackFindingCDC::CDCSegmentPair::getFromSegment
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Definition: CDCSegmentPair.h:120