Belle II Software  release-08-01-10
BaseSegmentTripleRelationFilter.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/segmentTripleRelation/BaseSegmentTripleRelationFilter.h>
9 
10 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentTriple.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 <vector>
18 #include <algorithm>
19 #include <cassert>
20 
21 using namespace Belle2;
22 using namespace TrackFindingCDC;
23 
25 
27 
29 
30 std::vector<const CDCSegmentTriple*> BaseSegmentTripleRelationFilter::getPossibleTos(
31  const CDCSegmentTriple* from,
32  const std::vector<const CDCSegmentTriple*>& segmentTriples) const
33 {
34  assert(std::is_sorted(segmentTriples.begin(), segmentTriples.end(), LessOf<Deref>()) &&
35  "Expected segment triples to be sorted");
36 
37  const CDCSegment2D* endSegment = from->getEndSegment();
38 
40  std::equal_range(segmentTriples.begin(), segmentTriples.end(), &endSegment, LessOf<Deref>())};
41  return {neighbors.begin(), neighbors.end()};
42 }
std::vector< const CDCSegmentTriple * > getPossibleTos(const CDCSegmentTriple *from, const std::vector< const CDCSegmentTriple * > &segmentTriples) const final
Returns the segment triples form the range that continue on the to site of the given segment triple.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Class representing a triple of reconstructed segements in adjacent superlayer.
const CDCAxialSegment2D * getEndSegment() const
Getter for the end axial 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
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