 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/filters/track/BestMatchedTruthVarSet.h>
12 #include <tracking/trackFindingCDC/mclookup/CDCMCHitLookUp.h>
13 #include <tracking/trackFindingCDC/mclookup/CDCMCTrackLookUp.h>
14 #include <tracking/trackFindingCDC/mclookup/CDCMCManager.h>
15 #include <tracking/trackFindingCDC/mclookup/CDCMCCloneLookUp.h>
17 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
18 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
21 using namespace TrackFindingCDC;
37 if (not ptrCDCTrack)
return false;
44 ITrackType trackMCMatch = mcTrackLookUp.
getMCTrackId(ptrCDCTrack);
45 bool trackIsFake =
false;
47 unsigned int numberOfCorrectHits = 0;
50 bool trackHasMinimalMatchPurity = (trackMCMatch != INVALID_ITRACK);
52 if (not trackHasMinimalMatchPurity) {
56 auto hitIsCorrect = [&hitLookUp, &trackMCMatch](
const CDCRecoHit3D & recoHit) {
57 return hitLookUp.
getMCTrackId(recoHit.getWireHit().getHit()) == trackMCMatch;
59 numberOfCorrectHits = std::count_if(begin(*ptrCDCTrack), end(*ptrCDCTrack), hitIsCorrect);
61 const double purity = (double)numberOfCorrectHits / ptrCDCTrack->size();
69 bool trackIsClone = cloneLookUp.
isTrackClone(*ptrCDCTrack);
70 bool matchedNotClone = (not trackIsClone) and (not trackIsFake);
71 var<
named(
"truth")>() = matchedNotClone;
72 var<
named(
"truth_track_is_fake")>() = trackIsFake;
73 var<
named(
"truth_track_is_matched")>() = not trackIsFake;
74 var<
named(
"truth_matched_hits")>() = numberOfCorrectHits;
75 var<
named(
"truth_track_is_clone")>() = trackIsClone;
78 var<
named(
"truth_MCTrackID")>() = trackMCMatch;
StoreObjPtr< EventMetaData > m_eventMetaData
Pointer to the store array object with the EventMetaData.
Class representing a three dimensional reconstructed hit.
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.
Class representing a sequence of three dimensional reconstructed hits.
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
Index getFirstNLoops(const ACDCHitCollection *ptrHits) const
Getter for number of loops till the first hit the collection of hits which has the Monte Carlo track ...
void initialize() override
Receive and dispatch signal before the start of the event processing.
void requireTruthInformation()
Require the mc information store arrays.
void initialize() final
Require the Monte Carlo truth information at initialisation.
void fill()
Fill Monte Carlo look up maps from the DataStore.
ITrackType getMCTrackId(const CDCHit *ptrHit) const
Returns the track id for the hit.
static const CDCMCTrackLookUp & getInstance()
Getter for the singletone instance.
Abstract base class for different kinds of events.
Interface class to the Monte Carlo information for individual hits.
Class providing information whether a PR CDC track is the best match or a clone.
static CDCMCManager & getInstance()
Getter for the singletone instance.
void beginEvent() override
Receive and dispatch signal for the start of a new event.
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
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.
static CDCMCCloneLookUp & getInstance()
Getter for the singletone instance.
Specialisation of the lookup for the truth values of reconstructed tracks.
bool extract(const CDCTrack *ptrCDCTrack) override
Generate and assign the contained variables.
bool isTrackClone(const CDCTrack &cdcTrack)
getter for information from m_cdcTrackIsCloneMap