 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/filters/segmentPair/TruthSegmentPairVarSet.h>
12 #include <tracking/trackFindingCDC/mclookup/CDCMCHitLookUp.h>
13 #include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
14 #include <tracking/trackFindingCDC/mclookup/CDCMCTrackStore.h>
16 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
17 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
18 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
20 #include <tracking/trackFindingCDC/numerics/Angle.h>
22 #include <cdc/dataobjects/CDCSimHit.h>
25 using namespace TrackFindingCDC;
29 if (not ptrSegmentPair)
return false;
42 const std::map<ITrackType, CDCMCTrackStore::CDCHitVector>& mcTracks =
56 if (fromSimHit and toSimHit) {
58 double truthToAlpha = -toSimHit->getPosTrack().DeltaPhi(toSimHit->getMomentum());
59 var<
named(
"truth_from_alpha")>() = truthFromAlpha;
60 var<
named(
"truth_to_alpha")>() = truthToAlpha;
63 var<
named(
"truth_from_alpha")>() = NAN;
64 var<
named(
"truth_to_alpha")>() = NAN;
65 var<
named(
"truth_delta_alpha")>() = NAN;
68 ITrackType fromTrackId = mcSegmentLookUp.
getMCTrackId(&fromSegment);
69 double fromMCTrackSize = 0;
70 if (mcTracks.count(fromTrackId)) {
71 fromMCTrackSize = mcTracks.find(fromTrackId)->second.size();
74 ITrackType toTrackId = mcSegmentLookUp.
getMCTrackId(&toSegment);
75 double toMCTrackSize = 0;
76 if (mcTracks.count(toTrackId)) {
77 toMCTrackSize = mcTracks.find(toTrackId)->second.size();
80 double trackFraction = fromSegment.size() / fromMCTrackSize + toSegment.size() / toMCTrackSize;
81 var<
named(
"truth_track_fraction")>() = trackFraction;
82 var<
named(
"__weight__")>() = std::isfinite(trackFraction) ? trackFraction : 0;
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
TVector3 getPosTrack() const
The method to get position on the track.
double getCurvatureXY() const
Getter for the curvature as seen from the xy projection.
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...
Specialisation of the lookup for the truth values of two dimensional segments.
Class to organize and present the monte carlo hit information.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
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.
bool extract(const CDCSegmentPair *ptrSegmentPair) final
Generate and assign the contained variables.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
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 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.
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.
double z() const
Getter for the z coordinate.
TVector3 getMomentum() const
The method to get momentum.
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.
const CDCWireHit & getWireHit() const
Getter for the wire hit assoziated with the reconstructed hit.
static double normalised(const double angle)
Normalise an angle to lie in the range from [-pi, pi].