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/trackFindingCDC/eventdata/tracks/CDCTrack.h>
14#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
15#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
17#include <tracking/trackFindingCDC/filters/base/Filter.h>
20using namespace TrackFindingCDC;
24 if (not testPair)
return false;
26 const CDCTrack* track = testPair->getFrom();
29 var<
named(
"belongs_to_same_track_truth")>() = 0.0;
35 ITrackType segmentMCMatch = mcSegmentLookup.
getMCTrackId(segment);
36 if (segmentMCMatch == INVALID_ITRACK) {
37 var<
named(
"segment_is_fake_truth")>() = 1.0;
38 var<
named(
"segment_purity_truth")>() = 0.0;
39 var<
named(
"track_purity_truth")>() = 0.0;
42 var<
named(
"segment_is_fake_truth")>() = 0.0;
44 double numberOfCorrectHits = 0;
46 if (mcHitLookup.getMCTrackId(recoHit.getWireHit().getHit()) == segmentMCMatch) {
47 numberOfCorrectHits++;
51 var<
named(
"track_purity_truth")>() = numberOfCorrectHits / track->size();
53 if (numberOfCorrectHits / track->size() > 0.5) {
54 var<
named(
"belongs_to_same_track_truth")>() = 1.0;
56 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.
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.
AObject Object
Type of the object to be analysed.
bool extract(const BaseSegmentTrackFilter::Object *testPair) final
Generate and assign the contained variables.
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.