8#include <tracking/trackFindingCDC/filters/segmentRelation/BasicSegmentRelationVarSet.h>
10#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
12#include <tracking/trackFindingCDC/topology/CDCWire.h>
14#include <tracking/trackFindingCDC/utilities/Functional.h>
17using namespace TrackFindingCDC;
20 std::array<int, 8> getNHitsByILayer(
const CDCSegment2D& segment)
22 std::array<int, 8> result{};
24 ++result[recoHit2D.getWire().getILayer()];
32 if (not ptrSegmentRelation)
return false;
45 var<
named(
"from_size")>() = fromSegment.size();
46 var<
named(
"to_size")>() = toSegment.size();
48 std::array<int, 8> fromNHitsByILayer = getNHitsByILayer(fromSegment);
49 std::array<int, 8> toNHitsByILayer = getNHitsByILayer(toSegment);
51 var<
named(
"from_n_layers")>() = std::count_if(fromNHitsByILayer.begin(), fromNHitsByILayer.end(),
Id() > 0);;
52 var<
named(
"to_n_layers")>() = std::count_if(toNHitsByILayer.begin(), toNHitsByILayer.end(),
Id() > 0);
bool extract(const Relation< const 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.
ISuperLayer getISuperLayer() const
Returns the common super layer id of all stored tracking hits.
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)
Getter for the index from the name.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Abstract base class for different kinds of events.
Generic identity functor.