CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TtFullHadKinFitter Class Reference

#include <TtFullHadKinFitter.h>

Inheritance diagram for TtFullHadKinFitter:
TopKinFitter

Classes

class  KinFit
 class that does the fitting More...
 
struct  KinFitResult
 struct for fit results More...
 

Public Types

enum  Constraint {
  kWPlusMass = 1, kWMinusMass, kTopMass, kTopBarMass,
  kEqualTopMasses
}
 supported constraints More...
 
- Public Types inherited from TopKinFitter
enum  Param { kEMom, kEtEtaPhi, kEtThetaPhi }
 supported parameterizations More...
 

Public Member Functions

TtHadEvtSolution addKinFitInfo (TtHadEvtSolution *asol)
 add kin fit information to the old event solution (in for legacy reasons) More...
 
int fit (const std::vector< pat::Jet > &jets)
 kinematic fit interface More...
 
const pat::Particle fittedB () const
 return fitted b quark candidate More...
 
const pat::Particle fittedBBar () const
 return fitted b quark candidate More...
 
const pat::Particle fittedLightP () const
 return fitted light quark candidate More...
 
const pat::Particle fittedLightPBar () const
 return fitted light quark candidate More...
 
const pat::Particle fittedLightQ () const
 return fitted light quark candidate More...
 
const pat::Particle fittedLightQBar () const
 return fitted light quark candidate More...
 
std::vector< TtFullHadKinFitter::ConstraintintToConstraint (const std::vector< unsigned int > &constraints)
 used to convert vector of int's to vector of constraints (just used in TtFullHadKinFitter(int, int, double, double, std::vector<unsigned int>)) More...
 
 TtFullHadKinFitter ()
 default constructor More...
 
 TtFullHadKinFitter (int jetParam, int maxNrIter, double maxDeltaS, double maxF, const std::vector< unsigned int > &constraints, double mW=80.4, double mTop=173., const std::vector< edm::ParameterSet > *udscResolutions=nullptr, const std::vector< edm::ParameterSet > *bResolutions=nullptr, const std::vector< double > *jetEnergyResolutionScaleFactors=nullptr, const std::vector< double > *jetEnergyResolutionEtaBinning=nullptr)
 constructor initialized with build-in types as custom parameters (only included to keep TtHadEvtSolutionMaker.cc running) More...
 
 TtFullHadKinFitter (Param jetParam, int maxNrIter, double maxDeltaS, double maxF, const std::vector< Constraint > &constraints, double mW=80.4, double mTop=173., const std::vector< edm::ParameterSet > *udscResolutions=nullptr, const std::vector< edm::ParameterSet > *bResolutions=nullptr, const std::vector< double > *jetEnergyResolutionScaleFactors=nullptr, const std::vector< double > *jetEnergyResolutionEtaBinning=nullptr)
 constructor initialized with built-in types and class enum's custom parameters More...
 
 ~TtFullHadKinFitter ()
 default destructor More...
 
- Public Member Functions inherited from TopKinFitter
int fitNrIter () const
 return number of used iterations More...
 
double fitProb () const
 return fit probability More...
 
double fitS () const
 return chi2 of fit (not normalized to degrees of freedom) More...
 
void setVerbosity (const int verbosityLevel)
 allows to change the verbosity of the TKinFitter More...
 
 TopKinFitter (const int maxNrIter=200, const double maxDeltaS=5e-5, const double maxF=1e-4, const double mW=80.4, const double mTop=173.)
 default constructor More...
 
 ~TopKinFitter ()
 default destructor More...
 

Private Member Functions

void printSetup () const
 print fitter setup More...
 
void setupConstraints ()
 initialize constraints More...
 
void setupFitter ()
 setup fitter More...
 
void setupJets ()
 initialize jet inputs More...
 

Private Attributes

std::unique_ptr< TAbsFitParticleb_
 input particles More...
 
std::unique_ptr< TAbsFitParticlebBar_
 
const std::vector< edm::ParameterSet > * bResolutions_ = nullptr
 
std::vector< Constraintconstraints_
 vector of constraints to be used More...
 
std::unique_ptr< CovarianceMatrixcovM_
 get object resolutions and put them into a matrix More...
 
pat::Particle fittedB_
 output particles More...
 
pat::Particle fittedBBar_
 
pat::Particle fittedLightP_
 
pat::Particle fittedLightPBar_
 
pat::Particle fittedLightQ_
 
pat::Particle fittedLightQBar_
 
const std::vector< double > * jetEnergyResolutionEtaBinning_ = nullptr
 
const std::vector< double > * jetEnergyResolutionScaleFactors_ = nullptr
 scale factors for the jet energy resolution More...
 
Param jetParam_
 jet parametrization More...
 
std::unique_ptr< TAbsFitParticlelightP_
 
std::unique_ptr< TAbsFitParticlelightPBar_
 
std::unique_ptr< TAbsFitParticlelightQ_
 
std::unique_ptr< TAbsFitParticlelightQBar_
 
std::map< Constraint, std::unique_ptr< TFitConstraintM > > massConstr_
 supported constraints More...
 
const std::vector< edm::ParameterSet > * udscResolutions_ = nullptr
 resolutions More...
 

Additional Inherited Members

- Protected Member Functions inherited from TopKinFitter
std::string param (const Param &param) const
 convert Param to human readable form More...
 
- Protected Attributes inherited from TopKinFitter
std::unique_ptr< TKinFitterfitter_
 kinematic fitter More...
 
double maxDeltaS_
 maximal allowed chi2 (not normalized to degrees of freedom) More...
 
double maxF_
 maximal allowed distance from constraints More...
 
int maxNrIter_
 maximal allowed number of iterations to be used for the fit More...
 
double mTop_
 top mass value used for constraints More...
 
double mW_
 W mass value used for constraints. More...
 

Detailed Description

Definition at line 29 of file TtFullHadKinFitter.h.

Member Enumeration Documentation

◆ Constraint

Constructor & Destructor Documentation

◆ TtFullHadKinFitter() [1/3]

TtFullHadKinFitter::TtFullHadKinFitter ( )

default constructor

Definition at line 16 of file TtFullHadKinFitter.cc.

References setupFitter().

TopKinFitter(const int maxNrIter=200, const double maxDeltaS=5e-5, const double maxF=1e-4, const double mW=80.4, const double mTop=173.)
default constructor
Definition: TopKinFitter.cc:4
Param jetParam_
jet parametrization
void setupFitter()
setup fitter

◆ TtFullHadKinFitter() [2/3]

TtFullHadKinFitter::TtFullHadKinFitter ( int  jetParam,
int  maxNrIter,
double  maxDeltaS,
double  maxF,
const std::vector< unsigned int > &  constraints,
double  mW = 80.4,
double  mTop = 173.,
const std::vector< edm::ParameterSet > *  udscResolutions = nullptr,
const std::vector< edm::ParameterSet > *  bResolutions = nullptr,
const std::vector< double > *  jetEnergyResolutionScaleFactors = nullptr,
const std::vector< double > *  jetEnergyResolutionEtaBinning = nullptr 
)

constructor initialized with build-in types as custom parameters (only included to keep TtHadEvtSolutionMaker.cc running)

Definition at line 30 of file TtFullHadKinFitter.cc.

References setupFitter().

46  jetParam_((Param)jetParam),
48  setupFitter();
49 }
const std::vector< double > * jetEnergyResolutionEtaBinning_
Param
supported parameterizations
Definition: TopKinFitter.h:22
TopKinFitter(const int maxNrIter=200, const double maxDeltaS=5e-5, const double maxF=1e-4, const double mW=80.4, const double mTop=173.)
default constructor
Definition: TopKinFitter.cc:4
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::vector< TtFullHadKinFitter::Constraint > intToConstraint(const std::vector< unsigned int > &constraints)
used to convert vector of int&#39;s to vector of constraints (just used in TtFullHadKinFitter(int, int, double, double, std::vector<unsigned int>))
const std::vector< edm::ParameterSet > * bResolutions_
std::vector< Constraint > constraints_
vector of constraints to be used
Param jetParam_
jet parametrization
void setupFitter()
setup fitter
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions

◆ TtFullHadKinFitter() [3/3]

TtFullHadKinFitter::TtFullHadKinFitter ( Param  jetParam,
int  maxNrIter,
double  maxDeltaS,
double  maxF,
const std::vector< Constraint > &  constraints,
double  mW = 80.4,
double  mTop = 173.,
const std::vector< edm::ParameterSet > *  udscResolutions = nullptr,
const std::vector< edm::ParameterSet > *  bResolutions = nullptr,
const std::vector< double > *  jetEnergyResolutionScaleFactors = nullptr,
const std::vector< double > *  jetEnergyResolutionEtaBinning = nullptr 
)

constructor initialized with built-in types and class enum's custom parameters

constructor initialized with build-in types and class enum's custom parameters

Definition at line 52 of file TtFullHadKinFitter.cc.

References setupFitter().

68  jetParam_(jetParam),
70  setupFitter();
71 }
const std::vector< double > * jetEnergyResolutionEtaBinning_
TopKinFitter(const int maxNrIter=200, const double maxDeltaS=5e-5, const double maxF=1e-4, const double mW=80.4, const double mTop=173.)
default constructor
Definition: TopKinFitter.cc:4
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
const std::vector< edm::ParameterSet > * bResolutions_
std::vector< Constraint > constraints_
vector of constraints to be used
Param jetParam_
jet parametrization
void setupFitter()
setup fitter
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions

◆ ~TtFullHadKinFitter()

TtFullHadKinFitter::~TtFullHadKinFitter ( )
default

default destructor

Member Function Documentation

◆ addKinFitInfo()

TtHadEvtSolution TtFullHadKinFitter::addKinFitInfo ( TtHadEvtSolution asol)

add kin fit information to the old event solution (in for legacy reasons)

Definition at line 277 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, TtFullHadEvtPartons::BBar, fit(), TopKinFitter::fitProb(), fittedB_, fittedBBar_, fittedLightP_, fittedLightPBar_, fittedLightQ_, fittedLightQBar_, TopKinFitter::fitter_, TtHadEvtSolution::getCalHadb(), TtHadEvtSolution::getCalHadbbar(), TtHadEvtSolution::getCalHadj(), TtHadEvtSolution::getCalHadk(), TtHadEvtSolution::getCalHadp(), TtHadEvtSolution::getCalHadq(), PDWG_EXODelayedJetMET_cff::jets, TtFullHadEvtPartons::LightP, TtFullHadEvtPartons::LightPBar, TtFullHadEvtPartons::LightQ, TtFullHadEvtPartons::LightQBar, TtHadEvtSolution::setFitHadb(), TtHadEvtSolution::setFitHadbbar(), TtHadEvtSolution::setFitHadj(), TtHadEvtSolution::setFitHadk(), TtHadEvtSolution::setFitHadp(), TtHadEvtSolution::setFitHadq(), and TtHadEvtSolution::setProbChi2().

Referenced by TtHadEvtSolutionMaker::produce().

277  {
278  TtHadEvtSolution fitsol(*asol);
279 
280  std::vector<pat::Jet> jets;
281  jets.resize(6);
282  jets[TtFullHadEvtPartons::LightQ] = fitsol.getCalHadp();
283  jets[TtFullHadEvtPartons::LightQBar] = fitsol.getCalHadq();
284  jets[TtFullHadEvtPartons::B] = fitsol.getCalHadb();
285  jets[TtFullHadEvtPartons::LightP] = fitsol.getCalHadj();
286  jets[TtFullHadEvtPartons::LightPBar] = fitsol.getCalHadk();
287  jets[TtFullHadEvtPartons::BBar] = fitsol.getCalHadbbar();
288 
289  fit(jets);
290 
291  // add fitted information to the solution
292  if (fitter_->getStatus() == 0) {
293  // finally fill the fitted particles
294  fitsol.setFitHadb(fittedB_);
295  fitsol.setFitHadp(fittedLightQ_);
296  fitsol.setFitHadq(fittedLightQBar_);
297  fitsol.setFitHadk(fittedLightP_);
298  fitsol.setFitHadj(fittedLightPBar_);
299  fitsol.setFitHadbbar(fittedBBar_);
300 
301  // store the fit's chi2 probability
302  fitsol.setProbChi2(fitProb());
303  }
304  return fitsol;
305 }
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedLightPBar_
pat::Particle fittedB_
output particles
int fit(const std::vector< pat::Jet > &jets)
kinematic fit interface
pat::Particle fittedLightQBar_
double fitProb() const
return fit probability
Definition: TopKinFitter.h:39
pat::Particle fittedLightP_
pat::Particle fittedBBar_
pat::Particle fittedLightQ_

◆ fit()

int TtFullHadKinFitter::fit ( const std::vector< pat::Jet > &  jets)

kinematic fit interface

Definition at line 186 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, b, b_, TtFullHadEvtPartons::BBar, bBar_, edm::errors::Configuration, covM_, reco::LeafCandidate::energy(), Exception, fittedB_, fittedBBar_, fittedLightP_, fittedLightPBar_, fittedLightQ_, fittedLightQBar_, TopKinFitter::fitter_, jetParam_, PDWG_EXODelayedJetMET_cff::jets, TtFullHadEvtPartons::LightP, lightP_, TtFullHadEvtPartons::LightPBar, lightPBar_, TtFullHadEvtPartons::LightQ, lightQ_, TtFullHadEvtPartons::LightQBar, lightQBar_, callgraph::m2, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::LeafCandidate::pz().

Referenced by addKinFitInfo(), and trackingPlots.Iteration::modules().

186  {
187  if (jets.size() < 6) {
188  throw edm::Exception(edm::errors::Configuration, "Cannot run the TtFullHadKinFitter with less than 6 jets");
189  }
190 
191  // get jets in right order
193  const pat::Jet& bBar = jets[TtFullHadEvtPartons::BBar];
194  const pat::Jet& lightQ = jets[TtFullHadEvtPartons::LightQ];
195  const pat::Jet& lightQBar = jets[TtFullHadEvtPartons::LightQBar];
196  const pat::Jet& lightP = jets[TtFullHadEvtPartons::LightP];
197  const pat::Jet& lightPBar = jets[TtFullHadEvtPartons::LightPBar];
198 
199  // initialize particles
200  const TLorentzVector p4B(b.px(), b.py(), b.pz(), b.energy());
201  const TLorentzVector p4BBar(bBar.px(), bBar.py(), bBar.pz(), bBar.energy());
202  const TLorentzVector p4LightQ(lightQ.px(), lightQ.py(), lightQ.pz(), lightQ.energy());
203  const TLorentzVector p4LightQBar(lightQBar.px(), lightQBar.py(), lightQBar.pz(), lightQBar.energy());
204  const TLorentzVector p4LightP(lightP.px(), lightP.py(), lightP.pz(), lightP.energy());
205  const TLorentzVector p4LightPBar(lightPBar.px(), lightPBar.py(), lightPBar.pz(), lightPBar.energy());
206 
207  // initialize covariance matrices
208  TMatrixD m1 = covM_->setupMatrix(lightQ, jetParam_);
209  TMatrixD m2 = covM_->setupMatrix(lightQBar, jetParam_);
210  TMatrixD m3 = covM_->setupMatrix(b, jetParam_, "bjets");
211  TMatrixD m4 = covM_->setupMatrix(lightP, jetParam_);
212  TMatrixD m5 = covM_->setupMatrix(lightPBar, jetParam_);
213  TMatrixD m6 = covM_->setupMatrix(bBar, jetParam_, "bjets");
214 
215  // set the kinematics of the objects to be fitted
216  b_->setIni4Vec(&p4B);
217  bBar_->setIni4Vec(&p4BBar);
218  lightQ_->setIni4Vec(&p4LightQ);
219  lightQBar_->setIni4Vec(&p4LightQBar);
220  lightP_->setIni4Vec(&p4LightP);
221  lightPBar_->setIni4Vec(&p4LightPBar);
222 
223  // initialize covariance matrices
224  lightQ_->setCovMatrix(&m1);
225  lightQBar_->setCovMatrix(&m2);
226  b_->setCovMatrix(&m3);
227  lightP_->setCovMatrix(&m4);
228  lightPBar_->setCovMatrix(&m5);
229  bBar_->setCovMatrix(&m6);
230 
231  // perform the fit!
232  fitter_->fit();
233 
234  // add fitted information to the solution
235  if (fitter_->getStatus() == 0) {
236  // read back jet kinematics
238  0,
240  b_->getCurr4Vec()->X(), b_->getCurr4Vec()->Y(), b_->getCurr4Vec()->Z(), b_->getCurr4Vec()->E()),
241  math::XYZPoint()));
243  math::XYZTLorentzVector(lightQ_->getCurr4Vec()->X(),
244  lightQ_->getCurr4Vec()->Y(),
245  lightQ_->getCurr4Vec()->Z(),
246  lightQ_->getCurr4Vec()->E()),
247  math::XYZPoint()));
249  math::XYZTLorentzVector(lightQBar_->getCurr4Vec()->X(),
250  lightQBar_->getCurr4Vec()->Y(),
251  lightQBar_->getCurr4Vec()->Z(),
252  lightQBar_->getCurr4Vec()->E()),
253  math::XYZPoint()));
254 
256  0,
258  bBar_->getCurr4Vec()->X(), bBar_->getCurr4Vec()->Y(), bBar_->getCurr4Vec()->Z(), bBar_->getCurr4Vec()->E()),
259  math::XYZPoint()));
261  math::XYZTLorentzVector(lightP_->getCurr4Vec()->X(),
262  lightP_->getCurr4Vec()->Y(),
263  lightP_->getCurr4Vec()->Z(),
264  lightP_->getCurr4Vec()->E()),
265  math::XYZPoint()));
267  math::XYZTLorentzVector(lightPBar_->getCurr4Vec()->X(),
268  lightPBar_->getCurr4Vec()->Y(),
269  lightPBar_->getCurr4Vec()->Z(),
270  lightPBar_->getCurr4Vec()->E()),
271  math::XYZPoint()));
272  }
273  return fitter_->getStatus();
274 }
double pz() const final
z coordinate of momentum vector
std::unique_ptr< TAbsFitParticle > lightPBar_
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedLightPBar_
pat::Particle fittedB_
output particles
pat::Particle fittedLightQBar_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
std::unique_ptr< TAbsFitParticle > lightP_
double px() const final
x coordinate of momentum vector
double py() const final
y coordinate of momentum vector
pat::Particle fittedLightP_
pat::Particle fittedBBar_
std::unique_ptr< TAbsFitParticle > b_
input particles
Param jetParam_
jet parametrization
pat::Particle fittedLightQ_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Analysis-level particle class.
Definition: Particle.h:30
double b
Definition: hdecay.h:120
Analysis-level calorimeter jet class.
Definition: Jet.h:77
std::unique_ptr< CovarianceMatrix > covM_
get object resolutions and put them into a matrix
std::unique_ptr< TAbsFitParticle > lightQBar_
std::unique_ptr< TAbsFitParticle > lightQ_
std::unique_ptr< TAbsFitParticle > bBar_
double energy() const final
energy

◆ fittedB()

const pat::Particle TtFullHadKinFitter::fittedB ( ) const
inline

return fitted b quark candidate

Definition at line 69 of file TtFullHadKinFitter.h.

References fittedB_, and TopKinFitter::fitter_.

69 { return (fitter_->getStatus() == 0 ? fittedB_ : pat::Particle()); };
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedB_
output particles
Analysis-level particle class.
Definition: Particle.h:30

◆ fittedBBar()

const pat::Particle TtFullHadKinFitter::fittedBBar ( ) const
inline

return fitted b quark candidate

Definition at line 71 of file TtFullHadKinFitter.h.

References fittedBBar_, and TopKinFitter::fitter_.

71 { return (fitter_->getStatus() == 0 ? fittedBBar_ : pat::Particle()); };
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedBBar_
Analysis-level particle class.
Definition: Particle.h:30

◆ fittedLightP()

const pat::Particle TtFullHadKinFitter::fittedLightP ( ) const
inline

return fitted light quark candidate

Definition at line 79 of file TtFullHadKinFitter.h.

References fittedLightP_, and TopKinFitter::fitter_.

79 { return (fitter_->getStatus() == 0 ? fittedLightP_ : pat::Particle()); };
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedLightP_
Analysis-level particle class.
Definition: Particle.h:30

◆ fittedLightPBar()

const pat::Particle TtFullHadKinFitter::fittedLightPBar ( ) const
inline

return fitted light quark candidate

Definition at line 81 of file TtFullHadKinFitter.h.

References fittedLightPBar_, and TopKinFitter::fitter_.

81  {
82  return (fitter_->getStatus() == 0 ? fittedLightPBar_ : pat::Particle());
83  };
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedLightPBar_
Analysis-level particle class.
Definition: Particle.h:30

◆ fittedLightQ()

const pat::Particle TtFullHadKinFitter::fittedLightQ ( ) const
inline

return fitted light quark candidate

Definition at line 73 of file TtFullHadKinFitter.h.

References fittedLightQ_, and TopKinFitter::fitter_.

73 { return (fitter_->getStatus() == 0 ? fittedLightQ_ : pat::Particle()); };
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedLightQ_
Analysis-level particle class.
Definition: Particle.h:30

◆ fittedLightQBar()

const pat::Particle TtFullHadKinFitter::fittedLightQBar ( ) const
inline

return fitted light quark candidate

Definition at line 75 of file TtFullHadKinFitter.h.

References fittedLightQBar_, and TopKinFitter::fitter_.

75  {
76  return (fitter_->getStatus() == 0 ? fittedLightQBar_ : pat::Particle());
77  };
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
pat::Particle fittedLightQBar_
Analysis-level particle class.
Definition: Particle.h:30

◆ intToConstraint()

std::vector< TtFullHadKinFitter::Constraint > TtFullHadKinFitter::intToConstraint ( const std::vector< unsigned int > &  constraints)

used to convert vector of int's to vector of constraints (just used in TtFullHadKinFitter(int, int, double, double, std::vector<unsigned int>))

Definition at line 19 of file TtFullHadKinFitter.cc.

References createBeamHaloJobs::constraints, and mps_fire::i.

20  {
21  std::vector<TtFullHadKinFitter::Constraint> cConstraints;
22  cConstraints.resize(constraints.size());
23  for (unsigned int i = 0; i < constraints.size(); ++i) {
24  cConstraints[i] = (Constraint)constraints[i];
25  }
26  return cConstraints;
27 }
Constraint
supported constraints

◆ printSetup()

void TtFullHadKinFitter::printSetup ( ) const
private

print fitter setup

Definition at line 77 of file TtFullHadKinFitter.cc.

References constraints_, mps_fire::i, jetParam_, kEqualTopMasses, kTopBarMass, kTopMass, kWMinusMass, kWPlusMass, TopKinFitter::maxDeltaS_, TopKinFitter::maxF_, TopKinFitter::maxNrIter_, TopKinFitter::mTop_, TopKinFitter::mW_, and TopKinFitter::param().

Referenced by setupFitter().

77  {
78  std::stringstream constr;
79  for (unsigned int i = 0; i < constraints_.size(); ++i) {
80  switch (constraints_[i]) {
81  case kWPlusMass:
82  constr << " * W+-mass (" << mW_ << " GeV) \n";
83  break;
84  case kWMinusMass:
85  constr << " * W--mass (" << mW_ << " GeV) \n";
86  break;
87  case kTopMass:
88  constr << " * t-mass (" << mTop_ << " GeV) \n";
89  break;
90  case kTopBarMass:
91  constr << " * tBar-mass (" << mTop_ << " GeV) \n";
92  break;
93  case kEqualTopMasses:
94  constr << " * equal t-masses \n";
95  break;
96  }
97  }
98  edm::LogVerbatim("TtFullHadKinFitter") << "\n"
99  << "+++++++++++ TtFullHadKinFitter Setup ++++++++++++ \n"
100  << " Parametrization: \n"
101  << " * jet : " << param(jetParam_) << "\n"
102  << " Constraints: \n"
103  << constr.str() << " Max(No iterations): " << maxNrIter_ << "\n"
104  << " Max(deltaS) : " << maxDeltaS_ << "\n"
105  << " Max(F) : " << maxF_ << "\n"
106  << "+++++++++++++++++++++++++++++++++++++++++++++++++ \n";
107 }
std::string param(const Param &param) const
convert Param to human readable form
Definition: TopKinFitter.cc:18
Log< level::Info, true > LogVerbatim
int maxNrIter_
maximal allowed number of iterations to be used for the fit
Definition: TopKinFitter.h:51
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:57
double maxDeltaS_
maximal allowed chi2 (not normalized to degrees of freedom)
Definition: TopKinFitter.h:53
std::vector< Constraint > constraints_
vector of constraints to be used
Param jetParam_
jet parametrization
double mTop_
top mass value used for constraints
Definition: TopKinFitter.h:59
double maxF_
maximal allowed distance from constraints
Definition: TopKinFitter.h:55

◆ setupConstraints()

void TtFullHadKinFitter::setupConstraints ( )
private

initialize constraints

Definition at line 142 of file TtFullHadKinFitter.cc.

References b_, bBar_, kEqualTopMasses, kTopBarMass, kTopMass, kWMinusMass, kWPlusMass, lightP_, lightPBar_, lightQ_, lightQBar_, massConstr_, TopKinFitter::mTop_, and TopKinFitter::mW_.

Referenced by setupFitter().

142  {
143  massConstr_[kWPlusMass] = std::make_unique<TFitConstraintM>("WPlusMass", "WPlusMass", nullptr, nullptr, mW_);
144  massConstr_[kWMinusMass] = std::make_unique<TFitConstraintM>("WMinusMass", "WMinusMass", nullptr, nullptr, mW_);
145  massConstr_[kTopMass] = std::make_unique<TFitConstraintM>("TopMass", "TopMass", nullptr, nullptr, mTop_);
146  massConstr_[kTopBarMass] = std::make_unique<TFitConstraintM>("TopBarMass", "TopBarMass", nullptr, nullptr, mTop_);
148  std::make_unique<TFitConstraintM>("EqualTopMasses", "EqualTopMasses", nullptr, nullptr, 0);
149 
150  massConstr_[kWPlusMass]->addParticles1(lightQ_.get(), lightQBar_.get());
151  massConstr_[kWMinusMass]->addParticles1(lightP_.get(), lightPBar_.get());
152  massConstr_[kTopMass]->addParticles1(b_.get(), lightQ_.get(), lightQBar_.get());
153  massConstr_[kTopBarMass]->addParticles1(bBar_.get(), lightP_.get(), lightPBar_.get());
154  massConstr_[kEqualTopMasses]->addParticles1(b_.get(), lightQ_.get(), lightQBar_.get());
155  massConstr_[kEqualTopMasses]->addParticles2(bBar_.get(), lightP_.get(), lightPBar_.get());
156 }
std::unique_ptr< TAbsFitParticle > lightPBar_
std::map< Constraint, std::unique_ptr< TFitConstraintM > > massConstr_
supported constraints
std::unique_ptr< TAbsFitParticle > lightP_
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:57
std::unique_ptr< TAbsFitParticle > b_
input particles
std::unique_ptr< TAbsFitParticle > lightQBar_
std::unique_ptr< TAbsFitParticle > lightQ_
double mTop_
top mass value used for constraints
Definition: TopKinFitter.h:59
std::unique_ptr< TAbsFitParticle > bBar_

◆ setupFitter()

void TtFullHadKinFitter::setupFitter ( )
private

setup fitter

Definition at line 159 of file TtFullHadKinFitter.cc.

References b_, bBar_, bResolutions_, constraints_, covM_, TopKinFitter::fitter_, mps_fire::i, jetEnergyResolutionEtaBinning_, jetEnergyResolutionScaleFactors_, lightP_, lightPBar_, lightQ_, lightQBar_, massConstr_, printSetup(), setupConstraints(), setupJets(), and udscResolutions_.

Referenced by TtFullHadKinFitter().

159  {
160  printSetup();
161  setupJets();
163 
164  // add measured particles
165  fitter_->addMeasParticle(b_.get());
166  fitter_->addMeasParticle(bBar_.get());
167  fitter_->addMeasParticle(lightQ_.get());
168  fitter_->addMeasParticle(lightQBar_.get());
169  fitter_->addMeasParticle(lightP_.get());
170  fitter_->addMeasParticle(lightPBar_.get());
171 
172  // add constraints
173  for (unsigned int i = 0; i < constraints_.size(); i++) {
174  fitter_->addConstraint(massConstr_[constraints_[i]].get());
175  }
176 
177  // initialize helper class used to bring the resolutions into covariance matrices
178  if (!udscResolutions_->empty() && !bResolutions_->empty())
179  covM_ = std::make_unique<CovarianceMatrix>(
181  else
182  covM_ = std::make_unique<CovarianceMatrix>();
183 }
const std::vector< double > * jetEnergyResolutionEtaBinning_
void setupConstraints()
initialize constraints
std::unique_ptr< TAbsFitParticle > lightPBar_
void printSetup() const
print fitter setup
std::unique_ptr< TKinFitter > fitter_
kinematic fitter
Definition: TopKinFitter.h:49
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::map< Constraint, std::unique_ptr< TFitConstraintM > > massConstr_
supported constraints
std::unique_ptr< TAbsFitParticle > lightP_
const std::vector< edm::ParameterSet > * bResolutions_
std::unique_ptr< TAbsFitParticle > b_
input particles
std::vector< Constraint > constraints_
vector of constraints to be used
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
std::unique_ptr< CovarianceMatrix > covM_
get object resolutions and put them into a matrix
void setupJets()
initialize jet inputs
std::unique_ptr< TAbsFitParticle > lightQBar_
std::unique_ptr< TAbsFitParticle > lightQ_
std::unique_ptr< TAbsFitParticle > bBar_

◆ setupJets()

void TtFullHadKinFitter::setupJets ( )
private

initialize jet inputs

Definition at line 110 of file TtFullHadKinFitter.cc.

References b_, bBar_, jetParam_, TopKinFitter::kEMom, TopKinFitter::kEtEtaPhi, TopKinFitter::kEtThetaPhi, lightP_, lightPBar_, lightQ_, and lightQBar_.

Referenced by setupFitter().

110  {
111  TMatrixD empty3x3(3, 3);
112  TMatrixD empty4x4(4, 4);
113  switch (jetParam_) { // setup jets according to parameterization
114  case kEMom:
115  b_ = std::make_unique<TFitParticleEMomDev>("Jet1", "Jet1", nullptr, &empty4x4);
116  bBar_ = std::make_unique<TFitParticleEMomDev>("Jet2", "Jet2", nullptr, &empty4x4);
117  lightQ_ = std::make_unique<TFitParticleEMomDev>("Jet3", "Jet3", nullptr, &empty4x4);
118  lightQBar_ = std::make_unique<TFitParticleEMomDev>("Jet4", "Jet4", nullptr, &empty4x4);
119  lightP_ = std::make_unique<TFitParticleEMomDev>("Jet5", "Jet5", nullptr, &empty4x4);
120  lightPBar_ = std::make_unique<TFitParticleEMomDev>("Jet6", "Jet6", nullptr, &empty4x4);
121  break;
122  case kEtEtaPhi:
123  b_ = std::make_unique<TFitParticleEtEtaPhi>("Jet1", "Jet1", nullptr, &empty3x3);
124  bBar_ = std::make_unique<TFitParticleEtEtaPhi>("Jet2", "Jet2", nullptr, &empty3x3);
125  lightQ_ = std::make_unique<TFitParticleEtEtaPhi>("Jet3", "Jet3", nullptr, &empty3x3);
126  lightQBar_ = std::make_unique<TFitParticleEtEtaPhi>("Jet4", "Jet4", nullptr, &empty3x3);
127  lightP_ = std::make_unique<TFitParticleEtEtaPhi>("Jet5", "Jet5", nullptr, &empty3x3);
128  lightPBar_ = std::make_unique<TFitParticleEtEtaPhi>("Jet6", "Jet6", nullptr, &empty3x3);
129  break;
130  case kEtThetaPhi:
131  b_ = std::make_unique<TFitParticleEtThetaPhi>("Jet1", "Jet1", nullptr, &empty3x3);
132  bBar_ = std::make_unique<TFitParticleEtThetaPhi>("Jet2", "Jet2", nullptr, &empty3x3);
133  lightQ_ = std::make_unique<TFitParticleEtThetaPhi>("Jet3", "Jet3", nullptr, &empty3x3);
134  lightQBar_ = std::make_unique<TFitParticleEtThetaPhi>("Jet4", "Jet4", nullptr, &empty3x3);
135  lightP_ = std::make_unique<TFitParticleEtThetaPhi>("Jet5", "Jet5", nullptr, &empty3x3);
136  lightPBar_ = std::make_unique<TFitParticleEtThetaPhi>("Jet6", "Jet6", nullptr, &empty3x3);
137  break;
138  }
139 }
std::unique_ptr< TAbsFitParticle > lightPBar_
std::unique_ptr< TAbsFitParticle > lightP_
std::unique_ptr< TAbsFitParticle > b_
input particles
Param jetParam_
jet parametrization
std::unique_ptr< TAbsFitParticle > lightQBar_
std::unique_ptr< TAbsFitParticle > lightQ_
std::unique_ptr< TAbsFitParticle > bBar_

Member Data Documentation

◆ b_

std::unique_ptr<TAbsFitParticle> TtFullHadKinFitter::b_
private

input particles

Definition at line 99 of file TtFullHadKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and setupJets().

◆ bBar_

std::unique_ptr<TAbsFitParticle> TtFullHadKinFitter::bBar_
private

Definition at line 100 of file TtFullHadKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and setupJets().

◆ bResolutions_

const std::vector<edm::ParameterSet>* TtFullHadKinFitter::bResolutions_ = nullptr
private

Definition at line 107 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

◆ constraints_

std::vector<Constraint> TtFullHadKinFitter::constraints_
private

vector of constraints to be used

Definition at line 123 of file TtFullHadKinFitter.h.

Referenced by printSetup(), and setupFitter().

◆ covM_

std::unique_ptr<CovarianceMatrix> TtFullHadKinFitter::covM_
private

get object resolutions and put them into a matrix

Definition at line 126 of file TtFullHadKinFitter.h.

Referenced by fit(), and setupFitter().

◆ fittedB_

pat::Particle TtFullHadKinFitter::fittedB_
private

output particles

Definition at line 114 of file TtFullHadKinFitter.h.

Referenced by addKinFitInfo(), fit(), and fittedB().

◆ fittedBBar_

pat::Particle TtFullHadKinFitter::fittedBBar_
private

Definition at line 115 of file TtFullHadKinFitter.h.

Referenced by addKinFitInfo(), fit(), and fittedBBar().

◆ fittedLightP_

pat::Particle TtFullHadKinFitter::fittedLightP_
private

Definition at line 118 of file TtFullHadKinFitter.h.

Referenced by addKinFitInfo(), fit(), and fittedLightP().

◆ fittedLightPBar_

pat::Particle TtFullHadKinFitter::fittedLightPBar_
private

Definition at line 119 of file TtFullHadKinFitter.h.

Referenced by addKinFitInfo(), fit(), and fittedLightPBar().

◆ fittedLightQ_

pat::Particle TtFullHadKinFitter::fittedLightQ_
private

Definition at line 116 of file TtFullHadKinFitter.h.

Referenced by addKinFitInfo(), fit(), and fittedLightQ().

◆ fittedLightQBar_

pat::Particle TtFullHadKinFitter::fittedLightQBar_
private

Definition at line 117 of file TtFullHadKinFitter.h.

Referenced by addKinFitInfo(), fit(), and fittedLightQBar().

◆ jetEnergyResolutionEtaBinning_

const std::vector<double>* TtFullHadKinFitter::jetEnergyResolutionEtaBinning_ = nullptr
private

Definition at line 110 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

◆ jetEnergyResolutionScaleFactors_

const std::vector<double>* TtFullHadKinFitter::jetEnergyResolutionScaleFactors_ = nullptr
private

scale factors for the jet energy resolution

Definition at line 109 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

◆ jetParam_

Param TtFullHadKinFitter::jetParam_
private

jet parametrization

Definition at line 121 of file TtFullHadKinFitter.h.

Referenced by fit(), printSetup(), and setupJets().

◆ lightP_

std::unique_ptr<TAbsFitParticle> TtFullHadKinFitter::lightP_
private

Definition at line 103 of file TtFullHadKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and setupJets().

◆ lightPBar_

std::unique_ptr<TAbsFitParticle> TtFullHadKinFitter::lightPBar_
private

Definition at line 104 of file TtFullHadKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and setupJets().

◆ lightQ_

std::unique_ptr<TAbsFitParticle> TtFullHadKinFitter::lightQ_
private

Definition at line 101 of file TtFullHadKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and setupJets().

◆ lightQBar_

std::unique_ptr<TAbsFitParticle> TtFullHadKinFitter::lightQBar_
private

Definition at line 102 of file TtFullHadKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and setupJets().

◆ massConstr_

std::map<Constraint, std::unique_ptr<TFitConstraintM> > TtFullHadKinFitter::massConstr_
private

supported constraints

Definition at line 112 of file TtFullHadKinFitter.h.

Referenced by setupConstraints(), and setupFitter().

◆ udscResolutions_

const std::vector<edm::ParameterSet>* TtFullHadKinFitter::udscResolutions_ = nullptr
private

resolutions

Definition at line 106 of file TtFullHadKinFitter.h.

Referenced by setupFitter().