8#include <tracking/trackFindingCDC/filters/segmentTrack/SegmentTrackTruthVarSet.h>
10#include <tracking/trackFindingCDC/mclookup/CDCMCHitLookUp.h>
11#include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
13#include <tracking/trackingUtilities/eventdata/tracks/CDCTrack.h>
14#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
15#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
17#include <tracking/trackingUtilities/filters/base/Filter.icc.h>
20using namespace TrackFindingCDC;
21using namespace TrackingUtilities;
25 if (not testPair)
return false;
30 var<
named(
"belongs_to_same_track_truth")>() = 0.0;
36 ITrackType segmentMCMatch = mcSegmentLookup.
getMCTrackId(segment);
37 if (segmentMCMatch == INVALID_ITRACK) {
38 var<
named(
"segment_is_fake_truth")>() = 1.0;
39 var<
named(
"segment_purity_truth")>() = 0.0;
40 var<
named(
"track_purity_truth")>() = 0.0;
43 var<
named(
"segment_is_fake_truth")>() = 0.0;
45 double numberOfCorrectHits = 0;
47 if (mcHitLookup.getMCTrackId(recoHit.getWireHit().getHit()) == segmentMCMatch) {
48 numberOfCorrectHits++;
52 var<
named(
"track_purity_truth")>() = numberOfCorrectHits / track->size();
54 if (numberOfCorrectHits / track->size() > 0.5) {
55 var<
named(
"belongs_to_same_track_truth")>() = 1.0;
57 var<
named(
"belongs_to_same_track_truth")>() = 0.0;
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
Interface class to the Monte Carlo information for individual hits.
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
Specialisation of the lookup for the truth values of two dimensional segments.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
bool extract(const BaseSegmentTrackFilter::Object *testPair) final
Generate and assign the contained variables.
Class representing a three dimensional reconstructed hit.
A reconstructed sequence of two dimensional hits in one super layer.
Class representing a sequence of three dimensional reconstructed hits.
TrackingUtilities::WeightedRelation< TrackingUtilities::CDCTrack, const TrackingUtilities::CDCSegment2D > Object
static constexpr int named(const char *name)
From * getFrom() const
Getter for the pointer to the from side object.
To * getTo() const
Getter for the pointer to the to side object.
Abstract base class for different kinds of events.