 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/filters/segmentTrack/SegmentTrackTruthVarSet.h>
12 #include <tracking/trackFindingCDC/mclookup/CDCMCHitLookUp.h>
13 #include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
15 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
16 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
17 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
19 #include <tracking/trackFindingCDC/filters/base/Filter.h>
22 using namespace TrackFindingCDC;
26 if (not testPair)
return false;
28 const CDCTrack* track = testPair->getFrom();
31 var<
named(
"belongs_to_same_track_truth")>() = 0.0;
37 ITrackType segmentMCMatch = mcSegmentLookup.
getMCTrackId(segment);
38 if (segmentMCMatch == INVALID_ITRACK) {
39 var<
named(
"segment_is_fake_truth")>() = 1.0;
40 var<
named(
"segment_purity_truth")>() = 0.0;
41 var<
named(
"track_purity_truth")>() = 0.0;
44 var<
named(
"segment_is_fake_truth")>() = 0.0;
46 double numberOfCorrectHits = 0;
48 if (mcHitLookup.getMCTrackId(recoHit.getWireHit().getHit()) == segmentMCMatch) {
49 numberOfCorrectHits++;
53 var<
named(
"track_purity_truth")>() = numberOfCorrectHits / track->size();
55 if (numberOfCorrectHits / track->size() > 0.5) {
56 var<
named(
"belongs_to_same_track_truth")>() = 1.0;
58 var<
named(
"belongs_to_same_track_truth")>() = 0.0;
Class representing a three dimensional reconstructed hit.
Class representing a sequence of three dimensional reconstructed hits.
Specialisation of the lookup for the truth values of two dimensional segments.
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
bool extract(const BaseSegmentTrackFilter::Object *testPair) final
Generate and assign the contained variables.
Abstract base class for different kinds of events.
Interface class to the Monte Carlo information for individual hits.
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
A reconstructed sequence of two dimensional hits in one super layer.
constexpr static 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.
AObject Object
Type of the object to be analysed.