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

A class implementing a likelihood for the ttZ trilepton channel. More...

#include <LikelihoodTTZTrilepton.h>

Inheritance diagram for KLFitter::LikelihoodTTZTrilepton:
KLFitter::LikelihoodBase

Public Member Functions

Constructors and destructors
 LikelihoodTTZTrilepton ()
 The default constructor.
 
 ~LikelihoodTTZTrilepton ()
 The (defaulted) destructor.
 
Member functions (Get)
double GetInvMassCutoff ()
 Get the cut-off value of the 1/E^2 distribution.
 
float GetOnShellFraction ()
 Get the fraction of on-shell events.
 
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...
 
std::vector< double > GetInitialParametersWoNeutrinoPz ()
 Get initial values for the parameters with a dummy of "0.0" for the neutrino pz. More...
 
- 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);.
 
virtual int Initialize ()
 Initialize the likelihood for the event. More...
 
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

std::vector< double > GetNeutrinoPzSolutions ()
 Return the neutrino pz solutions from the measured values and the W mass. More...
 
std::vector< double > CalculateNeutrinoPzSolutions (TLorentzVector *additionalParticle=0x0)
 Calculates the neutrino pz solutions from the measured values and the W mass. More...
 
int SavePermutedParticles () override
 Save permuted particles.
 
int SaveResolutionFunctions () override
 Save resolution functions.
 
Member functions (misc)
double LogBreitWignerRelNorm (const double &x, const double &mean, const double &gamma)
 Provide a local modification of BCMath::LogBreitWignerRel such that the relativistic Breit-Wigner distribution is normalised to 1. More...
 
double LogZCombinedDistribution (const double &x, const double &mean, const double &gamma)
 Evaluate a combined Z/y invariant mass distribution. More...
 
int CalculateLorentzVectors (std::vector< double > const &parameters) override
 Update 4-vectors of model particles. More...
 
int AdjustParameterRanges () override
 Adjust parameter ranges.
 
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...
 
- 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

bool fFlagTopMassFixed
 A flag for using a fixed top mass (true) or not (false).
 
bool fFlagGetParSigmasFromTFs
 Flag for using ResolutionBase::GetSigma() to retrieve the parameter ranges.
 
double ETmiss_x
 The values of the x component of the missing ET.
 
double ETmiss_y
 The values of the y component of the missing ET.
 
double SumET
 The values of the total scalar ET.
 
LeptonType fTypeLepton
 An index deciding if the event is electron (1) or muon (2) plus jets.
 
double fInvMassCutoff
 Cut-off value for the 1/E^2 distribution (in GeV).
 
double fOnShellFraction
 Fraction of on-shell events, i.e. More...
 
ResolutionBasefResEnergyBhad
 Save resolution functions since the eta of the partons is not fitted.
 
ResolutionBasefResEnergyBlep
 
ResolutionBasefResEnergyLQ1
 
ResolutionBasefResEnergyLQ2
 
ResolutionBasefResLeptonZ1
 
ResolutionBasefResLeptonZ2
 
ResolutionBasefResLepton
 
ResolutionBasefResMET
 
double bhad_meas_e
 Save measured particle values for frequent calls.
 
double bhad_meas_p
 
double bhad_meas_m
 
double bhad_meas_deteta
 
double bhad_meas_eta
 
double bhad_meas_phi
 
double bhad_meas_px
 
double bhad_meas_py
 
double bhad_meas_pz
 
double blep_meas_e
 
double blep_meas_p
 
double blep_meas_m
 
double blep_meas_deteta
 
double blep_meas_eta
 
double blep_meas_phi
 
double blep_meas_px
 
double blep_meas_py
 
double blep_meas_pz
 
double lq1_meas_e
 
double lq1_meas_p
 
double lq1_meas_m
 
double lq1_meas_deteta
 
double lq1_meas_eta
 
double lq1_meas_phi
 
double lq1_meas_px
 
double lq1_meas_py
 
double lq1_meas_pz
 
double lq2_meas_e
 
double lq2_meas_p
 
double lq2_meas_m
 
double lq2_meas_deteta
 
double lq2_meas_eta
 
double lq2_meas_phi
 
double lq2_meas_px
 
double lq2_meas_py
 
double lq2_meas_pz
 
double lep_meas_e
 
double lep_meas_deteta
 
double lep_meas_sintheta
 
double lep_meas_pt
 
double lep_meas_px
 
double lep_meas_py
 
double lep_meas_pz
 
double lepZ1_meas_e
 
double lepZ1_meas_deteta
 
double lepZ1_meas_sintheta
 
double lepZ1_meas_pt
 
double lepZ1_meas_px
 
double lepZ1_meas_py
 
double lepZ1_meas_pz
 
double lepZ2_meas_e
 
double lepZ2_meas_deteta
 
double lepZ2_meas_sintheta
 
double lepZ2_meas_pt
 
double lepZ2_meas_px
 
double lepZ2_meas_py
 
double lepZ2_meas_pz
 
double bhad_fit_e
 Save fit particle values for frequent calls.
 
double bhad_fit_px
 
double bhad_fit_py
 
double bhad_fit_pz
 
double blep_fit_e
 
double blep_fit_px
 
double blep_fit_py
 
double blep_fit_pz
 
double lq1_fit_e
 
double lq1_fit_px
 
double lq1_fit_py
 
double lq1_fit_pz
 
double lq2_fit_e
 
double lq2_fit_px
 
double lq2_fit_py
 
double lq2_fit_pz
 
double lep_fit_e
 
double lep_fit_px
 
double lep_fit_py
 
double lep_fit_pz
 
double nu_fit_e
 
double nu_fit_px
 
double nu_fit_py
 
double nu_fit_pz
 
double whad_fit_m
 
double wlep_fit_m
 
double thad_fit_m
 
double tlep_fit_m
 
double lepZ1_fit_e
 
double lepZ1_fit_px
 
double lepZ1_fit_py
 
double lepZ1_fit_pz
 
double lepZ2_fit_e
 
double lepZ2_fit_px
 
double lepZ2_fit_py
 
double lepZ2_fit_pz
 
double Z_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...
 

Member functions (Set)

enum  LeptonType { kElectron, kMuon }
 Enumerator for the lepton type.
 
enum  Parameters {
  parBhadE, parBlepE, parLQ1E, parLQ2E,
  parLepE, parNuPx, parNuPy, parNuPz,
  parTopM, parLepZ1E, parLepZ2E, parZM
}
 Enumerator for the parameters.
 
int SetET_miss_XY_SumET (double etx, double ety, double sumet) override
 Set the values for the missing ET x and y components and the SumET. More...
 
void RequestResolutionFunctions () override
 Request the necessary resolution functions from the detector.
 
void SetInvMassCutoff (double cutoff)
 Set the cut-off value of the 1/E^2 distribution.
 
void SetOnShellFraction (double fraction)
 Set the fraction of on-shell events.
 
void SetFlagTopMassFixed (bool flag)
 Set a flag. More...
 
void SetFlagGetParSigmasFromTFs (bool flag)
 
void SetLeptonType (LeptonType leptontype)
 Set the type of lepton. More...
 
void SetLeptonType (int leptontype)
 Set the type of lepton. More...
 

Additional Inherited Members

- Public Types inherited from KLFitter::LikelihoodBase
enum  BtaggingMethod {
  kNotag, kVeto, kVetoNoFit, kVetoNoFitLight,
  kVetoNoFitBoth, kVetoHybridNoFit, kWorkingPoint, kVetoLight,
  kVetoBoth
}
 Enumerate for b-tagging possibilities.
 

Detailed Description

A class implementing a likelihood for the ttZ trilepton channel.

This class represents a KLFitter likelihood for the ttZ trilepton channel. It is largely based on the LikelihoodTopLeptonJets class.

Member Function Documentation

int KLFitter::LikelihoodTTZTrilepton::BuildModelParticles ( )
overrideprotectedvirtual

Build the model particles from the best fit parameters.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

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

Update 4-vectors of model particles.

Returns
An error flag.

Implements KLFitter::LikelihoodBase.

std::vector< double > KLFitter::LikelihoodTTZTrilepton::CalculateNeutrinoPzSolutions ( TLorentzVector *  additionalParticle = 0x0)
protected

Calculates the neutrino pz solutions from the measured values and the W mass.

An additional particle to be added to the charged lepton may be specified, for example a photon in ttbargamma, which is radiated from the leptonic W or the charged lepton;

Parameters
additionalParticlePointer to a 4-vector of a particle which is added to the charged lepton in the calculation
Returns
A vector with 0, 1 or 2 neutrino pz solutions.
int KLFitter::LikelihoodTTZTrilepton::DefineModelParticles ( )
overrideprotectedvirtual

Define the model particles.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

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

Get initial values for the parameters.

Returns
vector of initial values.

Implements KLFitter::LikelihoodBase.

std::vector< double > KLFitter::LikelihoodTTZTrilepton::GetInitialParametersWoNeutrinoPz ( )

Get initial values for the parameters with a dummy of "0.0" for the neutrino pz.

The decision on the initial value for the neutrino pz then needs to be done in GetInitialParameters().

Returns
vector of initial values.
std::vector< double > KLFitter::LikelihoodTTZTrilepton::GetNeutrinoPzSolutions ( )
protected

Return the neutrino pz solutions from the measured values and the W mass.

Returns
A vector with 0, 1 or 2 neutrino pz solutions.
double KLFitter::LikelihoodTTZTrilepton::LogBreitWignerRelNorm ( const double &  x,
const double &  mean,
const double &  gamma 
)
protected

Provide a local modification of BCMath::LogBreitWignerRel such that the relativistic Breit-Wigner distribution is normalised to 1.

The function then returns the log of this distribution.

Parameters
xValue to be evaluated.
meanThe mean of the distribution, i.e. Z pole mass.
gammaThe FWHM of the distribution, i.e. the Z decay width.
Returns
Log of the relativistic B-W.
double KLFitter::LikelihoodTTZTrilepton::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::LikelihoodTTZTrilepton::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_lepZ1 5: TF_lepZ2 6: TF_lep 7: TF_METx 8: TF_METy 9: BW_Whad 10: BW_Wlep 11: BW_Thad 12: BW_Tlep 13: BW_Z

Implements KLFitter::LikelihoodBase.

double KLFitter::LikelihoodTTZTrilepton::LogZCombinedDistribution ( const double &  x,
const double &  mean,
const double &  gamma 
)
protected

Evaluate a combined Z/y invariant mass distribution.

The B-W function and the 1/E^2 distribution are weighted according to fOnShellFraction.

Parameters
xValue to be evaluated.
meanThe mean of the distribution, i.e. Z pole mass.
gammaThe FWHM of the distribution, i.e. the Z decay width.
Returns
Log of combined mass distribution.
int KLFitter::LikelihoodTTZTrilepton::RemoveInvariantParticlePermutations ( )
overrideprotectedvirtual

Remove invariant particle permutations.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

int KLFitter::LikelihoodTTZTrilepton::SetET_miss_XY_SumET ( double  etx,
double  ety,
double  sumet 
)
overridevirtual

Set the values for the missing ET x and y components and the SumET.

Parameters
etxmissing ET x component.
etymissing ET y component.
sumettotal scalar ET.
Returns
An error flag.

Implements KLFitter::LikelihoodBase.

void KLFitter::LikelihoodTTZTrilepton::SetFlagTopMassFixed ( bool  flag)
inline

Set a flag.

If flag is true the invariant top quark mass is fixed to the pole mass.

Parameters
flagThe flag.
void KLFitter::LikelihoodTTZTrilepton::SetLeptonType ( LeptonType  leptontype)

Set the type of lepton.

Parameters
leptontypeThe type of lepton: kElectron or kMuon
void KLFitter::LikelihoodTTZTrilepton::SetLeptonType ( int  leptontype)

Set the type of lepton.

Parameters
leptontypeThe type of lepton: electron(1) or muon (2)

Member Data Documentation

double KLFitter::LikelihoodTTZTrilepton::fOnShellFraction
protected

Fraction of on-shell events, i.e.

weighting factor between on-shell and off-shell distribution. A value of 1 corresponds to a pure on-shell distribution, 0 to a pure off-shell distribution.


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