test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 133 of file TtFullHadKinFitter.h.

Constructor & Destructor Documentation

TtFullHadKinFitter::KinFit::KinFit ( )

default constructor

Definition at line 298 of file TtFullHadKinFitter.cc.

References constraints_.

298  :
299  useBTagging_(true),
300  bTags_(2),
301  bTagAlgo_("trackCountingHighPurBJetTags"),
302  minBTagValueBJet_(3.41),
303  maxBTagValueNonBJet_(3.41),
304  udscResolutions_(std::vector<edm::ParameterSet>(0)),
305  bResolutions_(std::vector<edm::ParameterSet>(0)),
308  jetCorrectionLevel_("L3Absolute"),
309  maxNJets_(-1),
310  maxNComb_(1),
311  maxNrIter_(500),
312  maxDeltaS_(5e-5),
313  maxF_(0.0001),
314  jetParam_(1),
315  mW_(80.4),
316  mTop_(173.),
317  useOnlyMatch_(false),
318  match_(std::vector<int>(0)),
319  invalidMatch_(false)
320 {
321  constraints_.push_back(1);
322  constraints_.push_back(2);
323  constraints_.push_back(5);
324 }
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 327 of file TtFullHadKinFitter.cc.

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

331  :
332  useBTagging_(useBTagging),
333  bTags_(bTags),
334  bTagAlgo_(bTagAlgo),
335  minBTagValueBJet_(minBTagValueBJet),
336  maxBTagValueNonBJet_(maxBTagValueNonBJet),
337  udscResolutions_(udscResolutions),
338  bResolutions_(bResolutions),
339  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors),
340  jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
341  jetCorrectionLevel_(jetCorrectionLevel),
343  maxNComb_(maxNComb),
344  maxNrIter_(maxNrIter),
345  maxDeltaS_(maxDeltaS),
346  maxF_(maxF),
347  jetParam_(jetParam),
349  mW_(mW),
350  mTop_(mTop),
351  useOnlyMatch_(false),
352  invalidMatch_(false)
353 {
354  // define kinematic fit interface
357 }
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 360 of file TtFullHadKinFitter.cc.

361 {
362  delete fitter;
363 }
TtFullHadKinFitter * fitter
kinematic fit interface

Member Function Documentation

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

Definition at line 621 of file TtFullHadKinFitter.cc.

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

622 {
624  switch(configParameter){
630  default:
631  throw cms::Exception("Configuration")
632  << "Chosen fit constraint is not supported: " << configParameter << "\n";
633  break;
634  }
635  return result;
636 }
tuple result
Definition: mps_fire.py:84
Constraint
supported constraints
std::vector< TtFullHadKinFitter::Constraint > TtFullHadKinFitter::KinFit::constraints ( const std::vector< unsigned int > &  configParameters)
private

Definition at line 639 of file TtFullHadKinFitter.cc.

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

Referenced by KinFit(), and setFitter().

640 {
641  std::vector<TtFullHadKinFitter::Constraint> result;
642  for(unsigned i=0; i<configParameters.size(); ++i){
643  result.push_back(constraint(configParameters[i]));
644  }
645  return result;
646 }
int i
Definition: DBlmapReader.cc:9
TtFullHadKinFitter::Constraint constraint(unsigned int configParameter)
tuple result
Definition: mps_fire.py:84
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 433 of file TtFullHadKinFitter.cc.

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

434 {
435  // jetCorrectionLevel was not configured
436  if(jetCorrectionLevel_.empty())
437  throw cms::Exception("Configuration")
438  << "Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
439 
440  // quarkType is unknown
441  if( !(quarkType=="wMix" ||
442  quarkType=="uds" ||
443  quarkType=="charm" ||
444  quarkType=="bottom") )
445  throw cms::Exception("Configuration")
446  << quarkType << " is unknown as a quarkType for the jetCorrectionLevel.\n";
447 
448  float jecFactor = 1.;
449  if(quarkType=="wMix") jecFactor = 0.75 * jet.jecFactor(jetCorrectionLevel_, "uds") + 0.25 * jet.jecFactor(jetCorrectionLevel_, "charm");
450  else jecFactor = jet.jecFactor(jetCorrectionLevel_, quarkType);
451 
452  pat::Jet ret = jet;
453  ret.setP4(ret.p4()*jecFactor);
454  return ret;
455 }
tuple ret
prodAgent to be discontinued
std::string jetCorrectionLevel_
correction level for jets
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
Analysis-level calorimeter jet class.
Definition: Jet.h:78
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
bool TtFullHadKinFitter::KinFit::doBTagging ( const std::vector< pat::Jet > &  jets,
const unsigned int &  bJetCounter,
std::vector< int > &  combi 
)
private

Definition at line 366 of file TtFullHadKinFitter.cc.

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

366  {
367 
368  if( !useBTagging_ ) {
369  return true;
370  }
371  if( bTags_ == 2 &&
372  jets[combi[TtFullHadEvtPartons::B ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
373  jets[combi[TtFullHadEvtPartons::BBar ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
374  jets[combi[TtFullHadEvtPartons::LightQ ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
376  jets[combi[TtFullHadEvtPartons::LightP ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
378  return true;
379  }
380  else if( bTags_ == 1 ){
381  if( bJetCounter == 1 &&
382  (jets[combi[TtFullHadEvtPartons::B ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ ||
383  jets[combi[TtFullHadEvtPartons::BBar ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_) &&
384  jets[combi[TtFullHadEvtPartons::LightQ ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
386  jets[combi[TtFullHadEvtPartons::LightP ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
388  return true;
389  }
390  else if( bJetCounter > 1 &&
391  jets[combi[TtFullHadEvtPartons::B ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
392  jets[combi[TtFullHadEvtPartons::BBar ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
393  jets[combi[TtFullHadEvtPartons::LightQ ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
395  jets[combi[TtFullHadEvtPartons::LightP ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
397  return true;
398  }
399  }
400  else if( bTags_ == 0 ){
401  if( bJetCounter == 0){
402  return true;
403  }
404  else if( bJetCounter == 1 &&
405  (jets[combi[TtFullHadEvtPartons::B ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ ||
406  jets[combi[TtFullHadEvtPartons::BBar ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_) &&
407  jets[combi[TtFullHadEvtPartons::LightQ ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
409  jets[combi[TtFullHadEvtPartons::LightP ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
411  return true;
412  }
413  else if( bJetCounter > 1 &&
414  jets[combi[TtFullHadEvtPartons::B ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
415  jets[combi[TtFullHadEvtPartons::BBar ]].bDiscriminator(bTagAlgo_) >= minBTagValueBJet_ &&
416  jets[combi[TtFullHadEvtPartons::LightQ ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
418  jets[combi[TtFullHadEvtPartons::LightP ]].bDiscriminator(bTagAlgo_) < maxBTagValueNonBJet_ &&
420  return true;
421  }
422  }
423  else if( bTags_ > 2 ){
424  throw cms::Exception("Configuration")
425  << "Wrong number of bTags (" << bTags_ << " bTags not supported)!\n";
426  return true;
427  }
428  return false;
429 }
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 458 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, TtFullHadKinFitter::KinFitResult::B, TtFullHadEvtPartons::BBar, TtFullHadKinFitter::KinFitResult::BBar, TtFullHadKinFitter::KinFitResult::Chi2, i, customizeTrackingMonitorSeedNumber::idx, 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().

458  {
459 
460  std::list<TtFullHadKinFitter::KinFitResult> fitResults;
461 
468  if( jets.size()<nPartons || invalidMatch_ ) {
469  // indices referring to the jet combination
470  std::vector<int> invalidCombi;
471  for(unsigned int i = 0; i < nPartons; ++i) invalidCombi.push_back( -1 );
472 
473  KinFitResult result;
474  // status of the fitter
475  result.Status = -1;
476  // chi2
477  result.Chi2 = -1.;
478  // chi2 probability
479  result.Prob = -1.;
480  // the kinFit getters return empty objects here
481  result.B = fitter->fittedB();
482  result.BBar = fitter->fittedBBar();
483  result.LightQ = fitter->fittedLightQ();
484  result.LightQBar= fitter->fittedLightQBar();
485  result.LightP = fitter->fittedLightP();
486  result.LightPBar= fitter->fittedLightPBar();
487  result.JetCombi = invalidCombi;
488  // push back fit result
489  fitResults.push_back( result );
490  return fitResults;
491  }
492 
498  std::vector<int> jetIndices;
499  if(!useOnlyMatch_) {
500  for(unsigned int idx=0; idx<jets.size(); ++idx){
501  if(maxNJets_>=(int)nPartons && maxNJets_==(int)idx) break;
502  jetIndices.push_back(idx);
503  }
504  }
505 
506  std::vector<int> combi;
507  for(unsigned int idx=0; idx<nPartons; ++idx) {
508  useOnlyMatch_?combi.push_back(match_[idx]):combi.push_back(idx);
509  }
510 
511 
512  unsigned int bJetCounter = 0;
513  for(std::vector<pat::Jet>::const_iterator jet = jets.begin(); jet < jets.end(); ++jet){
514  if(jet->bDiscriminator(bTagAlgo_) >= minBTagValueBJet_) ++bJetCounter;
515  }
516 
517  do{
518  for(int cnt=0; cnt<TMath::Factorial(combi.size()); ++cnt){
519  // take into account indistinguishability of the two jets from the two W decays,
520  // and the two decay branches, this reduces the combinatorics by a factor of 2*2*2
524  useOnlyMatch_) && doBTagging(jets, bJetCounter, combi) ) {
525 
526  std::vector<pat::Jet> jetCombi;
527  jetCombi.resize(nPartons);
530  jetCombi[TtFullHadEvtPartons::B ] = corJet(jets[combi[TtFullHadEvtPartons::B ]], "bottom");
531  jetCombi[TtFullHadEvtPartons::BBar ] = corJet(jets[combi[TtFullHadEvtPartons::BBar ]], "bottom");
534 
535  // do the kinematic fit
536  int status = fitter->fit(jetCombi);
537 
538  if( status == 0 ) {
539  // fill struct KinFitResults if converged
541  result.Status = status;
542  result.Chi2 = fitter->fitS();
543  result.Prob = fitter->fitProb();
544  result.B = fitter->fittedB();
545  result.BBar = fitter->fittedBBar();
546  result.LightQ = fitter->fittedLightQ();
547  result.LightQBar= fitter->fittedLightQBar();
548  result.LightP = fitter->fittedLightP();
549  result.LightPBar= fitter->fittedLightPBar();
550  result.JetCombi = combi;
551  // push back fit result
552  fitResults.push_back( result );
553  }
554  }
555  // don't go through combinatorics if useOnlyMatch was chosen
556  if(useOnlyMatch_){
557  break;
558  }
559  // next permutation
560  std::next_permutation( combi.begin(), combi.end() );
561  }
562  // don't go through combinatorics if useOnlyMatch was chosen
563  if(useOnlyMatch_){
564  break;
565  }
566  }
567  while( stdcomb::next_combination( jetIndices.begin(), jetIndices.end(), combi.begin(), combi.end() ) );
568 
569 
570  // sort results w.r.t. chi2 values
571  fitResults.sort();
572 
578  if( (unsigned)fitResults.size() < 1 ) {
579  // in case no fit results were stored in the list (i.e. when all fits were aborted)
580 
581  KinFitResult result;
582  // status of the fitter
583  result.Status = -1;
584  // chi2
585  result.Chi2 = -1.;
586  // chi2 probability
587  result.Prob = -1.;
588  // the kinFit getters return empty objects here
589  result.B = fitter->fittedB();
590  result.BBar = fitter->fittedBBar();
591  result.LightQ = fitter->fittedLightQ();
592  result.LightQBar= fitter->fittedLightQBar();
593  result.LightP = fitter->fittedLightP();
594  result.LightPBar= fitter->fittedLightPBar();
595  // indices referring to the jet combination
596  std::vector<int> invalidCombi(nPartons, -1);
597  result.JetCombi = invalidCombi;
598  // push back fit result
599  fitResults.push_back( result );
600  }
601  return fitResults;
602 }
int i
Definition: DBlmapReader.cc:9
const pat::Particle fittedLightPBar() const
return fitted light quark candidate
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:36
tuple result
Definition: mps_fire.py:84
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
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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:32
bool invalidMatch_
match is invalid
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
Definition: combination.h:22
const pat::Particle fittedLightQBar() const
return fitted light quark candidate
const pat::Particle fittedB() const
return fitted b quark candidate
tuple status
Definition: mps_update.py:57
TtFullHadKinFitter::Param TtFullHadKinFitter::KinFit::param ( unsigned int  configParameter)
private

Definition at line 605 of file TtFullHadKinFitter.cc.

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

Referenced by KinFit().

606 {
608  switch(configParameter){
612  default:
613  throw cms::Exception("Configuration")
614  << "Chosen jet parametrization is not supported: " << configParameter << "\n";
615  break;
616  }
617  return result;
618 }
Param
supported parameterizations
Definition: TopKinFitter.h:22
tuple result
Definition: mps_fire.py:84
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 148 of file TtFullHadKinFitter.h.

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

148  {
149  useBTagging_ = useBTagging;
150  bTags_ = bTags;
151  bTagAlgo_ = bTagAlgo;
152  minBTagValueBJet_ = minBTagValueBJet;
153  maxBTagValueNonBJet_ = maxBTagValueNonBJet;
154  }
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 164 of file TtFullHadKinFitter.h.

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

165  {
167  maxNrIter_ = maxNrIter;
168  maxDeltaS_ = maxDeltaS;
169  maxF_ = maxF;
170  jetParam_ = jetParam;
172  mW_ = mW;
173  mTop_ = mTop;
174  }
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 176 of file TtFullHadKinFitter.h.

References jetCorrectionLevel_.

176  {
177  jetCorrectionLevel_ = jetCorrectionLevel;
178  }
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 184 of file TtFullHadKinFitter.h.

References match(), and match_.

Referenced by TtFullHadKinFitProducer::produce().

184  {
185  match_ = match;
186  }
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 188 of file TtFullHadKinFitter.h.

References invalidMatch_.

Referenced by TtFullHadKinFitProducer::produce().

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

set number of combinations of output

Definition at line 192 of file TtFullHadKinFitter.h.

References maxNComb_.

192  {
193  maxNComb_ = maxNComb;
194  }
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 156 of file TtFullHadKinFitter.h.

References bResolutions_, jetEnergyResolutionEtaBinning_, jetEnergyResolutionScaleFactors_, and udscResolutions_.

157  {
158  udscResolutions_ = udscResolutions;
159  bResolutions_ = bResolutions;
160  jetEnergyResolutionScaleFactors_ = jetEnergyResolutionScaleFactors;
161  jetEnergyResolutionEtaBinning_ = jetEnergyResolutionEtaBinning;
162  }
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 180 of file TtFullHadKinFitter.h.

References useOnlyMatch_.

Referenced by TtFullHadKinFitProducer::produce().

180  {
181  useOnlyMatch_ = useOnlyMatch;
182  }
bool useOnlyMatch_
fit or only a certain combination

Member Data Documentation

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

Definition at line 226 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setResolutions().

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

input tag for b-tagging algorithm

Definition at line 220 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

unsigned int TtFullHadKinFitter::KinFit::bTags_
private

minimal number of b-jets

Definition at line 218 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

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

numbering of different possible kinematic constraints

Definition at line 245 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

TtFullHadKinFitter* TtFullHadKinFitter::KinFit::fitter
private

kinematic fit interface

Definition at line 258 of file TtFullHadKinFitter.h.

Referenced by KinFit().

bool TtFullHadKinFitter::KinFit::invalidMatch_
private

match is invalid

Definition at line 255 of file TtFullHadKinFitter.h.

Referenced by setMatchInvalidity().

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

correction level for jets

Definition at line 231 of file TtFullHadKinFitter.h.

Referenced by setJEC().

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

Definition at line 229 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 228 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setResolutions().

unsigned int TtFullHadKinFitter::KinFit::jetParam_
private

numbering of different possible jet parametrizations

Definition at line 243 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 253 of file TtFullHadKinFitter.h.

Referenced by setMatch().

double TtFullHadKinFitter::KinFit::maxBTagValueNonBJet_
private

max value of bTag for a non-b-jet

Definition at line 224 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

double TtFullHadKinFitter::KinFit::maxDeltaS_
private

maximal chi2 equivalent

Definition at line 239 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

double TtFullHadKinFitter::KinFit::maxF_
private

maximal deviation for contstraints

Definition at line 241 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 235 of file TtFullHadKinFitter.h.

Referenced by setOutput().

int TtFullHadKinFitter::KinFit::maxNJets_
private

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

Definition at line 233 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 237 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 222 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

double TtFullHadKinFitter::KinFit::mTop_
private

top mass value used for constraints

Definition at line 249 of file TtFullHadKinFitter.h.

Referenced by KinFit(), and setFitter().

double TtFullHadKinFitter::KinFit::mW_
private

W mass value used for constraints.

Definition at line 247 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 226 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 216 of file TtFullHadKinFitter.h.

Referenced by setBTagging().

bool TtFullHadKinFitter::KinFit::useOnlyMatch_
private

fit or only a certain combination

Definition at line 251 of file TtFullHadKinFitter.h.

Referenced by setUseOnlyMatch().