Belle II Software development
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/trackingUtilities/eventdata/segments/CDCFacetSegment.h>
9
10#include <tracking/trackingUtilities/eventdata/segments/CDCRLWireHitSegment.h>
11#include <tracking/trackingUtilities/eventdata/hits/CDCFacet.h>
12
13#include <tracking/trackingUtilities/utilities/Algorithms.h>
14
15#include <framework/logging/Logger.h>
16
17#include <iterator>
18#include <vector>
19#include <stddef.h>
20
21namespace Belle2 {
26 namespace TrackingUtilities {
27 class CDCRLWireHit;
28 }
30}
31
32using namespace Belle2;
33using namespace CDC;
34using namespace TrackingUtilities;
35
37{
38 CDCFacetSegment facetSegment;
39 size_t nRLWireHits = rlWireHitSegment.size();
40 if (nRLWireHits < 3) return facetSegment;
41
42 facetSegment.reserve(nRLWireHits - 2);
43
44 // Make tangents from pairs of hits along the segment.
45 transform_adjacent_triples(rlWireHitSegment.begin(),
46 rlWireHitSegment.end(),
47 back_inserter(facetSegment),
48 [](const CDCRLWireHit & firstRLWireHit,
49 const CDCRLWireHit & secondRLWireHit,
50 const CDCRLWireHit & thirdRLWireHit) {
51 return CDCFacet(firstRLWireHit, secondRLWireHit, thirdRLWireHit);
52 });
53
54 if (facetSegment.size() + 2 != rlWireHitSegment.size()) {
55 B2ERROR("Wrong number of facets created.");
56 }
57
58 facetSegment.setAliasScore(rlWireHitSegment.getAliasScore());
59 facetSegment.setTrajectory2D(rlWireHitSegment.getTrajectory2D());
60 return facetSegment;
61}
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 reconstructed hits.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
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.