CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TtFullHadKinFitter::KinFit Class Reference

class that does the fitting More...

#include <TtFullHadKinFitter.h>

Public Member Functions

std::list
< TtFullHadKinFitter::KinFitResult
fit (const std::vector< pat::Jet > &jets)
 do the fitting and return fit result More...
 
 KinFit ()
 default constructor More...
 
 KinFit (bool useBTagging, unsigned int bTags, std::string bTagAlgo, double minBTagValueBJet, double maxBTagValueNonBJet, const std::vector< edm::ParameterSet > &udscResolutions, const std::vector< edm::ParameterSet > &bResolutions, const std::vector< double > &jetEnergyResolutionScaleFactors, const std::vector< double > &jetEnergyResolutionEtaBinning, std::string jetCorrectionLevel, int maxNJets, int maxNComb, unsigned int maxNrIter, double maxDeltaS, double maxF, unsigned int jetParam, const std::vector< unsigned > &constraints, double mW, double mTop)
 special constructor More...
 
void setBTagging (bool useBTagging, unsigned int bTags, std::string bTagAlgo, double minBTagValueBJet, double maxBTagValueNonBJet)
 set all parameters for b-tagging More...
 
void setFitter (int maxNJets, unsigned int maxNrIter, double maxDeltaS, double maxF, unsigned int jetParam, const std::vector< unsigned > &constraints, double mW, double mTop)
 set parameters for fitter More...
 
void setJEC (std::string jetCorrectionLevel)
 set jec level More...
 
void setMatch (const std::vector< int > &match)
 set match to be used More...
 
void setMatchInvalidity (bool invalidMatch)
 set the validity of a match More...
 
void setOutput (int maxNComb)
 set number of combinations of output More...
 
void setResolutions (const std::vector< edm::ParameterSet > &udscResolutions, const std::vector< edm::ParameterSet > &bResolutions, const std::vector< double > &jetEnergyResolutionScaleFactors, const std::vector< double > &jetEnergyResolutionEtaBinning)
 set resolutions More...
 
void setUseOnlyMatch (bool useOnlyMatch)
 set useOnlyMatch More...
 
 ~KinFit ()
 default destructor More...
 

Private Member Functions

TtFullHadKinFitter::Constraint constraint (unsigned int configParameter)
 
std::vector
< TtFullHadKinFitter::Constraint
constraints (const std::vector< unsigned int > &configParameters)
 
pat::Jet corJet (const pat::Jet &jet, const std::string &quarkType)
 helper function to construct the proper corrected jet for its corresponding quarkType More...
 
bool doBTagging (const std::vector< pat::Jet > &jets, const unsigned int &bJetCounter, std::vector< int > &combi)
 
TtFullHadKinFitter::Param param (unsigned int configParameter)
 

Private Attributes

std::vector< edm::ParameterSetbResolutions_
 
std::string bTagAlgo_
 input tag for b-tagging algorithm More...
 
unsigned int bTags_
 minimal number of b-jets More...
 
std::vector< unsigned > constraints_
 numbering of different possible kinematic constraints More...
 
TtFullHadKinFitterfitter
 kinematic fit interface More...
 
bool invalidMatch_
 match is invalid More...
 
std::string jetCorrectionLevel_
 correction level for jets More...
 
std::vector< double > jetEnergyResolutionEtaBinning_
 
std::vector< double > jetEnergyResolutionScaleFactors_
 scale factors for the jet energy resolution More...
 
unsigned int jetParam_
 numbering of different possible jet parametrizations More...
 
std::vector< int > match_
 the combination that should be used More...
 
double maxBTagValueNonBJet_
 max value of bTag for a non-b-jet More...
 
double maxDeltaS_
 maximal chi2 equivalent More...
 
double maxF_
 maximal deviation for contstraints More...
 
int maxNComb_
 maximal number of combinations to be written to the event More...
 
int maxNJets_
 maximal number of jets (-1 possible to indicate 'all') More...
 
unsigned int maxNrIter_
 maximal number of iterations to be performed for the fit More...
 
double minBTagValueBJet_
 min value of bTag for a b-jet More...
 
double mTop_
 top mass value used for constraints More...
 
double mW_
 W mass value used for constraints. More...
 
std::vector< edm::ParameterSetudscResolutions_
 store the resolutions for the jets More...
 
bool useBTagging_
 
bool useOnlyMatch_
 fit or only a certain combination More...
 

Detailed Description

class that does the fitting

Definition at line 145 of file TtFullHadKinFitter.h.

Constructor & Destructor Documentation

TtFullHadKinFitter::KinFit::KinFit ( )

default constructor

Definition at line 343 of file TtFullHadKinFitter.cc.

References constraints_.

344  : useBTagging_(true),
345  bTags_(2),
346  bTagAlgo_("trackCountingHighPurBJetTags"),
347  minBTagValueBJet_(3.41),
348  maxBTagValueNonBJet_(3.41),
349  udscResolutions_(std::vector<edm::ParameterSet>(0)),
350  bResolutions_(std::vector<edm::ParameterSet>(0)),
353  jetCorrectionLevel_("L3Absolute"),
354  maxNJets_(-1),
355  maxNComb_(1),
356  maxNrIter_(500),
357  maxDeltaS_(5e-5),
358  maxF_(0.0001),
359  jetParam_(1),
360  mW_(80.4),
361  mTop_(173.),
362  useOnlyMatch_(false),
363  match_(std::vector<int>(0)),
364  invalidMatch_(false) {
365  constraints_.push_back(1);
366  constraints_.push_back(2);
367  constraints_.push_back(5);
368 }
double maxF_
maximal deviation for contstraints
double maxDeltaS_
maximal chi2 equivalent
int maxNComb_
maximal number of combinations to be written to the event
double mW_
W mass value used for constraints.
std::vector< unsigned > constraints_
numbering of different possible kinematic constraints
std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::vector< edm::ParameterSet > udscResolutions_
store the resolutions for the jets
std::vector< edm::ParameterSet > bResolutions_
std::string jetCorrectionLevel_
correction level for jets
std::vector< double > jetEnergyResolutionEtaBinning_
unsigned int bTags_
minimal number of b-jets
unsigned int maxNrIter_
maximal number of iterations to be performed for the fit
std::vector< int > match_
the combination that should be used
double minBTagValueBJet_
min value of bTag for a b-jet
double mTop_
top mass value used for constraints
std::string bTagAlgo_
input tag for b-tagging algorithm
unsigned int jetParam_
numbering of different possible jet parametrizations
bool useOnlyMatch_
fit or only a certain combination
int maxNJets_
maximal number of jets (-1 possible to indicate &#39;all&#39;)
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
bool invalidMatch_
match is invalid
TtFullHadKinFitter::KinFit::KinFit ( bool  useBTagging,
unsigned int  bTags,
std::string  bTagAlgo,
double  minBTagValueBJet,
double  maxBTagValueNonBJet,
const std::vector< edm::ParameterSet > &  udscResolutions,
const std::vector< edm::ParameterSet > &  bResolutions,
const std::vector< double > &  jetEnergyResolutionScaleFactors,
const std::vector< double > &  jetEnergyResolutionEtaBinning,
std::string  jetCorrectionLevel,
int  maxNJets,
int  maxNComb,
unsigned int  maxNrIter,
double  maxDeltaS,
double  maxF,
unsigned int  jetParam,
const std::vector< unsigned > &  constraints,
double  mW,
double  mTop 
)

special constructor

Definition at line 371 of file TtFullHadKinFitter.cc.

References bResolutions_, constraints(), constraints_, fitter, jetEnergyResolutionEtaBinning_, jetEnergyResolutionScaleFactors_, jetParam_, maxDeltaS_, maxF_, maxNrIter_, mTop_, mW_, param(), TtFullHadKinFitter::TtFullHadKinFitter(), and udscResolutions_.

390  : useBTagging_(useBTagging),
391  bTags_(bTags),
392  bTagAlgo_(bTagAlgo),
393  minBTagValueBJet_(minBTagValueBJet),
394  maxBTagValueNonBJet_(maxBTagValueNonBJet),
395  udscResolutions_(udscResolutions),
396  bResolutions_(bResolutions),
397  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors),
398  jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
399  jetCorrectionLevel_(jetCorrectionLevel),
400  maxNJets_(maxNJets),
401  maxNComb_(maxNComb),
402  maxNrIter_(maxNrIter),
403  maxDeltaS_(maxDeltaS),
404  maxF_(maxF),
405  jetParam_(jetParam),
407  mW_(mW),
408  mTop_(mTop),
409  useOnlyMatch_(false),
410  invalidMatch_(false) {
411  // define kinematic fit interface
413  maxNrIter_,
414  maxDeltaS_,
415  maxF_,
417  mW_,
418  mTop_,
420  &bResolutions_,
423 }
double maxF_
maximal deviation for contstraints
double maxDeltaS_
maximal chi2 equivalent
TtFullHadKinFitter::Param param(unsigned int configParameter)
int maxNComb_
maximal number of combinations to be written to the event
TtFullHadKinFitter * fitter
kinematic fit interface
double mW_
W mass value used for constraints.
std::vector< unsigned > constraints_
numbering of different possible kinematic constraints
std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::vector< edm::ParameterSet > udscResolutions_
store the resolutions for the jets
std::vector< edm::ParameterSet > bResolutions_
std::string jetCorrectionLevel_
correction level for jets
std::vector< double > jetEnergyResolutionEtaBinning_
unsigned int bTags_
minimal number of b-jets
unsigned int maxNrIter_
maximal number of iterations to be performed for the fit
double minBTagValueBJet_
min value of bTag for a b-jet
std::vector< TtFullHadKinFitter::Constraint > constraints(const std::vector< unsigned int > &configParameters)
double mTop_
top mass value used for constraints
std::string bTagAlgo_
input tag for b-tagging algorithm
unsigned int jetParam_
numbering of different possible jet parametrizations
bool useOnlyMatch_
fit or only a certain combination
int maxNJets_
maximal number of jets (-1 possible to indicate &#39;all&#39;)
TtFullHadKinFitter()
default constructor
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
bool invalidMatch_
match is invalid
TtFullHadKinFitter::KinFit::~KinFit ( )

default destructor

Definition at line 426 of file TtFullHadKinFitter.cc.

426 { delete fitter; }
TtFullHadKinFitter * fitter
kinematic fit interface

Member Function Documentation

TtFullHadKinFitter::Constraint TtFullHadKinFitter::KinFit::constraint ( unsigned int  configParameter)
private

Definition at line 671 of file TtFullHadKinFitter.cc.

References Exception, TtFullHadKinFitter::kEqualTopMasses, TtFullHadKinFitter::kTopBarMass, TtFullHadKinFitter::kTopMass, TtFullHadKinFitter::kWMinusMass, TtFullHadKinFitter::kWPlusMass, and mps_fire::result.

671  {
673  switch (configParameter) {
676  break;
679  break;
682  break;
685  break;
688  break;
689  default:
690  throw cms::Exception("Configuration") << "Chosen fit constraint is not supported: " << configParameter << "\n";
691  break;
692  }
693  return result;
694 }
tuple result
Definition: mps_fire.py:311
Constraint
supported constraints
std::vector< TtFullHadKinFitter::Constraint > TtFullHadKinFitter::KinFit::constraints ( const std::vector< unsigned int > &  configParameters)
private

Definition at line 696 of file TtFullHadKinFitter.cc.

References HLT_FULL_cff::constraint, mps_fire::i, and mps_fire::result.

Referenced by KinFit(), and setFitter().

697  {
698  std::vector<TtFullHadKinFitter::Constraint> result;
699  for (unsigned i = 0; i < configParameters.size(); ++i) {
700  result.push_back(constraint(configParameters[i]));
701  }
702  return result;
703 }
TtFullHadKinFitter::Constraint constraint(unsigned int configParameter)
tuple result
Definition: mps_fire.py:311
pat::Jet TtFullHadKinFitter::KinFit::corJet ( const pat::Jet jet,
const std::string &  quarkType 
)
private

helper function to construct the proper corrected jet for its corresponding quarkType

Definition at line 485 of file TtFullHadKinFitter.cc.

References pat::Jet::jecFactor(), metsig::jet, reco::LeafCandidate::p4(), runTheMatrix::ret, and reco::LeafCandidate::setP4().

485  {
486  // jetCorrectionLevel was not configured
487  if (jetCorrectionLevel_.empty())
488  throw cms::Exception("Configuration")
489  << "Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
490 
491  // quarkType is unknown
492  if (!(quarkType == "wMix" || quarkType == "uds" || quarkType == "charm" || quarkType == "bottom"))
493  throw cms::Exception("Configuration") << quarkType << " is unknown as a quarkType for the jetCorrectionLevel.\n";
494 
495  float jecFactor = 1.;
496  if (quarkType == "wMix")
497  jecFactor = 0.75 * jet.jecFactor(jetCorrectionLevel_, "uds") + 0.25 * jet.jecFactor(jetCorrectionLevel_, "charm");
498  else
499  jecFactor = jet.jecFactor(jetCorrectionLevel_, quarkType);
500 
501  pat::Jet ret = jet;
502  ret.setP4(ret.p4() * jecFactor);
503  return ret;
504 }
tuple ret
prodAgent to be discontinued
const LorentzVector & p4() const final
four-momentum Lorentz vector
std::string jetCorrectionLevel_
correction level for jets
Analysis-level calorimeter jet class.
Definition: Jet.h:77
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
void setP4(const LorentzVector &p4) final
set 4-momentum
bool TtFullHadKinFitter::KinFit::doBTagging ( const std::vector< pat::Jet > &  jets,
const unsigned int &  bJetCounter,
std::vector< int > &  combi 
)
private

Definition at line 428 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, TtFullHadEvtPartons::BBar, Exception, TtFullHadEvtPartons::LightP, TtFullHadEvtPartons::LightPBar, TtFullHadEvtPartons::LightQ, and TtFullHadEvtPartons::LightQBar.

430  {
431  if (!useBTagging_) {
432  return true;
433  }
434  if (bTags_ == 2 && jets[combi[TtFullHadEvtPartons::B]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
435  jets[combi[TtFullHadEvtPartons::BBar]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
440  return true;
441  } else if (bTags_ == 1) {
442  if (bJetCounter == 1 &&
443  (jets[combi[TtFullHadEvtPartons::B]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ ||
444  jets[combi[TtFullHadEvtPartons::BBar]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_) &&
449  return true;
450  } else if (bJetCounter > 1 && jets[combi[TtFullHadEvtPartons::B]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
451  jets[combi[TtFullHadEvtPartons::BBar]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
456  return true;
457  }
458  } else if (bTags_ == 0) {
459  if (bJetCounter == 0) {
460  return true;
461  } else if (bJetCounter == 1 &&
462  (jets[combi[TtFullHadEvtPartons::B]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ ||
463  jets[combi[TtFullHadEvtPartons::BBar]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_) &&
468  return true;
469  } else if (bJetCounter > 1 && jets[combi[TtFullHadEvtPartons::B]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
470  jets[combi[TtFullHadEvtPartons::BBar]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
475  return true;
476  }
477  } else if (bTags_ > 2) {
478  throw cms::Exception("Configuration") << "Wrong number of bTags (" << bTags_ << " bTags not supported)!\n";
479  return true;
480  }
481  return false;
482 }
unsigned int bTags_
minimal number of b-jets
vector< PseudoJet > jets
double minBTagValueBJet_
min value of bTag for a b-jet
std::string bTagAlgo_
input tag for b-tagging algorithm
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
std::list< TtFullHadKinFitter::KinFitResult > TtFullHadKinFitter::KinFit::fit ( const std::vector< pat::Jet > &  jets)

do the fitting and return fit result


skip events with less jets than partons or invalid match

analyze different jet combinations using the KinFitter (or only a given jet combination if useOnlyMatch=true)

feed out result starting with the JetComb having the smallest chi2

Definition at line 506 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, TtFullHadKinFitter::KinFitResult::B, TtFullHadEvtPartons::BBar, TtFullHadKinFitter::KinFitResult::BBar, TtFullHadKinFitter::KinFitResult::Chi2, mps_fire::i, metsig::jet, TtFullHadKinFitter::KinFitResult::JetCombi, TtFullHadEvtPartons::LightP, TtFullHadKinFitter::KinFitResult::LightP, TtFullHadEvtPartons::LightPBar, TtFullHadKinFitter::KinFitResult::LightPBar, TtFullHadEvtPartons::LightQ, TtFullHadKinFitter::KinFitResult::LightQ, TtFullHadEvtPartons::LightQBar, TtFullHadKinFitter::KinFitResult::LightQBar, stdcomb::next_combination(), nPartons, TtFullHadKinFitter::KinFitResult::Prob, mps_fire::result, mps_update::status, and TtFullHadKinFitter::KinFitResult::Status.

Referenced by trackingPlots.Iteration::modules(), and TtFullHadKinFitProducer::produce().

506  {
507  std::list<TtFullHadKinFitter::KinFitResult> fitResults;
508 
515  if (jets.size() < nPartons || invalidMatch_) {
516  // indices referring to the jet combination
517  std::vector<int> invalidCombi;
518  for (unsigned int i = 0; i < nPartons; ++i)
519  invalidCombi.push_back(-1);
520 
521  KinFitResult result;
522  // status of the fitter
523  result.Status = -1;
524  // chi2
525  result.Chi2 = -1.;
526  // chi2 probability
527  result.Prob = -1.;
528  // the kinFit getters return empty objects here
529  result.B = fitter->fittedB();
530  result.BBar = fitter->fittedBBar();
531  result.LightQ = fitter->fittedLightQ();
532  result.LightQBar = fitter->fittedLightQBar();
533  result.LightP = fitter->fittedLightP();
534  result.LightPBar = fitter->fittedLightPBar();
535  result.JetCombi = invalidCombi;
536  // push back fit result
537  fitResults.push_back(result);
538  return fitResults;
539  }
540 
546  std::vector<int> jetIndices;
547  if (!useOnlyMatch_) {
548  for (unsigned int idx = 0; idx < jets.size(); ++idx) {
549  if (maxNJets_ >= (int)nPartons && maxNJets_ == (int)idx)
550  break;
551  jetIndices.push_back(idx);
552  }
553  }
554 
555  std::vector<int> combi;
556  for (unsigned int idx = 0; idx < nPartons; ++idx) {
557  useOnlyMatch_ ? combi.push_back(match_[idx]) : combi.push_back(idx);
558  }
559 
560  unsigned int bJetCounter = 0;
561  for (std::vector<pat::Jet>::const_iterator jet = jets.begin(); jet < jets.end(); ++jet) {
562  if (jet->bDiscriminator(bTagAlgo_) >= minBTagValueBJet_)
563  ++bJetCounter;
564  }
565 
566  do {
567  for (int cnt = 0; cnt < TMath::Factorial(combi.size()); ++cnt) {
568  // take into account indistinguishability of the two jets from the two W decays,
569  // and the two decay branches, this reduces the combinatorics by a factor of 2*2*2
573  useOnlyMatch_) &&
574  doBTagging(jets, bJetCounter, combi)) {
575  std::vector<pat::Jet> jetCombi;
576  jetCombi.resize(nPartons);
579  jetCombi[TtFullHadEvtPartons::B] = corJet(jets[combi[TtFullHadEvtPartons::B]], "bottom");
580  jetCombi[TtFullHadEvtPartons::BBar] = corJet(jets[combi[TtFullHadEvtPartons::BBar]], "bottom");
583 
584  // do the kinematic fit
585  int status = fitter->fit(jetCombi);
586 
587  if (status == 0) {
588  // fill struct KinFitResults if converged
590  result.Status = status;
591  result.Chi2 = fitter->fitS();
592  result.Prob = fitter->fitProb();
593  result.B = fitter->fittedB();
594  result.BBar = fitter->fittedBBar();
595  result.LightQ = fitter->fittedLightQ();
596  result.LightQBar = fitter->fittedLightQBar();
597  result.LightP = fitter->fittedLightP();
598  result.LightPBar = fitter->fittedLightPBar();
599  result.JetCombi = combi;
600  // push back fit result
601  fitResults.push_back(result);
602  }
603  }
604  // don't go through combinatorics if useOnlyMatch was chosen
605  if (useOnlyMatch_) {
606  break;
607  }
608  // next permutation
609  std::next_permutation(combi.begin(), combi.end());
610  }
611  // don't go through combinatorics if useOnlyMatch was chosen
612  if (useOnlyMatch_) {
613  break;
614  }
615  } while (stdcomb::next_combination(jetIndices.begin(), jetIndices.end(), combi.begin(), combi.end()));
616 
617  // sort results w.r.t. chi2 values
618  fitResults.sort();
619 
625  if ((unsigned)fitResults.size() < 1) {
626  // in case no fit results were stored in the list (i.e. when all fits were aborted)
627 
628  KinFitResult result;
629  // status of the fitter
630  result.Status = -1;
631  // chi2
632  result.Chi2 = -1.;
633  // chi2 probability
634  result.Prob = -1.;
635  // the kinFit getters return empty objects here
636  result.B = fitter->fittedB();
637  result.BBar = fitter->fittedBBar();
638  result.LightQ = fitter->fittedLightQ();
639  result.LightQBar = fitter->fittedLightQBar();
640  result.LightP = fitter->fittedLightP();
641  result.LightPBar = fitter->fittedLightPBar();
642  // indices referring to the jet combination
643  std::vector<int> invalidCombi(nPartons, -1);
644  result.JetCombi = invalidCombi;
645  // push back fit result
646  fitResults.push_back(result);
647  }
648  return fitResults;
649 }
const pat::Particle fittedLightPBar() const
return fitted light quark candidate
list status
Definition: mps_update.py:107
int fit(const std::vector< pat::Jet > &jets)
kinematic fit interface
TtFullHadKinFitter * fitter
kinematic fit interface
const pat::Particle fittedBBar() const
return fitted b quark candidate
double fitProb() const
return fit probability
Definition: TopKinFitter.h:37
tuple result
Definition: mps_fire.py:311
bool doBTagging(const std::vector< pat::Jet > &jets, const unsigned int &bJetCounter, std::vector< int > &combi)
pat::Jet corJet(const pat::Jet &jet, const std::string &quarkType)
helper function to construct the proper corrected jet for its corresponding quarkType ...
std::vector< int > match_
the combination that should be used
vector< PseudoJet > jets
double minBTagValueBJet_
min value of bTag for a b-jet
const pat::Particle fittedLightQ() const
return fitted light quark candidate
std::string bTagAlgo_
input tag for b-tagging algorithm
static const unsigned int nPartons
bool useOnlyMatch_
fit or only a certain combination
int maxNJets_
maximal number of jets (-1 possible to indicate &#39;all&#39;)
const pat::Particle fittedLightP() const
return fitted light quark candidate
double fitS() const
return chi2 of fit (not normalized to degrees of freedom)
Definition: TopKinFitter.h:33
bool invalidMatch_
match is invalid
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
Definition: combination.h:19
const pat::Particle fittedLightQBar() const
return fitted light quark candidate
const pat::Particle fittedB() const
return fitted b quark candidate
TtFullHadKinFitter::Param TtFullHadKinFitter::KinFit::param ( unsigned int  configParameter)
private

Definition at line 651 of file TtFullHadKinFitter.cc.

References Exception, TopKinFitter::kEMom, TopKinFitter::kEtEtaPhi, TopKinFitter::kEtThetaPhi, and mps_fire::result.

Referenced by KinFit().

651  {
653  switch (configParameter) {
655  result = TtFullHadKinFitter::kEMom;
656  break;
659  break;
662  break;
663  default:
664  throw cms::Exception("Configuration")
665  << "Chosen jet parametrization is not supported: " << configParameter << "\n";
666  break;
667  }
668  return result;
669 }
Param
supported parameterizations
Definition: TopKinFitter.h:20
tuple result
Definition: mps_fire.py:311
void TtFullHadKinFitter::KinFit::setBTagging ( bool  useBTagging,
unsigned int  bTags,
std::string  bTagAlgo,
double  minBTagValueBJet,
double  maxBTagValueNonBJet 
)
inline

set all parameters for b-tagging

Definition at line 173 of file TtFullHadKinFitter.h.

References bTagAlgo_, bTags_, maxBTagValueNonBJet_, minBTagValueBJet_, and useBTagging_.

177  {
178  useBTagging_ = useBTagging;
179  bTags_ = bTags;
180  bTagAlgo_ = bTagAlgo;
181  minBTagValueBJet_ = minBTagValueBJet;
182  maxBTagValueNonBJet_ = maxBTagValueNonBJet;
183  }
unsigned int bTags_
minimal number of b-jets
double minBTagValueBJet_
min value of bTag for a b-jet
std::string bTagAlgo_
input tag for b-tagging algorithm
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
void TtFullHadKinFitter::KinFit::setFitter ( int  maxNJets,
unsigned int  maxNrIter,
double  maxDeltaS,
double  maxF,
unsigned int  jetParam,
const std::vector< unsigned > &  constraints,
double  mW,
double  mTop 
)
inline

set parameters for fitter

Definition at line 195 of file TtFullHadKinFitter.h.

References constraints(), constraints_, jetParam_, maxDeltaS_, maxF_, maxNJets_, maxNrIter_, mTop_, and mW_.

202  {
203  maxNJets_ = maxNJets;
204  maxNrIter_ = maxNrIter;
205  maxDeltaS_ = maxDeltaS;
206  maxF_ = maxF;
207  jetParam_ = jetParam;
209  mW_ = mW;
210  mTop_ = mTop;
211  }
double maxF_
maximal deviation for contstraints
double maxDeltaS_
maximal chi2 equivalent
double mW_
W mass value used for constraints.
std::vector< unsigned > constraints_
numbering of different possible kinematic constraints
unsigned int maxNrIter_
maximal number of iterations to be performed for the fit
std::vector< TtFullHadKinFitter::Constraint > constraints(const std::vector< unsigned int > &configParameters)
double mTop_
top mass value used for constraints
unsigned int jetParam_
numbering of different possible jet parametrizations
int maxNJets_
maximal number of jets (-1 possible to indicate &#39;all&#39;)
void TtFullHadKinFitter::KinFit::setJEC ( std::string  jetCorrectionLevel)
inline

set jec level

Definition at line 213 of file TtFullHadKinFitter.h.

References jetCorrectionLevel_.

213 { jetCorrectionLevel_ = jetCorrectionLevel; }
std::string jetCorrectionLevel_
correction level for jets
void TtFullHadKinFitter::KinFit::setMatch ( const std::vector< int > &  match)
inline

set match to be used

Definition at line 217 of file TtFullHadKinFitter.h.

References match(), and match_.

Referenced by TtFullHadKinFitProducer::produce().

217 { match_ = match; }
std::vector< int > match_
the combination that should be used
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void TtFullHadKinFitter::KinFit::setMatchInvalidity ( bool  invalidMatch)
inline

set the validity of a match

Definition at line 219 of file TtFullHadKinFitter.h.

References invalidMatch_.

Referenced by TtFullHadKinFitProducer::produce().

219 { invalidMatch_ = invalidMatch; }
bool invalidMatch_
match is invalid
void TtFullHadKinFitter::KinFit::setOutput ( int  maxNComb)
inline

set number of combinations of output

Definition at line 221 of file TtFullHadKinFitter.h.

References maxNComb_.

221 { maxNComb_ = maxNComb; }
int maxNComb_
maximal number of combinations to be written to the event
void TtFullHadKinFitter::KinFit::setResolutions ( const std::vector< edm::ParameterSet > &  udscResolutions,
const std::vector< edm::ParameterSet > &  bResolutions,
const std::vector< double > &  jetEnergyResolutionScaleFactors,
const std::vector< double > &  jetEnergyResolutionEtaBinning 
)
inline

set resolutions

Definition at line 185 of file TtFullHadKinFitter.h.

References bResolutions_, jetEnergyResolutionEtaBinning_, jetEnergyResolutionScaleFactors_, and udscResolutions_.

188  {
189  udscResolutions_ = udscResolutions;
190  bResolutions_ = bResolutions;
191  jetEnergyResolutionScaleFactors_ = jetEnergyResolutionScaleFactors;
192  jetEnergyResolutionEtaBinning_ = jetEnergyResolutionEtaBinning;
193  }
std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::vector< edm::ParameterSet > udscResolutions_
store the resolutions for the jets
std::vector< edm::ParameterSet > bResolutions_
std::vector< double > jetEnergyResolutionEtaBinning_
void TtFullHadKinFitter::KinFit::setUseOnlyMatch ( bool  useOnlyMatch)
inline

set useOnlyMatch

Definition at line 215 of file TtFullHadKinFitter.h.

References useOnlyMatch_.

Referenced by TtFullHadKinFitProducer::produce().

215 { useOnlyMatch_ = useOnlyMatch; }
bool useOnlyMatch_
fit or only a certain combination

Member Data Documentation

std::vector<edm::ParameterSet> TtFullHadKinFitter::KinFit::bResolutions_
private

Definition at line 252 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setResolutions().

std::string TtFullHadKinFitter::KinFit::bTagAlgo_
private

input tag for b-tagging algorithm

Definition at line 246 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

unsigned int TtFullHadKinFitter::KinFit::bTags_
private

minimal number of b-jets

Definition at line 244 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

std::vector<unsigned> TtFullHadKinFitter::KinFit::constraints_
private

numbering of different possible kinematic constraints

Definition at line 271 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

TtFullHadKinFitter* TtFullHadKinFitter::KinFit::fitter
private

kinematic fit interface

Definition at line 284 of file TtFullHadKinFitter.h.

Referenced by KinFit().

bool TtFullHadKinFitter::KinFit::invalidMatch_
private

match is invalid

Definition at line 281 of file TtFullHadKinFitter.h.

Referenced by setMatchInvalidity().

std::string TtFullHadKinFitter::KinFit::jetCorrectionLevel_
private

correction level for jets

Definition at line 257 of file TtFullHadKinFitter.h.

Referenced by setJEC().

std::vector<double> TtFullHadKinFitter::KinFit::jetEnergyResolutionEtaBinning_
private

Definition at line 255 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setResolutions().

std::vector<double> TtFullHadKinFitter::KinFit::jetEnergyResolutionScaleFactors_
private

scale factors for the jet energy resolution

Definition at line 254 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setResolutions().

unsigned int TtFullHadKinFitter::KinFit::jetParam_
private

numbering of different possible jet parametrizations

Definition at line 269 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

std::vector<int> TtFullHadKinFitter::KinFit::match_
private

the combination that should be used

Definition at line 279 of file TtFullHadKinFitter.h.

Referenced by setMatch().

double TtFullHadKinFitter::KinFit::maxBTagValueNonBJet_
private

max value of bTag for a non-b-jet

Definition at line 250 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

double TtFullHadKinFitter::KinFit::maxDeltaS_
private

maximal chi2 equivalent

Definition at line 265 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

double TtFullHadKinFitter::KinFit::maxF_
private

maximal deviation for contstraints

Definition at line 267 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

int TtFullHadKinFitter::KinFit::maxNComb_
private

maximal number of combinations to be written to the event

Definition at line 261 of file TtFullHadKinFitter.h.

Referenced by setOutput().

int TtFullHadKinFitter::KinFit::maxNJets_
private

maximal number of jets (-1 possible to indicate 'all')

Definition at line 259 of file TtFullHadKinFitter.h.

Referenced by setFitter().

unsigned int TtFullHadKinFitter::KinFit::maxNrIter_
private

maximal number of iterations to be performed for the fit

Definition at line 263 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

double TtFullHadKinFitter::KinFit::minBTagValueBJet_
private

min value of bTag for a b-jet

Definition at line 248 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

double TtFullHadKinFitter::KinFit::mTop_
private

top mass value used for constraints

Definition at line 275 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

double TtFullHadKinFitter::KinFit::mW_
private

W mass value used for constraints.

Definition at line 273 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

std::vector<edm::ParameterSet> TtFullHadKinFitter::KinFit::udscResolutions_
private

store the resolutions for the jets

Definition at line 252 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setResolutions().

bool TtFullHadKinFitter::KinFit::useBTagging_
private

switch to tell whether all possible combinations should be used for the switch to tell whether to use b-tagging or not

Definition at line 242 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

bool TtFullHadKinFitter::KinFit::useOnlyMatch_
private

fit or only a certain combination

Definition at line 277 of file TtFullHadKinFitter.h.

Referenced by setUseOnlyMatch().