Belle II Software  release-08-00-10
CDCFacetSegment.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/eventdata/segments/CDCFacetSegment.h>
9 
10 #include <tracking/trackFindingCDC/eventdata/segments/CDCRLWireHitSegment.h>
11 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
12 
13 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
14 
15 #include <framework/logging/Logger.h>
16 
17 #include <iterator>
18 #include <vector>
19 #include <stddef.h>
20 
21 namespace Belle2 {
26  namespace TrackFindingCDC {
27  class CDCRLWireHit;
28  }
30 }
31 
32 using namespace Belle2;
33 using namespace TrackFindingCDC;
34 
36 {
37  CDCFacetSegment facetSegment;
38  size_t nRLWireHits = rlWireHitSegment.size();
39  if (nRLWireHits < 3) return facetSegment;
40 
41  facetSegment.reserve(nRLWireHits - 2);
42 
43  // Make tangents from pairs of hits along the segment.
44  transform_adjacent_triples(rlWireHitSegment.begin(),
45  rlWireHitSegment.end(),
46  back_inserter(facetSegment),
47  [](const CDCRLWireHit & firstRLWireHit,
48  const CDCRLWireHit & secondRLWireHit,
49  const CDCRLWireHit & thirdRLWireHit) {
50  return CDCFacet(firstRLWireHit, secondRLWireHit, thirdRLWireHit);
51  });
52 
53  if (facetSegment.size() + 2 != rlWireHitSegment.size()) {
54  B2ERROR("Wrong number of facets created.");
55  }
56 
57  facetSegment.setAliasScore(rlWireHitSegment.getAliasScore());
58  facetSegment.setTrajectory2D(rlWireHitSegment.getTrajectory2D());
59  return facetSegment;
60 }
A segment consisting of adjacent facets.
static CDCFacetSegment create(const CDCRLWireHitSegment &rlWireHitSegment)
Construct a train of facets from the given oriented wire hits.
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:32
A segment consisting of two dimensional reconsturcted hits.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
void setTrajectory2D(const CDCTrajectory2D &trajectory2D) const
Setter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:75
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:69
void setAliasScore(double aliasScore)
Setter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:96
double getAliasScore() const
Getter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:90
Abstract base class for different kinds of events.