10 #include <analysis/variables/TrackVariables.h>
13 #include <analysis/VariableManager/Manager.h>
15 #include <analysis/dataobjects/Particle.h>
18 #include <framework/datastore/StoreObjPtr.h>
19 #include <framework/dataobjects/Helix.h>
22 #include <mdst/dataobjects/Track.h>
23 #include <mdst/dataobjects/MCParticle.h>
24 #include <mdst/dataobjects/TrackFitResult.h>
25 #include <mdst/dataobjects/EventLevelTrackingInfo.h>
26 #include <mdst/dataobjects/HitPatternVXD.h>
27 #include <mdst/dataobjects/ECLCluster.h>
30 #include <framework/logging/Logger.h>
41 static const double realNaN = std::numeric_limits<double>::quiet_NaN();
42 static const B2Vector3D vecNaN(realNaN, realNaN, realNaN);
46 auto trackFit = part->getTrackFitResult();
47 if (!trackFit)
return realNaN;
51 if (trackFit->getHitPatternCDC().getNHits() + trackFit->getHitPatternVXD().getNdf() < 1) {
52 trackFit = part->getTrack()->getTrackFitResultWithClosestMass(Const::ChargedStable(std::abs(part->getPDGCode())));
54 if (det == Const::EDetector::CDC) {
55 return trackFit->getHitPatternCDC().getNHits();
56 }
else if (det == Const::EDetector::SVD) {
57 return trackFit->getHitPatternVXD().getNSVDHits();
58 }
else if (det == Const::EDetector::PXD) {
59 return trackFit->getHitPatternVXD().getNPXDHits();
65 double trackNCDCHits(
const Particle* part)
67 return trackNHits(part, Const::EDetector::CDC);
70 double trackNSVDHits(
const Particle* part)
72 return trackNHits(part, Const::EDetector::SVD);
75 double trackNPXDHits(
const Particle* part)
77 return trackNHits(part, Const::EDetector::PXD);
80 double trackNVXDHits(
const Particle* part)
82 return trackNPXDHits(part) + trackNSVDHits(part);
85 double trackNDF(
const Particle* part)
87 auto trackFit = part->getTrackFitResult();
88 if (!trackFit)
return realNaN;
89 return trackFit->getNDF();
92 double trackChi2(
const Particle* part)
94 auto trackFit = part->getTrackFitResult();
95 if (!trackFit)
return realNaN;
96 return trackFit->getChi2();
99 double trackFirstSVDLayer(
const Particle* part)
101 auto trackFit = part->getTrackFitResult();
102 if (!trackFit)
return realNaN;
105 if (trackFit->getHitPatternCDC().getNHits() + trackFit->getHitPatternVXD().getNdf() < 1) {
106 trackFit = part->getTrack()->getTrackFitResultWithClosestMass(Const::ChargedStable(std::abs(part->getPDGCode())));
108 return trackFit->getHitPatternVXD().getFirstSVDLayer();
111 double trackFirstPXDLayer(
const Particle* part)
113 auto trackFit = part->getTrackFitResult();
114 if (!trackFit)
return realNaN;
117 if (trackFit->getHitPatternCDC().getNHits() + trackFit->getHitPatternVXD().getNdf() < 1) {
118 trackFit = part->getTrack()->getTrackFitResultWithClosestMass(Const::ChargedStable(std::abs(part->getPDGCode())));
120 return trackFit->getHitPatternVXD().getFirstPXDLayer(HitPatternVXD::PXDMode::normal);
123 double trackFirstCDCLayer(
const Particle* part)
125 auto trackFit = part->getTrackFitResult();
126 if (!trackFit)
return realNaN;
129 if (trackFit->getHitPatternCDC().getNHits() + trackFit->getHitPatternVXD().getNdf() < 1) {
130 trackFit = part->getTrack()->getTrackFitResultWithClosestMass(Const::ChargedStable(std::abs(part->getPDGCode())));
132 return trackFit->getHitPatternCDC().getFirstLayer();
135 double trackLastCDCLayer(
const Particle* part)
137 auto trackFit = part->getTrackFitResult();
138 if (!trackFit)
return realNaN;
141 if (trackFit->getHitPatternCDC().getNHits() + trackFit->getHitPatternVXD().getNdf() < 1) {
142 trackFit = part->getTrack()->getTrackFitResultWithClosestMass(Const::ChargedStable(std::abs(part->getPDGCode())));
144 return trackFit->getHitPatternCDC().getLastLayer();
147 double trackD0(
const Particle* part)
149 auto trackFit = part->getTrackFitResult();
150 if (!trackFit)
return realNaN;
151 return trackFit->getD0();
154 double trackPhi0(
const Particle* part)
156 auto trackFit = part->getTrackFitResult();
157 if (!trackFit)
return realNaN;
158 return trackFit->getPhi0();
161 double trackOmega(
const Particle* part)
163 auto trackFit = part->getTrackFitResult();
164 if (!trackFit)
return realNaN;
165 return trackFit->getOmega();
168 double trackZ0(
const Particle* part)
170 auto trackFit = part->getTrackFitResult();
171 if (!trackFit)
return realNaN;
172 return trackFit->getZ0();
175 double trackTanLambda(
const Particle* part)
177 auto trackFit = part->getTrackFitResult();
178 if (!trackFit)
return realNaN;
179 return trackFit->getTanLambda();
182 double trackD0Error(
const Particle* part)
184 auto trackFit = part->getTrackFitResult();
185 if (!trackFit)
return realNaN;
187 double errorSquared = trackFit->getCovariance5()[0][0];
188 if (errorSquared <= 0)
return realNaN;
189 return sqrt(errorSquared);
192 double trackPhi0Error(
const Particle* part)
194 auto trackFit = part->getTrackFitResult();
195 if (!trackFit)
return realNaN;
197 double errorSquared = trackFit->getCovariance5()[1][1];
198 if (errorSquared <= 0)
return realNaN;
199 return sqrt(errorSquared);
202 double trackOmegaError(
const Particle* part)
204 auto trackFit = part->getTrackFitResult();
205 if (!trackFit)
return realNaN;
207 double errorSquared = trackFit->getCovariance5()[2][2];
208 if (errorSquared <= 0)
return realNaN;
209 return sqrt(errorSquared);
212 double trackZ0Error(
const Particle* part)
214 auto trackFit = part->getTrackFitResult();
215 if (!trackFit)
return realNaN;
217 double errorSquared = trackFit->getCovariance5()[3][3];
218 if (errorSquared <= 0)
return realNaN;
219 return sqrt(errorSquared);
222 double trackTanLambdaError(
const Particle* part)
224 auto trackFit = part->getTrackFitResult();
225 if (!trackFit)
return realNaN;
227 double errorSquared = trackFit->getCovariance5()[4][4];
228 if (errorSquared <= 0)
return realNaN;
229 return sqrt(errorSquared);
232 double trackFitCovariance(
const Particle* particle,
const std::vector<double>& indices)
234 if (indices.size() != 2) {
235 B2FATAL(
"Exactly two indices must be provided to the variable trackFitCovariance!");
237 if (*(std::min_element(indices.begin(), indices.end())) < 0 or *(std::max_element(indices.begin(), indices.end())) > 4) {
238 B2FATAL(
"The indices provided to the variable trackFitCovariance must be in the range 0 - 4!");
240 auto trackFit = particle->getTrackFitResult();
241 if (!trackFit)
return realNaN;
242 return trackFit->getCovariance5()[indices[0]][indices[1]];
245 double trackPValue(
const Particle* part)
247 auto trackFit = part->getTrackFitResult();
248 if (!trackFit)
return realNaN;
249 return trackFit->getPValue();
252 double trackFitHypothesisPDG(
const Particle* part)
254 auto trackFit = part->getTrackFitResult();
255 if (!trackFit)
return realNaN;
256 return trackFit->getParticleType().getPDGCode();
259 double trackNECLClusters(
const Particle* part)
261 const Track* track = part->getTrack();
262 if (!track)
return realNaN;
266 for (
const ECLCluster& cluster : track->getRelationsTo<ECLCluster>())
273 B2Vector3D getPositionOnHelix(
const Particle* part,
const std::vector<double>& pars)
275 const auto nParams = pars.size();
276 if (nParams != 3 && nParams != 4) {
277 B2FATAL(
"Exactly three (+1 optional) parameters (r, zfwd, zbwd, [useHighestProbMass]) required.");
280 const double r = pars[0];
281 const double zfwd = pars[1];
282 const double zbwd = pars[2];
283 const auto useHighestProbMass = (nParams == 4) ?
bool(pars[3]) :
false;
285 const Track* track = part->getTrack();
287 if (!track)
return vecNaN;
289 auto highestProbMass = (useHighestProbMass) ? part->getMostLikelyTrackFitResult().first : Const::ChargedStable(std::abs(
290 part->getPDGCode()));
292 const TrackFitResult* trackFit = track->getTrackFitResultWithClosestMass(highestProbMass);
295 const double z0 = trackFit->getZ0();
296 const double tanlambda = trackFit->getTanLambda();
297 const Helix h = trackFit->getHelix();
300 const double arcLength = h.getArcLength2DAtCylindricalR(r);
301 const double lHelixRadius = arcLength > 0 ? arcLength : std::numeric_limits<double>::max();
304 const double lFWD = (zfwd - z0) / tanlambda > 0 ? (zfwd - z0) / tanlambda : std::numeric_limits<double>::max();
307 const double lBWD = (zbwd - z0) / tanlambda > 0 ? (zbwd - z0) / tanlambda : std::numeric_limits<double>::max();
310 const double l = std::min({lHelixRadius, lFWD, lBWD});
312 return h.getPositionAtArcLength2D(l);
316 double trackHelixExtTheta(
const Particle* part,
const std::vector<double>& pars)
318 const auto nParams = pars.size();
319 if (nParams != 3 && nParams != 4) {
320 B2FATAL(
"Exactly three (+1 optional) parameters (r, zfwd, zbwd, [useHighestProbMass]) required for helixExtTheta.");
322 B2Vector3D position = getPositionOnHelix(part, pars);
323 if (position == vecNaN)
return realNaN;
324 return position.Theta();
328 double trackHelixExtPhi(
const Particle* part,
const std::vector<double>& pars)
330 const auto nParams = pars.size();
331 if (nParams != 3 && nParams != 4) {
332 B2FATAL(
"Exactly three (+1 optional) parameters (r, zfwd, zbwd, [useHighestProbMass]) required for helixExtPhi.");
334 B2Vector3D position = getPositionOnHelix(part, pars);
335 if (position == vecNaN)
return realNaN;
336 return position.Phi();
345 double nExtraCDCHits(
const Particle*)
347 StoreObjPtr<EventLevelTrackingInfo> elti;
348 if (!elti)
return realNaN;
349 return elti->getNCDCHitsNotAssigned();
354 double nExtraCDCHitsPostCleaning(
const Particle*)
356 StoreObjPtr<EventLevelTrackingInfo> elti;
357 if (!elti)
return realNaN;
358 return elti->getNCDCHitsNotAssignedPostCleaning();
362 double hasExtraCDCHitsInLayer(
const Particle*,
const std::vector<double>& layer)
364 StoreObjPtr<EventLevelTrackingInfo> elti;
365 if (!elti)
return realNaN;
366 int ilayer = std::lround(layer[0]);
367 return elti->hasCDCLayer(ilayer);
371 double hasExtraCDCHitsInSuperLayer(
const Particle*,
const std::vector<double>& layer)
373 StoreObjPtr<EventLevelTrackingInfo> elti;
374 if (!elti)
return realNaN;
375 int ilayer = std::lround(layer[0]);
376 return elti->hasCDCSLayer(ilayer);
380 double nExtraCDCSegments(
const Particle*)
382 StoreObjPtr<EventLevelTrackingInfo> elti;
383 if (!elti)
return realNaN;
384 return elti->getNCDCSegments();
388 double nExtraVXDHitsInLayer(
const Particle*,
const std::vector<double>& layer)
390 StoreObjPtr<EventLevelTrackingInfo> elti;
391 if (!elti)
return realNaN;
392 int ilayer = std::lround(layer[0]);
393 return elti->getNVXDClustersInLayer(ilayer);
397 double nExtraVXDHits(
const Particle*)
399 StoreObjPtr<EventLevelTrackingInfo> elti;
400 if (!elti)
return realNaN;
402 for (uint16_t ilayer = 1; ilayer < 7; ++ilayer)
403 out += elti->getNVXDClustersInLayer(ilayer);
408 double svdFirstSampleTime(
const Particle*)
410 StoreObjPtr<EventLevelTrackingInfo> elti;
411 if (!elti)
return realNaN;
412 return elti->getSVDFirstSampleTime();
419 double trackFindingFailureFlag(
const Particle*)
421 StoreObjPtr<EventLevelTrackingInfo> elti;
422 if (!elti)
return realNaN;
423 return elti->hasAnErrorFlag();
426 double getHelixParameterPullAtIndex(
const Particle* particle,
const int index)
428 if (!particle)
return realNaN;
431 if (!mcparticle)
return realNaN;
434 if (!trackfit)
return realNaN;
437 const TMatrixDSym measCovariance = measHelix.
getCovariance();
438 const B2Vector3D mcProdVertex = mcparticle->getVertex();
439 const B2Vector3D mcMomentum = mcparticle->getMomentum();
442 const double mcParticleCharge = mcparticle->getCharge();
447 const std::vector<double> measErrSquare = {measCovariance[0][0], measCovariance[1][1], measCovariance[2][2], measCovariance[3][3], measCovariance[4][4]};
449 return (mcHelixPars.at(index) - measHelixPars.at(index)) / std::sqrt(measErrSquare.at(index));
452 double getHelixD0Pull(
const Particle* part)
454 return getHelixParameterPullAtIndex(part, 0);
457 double getHelixPhi0Pull(
const Particle* part)
459 return getHelixParameterPullAtIndex(part, 1);
462 double getHelixOmegaPull(
const Particle* part)
464 return getHelixParameterPullAtIndex(part, 2);
467 double getHelixZ0Pull(
const Particle* part)
469 return getHelixParameterPullAtIndex(part, 3);
471 double getHelixTanLambdaPull(
const Particle* part)
473 return getHelixParameterPullAtIndex(part, 4);
477 VARIABLE_GROUP(
"Tracking");
478 REGISTER_VARIABLE(
"d0Pull", getHelixD0Pull, R
"DOC(
479 The pull of the tracking parameter :math:`d_0` for the reconstructed
480 pattern-recognition track, with respect to the MC track. That is:
484 \frac{d_0^\textrm{MC} - d_0^\textrm{PR}}{\sigma_{d_0; \textrm{PR}}}
486 .. seealso:: :b2:var:`d0`, :b2:var:`d0Err`
488 Returns NaN if no MC particle is related or if called on something other than a
489 track-based particle.
491 REGISTER_VARIABLE("phi0Pull", getHelixPhi0Pull, R
"DOC(
492 The pull of the tracking parameter :math:`\phi_0` for the reconstructed
493 pattern-recognition track, with respect to the MC track. That is:
497 \frac{\phi_0^\textrm{MC} - \phi_0^\textrm{PR}}{\sigma_{\phi_0; \textrm{PR}}}
499 .. seealso:: :b2:var:`phi0`, :b2:var:`phi0Err`
501 Returns NaN if no MC particle is related or if called on something other than a
502 track-based particle.
504 REGISTER_VARIABLE("omegaPull", getHelixOmegaPull, R
"DOC(
505 The pull of the tracking parameter :math:`\omega` for the reconstructed
506 pattern-recognition track, with respect to the MC track. That is:
510 \frac{\omega^\textrm{MC} - \omega^\textrm{PR}}{\sigma_{\omega; \textrm{PR}}}
512 .. seealso:: :b2:var:`omega`, :b2:var:`omegaErr`
514 Returns NaN if no MC particle is related or if called on something other than a
515 track-based particle.
517 REGISTER_VARIABLE("z0Pull", getHelixZ0Pull, R
"DOC(
518 The pull of the tracking parameter :math:`z_0` for the reconstructed
519 pattern-recognition track, with respect to the MC track. That is:
523 \frac{z_0^\textrm{MC} - z_0^\textrm{PR}}{\sigma_{z_0; \textrm{PR}}}
525 .. seealso:: :b2:var:`z0`, :b2:var:`z0Err`
527 Returns NaN if no MC particle is related or if called on something other than a
528 track-based particle.
530 REGISTER_VARIABLE("tanLambdaPull", getHelixTanLambdaPull, R
"DOC(
531 The pull of the tracking parameter :math:`\tan\lambda` for the reconstructed
532 pattern-recognition track, with respect to the MC track. That is:
536 \frac{(\tan\lambda)^\textrm{MC} - (\tan\lambda)^\textrm{PR}}{\sigma_{\tan\lambda; \textrm{PR}}}
538 .. seealso:: :b2:var:`tanLambda`, :b2:var:`tanLambdaErr`
540 Returns NaN if no MC particle is related or if called on something other than a
541 track-based particle.
543 REGISTER_VARIABLE("nCDCHits", trackNCDCHits,
544 "The number of CDC hits associated to the track. Returns NaN if called for something other than a track-based particle.");
545 REGISTER_VARIABLE(
"nSVDHits", trackNSVDHits,
546 "The number of SVD hits associated to the track. Returns NaN if called for something other than a track-based particle.");
547 REGISTER_VARIABLE(
"nPXDHits", trackNPXDHits,
548 "The number of PXD hits associated to the track. Returns NaN if called for something other than a track-based particle.");
549 REGISTER_VARIABLE(
"nVXDHits", trackNVXDHits,
550 "The number of PXD and SVD hits associated to the track. Returns NaN if called for something other than a track-based particle.");
551 REGISTER_VARIABLE(
"ndf", trackNDF, R
"DOC(
552 Returns the number of degrees of freedom of the track fit.
556 Note that this is not simply the number of hits -5 due to outlier hit
559 Returns NaN if called for something other than a track-based particle, or for
560 mdst files processed with basf2 versions older than ``release-05-01``.
562 REGISTER_VARIABLE("chi2", trackChi2, R
"DOC(
563 Returns the :math:`\chi^2` of the track fit. This is actually computed based on
564 :b2:var:`pValue` and :b2:var:`ndf`.
566 .. note:: Note that for :b2:var:`pValue` exactly equal to 0 it returns infinity.
568 Returns NaN if called for something other than a track-based particle, or for
569 mdst files processed with basf2 versions older than ``release-05-01``.
571 REGISTER_VARIABLE("firstSVDLayer", trackFirstSVDLayer,
572 "The first activated SVD layer associated to the track. Returns NaN if called for something other than a track-based particle.");
573 REGISTER_VARIABLE(
"firstPXDLayer", trackFirstPXDLayer,
574 "The first activated PXD layer associated to the track. Returns NaN if called for something other than a track-based particle.");
575 REGISTER_VARIABLE(
"firstCDCLayer", trackFirstCDCLayer,
576 "The first activated CDC layer associated to the track. Returns NaN if called for something other than a track-based particle.");
577 REGISTER_VARIABLE(
"lastCDCLayer", trackLastCDCLayer,
578 "The last CDC layer associated to the track. Returns NaN if called for something other than a track-based particle.");
579 REGISTER_VARIABLE(
"d0", trackD0, R
"DOC(
580 Returns the tracking parameter :math:`d_0`, the signed distance to the
581 point-of-closest-approach (POCA) in the :math:`r-\phi` plane.
585 Tracking parameters are with respect to the origin (0,0,0). For the
586 POCA with respect to the measured beam interaction point, see
587 :b2:var:`dr` (you probably want this unless you're doing a tracking
588 study or some debugging).
590 Returns NaN if called for something other than a track-based particle.
592 REGISTER_VARIABLE(
"phi0", trackPhi0, R
"DOC(
593 Returns the tracking parameter :math:`\phi_0`, the angle of the transverse
594 momentum in the :math:`r-\phi` plane.
596 Returns NaN if called for something other than a track-based particle.
598 REGISTER_VARIABLE(
"omega", trackOmega, R
"DOC(
599 Returns the tracking parameter :math:`\omega`, the curvature of the track.
601 Returns NaN if called for something other than a track-based particle.
602 )DOC", ":math:`\\text{cm}^{-1}`");
603 REGISTER_VARIABLE(
"z0", trackZ0, R
"DOC(
604 Returns the tracking parameter :math:`z_0`, the z-coordinate of the
605 point-of-closest-approach (POCA).
609 Tracking parameters are with respect to the origin (0,0,0). For the
610 POCA with respect to the measured beam interaction point, see
611 :b2:var:`dz` (you probably want this unless you're doing a tracking
612 study or some debugging).
614 Returns NaN if called for something other than a track-based particle.
616 REGISTER_VARIABLE(
"tanLambda", trackTanLambda, R
"DOC(
617 Returns :math:`\tan\lambda`, the slope of the track in the :math:`r-z` plane.
619 Returns NaN if called for something other than a track-based particle.
621 REGISTER_VARIABLE("d0Err", trackD0Error, R
"DOC(
622 Returns the uncertainty on :math:`d_0`, the signed distance to the
623 point-of-closest-approach (POCA) in the :math:`r-\phi` plane.
625 .. seealso:: :b2:var:`d0`, :b2:var:`d0Pull`
627 Returns NaN if called for something other than a track-based particle.
629 REGISTER_VARIABLE(
"phi0Err", trackPhi0Error, R
"DOC(
630 Returns the uncertainty on :math:`\phi_0`, the angle of the transverse momentum
631 in the :math:`r-\phi` plane.
633 .. seealso:: :b2:var:`phi0`, :b2:var:`phi0Pull`
635 Returns NaN if called for something other than a track-based particle.
637 REGISTER_VARIABLE(
"omegaErr", trackOmegaError, R
"DOC(
638 Returns the uncertainty on :math:`\omega`, the curvature of the track.
640 .. seealso:: :b2:var:`omega`, :b2:var:`omegaPull`
642 Returns NaN if called for something other than a track-based particle.
643 )DOC", ":math:`\\text{cm}^{-1}`");
644 REGISTER_VARIABLE(
"z0Err", trackZ0Error, R
"DOC(
645 Returns the uncertainty on :math:`z_0`, the z-coordinate of the
646 point-of-closest-approach (POCA).
648 .. seealso:: :b2:var:`z0`, :b2:var:`z0Pull`
650 Returns NaN if called for something other than a track-based particle."
652 REGISTER_VARIABLE(
"tanLambdaErr", trackTanLambdaError, R
"DOC(
653 Returns the uncertainty on :math:`\tan\lambda`, the slope of the track in the
656 .. seealso:: :b2:var:`tanLambda`, :b2:var:`tanLambdaPull`
658 Returns NaN if called for something other than a track-based particle.
660 REGISTER_VARIABLE("trackFitCovariance(i, j)", trackFitCovariance, R
"DOC(
661 The track fit covariance matrix element corresponding to the two indices is returned.
662 This is the association between integers and parameters:
668 * 4: :math:`\tan\lambda`
672 The covariance is returned. This means that the return value can be negative.
673 Furthermore, it's the squared value of the track fit error variables :b2:var:`d0Err`, etc.
674 when selecting the diagonal entries.
677 REGISTER_VARIABLE("pValue", trackPValue, R
"DOC(
678 The :math:`\chi^2` probability of the **track** fit.
682 This is the p-value of the track-fit. It does not get updated after
683 vertex fitting or kinematic fitting, and is meaningless for composite
686 See :b2:var:`chiProb` (you probably want this for high-level analysis).
688 Returns NaN if called for something other than a track-based particle.
690 REGISTER_VARIABLE("trackFitHypothesisPDG", trackFitHypothesisPDG, R
"DOC(
691 Returns the PDG code of the track hypothesis actually used for the fit.
692 Returns NaN if called for something other than a track-based particle.
694 REGISTER_VARIABLE("trackNECLClusters", trackNECLClusters, R
"DOC(
695 Returns a count of the number of ECLClusters matched to the track. This is
696 always 0 or 1 with newer versions of ECL reconstruction.
700 For high-level analysis it is recommended to require the presence of a
701 matched ECL cluster along with a minimum energy requirement. A
702 track-based particle will have a clusterE if it is matched (NaN if
703 there is no cluster match for the track.
705 .. code-block:: python
707 import modularAnalysis as ma
708 # minimum energy of 200 MeV
709 ma.fillParticleList("e+:clusters", "clusterE > 0.2", path)
711 # these two are equivalent
712 ma.fillParticleList("e+:unmatched", "isNAN(clusterE) == 1", path)
713 ma.fillParticleList("e+:unmatched2", "trackNECLClusters == 0", path)
715 Returns NaN if called for something other than a track-based particle.
717 REGISTER_VARIABLE("helixExtTheta(radius [cm], z fwd [cm], z bwd [cm], useHighestProbMass=0)", trackHelixExtTheta,
718 "Returns theta of extrapolated helix parameters. If ``useHighestProbMass=1`` is set, the extrapolation will use the track fit result for the mass hypothesis with the highest pValue.",
720 REGISTER_VARIABLE(
"helixExtPhi(radius, z fwd, z bwd, useHighestProbMass=0)", trackHelixExtPhi,
721 "Returns phi of extrapolated helix parameters. If ``useHighestProbMass=1`` is set, the extrapolation will use the track fit result for the mass hypothesis with the highest pValue.",
724 REGISTER_VARIABLE(
"nExtraCDCHits", nExtraCDCHits, R
"DOC(
725 [Eventbased] The number of CDC hits in the event not assigned to any track.
727 Returns NaN if there is no event-level tracking information available.
729 REGISTER_VARIABLE("nExtraCDCHitsPostCleaning", nExtraCDCHitsPostCleaning, R
"DOC(
730 [Eventbased] Returns a count of the number of CDC hits in the event not assigned
731 to any track nor very likely beam background (i.e. hits that survive a cleanup
734 Returns NaN if there is no event-level tracking information available.
736 REGISTER_VARIABLE("hasExtraCDCHitsInLayer(i)", hasExtraCDCHitsInLayer, R
"DOC(
737 [Eventbased] Returns 1 if a non-assigned hit exists in the specified CDC layer,
740 Returns NaN if there is no event-level tracking information available.
742 REGISTER_VARIABLE("hasExtraCDCHitsInSuperLayer(i)", hasExtraCDCHitsInSuperLayer, R
"DOC(
743 [Eventbased] Returns 1 if a non-assigned hit exists in the specified CDC
744 SuperLayer, 0 otherwise.
746 Returns NaN if there is no event-level tracking information available.
748 REGISTER_VARIABLE("nExtraCDCSegments", nExtraCDCSegments, R
"DOC(
749 [Eventbased] Returns the number of CDC segments not assigned to any track.
751 Returns NaN if there is no event-level tracking information available.
759 REGISTER_VARIABLE(
"trackFindingFailureFlag", trackFindingFailureFlag, R
"DOC(
760 [Eventbased] Returns a flag set by the tracking if there is reason to assume
761 there was a track in the event missed by the tracking, or the track finding was
762 (partly) aborted for this event.
764 Returns NaN if there is no event-level tracking information available.
DataType Z() const
access variable Z (= .at(2) without boundary check)
static B2Vector3D getFieldInTesla(const B2Vector3D &pos)
return the magnetic field at a given position in Tesla.
EDetector
Enum for identifying the detector components (detector and subdetector).
@ c_nPhotons
CR is split into n photons (N1)
This class represents an ideal helix in perigee parameterization.
double getOmega() const
Getter for omega, which is a signed curvature measure of the track.
double getD0() const
Getter for d0, which is the signed distance to the perigee in the r-phi plane.
double getTanLambda() const
Getter for tan lambda, which is the z over two dimensional arc length slope of the track.
double getZ0() const
Getter for z0, which is the z coordinate of the perigee.
double getPhi0() const
Getter for phi0, which is the azimuth angle of the transverse momentum at the perigee.
const MCParticle * getMCParticle() const
Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c...
Values of the result of a track fit with a given particle hypothesis.
UncertainHelix getUncertainHelix() const
Conversion to framework Uncertain Helix (i.e., with covariance).
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...
const TMatrixDSym & getCovariance() const
Getter for covariance matrix of perigee parameters in matrix form.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.