 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/filters/segmentPairRelation/TruthSegmentPairRelationVarSet.h>
12 #include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
13 #include <tracking/trackFindingCDC/mclookup/CDCMCTrackStore.h>
15 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
16 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
19 using namespace TrackFindingCDC;
23 if (not ptrSegmentPairRelation)
return false;
39 const std::map<ITrackType, CDCMCTrackStore::CDCHitVector>& mcTracks =
47 ITrackType startTrackId = mcSegmentLookUp.
getMCTrackId(&startSegment);
48 double startMCTrackSize = 0;
49 if (mcTracks.count(startTrackId)) {
50 startMCTrackSize = mcTracks.find(startTrackId)->second.size();
53 ITrackType middleTrackId = mcSegmentLookUp.
getMCTrackId(&middleSegment);
54 double middleMCTrackSize = 0;
55 if (mcTracks.count(middleTrackId)) {
56 middleMCTrackSize = mcTracks.find(middleTrackId)->second.size();
59 ITrackType endTrackId = mcSegmentLookUp.
getMCTrackId(&endSegment);
60 double endMCTrackSize = 0;
61 if (mcTracks.count(endTrackId)) {
62 endMCTrackSize = mcTracks.find(endTrackId)->second.size();
65 double trackFraction =
66 startSegment.size() / startMCTrackSize +
67 middleSegment.size() / middleMCTrackSize +
68 endSegment.size() / endMCTrackSize;
70 var<
named(
"truth_track_fraction")>() = trackFraction;
71 var<
named(
"__weight__")>() = std::isfinite(trackFraction) ? trackFraction : 0;
From * getFrom() const
Getter for the pointer to the from side object.
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
Type for two related objects.
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
double getCurvatureXY() const
Getter for the curvature as seen from the xy projection.
Specialisation of the lookup for the truth values of two dimensional segments.
Class to organize and present the monte carlo hit information.
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.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
Abstract base class for different kinds of events.
static const CDCMCTrackStore & getInstance()
Getter for the singletone instance.
const std::map< ITrackType, Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > & getMCTracksByMCParticleIdx() const
Getter for the stored Monte Carlo tracks ordered by their Monte Carlo Id.
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
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.
bool extract(const Relation< const CDCSegmentPair > *ptrSegmentPairRelation) final
Generate and assign the contained variables.
To * getTo() const
Getter for the pointer to the to side object.
double z() const
Getter for the z coordinate.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Particle full three dimensional trajectory.
CDCTrajectory3D getTrajectory3D(const ACDCHitCollection *ptrHits) const
Returns the trajectory of the collection of hits.