Generate and assign the contained variables.
42{
43 if (not ptrAxialSegmentPair) return false;
44
46
49
52
56 const std::map<ITrackType, CDCMCTrackStore::CDCHitVector>& mcTracks =
58
63
64
67
70 if (fromSimHit and toSimHit) {
72 double truthToAlpha = -toSimHit->getPosTrack().DeltaPhi(toSimHit->getMomentum());
73 var<
named(
"truth_from_alpha")>() = truthFromAlpha;
74 var<
named(
"truth_to_alpha")>() = truthToAlpha;
76 } else {
77 var<
named(
"truth_from_alpha")>() = NAN;
78 var<
named(
"truth_to_alpha")>() = NAN;
79 var<
named(
"truth_delta_alpha")>() = NAN;
80 }
81
82 ITrackType fromTrackId = mcSegmentLookUp.
getMCTrackId(&fromSegment);
83 double fromMCTrackSize = 0;
84 if (mcTracks.count(fromTrackId)) {
85 fromMCTrackSize = mcTracks.find(fromTrackId)->second.size();
86 }
87
88 ITrackType toTrackId = mcSegmentLookUp.
getMCTrackId(&toSegment);
89 double toMCTrackSize = 0;
90 if (mcTracks.count(toTrackId)) {
91 toMCTrackSize = mcTracks.find(toTrackId)->second.size();
92 }
93
94 double trackFraction = fromSegment.size() / fromMCTrackSize + toSegment.size() / toMCTrackSize;
95 var<
named(
"truth_track_fraction")>() = trackFraction;
96
97 double fromRLPurity = mcSegmentLookUp.
getRLPurity(&fromSegment);
98 double toRLPurity = mcSegmentLookUp.
getRLPurity(&toSegment);
99 if (fromRLPurity < 0.5) fromRLPurity = 0;
100 if (toRLPurity < 0.5) toRLPurity = 0;
101
103
104
105 double weight = pairFBInfo != EForwardBackward::c_Invalid ? fromRLPurity * toRLPurity : 1;
106 var<
named(
"__weight__")>() = weight;
107
108 return true;
109}
DataType DeltaPhi(const B2Vector3< DataType > &v) const
returns phi in the interval [-PI,PI)
B2Vector3D getPosTrack() const
The method to get position on the track.
B2Vector3D getMomentum() const
The method to get momentum.
Class representing a pair of reconstructed axial segments in adjacent superlayer.
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
double getRLPurity(const ACDCHitCollection *ptrHits) const
Getter for the right left passge purity which respects the forward backward reconstruction.
CDCTrajectory3D getTrajectory3D(const ACDCHitCollection *ptrHits) const
Returns the trajectory of the collection of hits.
EForwardBackward areAlignedInMCTrack(const ACDCHitCollection *ptrFromHits, const ACDCHitCollection *ptrToHits) const
Returns if the second collection of hits follows the first collection of hits in their common Monte C...
Interface class to the Monte Carlo information for individual hits.
const CDCSimHit * getClosestPrimarySimHit(const CDCHit *ptrHit) const
Getter for the closest simulated hit of a primary particle to the given hit - may return nullptr of n...
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
Specialisation of the lookup for the truth values of two dimensional segments.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
Class to organize and present the monte carlo hit information.
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.
Class representing a two dimensional reconstructed hit in the central drift chamber.
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the reconstructed hit.
A reconstructed sequence of two dimensional hits in one super layer.
Particle full three dimensional trajectory.
double getCurvatureXY() const
Getter for the curvature as seen from the xy projection.
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
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.
double z() const
Getter for the z coordinate.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].