PandaRoot
DecayTreeFitter Namespace Reference

Classes

class  ChiSquare
 
class  Configuration
 
class  Constraint
 
class  DecayChain
 
class  ErrCode
 
class  FitParams
 
class  Fitter
 
class  InteractionPoint
 
class  InternalParticle
 
class  KalmanCalculator
 
class  Line
 
class  MergedConstraint
 
class  MissingParticle
 
class  ParticleBase
 
class  Projection
 
class  RecoComposite
 
class  RecoParticle
 
class  RecoPhoton
 
class  RecoResonance
 
class  RecoTrack
 
class  RecoTrackStateProvider
 
class  Resonance
 
class  State
 

Functions

std::ostream & operator<< (std::ostream &os, const Line &rhs)
 
bool closestPointParams (const Line &line0, const Line &line1, double &mu0, double &mu1)
 
bool sortByType (const ParticleBase *lhs, const ParticleBase *rhs)
 
bool compTrkTransverseMomentum (const RecoTrack *lhs, const RecoTrack *rhs)
 
std::ostream & operator<< (std::ostream &str, const State &obj)
 

Function Documentation

◆ closestPointParams()

bool DecayTreeFitter::closestPointParams ( const Line line0,
const Line line1,
double &  mu0,
double &  mu1 
)
inline

Definition at line 58 of file LineTool.h.

References DecayTreeFitter::Line::beginPoint(), DecayTreeFitter::Line::direction(), and fabs().

59 {
60  // lhs:
61 
62  bool OK = true;
63 
64  // the matrix:
65  const double a00 = line0.direction().Mag2();
66  const double a10 = line0.direction().Dot(line1.direction());
67  const double a01 = -a10;
68  const double a11 = -line1.direction().Mag2();
69 
70  // the inverse determinant:
71  const double det = (a00 * a11 - a01 * a10); // det = -sin^2(angle(line0.dir,line1.dir))
72  if (std::fabs(det) < 1e-10) {
73  OK = false; // parallel
74  } else {
75 
76  const double detinv = 1.0 / det;
77 
78  // rhs:
79  const TVector3 p1_p0 = line1.beginPoint() - line0.beginPoint();
80 
81  const double b0 = p1_p0.Dot(line0.direction());
82  const double b1 = p1_p0.Dot(line1.direction());
83 
84  // get the Kramer solutions:
85 
86  mu0 = (b0 * a11 - b1 * a01) * detinv;
87  mu1 = (a00 * b1 - a10 * b0) * detinv;
88  }
89 
90  return OK;
91 }
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:46

◆ compTrkTransverseMomentum()

bool DecayTreeFitter::compTrkTransverseMomentum ( const RecoTrack lhs,
const RecoTrack rhs 
)
inline

Definition at line 36 of file SortTool.h.

References DecayTreeFitter::ParticleBase::particle(), and RhoCandidate::Pt().

37 {
38  return lhs->particle()->Pt() > rhs->particle()->Pt();
39 }

◆ operator<<() [1/2]

std::ostream& DecayTreeFitter::operator<< ( std::ostream &  os,
const Line rhs 
)
inline

Definition at line 51 of file LineTool.h.

References DecayTreeFitter::Line::fillStream().

52 {
53  return rhs.fillStream(os);
54 }

◆ operator<<() [2/2]

std::ostream& DecayTreeFitter::operator<< ( std::ostream &  str,
const State obj 
)
inline

Definition at line 177 of file State.h.

References DecayTreeFitter::State::fillStream().

178 {
179  return obj.fillStream(str);
180 }

◆ sortByType()

bool DecayTreeFitter::sortByType ( const ParticleBase lhs,
const ParticleBase rhs 
)
inline

Definition at line 23 of file SortTool.h.

References DecayTreeFitter::ParticleBase::kRecoTrack, RhoCandidate::NDaughters(), DecayTreeFitter::ParticleBase::nFinalChargedCandidates(), DecayTreeFitter::ParticleBase::particle(), RhoCandidate::Pt(), and DecayTreeFitter::ParticleBase::type().

24 {
25  int lhstype = lhs->type();
26  int rhstype = rhs->type();
27  bool rc = false;
28  if (lhstype == rhstype && lhstype == ParticleBase::kRecoTrack)
29  rc = lhs->particle()->Pt() > rhs->particle()->Pt();
30  else if (lhs->particle()->NDaughters() > 0 && rhs->particle()->NDaughters() > 0)
31  rc = lhs->nFinalChargedCandidates() > rhs->nFinalChargedCandidates();
32  else
33  rc = lhstype < rhstype;
34  return rc;
35 }