KLFitter
v1.3.2
Documentation of the KLFitter library -- The Kinematic Likelihood Fitter
|
A base class for likelihoods. More...
#include <LikelihoodBase.h>
Public Types | |
enum | BtaggingMethod { kNotag, kVeto, kVetoNoFit, kVetoNoFitLight, kVetoNoFitBoth, kVetoHybridNoFit, kWorkingPoint, kVetoLight, kVetoBoth } |
Enumerate for b-tagging possibilities. | |
Public Member Functions | |
Constructors and destructors | |
LikelihoodBase (Particles **particles=0) | |
The default constructor. More... | |
virtual | ~LikelihoodBase () |
The default destructor. | |
Member functions (Get) | |
KLFitter::PhysicsConstants * | PhysicsConstants () |
Return the table of physics constants. More... | |
KLFitter::DetectorBase * | Detector () |
Return the detector. More... | |
KLFitter::Particles ** | PParticlesPermuted () |
Return the set of measured particles. More... | |
KLFitter::Particles * | ParticlesModel () |
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 () |
Member functions (Set) | |
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... | |
virtual int | SetET_miss_XY_SumET (double etx, double ety, double sumet)=0 |
Set the values for the missing ET x and y components and the SumET. 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 ¶meters) |
Set the initial values for the minimization, etc. More... | |
int | SetInitialParametersNChains (std::vector< double > const ¶meters, 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);. | |
Member functions (misc) | |
virtual int | CalculateLorentzVectors (std::vector< double > const ¶meters)=0 |
Update 4-vectors of model particles. More... | |
virtual int | Initialize () |
Initialize the likelihood for the event. More... | |
virtual int | AdjustParameterRanges ()=0 |
Adjust parameter ranges. | |
virtual int | DefineModelParticles ()=0 |
Define the model particles. More... | |
void | PropagateBTaggingInformation () |
Propagate the b-tagging information from the permuted (measured) particles to the model particles. | |
virtual void | RequestResolutionFunctions ()=0 |
Request necessary resolution functions from the detector. More... | |
Member functions (BAT) | |
virtual void | DefineParameters ()=0 |
Define the parameters of the fit. | |
virtual double | LogAPrioriProbability (const std::vector< double > &) override |
The prior probability definition, overloaded from BCModel. More... | |
virtual double | LogLikelihood (const std::vector< double > ¶meters) override=0 |
The posterior probability definition, overloaded from BCModel. More... | |
virtual std::vector< double > | LogLikelihoodComponents (std::vector< double > parameters)=0 |
The posterior 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 | RemoveInvariantParticlePermutations ()=0 |
Remove invariant particle permutations. More... | |
virtual int | RemoveForbiddenParticlePermutations () |
Remove forbidden particle permutations. More... | |
virtual int | BuildModelParticles ()=0 |
Build the model particles from the best fit parameters. More... | |
virtual std::vector< double > | GetInitialParameters ()=0 |
Get initial values for the parameters. 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 | |
virtual int | SavePermutedParticles ()=0 |
Save permuted particles. | |
virtual int | SaveResolutionFunctions ()=0 |
Save resolution functions. | |
double | SetPartonMass (double jetmass, double quarkmass, double *px, double *py, double *pz, double e) |
Set model parton mass according to fFlagUseJetMass. More... | |
Protected Attributes | |
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::Particles > | fParticlesModel |
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... | |
A base class for likelihoods.
|
explicit |
The default constructor.
particles | A pointer to the measured particles. |
|
pure virtual |
Build the model particles from the best fit parameters.
Implemented in KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodTopAllHadronic, KLFitter::LikelihoodTwoTracks, and KLFitter::LikelihoodOneHadronicTop.
|
pure virtual |
Update 4-vectors of model particles.
Implemented in KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodOneHadronicTop, KLFitter::LikelihoodTopLeptonJets_JetAngles, KLFitter::LikelihoodTopAllHadronic, and KLFitter::LikelihoodTwoTracks.
|
pure virtual |
Define the model particles.
Implemented in KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodTopLeptonJetsUDSep, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodOneHadronicTop, KLFitter::LikelihoodTopAllHadronic, and KLFitter::LikelihoodTwoTracks.
|
inline |
Return the detector.
double KLFitter::LikelihoodBase::GetBestFitParameter | ( | unsigned int | index | ) |
Returns the best fit parameters, overloaded from BCModel.
double KLFitter::LikelihoodBase::GetBestFitParameterError | ( | unsigned int | index | ) |
Returns the errors of the best fit parameter i, overloaded from BCModel.
std::vector< double > KLFitter::LikelihoodBase::GetBestFitParameterErrors | ( | ) |
Returns the errors of the best fit parameters, overloaded from BCModel.
std::vector< double > KLFitter::LikelihoodBase::GetBestFitParameters | ( | ) |
Returns the best fit parameters, overloaded from BCModel.
|
inline |
Get flag to use b-tagging or not.
|
inline |
Get flag FlagIsNan.
This Flag should be true if Minuit gave parameters with NaN values to LogLikelihood.
|
pure virtual |
Get initial values for the parameters.
Implemented in KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodTopAllHadronic, KLFitter::LikelihoodTwoTracks, KLFitter::LikelihoodTopLeptonJets, and KLFitter::LikelihoodOneHadronicTop.
double KLFitter::LikelihoodBase::GetIntegral | ( | ) |
int KLFitter::LikelihoodBase::GetParametersFromCache | ( | int | iperm | ) |
Write parameters from fCachedParametersVector.at(iperm) to fCachedParameters.
iperm | Current permutation |
|
virtual |
Initialize the likelihood for the event.
Reimplemented in KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodSgTopWtLJ, and KLFitter::LikelihoodTwoTracks.
|
inlinevirtual |
Check if the permutation is LH invariant.
iperm | Current permutation |
nperms | Total number of permutations |
switchpar1 | ??? |
switchpar2 | ??? |
Reimplemented in KLFitter::LikelihoodTopLeptonJetsUDSep.
|
inlineoverridevirtual |
The prior probability definition, overloaded from BCModel.
parameters | A vector of parameters (double values). |
|
virtual |
Return the log of the event probability fof the current combination.
Reimplemented in KLFitter::LikelihoodTopLeptonJetsUDSep.
|
virtual |
Return the contribution from b tagging to the log of the event probability for the current combination.
Reimplemented in KLFitter::LikelihoodTopLeptonJetsUDSep.
|
overridepure virtual |
The posterior probability definition, overloaded from BCModel.
parameters | A vector of parameters (double values). |
Implemented in KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodTopAllHadronic, KLFitter::LikelihoodOneHadronicTop, KLFitter::LikelihoodTwoTracks, KLFitter::LikelihoodTopLeptonJets_JetAngles, and KLFitter::LikelihoodTopLeptonJets_Angular.
|
pure virtual |
The posterior probability definition, overloaded from BCModel.
Split up into several subcomponents
parameters | A vector of parameters (double values). |
Implemented in KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTHLeptonJets, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodTopLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodTopAllHadronic, KLFitter::LikelihoodTopLeptonJets_JetAngles, KLFitter::LikelihoodTwoTracks, and KLFitter::LikelihoodOneHadronicTop.
|
virtual |
Check if there are TF problems.
|
inline |
Return the number of parameters.
|
inline |
Return the number of model particles.
double KLFitter::LikelihoodBase::ParMax | ( | int | index | ) |
Return the upper boundary of a parameter.
index | The index of the parameter. |
double KLFitter::LikelihoodBase::ParMin | ( | int | index | ) |
Return the lower boundary of a parameter.
index | The index of the parameter. |
|
inline |
Return the set of model particles.
|
inline |
Return the table of physics constants.
|
inline |
Return the set of measured particles.
|
virtual |
Remove forbidden particle permutations.
Reimplemented in KLFitter::LikelihoodTopLeptonJetsUDSep.
|
pure virtual |
Remove invariant particle permutations.
Implemented in KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodTopLeptonJetsUDSep, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodOneHadronicTop, KLFitter::LikelihoodTopAllHadronic, and KLFitter::LikelihoodTwoTracks.
|
pure virtual |
Request necessary resolution functions from the detector.
Implemented in KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodOneHadronicTop, KLFitter::LikelihoodTwoTracks, KLFitter::LikelihoodTopLeptonJets_JetAngles, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, and KLFitter::LikelihoodTopAllHadronic.
int KLFitter::LikelihoodBase::ResetCache | ( | ) |
Resets the values of all parameter cache vectors.
|
inline |
Set which b-tagging you wish to use.
btagmethod | The enum of btagging method. |
|
virtual |
Set the detector.
detector | A pointer to a pointer of the detector. |
|
pure virtual |
Set the values for the missing ET x and y components and the SumET.
etx | missing ET x component. |
ety | missing ET y component. |
sumet | total scalar ET. |
Implemented in KLFitter::LikelihoodTopLeptonJets, KLFitter::LikelihoodOneHadronicTop, KLFitter::LikelihoodTwoTracks, KLFitter::LikelihoodSgTopWtLJ, KLFitter::LikelihoodTTZTrilepton, KLFitter::LikelihoodTopDilepton, KLFitter::LikelihoodTTHLeptonJets, KLFitter::BoostedLikelihoodTopLeptonJets, and KLFitter::LikelihoodTopAllHadronic.
|
inline |
THIS IS AN OUTDATED METHOD - JUST HERE FOR BACKWARD COMPATIBILITY.
Set flag to use b-tagging or not.
flag | The flag. |
|
inline |
Set flag to integrate or not.
flag | The flag. |
|
inline |
Set flag FlagIsNan.
This Flag should be true if Minuit gave parameters with NaN values to LogLikelihood.
flag | The flag. |
int KLFitter::LikelihoodBase::SetInitialParameters | ( | std::vector< double > const & | parameters | ) |
Set the initial values for the minimization, etc.
parameters | The initial values. |
int KLFitter::LikelihoodBase::SetInitialParametersNChains | ( | std::vector< double > const & | parameters, |
unsigned int | nchains | ||
) |
Set the initial values for the minimization, etc.
for each chain
parameters | The initial values. |
nchains | The number of chains. |
int KLFitter::LikelihoodBase::SetParameterRange | ( | int | index, |
double | parmin, | ||
double | parmax | ||
) |
Set the range of a model parameter.
index | The index of the parameter. |
parmin | The minimum value. |
parmax | The maximum value. |
int KLFitter::LikelihoodBase::SetParametersToCache | ( | int | iperm, |
int | nperms | ||
) |
Write parameters to fCachedParametersVector.at(iperm) from GetBestFitParameter()
iperm | Current permutation |
nperms | Number of permutations |
int KLFitter::LikelihoodBase::SetParticlesPermuted | ( | KLFitter::Particles ** | particles | ) |
Set the measured particles.
particles | The measured particles. |
|
protected |
Set model parton mass according to fFlagUseJetMass.
jetmass | The jet mass. |
quarkmass | The quark mass. |
px | The parton px (will be modified, if necessary). |
py | The parton py (will be modified, if necessary). |
pz | The parton pz (will be modified, if necessary). |
e | The parton energy (not modified). |
int KLFitter::LikelihoodBase::SetPermutations | ( | std::unique_ptr< KLFitter::Permutations > * | permutations | ) |
Set the permutation object.
permutations | The permutation object. |
int KLFitter::LikelihoodBase::SetPhysicsConstants | ( | KLFitter::PhysicsConstants * | physicsconstants | ) |
Set the physics constants.
physicsconstants | A pointer to physics constants. |
|
protected |
A vector of cached parameters, one for each permutation.
Has to be set via fitter.
|
protected |
A vector of cached parameter errors, one for each permutation.
Has to be set via fitter.
|
protected |
A vector of cached parameters, one for each permutation.
Has to be set via fitter.