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

A class implementing a likelihood for the ttbar dilepton channel. More...

#include <LikelihoodTopDilepton.h>

Inheritance diagram for KLFitter::LikelihoodTopDilepton:
KLFitter::LikelihoodBase

Public Member Functions

Constructors and destructors
 LikelihoodTopDilepton ()
 The default constructor.
 
 ~LikelihoodTopDilepton ()
 The (defaulted) destructor.
 
Member functions (BAT)
void DefineParameters () override
 Define the parameters of the fit.
 
void DefinePrior ()
 Define sharp gauss prior for mtop par if mtop fixed.
 
void DefineHistograms ()
 Define BCH1D and TH1D histograms to be filled in MCMCIterationInterface.
 
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...
 
double GaussNuEta (std::vector< double > parameters)
 Return Gaussian term for neutrino pseudorapidity. More...
 
double GaussAntiNuEta (std::vector< double > parameters)
 Return Gaussian term for antineutrino pseudorapidity. More...
 
double CalculateWeight (const std::vector< double > &parameters)
 Return NuWT weight. More...
 
double CalculateWeightPerm (TLorentzVector *l1, TLorentzVector *l2, TLorentzVector *j1, TLorentzVector *j2, const std::vector< double > &parameters)
 Return NuWT weight for a set of jet1, jet2, lep1, lep2. More...
 
KLFitter::NuSolutions SolveForNuMom (TLorentzVector *l, TLorentzVector *b, double mtop, double nueta)
 Return set of neutrino/antineutrino kinematic solutions (up to 2) More...
 
double neutrino_weight (TLorentzVector nu, TLorentzVector nubar)
 Return neutrino weight for a given nu solution and antinu solution. More...
 
double CalculateMLepJet ()
 Return sum of invariant masses of each (lep,jet) pair, including a tuning factor alpha. More...
 
void SetDoSumLogLik (bool flag)
 Set a flag. 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);.
 
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...
 

Public Attributes

TH1D * hist_mttbar
 TH1D histograms to be filled with functions of interest, e.g. More...
 
TH1D * hist_costheta
 

Protected Member Functions

int SavePermutedParticles () override
 Save permuted particles.
 
int SaveResolutionFunctions () override
 Save resolution functions.
 
Member functions (misc)
int CalculateLorentzVectors (std::vector< double > const &parameters) override
 Update 4-vectors of model particles. More...
 
int Initialize () override
 Initialize the likelihood for the event.
 
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...
 
void MCMCIterationInterface () override
 Calculate other variables out of the KLFitter parameters for each MCMCiteration. More...
 
BCH1D * GetHistMttbar ()
 Get BAT BCH1D histograms of Mttbar. More...
 
BCH1D * GetHistCosTheta ()
 Get BAT BCH1D histograms of CosTheta. More...
 
std::pair< float, float > CalculateCosTheta (std::vector< TLorentzVector > *particles)
 calculate cos(theta*) for both top and antitop
 
- 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).
 
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_1
 Lepton 1 Type (electron or muon)
 
LeptonType fTypeLepton_2
 Lepton 2 Type (electron or muon)
 
std::vector< double > nueta_params
 vector including nu pseudorapidity sigma dependency on mtop ( if sigma = a + b*mtop = > vector[0] = a, vector[1] = b)
 
bool doSumloglik
 A flag for using sumloglikelihood option.
 
std::unique_ptr< BCH1D > fHistMttbar
 BAT BCH1D Histogram for mttbar.
 
std::unique_ptr< BCH1D > fHistCosTheta
 BAT BCH1D Histogram cos(theta*)
 
BCH1D * fHistdRTop
 BAT BCH1D Histogram for dR(truth top, fit top)
 
BCH1D * fHistdRAntiTop
 BAT BCH1D Histogram for dR(truth antitop, fit antitop)
 
BCH1D * fHistdRNu
 BAT BCH1D Histogram for dR(truth nu, fit nu)
 
BCH1D * fHistdRAntiNu
 BAT BCH1D Histogram for dR(truth antinu, fit antinu)
 
ResolutionBasefResEnergyB1
 Save resolution functions since the eta of the partons is not fitted.
 
ResolutionBasefResEnergyB2
 
ResolutionBasefResLepton1
 
ResolutionBasefResLepton2
 
ResolutionBasefResMET
 
double b1_meas_e
 Save measured particle values for frequent calls.
 
double b1_meas_p
 
double b1_meas_m
 
double b1_meas_deteta
 
double b1_meas_eta
 
double b1_meas_phi
 
double b1_meas_px
 
double b1_meas_py
 
double b1_meas_pz
 
double b2_meas_e
 
double b2_meas_p
 
double b2_meas_m
 
double b2_meas_deteta
 
double b2_meas_eta
 
double b2_meas_phi
 
double b2_meas_px
 
double b2_meas_py
 
double b2_meas_pz
 
double lep1_meas_e
 
double lep1_meas_deteta
 
float lep1_meas_charge
 
double lep1_meas_sintheta
 
double lep1_meas_pt
 
double lep1_meas_px
 
double lep1_meas_py
 
double lep1_meas_pz
 
double lep2_meas_e
 
double lep2_meas_deteta
 
float lep2_meas_charge
 
double lep2_meas_sintheta
 
double lep2_meas_pt
 
double lep2_meas_px
 
double lep2_meas_py
 
double lep2_meas_pz
 
double lep1_fit_e
 Save fit particle values for frequent calls.
 
double lep1_fit_px
 
double lep1_fit_py
 
double lep1_fit_pz
 
double lep2_fit_e
 
double lep2_fit_px
 
double lep2_fit_py
 
double lep2_fit_pz
 
double b1_fit_e
 
double b1_fit_px
 
double b1_fit_py
 
double b1_fit_pz
 
double b2_fit_e
 
double b2_fit_px
 
double b2_fit_py
 
double b2_fit_pz
 
- 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 {
  parTopM = 0, parB1E, parB2E, parLep1E,
  parLep2E, parAntiNuEta, parNuEta
}
 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 SetFlagTopMassFixed (bool flag)
 Set a flag. More...
 
void SetEtaNuParams (std::vector< double > etanuparam)
 Set the neutrino pseudorapidity sigma linear dependency on mtop according to SM expectations.
 
void SetLeptonType (LeptonType leptontype_1, LeptonType leptontype_2)
 Set the type of lepton. More...
 
void SetLeptonType (int leptontype_1, int leptontype_2)
 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 ttbar dilepton channel.

This class represents a likelihood for the ttbar dilepton channel.

Member Function Documentation

int KLFitter::LikelihoodTopDilepton::BuildModelParticles ( )
overrideprotectedvirtual

Build the model particles from the best fit parameters.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

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

Update 4-vectors of model particles.

Returns
An error flag.

Implements KLFitter::LikelihoodBase.

double KLFitter::LikelihoodTopDilepton::CalculateMLepJet ( )

Return sum of invariant masses of each (lep,jet) pair, including a tuning factor alpha.

Returns
A double.
double KLFitter::LikelihoodTopDilepton::CalculateWeight ( const std::vector< double > &  parameters)

Return NuWT weight.

Returns
A double.
double KLFitter::LikelihoodTopDilepton::CalculateWeightPerm ( TLorentzVector *  l1,
TLorentzVector *  l2,
TLorentzVector *  j1,
TLorentzVector *  j2,
const std::vector< double > &  parameters 
)

Return NuWT weight for a set of jet1, jet2, lep1, lep2.

Returns
A double.
int KLFitter::LikelihoodTopDilepton::DefineModelParticles ( )
overrideprotectedvirtual

Define the model particles.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

double KLFitter::LikelihoodTopDilepton::GaussAntiNuEta ( std::vector< double >  parameters)

Return Gaussian term for antineutrino pseudorapidity.

Returns
A double.
double KLFitter::LikelihoodTopDilepton::GaussNuEta ( std::vector< double >  parameters)

Return Gaussian term for neutrino pseudorapidity.

Returns
A double.
BCH1D* KLFitter::LikelihoodTopDilepton::GetHistCosTheta ( )
inlineprotected

Get BAT BCH1D histograms of CosTheta.

Returns
BCH1D histograms
BCH1D* KLFitter::LikelihoodTopDilepton::GetHistMttbar ( )
inlineprotected

Get BAT BCH1D histograms of Mttbar.

Returns
BCH1D histograms
std::vector< double > KLFitter::LikelihoodTopDilepton::GetInitialParameters ( )
overridevirtual

Get initial values for the parameters.

Returns
vector of initial values.

Implements KLFitter::LikelihoodBase.

double KLFitter::LikelihoodTopDilepton::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::LikelihoodTopDilepton::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: NuWT 1: TF_b1 2: TF_b2 3: TF_lep1 4: TF_lep2 5: AntiNu_Eta 6: Nu_Eta 7: Minv(lep,jet)

Implements KLFitter::LikelihoodBase.

void KLFitter::LikelihoodTopDilepton::MCMCIterationInterface ( )
overrideprotected

Calculate other variables out of the KLFitter parameters for each MCMCiteration.

double KLFitter::LikelihoodTopDilepton::neutrino_weight ( TLorentzVector  nu,
TLorentzVector  nubar 
)

Return neutrino weight for a given nu solution and antinu solution.

Returns
A double.
int KLFitter::LikelihoodTopDilepton::RemoveInvariantParticlePermutations ( )
overrideprotectedvirtual

Remove invariant particle permutations.

Returns
An error code.

Implements KLFitter::LikelihoodBase.

void KLFitter::LikelihoodTopDilepton::SetDoSumLogLik ( bool  flag)
inline

Set a flag.

If flag is true the sumloglikelihood option is used, instead of the default best-permutation

Parameters
flagThe flag.
int KLFitter::LikelihoodTopDilepton::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::LikelihoodTopDilepton::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::LikelihoodTopDilepton::SetLeptonType ( LeptonType  leptontype_1,
LeptonType  leptontype_2 
)

Set the type of lepton.

Parameters
leptontype_1The type of the first lepton: kElectron or kMuon
leptontype_2The type of the second lepton: kElectron or kMuon
void KLFitter::LikelihoodTopDilepton::SetLeptonType ( int  leptontype_1,
int  leptontype_2 
)

Set the type of lepton.

Parameters
leptontype_1The type of the first lepton: electron(1) or muon (2)
leptontype_2The type of the second lepton: electron(1) or muon (2)
KLFitter::NuSolutions KLFitter::LikelihoodTopDilepton::SolveForNuMom ( TLorentzVector *  l,
TLorentzVector *  b,
double  mtop,
double  nueta 
)

Return set of neutrino/antineutrino kinematic solutions (up to 2)

Returns
A KLFitter::NuSolutions object.

Member Data Documentation

TH1D* KLFitter::LikelihoodTopDilepton::hist_mttbar

TH1D histograms to be filled with functions of interest, e.g.

: mttbar, costheta*,etc. for each MCNCiteration


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