Belle II Software  release-05-01-25
BaseSegmentPairRelationFilter.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/BaseSegmentPairRelationFilter.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
13 
14 #include <tracking/trackFindingCDC/filters/base/RelationFilter.icc.h>
15 
16 #include <tracking/trackFindingCDC/utilities/VectorRange.h>
17 #include <tracking/trackFindingCDC/utilities/Functional.h>
18 
19 #include <algorithm>
20 #include <cassert>
21 
22 using namespace Belle2;
23 using namespace TrackFindingCDC;
24 
26 
28 
30 
31 std::vector<const CDCSegmentPair*> BaseSegmentPairRelationFilter::getPossibleTos(
32  const CDCSegmentPair* from,
33  const std::vector<const CDCSegmentPair*>& segmentPairs) const
34 {
35  assert(std::is_sorted(segmentPairs.begin(), segmentPairs.end(), LessOf<Deref>()) &&
36  "Expected segment pairs to be sorted");
37 
38  const CDCSegment2D* toSegment = from->getToSegment();
39 
41  std::equal_range(segmentPairs.begin(), segmentPairs.end(), &toSegment, LessOf<Deref>())};
42  return {neighbors.begin(), neighbors.end()};
43 }
Belle2::TrackFindingCDC::RelationFilter< const CDCSegmentPair >
Belle2::TrackFindingCDC::Range::begin
Iterator begin() const
Begin of the range for range based for.
Definition: Range.h:74
Belle2::TrackFindingCDC::BinaryJoin
Functor factory turning a binary functor and two functors into a new functor which executes the binar...
Definition: Functional.h:137
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::getToSegment
const CDCSegment2D * getToSegment() const
Getter for the to segment.
Definition: CDCSegmentPair.h:132
Belle2::TrackFindingCDC::BaseSegmentPairRelationFilter::~BaseSegmentPairRelationFilter
~BaseSegmentPairRelationFilter()
Default destructor.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::BaseSegmentPairRelationFilter::getPossibleTos
std::vector< const CDCSegmentPair * > getPossibleTos(const CDCSegmentPair *from, const std::vector< const CDCSegmentPair * > &segmentPairs) const final
Returns the segment pairs form the range that continue on the to site of the given segment pair.
Definition: BaseSegmentPairRelationFilter.cc:31
Belle2::TrackFindingCDC::BaseSegmentPairRelationFilter::BaseSegmentPairRelationFilter
BaseSegmentPairRelationFilter()
Default constructor.
Belle2::TrackFindingCDC::Range
A pair of iterators usable with the range base for loop.
Definition: Range.h:35
Belle2::TrackFindingCDC::CDCSegment2D
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:40