 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/filters/segment/TruthSegmentVarSet.h>
12 #include <tracking/trackFindingCDC/mclookup/CDCMCHitLookUp.h>
13 #include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
14 #include <tracking/trackFindingCDC/mclookup/CDCMCManager.h>
16 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
17 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
19 #include <tracking/trackFindingCDC/rootification/StoreWrappedObjPtr.h>
22 using namespace TrackFindingCDC;
38 if (not segment)
return false;
44 ITrackType segmentMCMatch = mcSegmentLookup.
getMCTrackId(segment);
45 bool segmentIsFake =
false;
46 bool trackIsAlreadyFound =
false;
49 if (segmentMCMatch == INVALID_ITRACK) {
53 unsigned int numberOfCorrectHits = 0;
55 if (hitLookup.
getMCTrackId(recoHit.getWireHit().getHit()) == segmentMCMatch) {
56 numberOfCorrectHits++;
59 if (numberOfCorrectHits < 0.8 * segment->size()) {
62 segmentIsFake =
false;
67 if (not segmentIsFake) {
71 const std::vector<CDCWireHit>& wireHits = *storedWireHits;
72 unsigned int numberOfTakenHitsInThisTrack = 0;
73 unsigned int numberOfHitsInThisTrack = 0;
76 if (hitLookup.
getMCTrackId(wireHit.getHit()) == segmentMCMatch) {
77 numberOfHitsInThisTrack++;
78 if (wireHit.getAutomatonCell().hasTakenFlag()) {
79 numberOfTakenHitsInThisTrack++;
84 if (numberOfTakenHitsInThisTrack > 0.5 * numberOfHitsInThisTrack) {
85 trackIsAlreadyFound =
true;
89 var<
named(
"segment_is_fake_truth")>() = segmentIsFake;
90 var<
named(
"track_is_already_found_truth")>() = trackIsAlreadyFound;
91 var<
named(
"segment_is_new_track_truth")>() = not segmentIsFake and not trackIsAlreadyFound;
bool extract(const CDCSegment2D *segment) override
Generate and assign the contained variables.
Specialisation of the lookup for the truth values of two dimensional segments.
void initialize() final
Require the Monte Carlo truth information at initialisation.
This class is for convenience access and registration of objects, that are stored inside the StoreWra...
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.
void initialize() override
Receive and dispatch signal before the start of the event processing.
void requireTruthInformation()
Require the mc information store arrays.
void fill()
Fill Monte Carlo look up maps from the DataStore.
ITrackType getMCTrackId(const CDCHit *ptrHit) const
Returns the track id for the hit.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Abstract base class for different kinds of events.
Interface class to the Monte Carlo information for individual hits.
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.
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.
Class representing a hit wire in the central drift chamber.
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.