8#include <tracking/trackFindingCDC/filters/segment/TruthSegmentVarSet.h>
10#include <tracking/trackFindingCDC/mclookup/CDCMCHitLookUp.h>
11#include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
12#include <tracking/trackFindingCDC/mclookup/CDCMCManager.h>
14#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
15#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
17#include <tracking/trackFindingCDC/rootification/StoreWrappedObjPtr.h>
20using namespace TrackFindingCDC;
36 if (not segment)
return false;
42 ITrackType segmentMCMatch = mcSegmentLookup.
getMCTrackId(segment);
43 bool segmentIsFake =
false;
44 bool trackIsAlreadyFound =
false;
47 if (segmentMCMatch == INVALID_ITRACK) {
51 unsigned int numberOfCorrectHits = 0;
53 if (hitLookup.
getMCTrackId(recoHit.getWireHit().getHit()) == segmentMCMatch) {
54 numberOfCorrectHits++;
57 if (numberOfCorrectHits < 0.8 * segment->size()) {
60 segmentIsFake =
false;
65 if (not segmentIsFake) {
69 const std::vector<CDCWireHit>& wireHits = *storedWireHits;
70 unsigned int numberOfTakenHitsInThisTrack = 0;
71 unsigned int numberOfHitsInThisTrack = 0;
74 if (hitLookup.
getMCTrackId(wireHit.getHit()) == segmentMCMatch) {
75 numberOfHitsInThisTrack++;
76 if (wireHit.getAutomatonCell().hasTakenFlag()) {
77 numberOfTakenHitsInThisTrack++;
82 if (numberOfTakenHitsInThisTrack > 0.5 * numberOfHitsInThisTrack) {
83 trackIsAlreadyFound =
true;
87 var<
named(
"segment_is_fake_truth")>() = segmentIsFake;
88 var<
named(
"track_is_already_found_truth")>() = trackIsAlreadyFound;
89 var<
named(
"segment_is_new_track_truth")>() = not segmentIsFake and not trackIsAlreadyFound;
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.
ITrackType getMCTrackId(const CDCHit *ptrHit) const
Returns the track id for the hit.
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
void requireTruthInformation()
Require the MC information store arrays.
void fill()
Fill Monte Carlo look up maps from the DataStore.
static CDCMCManager & getInstance()
Getter for the singleton 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 two dimensional reconstructed hit in the central drift chamber.
A reconstructed sequence of two dimensional hits in one super layer.
Class representing a hit wire in the central drift chamber.
void initialize() override
Receive and dispatch signal before the start of the event processing.
void beginEvent() override
Receive and dispatch signal for the start of a new event.
This class is for convenience access and registration of objects, that are stored inside the StoreWra...
void initialize() final
Require the Monte Carlo truth information at initialisation.
bool extract(const CDCSegment2D *segment) override
Generate and assign the contained variables.
void beginEvent() final
Prepare the Monte Carlo truth information at start of the event.
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.