8#include <tracking/trackFindingCDC/filters/axialSegmentPair/BasicAxialSegmentPairVarSet.h>
10#include <tracking/trackingUtilities/eventdata/tracks/CDCAxialSegmentPair.h>
11#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
12#include <tracking/trackingUtilities/eventdata/hits/CDCRecoHit2D.h>
13#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
15#include <tracking/trackingUtilities/utilities/Functional.h>
18using namespace TrackFindingCDC;
19using namespace TrackingUtilities;
22 std::array<int, 8> getNHitsByILayer(
const CDCSegment2D& segment)
24 std::array<int, 8> result{};
26 ++result[recoHit2D.getWireHit().getILayer()];
34 if (not ptrAxialSegmentPair)
return false;
47 var<
named(
"from_size")>() = fromSegment.size();
48 var<
named(
"to_size")>() = toSegment.size();
50 std::array<int, 8> fromNHitsByILayer = getNHitsByILayer(fromSegment);
51 std::array<int, 8> toNHitsByILayer = getNHitsByILayer(toSegment);
53 var<
named(
"from_n_layers")>() = std::count_if(fromNHitsByILayer.begin(), fromNHitsByILayer.end(),
Id() > 0);;
54 var<
named(
"to_n_layers")>() = std::count_if(toNHitsByILayer.begin(), toNHitsByILayer.end(),
Id() > 0);
bool extract(const TrackingUtilities::CDCAxialSegmentPair *ptrAxialSegmentPair) override
Generate and assign the contained variables.
Class representing a pair of reconstructed axial segments in adjacent superlayer.
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
Class representing a two dimensional reconstructed hit in the central drift chamber.
A reconstructed sequence of two dimensional hits in one super layer.
CDC::ISuperLayer getISuperLayer() const
Returns the common super layer id of all stored tracking hits.
CDC::EStereoKind getStereoKind() const
Returns the common stereo type of all hits.
static constexpr int named(const char *name)
Abstract base class for different kinds of events.
Generic identity functor.