PandaRoot
DecayTreeFitter::Fitter Class Reference

#include <Fitter.h>

Inheritance diagram for DecayTreeFitter::Fitter:
RhoFitterBase RhoDecayTreeFitter

Public Types

enum  FitStatus {
  UnFitted = -1, Success = 0, Failed, BadInput,
  NonConverged
}
 

Public Member Functions

 Fitter (RhoCandidate *bc, RecoTrackStateProvider *extrapolator, int verbosity=0)
 constructor from the particle (decay head) More...
 
 Fitter (RhoCandidate *bc, const RhoVector3Err &pv, RecoTrackStateProvider *extrapolator=nullptr, int verbosity=0)
 constructor from the particle (decay head) and primary vertex More...
 
 Fitter (RhoCandidate *bc, const RhoLorentzVectorErr &lv, RecoTrackStateProvider *extrapolator, int verbosity=0)
 constructor from the particle (decay head) and pbeam More...
 
 Fitter (RhoCandidate *bc, const RhoLorentzVectorErr &lv, const RhoVector3Err &pv, RecoTrackStateProvider *extrapolator=nullptr, int verbosity=0)
 constructor from the particle (decay head), pbeam and primary vertex More...
 
virtual ~Fitter ()
 destructor More...
 
void setMassConstraint (RhoCandidate *cand, bool add=true)
 Add or remove a mass constraint. More...
 
void setMassConstraint (RhoCandidate *cand, double mass)
 Add a constraint to a mass different from the property table mass. More...
 
Bool_t Fit (int maxNumberOfIterations=10, double deltaChisquareConverged=0.01)
 Add or remove a mass constraintfor a certain ParticleID. More...
 
Bool_t FitAll (int maxit=10, double dchiq=0.01)
 
std::string print () const
 Print the result of the fit. More...
 
std::ostream & fillStream (std::ostream &s) const
 Print the result of the fit. More...
 
RhoCandidateparticle () const
 The top level particle that is fitted. More...
 
RhoCandidatefitParams (RhoCandidate *p=0) const
 
double chiSquare () const
 Total chisquare. More...
 
int nDof () const
 Total number of DOFs. More...
 
FitStatus status () const
 Status of fit. More...
 
int nIter () const
 Number of iterations used by vertex fit. More...
 
ChiSquare chiSquare (RhoCandidate *p) const
 get the chisquare of everything 'downstream' of a particle More...
 
RhoDoubleErr decayLengthSum (RhoCandidate *, RhoCandidate *) const
 
bool updateCand (RhoCandidate *cand) const
 update a particlular candidate in the tree More...
 
bool updateTree (RhoCandidate *cand) const
 update a particlular candidate in the tree More...
 
int errCode ()
 error code More...
 
void setVerbose (int i)
 set the verbosity level (for debugging only) More...
 
void SetToleranceZ (double z)
 
DecayChainGetDecayChainDirty ()
 
RecoTrackStateProviderextrapolator ()
 get the extrapolator More...
 
void setStateProvider (RecoTrackStateProvider *extrapolator)
 set the track extrapolator More...
 
- Public Member Functions inherited from RhoFitterBase
 RhoFitterBase ()
 
 RhoFitterBase (RhoCandidate *decayTree)
 
 RhoFitterBase (const RhoFitterBase &)
 
 ~RhoFitterBase ()
 
Bool_t Fit ()
 
Bool_t FitAll ()
 
double Chi2Contribution (const RhoCandidate *)
 
double GetChi2 () const
 
int GetNdf () const
 
double GetProb () const
 
void SetVerbose (Bool_t v=kTRUE)
 

Protected Member Functions

std::string name (RhoCandidate *cand) const
 Name of a particle in the decay tree. More...
 
RhoDoubleErr decayLengthSum (const ParticleBase &, const ParticleBase &) const
 
DecayChaindecaychain ()
 
FitParamsfitparams ()
 
const DecayChaindecaychain () const
 
const FitParamsfitparams () const
 
double globalChiSquare () const
 
double add (RhoCandidate *cand)
 
double remove (RhoCandidate *cand)
 
void updateIndex ()
 
void fit (int maxNumberOfIterations=10, double deltaChisquareConverged=0.01)
 Fit the decay tree. More...
 
void fitOneStep ()
 Fit just one step. More...
 
RhoCandidatefittedCand (RhoCandidate *cand, RhoCandidate *headoftree) const
 
void updateCand (const ParticleBase &pb, RhoCandidate *cand) const
 
- Protected Member Functions inherited from RhoFitterBase
RhoCandidateHeadOfTree () const
 
virtual Bool_t FitNode (RhoCandidate *b)
 
RhoCandidateCopyCand (RhoCandidate *)
 uppermost particle composite in tree More...
 
RhoCandidateCopyTree (RhoCandidate *)
 
void InsertChi2 (const RhoCandidate *bc, const double chi2)
 
void SetDaugthersFromComposite (RhoCandidate *cand)
 
void FindAndAddFinalStateDaughters (RhoCandidate *cand)
 
void SetFourMomentumByDaughters (RhoCandidate *composite)
 
void SetDecayVertex (RhoCandidate *composite, const TVector3 &vtx, const TMatrixD &CovVV)
 

Protected Attributes

RecoTrackStateProviderm_extrapolator
 track extrapolator (if needed) More...
 
- Protected Attributes inherited from RhoFitterBase
Bool_t fVerbose
 
RhoCandidatefHeadOfTree
 
std::vector< RhoCandidate * > fDaughters
 
double fChiSquare
 
int fNDegreesOfFreedom
 

Detailed Description

``Decay-Tree-Fitter''`

Author
Wouter Hulsbergen Woute.nosp@m.r.Hu.nosp@m.lsber.nosp@m.gen@.nosp@m.nikhe.nosp@m.f.nl

Definition at line 54 of file Fitter.h.

Member Enumeration Documentation

◆ FitStatus

Constructor & Destructor Documentation

◆ Fitter() [1/4]

DecayTreeFitter::Fitter::Fitter ( RhoCandidate bc,
RecoTrackStateProvider extrapolator,
int  verbosity = 0 
)

constructor from the particle (decay head)

◆ Fitter() [2/4]

DecayTreeFitter::Fitter::Fitter ( RhoCandidate bc,
const RhoVector3Err pv,
RecoTrackStateProvider extrapolator = nullptr,
int  verbosity = 0 
)

constructor from the particle (decay head) and primary vertex

◆ Fitter() [3/4]

DecayTreeFitter::Fitter::Fitter ( RhoCandidate bc,
const RhoLorentzVectorErr lv,
RecoTrackStateProvider extrapolator,
int  verbosity = 0 
)

constructor from the particle (decay head) and pbeam

◆ Fitter() [4/4]

DecayTreeFitter::Fitter::Fitter ( RhoCandidate bc,
const RhoLorentzVectorErr lv,
const RhoVector3Err pv,
RecoTrackStateProvider extrapolator = nullptr,
int  verbosity = 0 
)

constructor from the particle (decay head), pbeam and primary vertex

◆ ~Fitter()

virtual DecayTreeFitter::Fitter::~Fitter ( )
virtual

destructor

Member Function Documentation

◆ add()

double DecayTreeFitter::Fitter::add ( RhoCandidate cand)
protected

Referenced by fitparams().

◆ chiSquare() [1/2]

double DecayTreeFitter::Fitter::chiSquare ( ) const
inline

Total chisquare.

Definition at line 104 of file Fitter.h.

References RhoFitterBase::fChiSquare, and nDof().

Referenced by nIter().

104 { return fChiSquare; }
double fChiSquare
Definition: RhoFitterBase.h:72

◆ chiSquare() [2/2]

ChiSquare DecayTreeFitter::Fitter::chiSquare ( RhoCandidate p) const

get the chisquare of everything 'downstream' of a particle

◆ decaychain() [1/2]

DecayChain* DecayTreeFitter::Fitter::decaychain ( )
inlineprotected

Definition at line 167 of file Fitter.h.

167 { return m_decaychain; }

◆ decaychain() [2/2]

const DecayChain* DecayTreeFitter::Fitter::decaychain ( ) const
inlineprotected

Definition at line 169 of file Fitter.h.

169 { return m_decaychain; }

◆ decayLengthSum() [1/2]

RhoDoubleErr DecayTreeFitter::Fitter::decayLengthSum ( RhoCandidate ,
RhoCandidate  
) const

Compute the decay length sum of two particles in the decay tree (useful for e.g. B->DD)

Referenced by extrapolator(), and nIter().

◆ decayLengthSum() [2/2]

RhoDoubleErr DecayTreeFitter::Fitter::decayLengthSum ( const ParticleBase ,
const ParticleBase  
) const
protected

◆ errCode()

int DecayTreeFitter::Fitter::errCode ( )
inline

error code

Definition at line 137 of file Fitter.h.

References i, and setVerbose().

137 { return m_errCode; }

◆ extrapolator()

RecoTrackStateProvider* DecayTreeFitter::Fitter::extrapolator ( )
inline

get the extrapolator

Definition at line 153 of file Fitter.h.

References decayLengthSum(), m_extrapolator, name(), and setStateProvider().

153 { return m_extrapolator; }
RecoTrackStateProvider * m_extrapolator
track extrapolator (if needed)
Definition: Fitter.h:213

◆ fillStream()

std::ostream& DecayTreeFitter::Fitter::fillStream ( std::ostream &  s) const

Print the result of the fit.

Referenced by FitAll().

◆ Fit()

Bool_t DecayTreeFitter::Fitter::Fit ( int  maxNumberOfIterations = 10,
double  deltaChisquareConverged = 0.01 
)
inline

Add or remove a mass constraintfor a certain ParticleID.

Add a constraint to a mass different from the property table mass Fit the decay tree

Definition at line 83 of file Fitter.h.

References fit(), and updateTree().

84  {
85  fit(maxNumberOfIterations, deltaChisquareConverged);
86  bool check = updateTree(m_particle);
87  check = check && (m_status == 0);
88  return check;
89  };
bool updateTree(RhoCandidate *cand) const
update a particlular candidate in the tree
void fit(int maxNumberOfIterations=10, double deltaChisquareConverged=0.01)
Fit the decay tree.

◆ fit()

void DecayTreeFitter::Fitter::fit ( int  maxNumberOfIterations = 10,
double  deltaChisquareConverged = 0.01 
)
protected

Fit the decay tree.

Referenced by Fit(), and fitparams().

◆ FitAll()

Bool_t DecayTreeFitter::Fitter::FitAll ( int  maxit = 10,
double  dchiq = 0.01 
)
inline

Definition at line 90 of file Fitter.h.

References fillStream(), RhoFitterBase::Fit(), and print().

90 { return Fit(maxit, dchiq); };
Bool_t Fit()

◆ fitOneStep()

void DecayTreeFitter::Fitter::fitOneStep ( )
protected

Fit just one step.

Referenced by fitparams().

◆ fitParams()

RhoCandidate* DecayTreeFitter::Fitter::fitParams ( RhoCandidate p = 0) const
inline

Currently the only accessor to the actual fitted data

Parameters
p(INPUT) the particle the fitted parameters ( 0 for invaild parameters/fits)

Definition at line 101 of file Fitter.h.

References RhoCandidate::GetFit().

101 { return p->GetFit(); };
RhoCandidate * GetFit() const
Definition: RhoCandidate.h:287

◆ fitparams() [1/2]

FitParams* DecayTreeFitter::Fitter::fitparams ( )
inlineprotected

Definition at line 168 of file Fitter.h.

168 { return m_fitparams; }

◆ fitparams() [2/2]

const FitParams* DecayTreeFitter::Fitter::fitparams ( ) const
inlineprotected

Definition at line 170 of file Fitter.h.

References add(), fit(), fitOneStep(), fittedCand(), globalChiSquare(), updateCand(), and updateIndex().

170 { return m_fitparams; }

◆ fittedCand()

RhoCandidate* DecayTreeFitter::Fitter::fittedCand ( RhoCandidate cand,
RhoCandidate headoftree 
) const
protected

Referenced by fitparams().

◆ GetDecayChainDirty()

DecayChain* DecayTreeFitter::Fitter::GetDecayChainDirty ( )
inline

Definition at line 147 of file Fitter.h.

147 { return m_decaychain; }

◆ globalChiSquare()

double DecayTreeFitter::Fitter::globalChiSquare ( ) const
protected

Referenced by fitparams().

◆ name()

std::string DecayTreeFitter::Fitter::name ( RhoCandidate cand) const
protected

Name of a particle in the decay tree.

Referenced by extrapolator().

◆ nDof()

int DecayTreeFitter::Fitter::nDof ( ) const

Total number of DOFs.

Referenced by chiSquare().

◆ nIter()

int DecayTreeFitter::Fitter::nIter ( ) const
inline

Number of iterations used by vertex fit.

Definition at line 110 of file Fitter.h.

References chiSquare(), decayLengthSum(), updateCand(), and updateTree().

110 { return m_niter; }

◆ particle()

RhoCandidate* DecayTreeFitter::Fitter::particle ( ) const
inline

The top level particle that is fitted.

Definition at line 96 of file Fitter.h.

96 { return m_particle; }

◆ print()

std::string DecayTreeFitter::Fitter::print ( ) const

Print the result of the fit.

Referenced by FitAll().

◆ remove()

double DecayTreeFitter::Fitter::remove ( RhoCandidate cand)
protected

◆ setMassConstraint() [1/2]

void DecayTreeFitter::Fitter::setMassConstraint ( RhoCandidate cand,
bool  add = true 
)

Add or remove a mass constraint.

◆ setMassConstraint() [2/2]

void DecayTreeFitter::Fitter::setMassConstraint ( RhoCandidate cand,
double  mass 
)

Add a constraint to a mass different from the property table mass.

◆ setStateProvider()

void DecayTreeFitter::Fitter::setStateProvider ( RecoTrackStateProvider extrapolator)

set the track extrapolator

Referenced by extrapolator().

◆ SetToleranceZ()

void DecayTreeFitter::Fitter::SetToleranceZ ( double  z)
inline

Definition at line 140 of file Fitter.h.

References m_extrapolator, and DecayTreeFitter::RecoTrackStateProvider::SetToleranceZ().

141  {
142  if (m_extrapolator)
144  };
RecoTrackStateProvider * m_extrapolator
track extrapolator (if needed)
Definition: Fitter.h:213

◆ setVerbose()

void DecayTreeFitter::Fitter::setVerbose ( int  i)

set the verbosity level (for debugging only)

Referenced by errCode().

◆ status()

FitStatus DecayTreeFitter::Fitter::status ( ) const
inline

Status of fit.

Definition at line 108 of file Fitter.h.

108 { return m_status; }

◆ updateCand() [1/2]

bool DecayTreeFitter::Fitter::updateCand ( RhoCandidate cand) const

update a particlular candidate in the tree

return an updated decay tree. this is not a final solution. will try to move more info to Particle methods to retrieve the result in terms of RhoCandidates (note: mother vertex is not updated, and decay length cannot be stored anywhere. Use fitParams instead methods to retrieve the result in terms of RhoCandidates (note: mother vertex is not updated, and decay length cannot be stored anywhere. Use fitParams instead

Referenced by fitparams(), and nIter().

◆ updateCand() [2/2]

void DecayTreeFitter::Fitter::updateCand ( const ParticleBase pb,
RhoCandidate cand 
) const
protected

◆ updateIndex()

void DecayTreeFitter::Fitter::updateIndex ( )
protected

Referenced by fitparams().

◆ updateTree()

bool DecayTreeFitter::Fitter::updateTree ( RhoCandidate cand) const

update a particlular candidate in the tree

Referenced by Fit(), and nIter().

Member Data Documentation

◆ m_extrapolator

RecoTrackStateProvider* DecayTreeFitter::Fitter::m_extrapolator
protected

track extrapolator (if needed)

Definition at line 213 of file Fitter.h.

Referenced by extrapolator(), and SetToleranceZ().


The documentation for this class was generated from the following file: