Belle II Software  release-05-01-25
SimpleSegmentPairRelationFilter.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/SimpleSegmentPairRelationFilter.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  // Just let all found neighors pass since we have the same to -> from segment
22  // and let the cellular automaton figure auto which is longest
23 
24  // neighbor weight is a penalty for the overlap of the segments since we would
25  // count it two times
26 
27  size_t fromOverlapSize = fromSegmentPair.getToSegment()->size();
28  size_t fromSize = fromOverlapSize + fromSegmentPair.getFromSegment()->size();
29  Weight fromWeight = fromSegmentPair.getAutomatonCell().getCellWeight();
30 
31  size_t toOverlapSize = toSegmentPair.getFromSegment()->size();
32  size_t toSize = toOverlapSize + toSegmentPair.getToSegment()->size();
33  Weight toWeight = toSegmentPair.getAutomatonCell().getCellWeight();
34 
35  return -(fromWeight * fromOverlapSize / fromSize + toWeight * toOverlapSize / toSize) / 2.0;
36 }
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::SimpleSegmentPairRelationFilter::operator()
Weight operator()(const CDCSegmentPair &fromSegmentPair, const CDCSegmentPair &toSegmentPair) final
Main filter method weighting the relation between the segment pairs.
Definition: SimpleSegmentPairRelationFilter.cc:18
Belle2::TrackFindingCDC::CDCSegmentPair::getFromSegment
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Definition: CDCSegmentPair.h:120