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