8#include <tracking/trackFindingCDC/filters/segmentRelation/BasicSegmentRelationVarSet.h>
10#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
12#include <cdc/topology/CDCWire.h>
14#include <tracking/trackingUtilities/utilities/Functional.h>
17using namespace TrackFindingCDC;
18using namespace TrackingUtilities;
21 std::array<int, 8> getNHitsByILayer(
const CDCSegment2D& segment)
23 std::array<int, 8> result{};
25 ++result[recoHit2D.getWire().getILayer()];
33 if (not ptrSegmentRelation)
return false;
46 var<
named(
"from_size")>() = fromSegment.size();
47 var<
named(
"to_size")>() = toSegment.size();
49 std::array<int, 8> fromNHitsByILayer = getNHitsByILayer(fromSegment);
50 std::array<int, 8> toNHitsByILayer = getNHitsByILayer(toSegment);
52 var<
named(
"from_n_layers")>() = std::count_if(fromNHitsByILayer.begin(), fromNHitsByILayer.end(),
Id() > 0);;
53 var<
named(
"to_n_layers")>() = std::count_if(toNHitsByILayer.begin(), toNHitsByILayer.end(),
Id() > 0);
bool extract(const TrackingUtilities::Relation< const TrackingUtilities::CDCSegment2D > *ptrSegmentRelation) override
Generate and assign the contained variables.
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.
Type for two related objects.
From * getFrom() const
Getter for the pointer to the from side object.
To * getTo() const
Getter for the pointer to the to side object.
static constexpr int named(const char *name)
Abstract base class for different kinds of events.
Generic identity functor.