Belle II Software development
BaseSegmentPairRelationFilter.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/BaseSegmentPairRelationFilter.h>
9
10#include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
11
12#include <tracking/trackFindingCDC/filters/base/RelationFilter.icc.h>
13
14#include <tracking/trackFindingCDC/utilities/VectorRange.h>
15#include <tracking/trackFindingCDC/utilities/Functional.h>
16
17#include <algorithm>
18#include <cassert>
19
20using namespace Belle2;
21using namespace TrackFindingCDC;
22
24
26
28
29std::vector<const CDCSegmentPair*> BaseSegmentPairRelationFilter::getPossibleTos(
30 const CDCSegmentPair* from,
31 const std::vector<const CDCSegmentPair*>& segmentPairs) const
32{
33 assert(std::is_sorted(segmentPairs.begin(), segmentPairs.end(), LessOf<Deref>()) &&
34 "Expected segment pairs to be sorted");
35
36 const CDCSegment2D* toSegment = from->getToSegment();
37
39 std::equal_range(segmentPairs.begin(), segmentPairs.end(), &toSegment, LessOf<Deref>())};
40 return {neighbors.begin(), neighbors.end()};
41}
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.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
const CDCSegment2D * getToSegment() const
Getter for the to segment.
A pair of iterators usable with the range base for loop.
Definition: Range.h:25
Iterator begin() const
Begin of the range for range based for.
Definition: Range.h:64
Base class for filtering the neighborhood of objects.
Abstract base class for different kinds of events.
Functor factory turning a binary functor and two functors into a new functor which executes the binar...
Definition: Functional.h:127