KLFitter  v1.3.2
Documentation of the KLFitter library -- The Kinematic Likelihood Fitter
Public Types | Public Member Functions | Protected Member Functions | List of all members
KLFitter::LikelihoodTwoTracks Class Reference

This class implements a likelihood for the reconstruction of a particle decaying to two (oppositely) charged particles producing tracks in the detector. More...

#include <LikelihoodTwoTracks.h>

Inheritance diagram for KLFitter::LikelihoodTwoTracks:
KLFitter::LikelihoodBase

Public Types

enum  Parameters {
  parPiPlusPhi, parPiPlusTheta, parPiPlusP, parPiMinusPhi,
  parPiMinusTheta, parPiMinusP, parKShortM
}
 Enumerator for the parameters. More...
 
- Public Types inherited from KLFitter::LikelihoodBase
enum  BtaggingMethod {
  kNotag, kVeto, kVetoNoFit, kVetoNoFitLight,
  kVetoNoFitBoth, kVetoHybridNoFit, kWorkingPoint, kVetoLight,
  kVetoBoth
}
 Enumerate for b-tagging possibilities.
 

Public Member Functions

double Log3DGaus (double x0, double x1, double x2, double mean0, double mean1, double mean2, double sigma00, double sigma10, double sigma11, double sigma20, double sigma21, double sigma22)
 Calculate 3D Gaussian. More...
 
Constructors and destructors
 LikelihoodTwoTracks ()
 The default constructor.
 
 ~LikelihoodTwoTracks ()
 The (defaulted) destructor.
 
Member functions (BAT)
void DefineParameters () override
 Define the parameters of the fit.
 
double LogLikelihood (const std::vector< double > &parameters) override
 The posterior probability definition, overloaded from BCModel. More...
 
std::vector< double > LogLikelihoodComponents (std::vector< double > parameters) override
 The posterior probability definition, overloaded from BCModel. More...
 
std::vector< double > GetInitialParameters () override
 Get initial values for the parameters. More...
 
int SetET_miss_XY_SumET (double, double, double) override
 Dummy reimplementation of the base class function.
 
void RequestResolutionFunctions () override
 Dummy reimplementation from the base class.
 
int AdjustParameterRanges () override
 Dummy reimplementation of the base class function.
 
int SaveResolutionFunctions () override
 Dummy reimplementation of the base class function.
 
- Public Member Functions inherited from KLFitter::LikelihoodBase
 LikelihoodBase (Particles **particles=0)
 The default constructor. More...
 
virtual ~LikelihoodBase ()
 The default destructor.
 
KLFitter::PhysicsConstantsPhysicsConstants ()
 Return the table of physics constants. More...
 
KLFitter::DetectorBaseDetector ()
 Return the detector. More...
 
KLFitter::Particles ** PParticlesPermuted ()
 Return the set of measured particles. More...
 
KLFitter::ParticlesParticlesModel ()
 Return the set of model particles. More...
 
int NParticlesModel ()
 Return the number of model particles. More...
 
int NParameters ()
 Return the number of parameters. More...
 
double ParMin (int index)
 Return the lower boundary of a parameter. More...
 
double ParMax (int index)
 Return the upper boundary of a parameter. More...
 
BtaggingMethod GetBTagging ()
 Get flag to use b-tagging or not. More...
 
bool FlagIntegrate ()
 
int SetPhysicsConstants (KLFitter::PhysicsConstants *physicsconstants)
 Set the physics constants. More...
 
virtual int SetDetector (KLFitter::DetectorBase **detector)
 Set the detector. More...
 
int SetParticlesPermuted (KLFitter::Particles **particles)
 Set the measured particles. More...
 
int SetPermutations (std::unique_ptr< KLFitter::Permutations > *permutations)
 Set the permutation object. More...
 
int SetParameterRange (int index, double parmin, double parmax)
 Set the range of a model parameter. More...
 
int SetInitialParameters (std::vector< double > const &parameters)
 Set the initial values for the minimization, etc. More...
 
int SetInitialParametersNChains (std::vector< double > const &parameters, unsigned int nchains)
 Set the initial values for the minimization, etc. More...
 
int SetBTagging (BtaggingMethod btagmethod)
 Set which b-tagging you wish to use. More...
 
int SetFlagBTagging (bool flag)
 THIS IS AN OUTDATED METHOD - JUST HERE FOR BACKWARD COMPATIBILITY. More...
 
int SetFlagIsNan (bool flag)
 Set flag FlagIsNan. More...
 
bool GetFlagIsNan (void)
 Get flag FlagIsNan. More...
 
int SetFlagIntegrate (bool flag)
 Set flag to integrate or not. More...
 
void SetFlagUseJetMass (bool flag)
 Set flag to use measured jet masses (true) instead of parton masses (false);.
 
void PropagateBTaggingInformation ()
 Propagate the b-tagging information from the permuted (measured) particles to the model particles.
 
virtual double LogAPrioriProbability (const std::vector< double > &) override
 The prior probability definition, overloaded from BCModel. More...
 
virtual double LogEventProbability ()
 Return the log of the event probability fof the current combination. More...
 
virtual double LogEventProbabilityBTag ()
 Return the contribution from b tagging to the log of the event probability for the current combination. More...
 
virtual int RemoveForbiddenParticlePermutations ()
 Remove forbidden particle permutations. More...
 
virtual bool NoTFProblem (std::vector< double > parameters)
 Check if there are TF problems. More...
 
std::vector< double > GetBestFitParameters ()
 Returns the best fit parameters, overloaded from BCModel. More...
 
std::vector< double > GetBestFitParameterErrors ()
 Returns the errors of the best fit parameters, overloaded from BCModel. More...
 
double GetBestFitParameter (unsigned int index)
 Returns the best fit parameters, overloaded from BCModel. More...
 
double GetBestFitParameterError (unsigned int index)
 Returns the errors of the best fit parameter i, overloaded from BCModel. More...
 
virtual int LHInvariantPermutationPartner (int, int, int *, int *)
 Check if the permutation is LH invariant. More...
 
int GetParametersFromCache (int iperm)
 Write parameters from fCachedParametersVector.at(iperm) to fCachedParameters. More...
 
int SetParametersToCache (int iperm, int nperms)
 Write parameters to fCachedParametersVector.at(iperm) from GetBestFitParameter() More...
 
double GetIntegral ()
 
int ResetCache ()
 Resets the values of all parameter cache vectors. More...
 

Protected Member Functions

int CalculateLorentzVectors (const std::vector< double > &parameters) override
 Update 4-vectors of model particles. More...
 
int Initialize () override
 Initialize the likelihood for the event.
 
int DefineModelParticles () override
 Define the model particles. More...
 
int RemoveInvariantParticlePermutations () override
 Remove invariant particle permutations. More...
 
int BuildModelParticles () override
 Build the model particles from the best fit parameters. More...
 
int SavePermutedParticles () override
 Save permuted particles.
 
- Protected Member Functions inherited from KLFitter::LikelihoodBase
double SetPartonMass (double jetmass, double quarkmass, double *px, double *py, double *pz, double e)
 Set model parton mass according to fFlagUseJetMass. More...
 

Protected Attributes

Member attributes
const double m_pion_mass
 Mass of the pion.
 
const double m_kshort_mass
 Mass of k_short.
 
const double m_kshort_width
 Decay width of k_short.
 
Member attributes (measured parameters)
double m_t1_meas_phi
 
double m_t1_meas_theta
 
double m_t1_meas_p
 
double m_t1_meas_sigma00
 
double m_t1_meas_sigma10
 
double m_t1_meas_sigma11
 
double m_t1_meas_sigma20
 
double m_t1_meas_sigma21
 
double m_t1_meas_sigma22
 
double m_t2_meas_phi
 
double m_t2_meas_theta
 
double m_t2_meas_p
 
double m_t2_meas_sigma00
 
double m_t2_meas_sigma10
 
double m_t2_meas_sigma11
 
double m_t2_meas_sigma20
 
double m_t2_meas_sigma21
 
double m_t2_meas_sigma22
 
Member attributes (fitted parameters)
double m_t1_fit_phi
 
double m_t1_fit_theta
 
double m_t1_fit_p
 
double m_t1_fit_m
 
double m_t2_fit_phi
 
double m_t2_fit_theta
 
double m_t2_fit_p
 
double m_t2_fit_m
 
double m_ks_fit_m
 
- Protected Attributes inherited from KLFitter::LikelihoodBase
KLFitter::Particles ** fParticlesPermuted
 A pointer to the measured particles.
 
std::unique_ptr< KLFitter::Permutations > * fPermutations
 A pointer to the permutation object.
 
std::unique_ptr< KLFitter::ParticlesfParticlesModel
 A pointer to the model particles.
 
KLFitter::PhysicsConstants fPhysicsConstants
 A pointer to the table of physics constants.
 
KLFitter::DetectorBase ** fDetector
 A pointer to the detector.
 
std::vector< double > fEventProbability
 The event probabilities for the different permutations.
 
bool fFlagIntegrate
 A flag to integrate over the likelihood or not.
 
bool fFlagIsNan
 A flag for knowing that Minuit gave parameters with NaN values to LogLikelihood.
 
bool fFlagUseJetMass
 A flag for using the measured jet masses (true) instead of parton masses (false);.
 
bool fTFgood
 Global variable for TF problems.
 
BtaggingMethod fBTagMethod
 Name of btagging enum.
 
std::vector< double > fCachedParameters
 The cached parameters used for the current permutation.
 
std::vector< double > fCachedParameterErrors
 The cached parameter errors used for the current permutation.
 
std::vector< std::vector< double > > fCachedParametersVector
 A vector of cached parameters, one for each permutation. More...
 
std::vector< std::vector< double > > fCachedParameterErrorsVector
 A vector of cached parameter errors, one for each permutation. More...
 
double fCachedNormalization
 The cached normalization, needed for the overloaded BCIntegrate::GetIntegral.
 
std::vector< double > fCachedNormalizationVector
 A vector of cached parameters, one for each permutation. More...
 

Detailed Description

This class implements a likelihood for the reconstruction of a particle decaying to two (oppositely) charged particles producing tracks in the detector.

Per track, it uses the four-vector (usually constructed from phi, theta, and q/p assuming a charge of +/- 1 and pion/kaon mass) as well as the covariance matrix of the variables phi, theta, and q/p as parameters.

Member Enumeration Documentation

Enumerator for the parameters.

Enumerator
parPiPlusPhi 

First (positive) track phi.

parPiPlusTheta 

First (positive) track theta.

parPiPlusP 

First (positive) track momentum.

parPiMinusPhi 

Second (negative) track phi.

parPiMinusTheta 

Second (negative) track theta.

parPiMinusP 

Second (negative) track momentum.

parKShortM 

Mass of track particle.

Member Function Documentation

int KLFitter::LikelihoodTwoTracks::BuildModelParticles ( )
overrideprotectedvirtual

Build the model particles from the best fit parameters.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

int KLFitter::LikelihoodTwoTracks::CalculateLorentzVectors ( const std::vector< double > &  parameters)
overrideprotectedvirtual

Update 4-vectors of model particles.

Returns
An error flag.

Implements KLFitter::LikelihoodBase.

int KLFitter::LikelihoodTwoTracks::DefineModelParticles ( )
overrideprotectedvirtual

Define the model particles.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

std::vector< double > KLFitter::LikelihoodTwoTracks::GetInitialParameters ( )
overridevirtual

Get initial values for the parameters.

Returns
vector of initial values.

Implements KLFitter::LikelihoodBase.

double KLFitter::LikelihoodTwoTracks::Log3DGaus ( double  x0,
double  x1,
double  x2,
double  mean0,
double  mean1,
double  mean2,
double  sigma00,
double  sigma10,
double  sigma11,
double  sigma20,
double  sigma21,
double  sigma22 
)

Calculate 3D Gaussian.

Parameters
x0First variable point of evalulation
x1Second variable point of evaluation
x2Third variable point of evaluation
mean0First variable mean of distribution
mean1Second variable mean of distribution
mean2Third variable mean of distribution
sigma00First variable variance squared
sigma10Covariance of first and second variable
sigma11Second variable variance squared
sigma20Covariance of first and third variable
sigma21Covariance of second and third variable
sigma22Third variable variance squared
Returns
Evaluated value of the 3D Gaussian
double KLFitter::LikelihoodTwoTracks::LogLikelihood ( const std::vector< double > &  parameters)
overridevirtual

The posterior probability definition, overloaded from BCModel.

Parameters
parametersA vector of parameters (double values).
Returns
The logarithm of the prior probability.

Implements KLFitter::LikelihoodBase.

std::vector< double > KLFitter::LikelihoodTwoTracks::LogLikelihoodComponents ( std::vector< double >  parameters)
overridevirtual

The posterior probability definition, overloaded from BCModel.

Split up into several subcomponents.

Parameters
parametersA vector of parameters (double values).
Returns
A vector with the components of the logarithm of the prior probability. Its components are:
0) TF_bhad
1) TF_blep
2) TF_lq1
3) TF_lq2
4) TF_lep
5) TF_METx
6) TF_METy
7) BW_Whad
8) BW_Wlep
9) BW_Thad
10) BW_Tlep

Implements KLFitter::LikelihoodBase.

int KLFitter::LikelihoodTwoTracks::RemoveInvariantParticlePermutations ( )
overrideprotectedvirtual

Remove invariant particle permutations.

Returns
An error code.

Implements KLFitter::LikelihoodBase.


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