CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::Constraint
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>)) 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

TAbsFitParticleb_
 input particles More...
 
TAbsFitParticlebBar_
 
const std::vector
< edm::ParameterSet > * 
bResolutions_
 
std::vector< Constraintconstraints_
 vector of constraints to be used More...
 
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_
 
const std::vector< double > * jetEnergyResolutionScaleFactors_
 scale factors for the jet energy resolution More...
 
Param jetParam_
 jet parametrization More...
 
TAbsFitParticlelightP_
 
TAbsFitParticlelightPBar_
 
TAbsFitParticlelightQ_
 
TAbsFitParticlelightQBar_
 
std::map< Constraint,
TFitConstraintM * > 
massConstr_
 supported constraints More...
 
const std::vector
< edm::ParameterSet > * 
udscResolutions_
 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
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

Constructor & Destructor Documentation

TtFullHadKinFitter::TtFullHadKinFitter ( )

default constructor

Definition at line 16 of file TtFullHadKinFitter.cc.

References setupFitter().

Referenced by TtFullHadKinFitter::KinFit::KinFit().

17  : TopKinFitter(),
18  b_(nullptr),
19  bBar_(nullptr),
20  lightQ_(nullptr),
21  lightQBar_(nullptr),
22  lightP_(nullptr),
23  lightPBar_(nullptr),
24  udscResolutions_(nullptr),
25  bResolutions_(nullptr),
28  jetParam_(kEMom) {
29  setupFitter();
30 }
TAbsFitParticle * lightQ_
const std::vector< double > * jetEnergyResolutionEtaBinning_
TAbsFitParticle * lightP_
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_
TAbsFitParticle * b_
input particles
TAbsFitParticle * lightQBar_
Param jetParam_
jet parametrization
void setupFitter()
setup fitter
TAbsFitParticle * bBar_
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
TAbsFitParticle * lightPBar_
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 44 of file TtFullHadKinFitter.cc.

References setupFitter().

55  : TopKinFitter(maxNrIter, maxDeltaS, maxF, mW, mTop),
56  b_(nullptr),
57  bBar_(nullptr),
58  lightQ_(nullptr),
59  lightQBar_(nullptr),
60  lightP_(nullptr),
61  lightPBar_(nullptr),
62  udscResolutions_(udscResolutions),
63  bResolutions_(bResolutions),
64  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors),
65  jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
66  jetParam_((Param)jetParam),
68  setupFitter();
69 }
TAbsFitParticle * lightQ_
const std::vector< double > * jetEnergyResolutionEtaBinning_
Param
supported parameterizations
Definition: TopKinFitter.h:20
TAbsFitParticle * lightP_
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&lt;unsigned int&gt;))
const std::vector< edm::ParameterSet > * bResolutions_
TAbsFitParticle * b_
input particles
TAbsFitParticle * lightQBar_
std::vector< Constraint > constraints_
vector of constraints to be used
Param jetParam_
jet parametrization
void setupFitter()
setup fitter
TAbsFitParticle * bBar_
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
TAbsFitParticle * lightPBar_
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 72 of file TtFullHadKinFitter.cc.

References setupFitter().

83  : TopKinFitter(maxNrIter, maxDeltaS, maxF, mW, mTop),
84  b_(nullptr),
85  bBar_(nullptr),
86  lightQ_(nullptr),
87  lightQBar_(nullptr),
88  lightP_(nullptr),
89  lightPBar_(nullptr),
90  udscResolutions_(udscResolutions),
91  bResolutions_(bResolutions),
92  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors),
93  jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
94  jetParam_(jetParam),
96  setupFitter();
97 }
TAbsFitParticle * lightQ_
const std::vector< double > * jetEnergyResolutionEtaBinning_
TAbsFitParticle * lightP_
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_
TAbsFitParticle * b_
input particles
TAbsFitParticle * lightQBar_
std::vector< Constraint > constraints_
vector of constraints to be used
Param jetParam_
jet parametrization
void setupFitter()
setup fitter
TAbsFitParticle * bBar_
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
TAbsFitParticle * lightPBar_
TtFullHadKinFitter::~TtFullHadKinFitter ( )

default destructor

Definition at line 100 of file TtFullHadKinFitter.cc.

References b_, bBar_, covM_, lightP_, lightPBar_, lightQ_, lightQBar_, and massConstr_.

100  {
101  delete b_;
102  delete bBar_;
103  delete lightQ_;
104  delete lightQBar_;
105  delete lightP_;
106  delete lightPBar_;
107  delete covM_;
108  for (std::map<Constraint, TFitConstraintM*>::iterator it = massConstr_.begin(); it != massConstr_.end(); ++it)
109  delete it->second;
110 }
TAbsFitParticle * lightQ_
CovarianceMatrix * covM_
get object resolutions and put them into a matrix
TAbsFitParticle * lightP_
TAbsFitParticle * b_
input particles
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
TAbsFitParticle * lightQBar_
TAbsFitParticle * bBar_
TAbsFitParticle * lightPBar_

Member Function Documentation

TtHadEvtSolution TtFullHadKinFitter::addKinFitInfo ( TtHadEvtSolution asol)

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

Definition at line 312 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(), TKinFitter::getStatus(), fwrapper::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().

312  {
313  TtHadEvtSolution fitsol(*asol);
314 
315  std::vector<pat::Jet> jets;
316  jets.resize(6);
317  jets[TtFullHadEvtPartons::LightQ] = fitsol.getCalHadp();
318  jets[TtFullHadEvtPartons::LightQBar] = fitsol.getCalHadq();
319  jets[TtFullHadEvtPartons::B] = fitsol.getCalHadb();
320  jets[TtFullHadEvtPartons::LightP] = fitsol.getCalHadj();
321  jets[TtFullHadEvtPartons::LightPBar] = fitsol.getCalHadk();
322  jets[TtFullHadEvtPartons::BBar] = fitsol.getCalHadbbar();
323 
324  fit(jets);
325 
326  // add fitted information to the solution
327  if (fitter_->getStatus() == 0) {
328  // finally fill the fitted particles
329  fitsol.setFitHadb(fittedB_);
330  fitsol.setFitHadp(fittedLightQ_);
331  fitsol.setFitHadq(fittedLightQBar_);
332  fitsol.setFitHadk(fittedLightP_);
333  fitsol.setFitHadj(fittedLightPBar_);
334  fitsol.setFitHadbbar(fittedBBar_);
335 
336  // store the fit's chi2 probability
337  fitsol.setProbChi2(fitProb());
338  }
339  return fitsol;
340 }
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:37
vector< PseudoJet > jets
Int_t getStatus()
Definition: TKinFitter.h:51
pat::Particle fittedLightP_
pat::Particle fittedBBar_
pat::Particle fittedLightQ_
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
int TtFullHadKinFitter::fit ( const std::vector< pat::Jet > &  jets)

kinematic fit interface

Definition at line 221 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, b, b_, TtFullHadEvtPartons::BBar, bBar_, edm::errors::Configuration, covM_, reco::LeafCandidate::energy(), Exception, TKinFitter::fit(), fittedB_, fittedBBar_, fittedLightP_, fittedLightPBar_, fittedLightQ_, fittedLightQBar_, TopKinFitter::fitter_, TAbsFitParticle::getCurr4Vec(), TKinFitter::getStatus(), jetParam_, TtFullHadEvtPartons::LightP, lightP_, TtFullHadEvtPartons::LightPBar, lightPBar_, TtFullHadEvtPartons::LightQ, lightQ_, TtFullHadEvtPartons::LightQBar, lightQBar_, callgraph::m2, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), TAbsFitParticle::setCovMatrix(), TAbsFitParticle::setIni4Vec(), and CovarianceMatrix::setupMatrix().

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

221  {
222  if (jets.size() < 6) {
223  throw edm::Exception(edm::errors::Configuration, "Cannot run the TtFullHadKinFitter with less than 6 jets");
224  }
225 
226  // get jets in right order
228  const pat::Jet& bBar = jets[TtFullHadEvtPartons::BBar];
229  const pat::Jet& lightQ = jets[TtFullHadEvtPartons::LightQ];
230  const pat::Jet& lightQBar = jets[TtFullHadEvtPartons::LightQBar];
231  const pat::Jet& lightP = jets[TtFullHadEvtPartons::LightP];
232  const pat::Jet& lightPBar = jets[TtFullHadEvtPartons::LightPBar];
233 
234  // initialize particles
235  const TLorentzVector p4B(b.px(), b.py(), b.pz(), b.energy());
236  const TLorentzVector p4BBar(bBar.px(), bBar.py(), bBar.pz(), bBar.energy());
237  const TLorentzVector p4LightQ(lightQ.px(), lightQ.py(), lightQ.pz(), lightQ.energy());
238  const TLorentzVector p4LightQBar(lightQBar.px(), lightQBar.py(), lightQBar.pz(), lightQBar.energy());
239  const TLorentzVector p4LightP(lightP.px(), lightP.py(), lightP.pz(), lightP.energy());
240  const TLorentzVector p4LightPBar(lightPBar.px(), lightPBar.py(), lightPBar.pz(), lightPBar.energy());
241 
242  // initialize covariance matrices
243  TMatrixD m1 = covM_->setupMatrix(lightQ, jetParam_);
244  TMatrixD m2 = covM_->setupMatrix(lightQBar, jetParam_);
245  TMatrixD m3 = covM_->setupMatrix(b, jetParam_, "bjets");
246  TMatrixD m4 = covM_->setupMatrix(lightP, jetParam_);
247  TMatrixD m5 = covM_->setupMatrix(lightPBar, jetParam_);
248  TMatrixD m6 = covM_->setupMatrix(bBar, jetParam_, "bjets");
249 
250  // set the kinematics of the objects to be fitted
251  b_->setIni4Vec(&p4B);
252  bBar_->setIni4Vec(&p4BBar);
253  lightQ_->setIni4Vec(&p4LightQ);
254  lightQBar_->setIni4Vec(&p4LightQBar);
255  lightP_->setIni4Vec(&p4LightP);
256  lightPBar_->setIni4Vec(&p4LightPBar);
257 
258  // initialize covariance matrices
259  lightQ_->setCovMatrix(&m1);
260  lightQBar_->setCovMatrix(&m2);
261  b_->setCovMatrix(&m3);
262  lightP_->setCovMatrix(&m4);
263  lightPBar_->setCovMatrix(&m5);
264  bBar_->setCovMatrix(&m6);
265 
266  // perform the fit!
267  fitter_->fit();
268 
269  // add fitted information to the solution
270  if (fitter_->getStatus() == 0) {
271  // read back jet kinematics
273  0,
275  b_->getCurr4Vec()->X(), b_->getCurr4Vec()->Y(), b_->getCurr4Vec()->Z(), b_->getCurr4Vec()->E()),
276  math::XYZPoint()));
279  lightQ_->getCurr4Vec()->Y(),
280  lightQ_->getCurr4Vec()->Z(),
281  lightQ_->getCurr4Vec()->E()),
282  math::XYZPoint()));
285  lightQBar_->getCurr4Vec()->Y(),
286  lightQBar_->getCurr4Vec()->Z(),
287  lightQBar_->getCurr4Vec()->E()),
288  math::XYZPoint()));
289 
291  0,
293  bBar_->getCurr4Vec()->X(), bBar_->getCurr4Vec()->Y(), bBar_->getCurr4Vec()->Z(), bBar_->getCurr4Vec()->E()),
294  math::XYZPoint()));
297  lightP_->getCurr4Vec()->Y(),
298  lightP_->getCurr4Vec()->Z(),
299  lightP_->getCurr4Vec()->E()),
300  math::XYZPoint()));
303  lightPBar_->getCurr4Vec()->Y(),
304  lightPBar_->getCurr4Vec()->Z(),
305  lightPBar_->getCurr4Vec()->E()),
306  math::XYZPoint()));
307  }
308  return fitter_->getStatus();
309 }
TAbsFitParticle * lightQ_
CovarianceMatrix * covM_
get object resolutions and put them into a matrix
double pz() const final
z coordinate of momentum vector
TAbsFitParticle * lightP_
Int_t fit()
Definition: TKinFitter.cc:318
virtual void setIni4Vec(const TLorentzVector *pini)=0
pat::Particle fittedLightPBar_
pat::Particle fittedB_
output particles
TMatrixD setupMatrix(const pat::PATObject< T > &object, const TopKinFitter::Param param, const std::string &resolutionProvider="")
return covariance matrix for a PAT object
pat::Particle fittedLightQBar_
tuple m2
Definition: callgraph.py:57
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double px() const final
x coordinate of momentum vector
vector< PseudoJet > jets
TAbsFitParticle * b_
input particles
Int_t getStatus()
Definition: TKinFitter.h:51
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
double py() const final
y coordinate of momentum vector
pat::Particle fittedLightP_
TAbsFitParticle * lightQBar_
pat::Particle fittedBBar_
Param jetParam_
jet parametrization
pat::Particle fittedLightQ_
TAbsFitParticle * bBar_
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:118
Analysis-level calorimeter jet class.
Definition: Jet.h:77
const TLorentzVector * getCurr4Vec()
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
TAbsFitParticle * lightPBar_
double energy() const final
energy
const pat::Particle TtFullHadKinFitter::fittedB ( ) const
inline

return fitted b quark candidate

Definition at line 69 of file TtFullHadKinFitter.h.

References fittedB_, TopKinFitter::fitter_, and TKinFitter::getStatus().

69 { return (fitter_->getStatus() == 0 ? fittedB_ : pat::Particle()); };
pat::Particle fittedB_
output particles
Int_t getStatus()
Definition: TKinFitter.h:51
Analysis-level particle class.
Definition: Particle.h:30
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
const pat::Particle TtFullHadKinFitter::fittedBBar ( ) const
inline

return fitted b quark candidate

Definition at line 71 of file TtFullHadKinFitter.h.

References fittedBBar_, TopKinFitter::fitter_, and TKinFitter::getStatus().

71 { return (fitter_->getStatus() == 0 ? fittedBBar_ : pat::Particle()); };
Int_t getStatus()
Definition: TKinFitter.h:51
pat::Particle fittedBBar_
Analysis-level particle class.
Definition: Particle.h:30
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
const pat::Particle TtFullHadKinFitter::fittedLightP ( ) const
inline

return fitted light quark candidate

Definition at line 79 of file TtFullHadKinFitter.h.

References fittedLightP_, TopKinFitter::fitter_, and TKinFitter::getStatus().

79 { return (fitter_->getStatus() == 0 ? fittedLightP_ : pat::Particle()); };
Int_t getStatus()
Definition: TKinFitter.h:51
pat::Particle fittedLightP_
Analysis-level particle class.
Definition: Particle.h:30
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
const pat::Particle TtFullHadKinFitter::fittedLightPBar ( ) const
inline

return fitted light quark candidate

Definition at line 81 of file TtFullHadKinFitter.h.

References fittedLightPBar_, TopKinFitter::fitter_, and TKinFitter::getStatus().

81  {
82  return (fitter_->getStatus() == 0 ? fittedLightPBar_ : pat::Particle());
83  };
pat::Particle fittedLightPBar_
Int_t getStatus()
Definition: TKinFitter.h:51
Analysis-level particle class.
Definition: Particle.h:30
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
const pat::Particle TtFullHadKinFitter::fittedLightQ ( ) const
inline

return fitted light quark candidate

Definition at line 73 of file TtFullHadKinFitter.h.

References fittedLightQ_, TopKinFitter::fitter_, and TKinFitter::getStatus().

73 { return (fitter_->getStatus() == 0 ? fittedLightQ_ : pat::Particle()); };
Int_t getStatus()
Definition: TKinFitter.h:51
pat::Particle fittedLightQ_
Analysis-level particle class.
Definition: Particle.h:30
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
const pat::Particle TtFullHadKinFitter::fittedLightQBar ( ) const
inline

return fitted light quark candidate

Definition at line 75 of file TtFullHadKinFitter.h.

References fittedLightQBar_, TopKinFitter::fitter_, and TKinFitter::getStatus().

75  {
76  return (fitter_->getStatus() == 0 ? fittedLightQBar_ : pat::Particle());
77  };
pat::Particle fittedLightQBar_
Int_t getStatus()
Definition: TKinFitter.h:51
Analysis-level particle class.
Definition: Particle.h:30
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
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 33 of file TtFullHadKinFitter.cc.

References mps_fire::i.

34  {
35  std::vector<TtFullHadKinFitter::Constraint> cConstraints;
36  cConstraints.resize(constraints.size());
37  for (unsigned int i = 0; i < constraints.size(); ++i) {
38  cConstraints[i] = (Constraint)constraints[i];
39  }
40  return cConstraints;
41 }
Constraint
supported constraints
void TtFullHadKinFitter::printSetup ( ) const
private

print fitter setup

Definition at line 113 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().

113  {
114  std::stringstream constr;
115  for (unsigned int i = 0; i < constraints_.size(); ++i) {
116  switch (constraints_[i]) {
117  case kWPlusMass:
118  constr << " * W+-mass (" << mW_ << " GeV) \n";
119  break;
120  case kWMinusMass:
121  constr << " * W--mass (" << mW_ << " GeV) \n";
122  break;
123  case kTopMass:
124  constr << " * t-mass (" << mTop_ << " GeV) \n";
125  break;
126  case kTopBarMass:
127  constr << " * tBar-mass (" << mTop_ << " GeV) \n";
128  break;
129  case kEqualTopMasses:
130  constr << " * equal t-masses \n";
131  break;
132  }
133  }
134  edm::LogVerbatim("TtFullHadKinFitter") << "\n"
135  << "+++++++++++ TtFullHadKinFitter Setup ++++++++++++ \n"
136  << " Parametrization: \n"
137  << " * jet : " << param(jetParam_) << "\n"
138  << " Constraints: \n"
139  << constr.str() << " Max(No iterations): " << maxNrIter_ << "\n"
140  << " Max(deltaS) : " << maxDeltaS_ << "\n"
141  << " Max(F) : " << maxF_ << "\n"
142  << "+++++++++++++++++++++++++++++++++++++++++++++++++ \n";
143 }
Log< level::Info, true > LogVerbatim
std::string param(const Param &param) const
convert Param to human readable form
Definition: TopKinFitter.cc:18
int maxNrIter_
maximal allowed number of iterations to be used for the fit
Definition: TopKinFitter.h:49
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:55
double maxDeltaS_
maximal allowed chi2 (not normalized to degrees of freedom)
Definition: TopKinFitter.h:51
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:57
double maxF_
maximal allowed distance from constraints
Definition: TopKinFitter.h:53
void TtFullHadKinFitter::setupConstraints ( )
private

initialize constraints

Definition at line 178 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().

178  {
179  massConstr_[kWPlusMass] = new TFitConstraintM("WPlusMass", "WPlusMass", nullptr, nullptr, mW_);
180  massConstr_[kWMinusMass] = new TFitConstraintM("WMinusMass", "WMinusMass", nullptr, nullptr, mW_);
181  massConstr_[kTopMass] = new TFitConstraintM("TopMass", "TopMass", nullptr, nullptr, mTop_);
182  massConstr_[kTopBarMass] = new TFitConstraintM("TopBarMass", "TopBarMass", nullptr, nullptr, mTop_);
183  massConstr_[kEqualTopMasses] = new TFitConstraintM("EqualTopMasses", "EqualTopMasses", nullptr, nullptr, 0);
184 
185  massConstr_[kWPlusMass]->addParticles1(lightQ_, lightQBar_);
186  massConstr_[kWMinusMass]->addParticles1(lightP_, lightPBar_);
187  massConstr_[kTopMass]->addParticles1(b_, lightQ_, lightQBar_);
188  massConstr_[kTopBarMass]->addParticles1(bBar_, lightP_, lightPBar_);
189  massConstr_[kEqualTopMasses]->addParticles1(b_, lightQ_, lightQBar_);
191 }
TAbsFitParticle * lightQ_
TAbsFitParticle * lightP_
TAbsFitParticle * b_
input particles
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:55
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
TAbsFitParticle * lightQBar_
TAbsFitParticle * bBar_
double mTop_
top mass value used for constraints
Definition: TopKinFitter.h:57
TAbsFitParticle * lightPBar_
void TtFullHadKinFitter::setupFitter ( )
private

setup fitter

Definition at line 194 of file TtFullHadKinFitter.cc.

References TKinFitter::addConstraint(), TKinFitter::addMeasParticle(), 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().

194  {
195  printSetup();
196  setupJets();
198 
199  // add measured particles
206 
207  // add constraints
208  for (unsigned int i = 0; i < constraints_.size(); i++) {
210  }
211 
212  // initialize helper class used to bring the resolutions into covariance matrices
213  if (!udscResolutions_->empty() && !bResolutions_->empty())
214  covM_ = new CovarianceMatrix(
216  else
217  covM_ = new CovarianceMatrix();
218 }
TAbsFitParticle * lightQ_
const std::vector< double > * jetEnergyResolutionEtaBinning_
CovarianceMatrix * covM_
get object resolutions and put them into a matrix
void setupConstraints()
initialize constraints
TAbsFitParticle * lightP_
void printSetup() const
print fitter setup
math::Error< 5 >::type CovarianceMatrix
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
const std::vector< edm::ParameterSet > * bResolutions_
void addConstraint(TAbsFitConstraint *constraint)
Definition: TKinFitter.cc:292
TAbsFitParticle * b_
input particles
void addMeasParticle(TAbsFitParticle *particle)
Definition: TKinFitter.cc:194
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
TAbsFitParticle * lightQBar_
std::vector< Constraint > constraints_
vector of constraints to be used
TAbsFitParticle * bBar_
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
void setupJets()
initialize jet inputs
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:47
TAbsFitParticle * lightPBar_
void TtFullHadKinFitter::setupJets ( )
private

initialize jet inputs

Definition at line 146 of file TtFullHadKinFitter.cc.

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

Referenced by setupFitter().

146  {
147  TMatrixD empty3x3(3, 3);
148  TMatrixD empty4x4(4, 4);
149  switch (jetParam_) { // setup jets according to parameterization
150  case kEMom:
151  b_ = new TFitParticleEMomDev("Jet1", "Jet1", nullptr, &empty4x4);
152  bBar_ = new TFitParticleEMomDev("Jet2", "Jet2", nullptr, &empty4x4);
153  lightQ_ = new TFitParticleEMomDev("Jet3", "Jet3", nullptr, &empty4x4);
154  lightQBar_ = new TFitParticleEMomDev("Jet4", "Jet4", nullptr, &empty4x4);
155  lightP_ = new TFitParticleEMomDev("Jet5", "Jet5", nullptr, &empty4x4);
156  lightPBar_ = new TFitParticleEMomDev("Jet6", "Jet6", nullptr, &empty4x4);
157  break;
158  case kEtEtaPhi:
159  b_ = new TFitParticleEtEtaPhi("Jet1", "Jet1", nullptr, &empty3x3);
160  bBar_ = new TFitParticleEtEtaPhi("Jet2", "Jet2", nullptr, &empty3x3);
161  lightQ_ = new TFitParticleEtEtaPhi("Jet3", "Jet3", nullptr, &empty3x3);
162  lightQBar_ = new TFitParticleEtEtaPhi("Jet4", "Jet4", nullptr, &empty3x3);
163  lightP_ = new TFitParticleEtEtaPhi("Jet5", "Jet5", nullptr, &empty3x3);
164  lightPBar_ = new TFitParticleEtEtaPhi("Jet6", "Jet6", nullptr, &empty3x3);
165  break;
166  case kEtThetaPhi:
167  b_ = new TFitParticleEtThetaPhi("Jet1", "Jet1", nullptr, &empty3x3);
168  bBar_ = new TFitParticleEtThetaPhi("Jet2", "Jet2", nullptr, &empty3x3);
169  lightQ_ = new TFitParticleEtThetaPhi("Jet3", "Jet3", nullptr, &empty3x3);
170  lightQBar_ = new TFitParticleEtThetaPhi("Jet4", "Jet4", nullptr, &empty3x3);
171  lightP_ = new TFitParticleEtThetaPhi("Jet5", "Jet5", nullptr, &empty3x3);
172  lightPBar_ = new TFitParticleEtThetaPhi("Jet6", "Jet6", nullptr, &empty3x3);
173  break;
174  }
175 }
TAbsFitParticle * lightQ_
TAbsFitParticle * lightP_
TAbsFitParticle * b_
input particles
TAbsFitParticle * lightQBar_
Param jetParam_
jet parametrization
TAbsFitParticle * bBar_
TAbsFitParticle * lightPBar_

Member Data Documentation

TAbsFitParticle* TtFullHadKinFitter::b_
private

input particles

Definition at line 99 of file TtFullHadKinFitter.h.

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

TAbsFitParticle* TtFullHadKinFitter::bBar_
private
const std::vector<edm::ParameterSet>* TtFullHadKinFitter::bResolutions_
private

Definition at line 107 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

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().

CovarianceMatrix* TtFullHadKinFitter::covM_
private

get object resolutions and put them into a matrix

Definition at line 126 of file TtFullHadKinFitter.h.

Referenced by fit(), setupFitter(), and ~TtFullHadKinFitter().

pat::Particle TtFullHadKinFitter::fittedB_
private

output particles

Definition at line 114 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedBBar_
private

Definition at line 115 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightP_
private

Definition at line 118 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightPBar_
private

Definition at line 119 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightQ_
private

Definition at line 116 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightQBar_
private

Definition at line 117 of file TtFullHadKinFitter.h.

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

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

Definition at line 110 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

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

scale factors for the jet energy resolution

Definition at line 109 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

Param TtFullHadKinFitter::jetParam_
private

jet parametrization

Definition at line 121 of file TtFullHadKinFitter.h.

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

TAbsFitParticle* TtFullHadKinFitter::lightP_
private
TAbsFitParticle* TtFullHadKinFitter::lightPBar_
private
TAbsFitParticle* TtFullHadKinFitter::lightQ_
private
TAbsFitParticle* TtFullHadKinFitter::lightQBar_
private
std::map<Constraint, TFitConstraintM*> TtFullHadKinFitter::massConstr_
private

supported constraints

Definition at line 112 of file TtFullHadKinFitter.h.

Referenced by setupConstraints(), setupFitter(), and ~TtFullHadKinFitter().

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

resolutions

Definition at line 106 of file TtFullHadKinFitter.h.

Referenced by setupFitter().