CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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=0, const std::vector< edm::ParameterSet > *bResolutions=0, const std::vector< double > *jetEnergyResolutionScaleFactors=0, const std::vector< double > *jetEnergyResolutionEtaBinning=0)
 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=0, const std::vector< edm::ParameterSet > *bResolutions=0, const std::vector< double > *jetEnergyResolutionScaleFactors=0, const std::vector< double > *jetEnergyResolutionEtaBinning=0)
 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().

16  :
17  TopKinFitter(),
18  b_(0), bBar_(0), lightQ_(0), lightQBar_(0), lightP_(0), lightPBar_(0),
22 {
23  setupFitter();
24 }
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 = 0,
const std::vector< edm::ParameterSet > *  bResolutions = 0,
const std::vector< double > *  jetEnergyResolutionScaleFactors = 0,
const std::vector< double > *  jetEnergyResolutionEtaBinning = 0 
)

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

Definition at line 40 of file TtFullHadKinFitter.cc.

References setupFitter().

45  :
46  TopKinFitter(maxNrIter, maxDeltaS, maxF, mW, mTop),
47  b_(0), bBar_(0), lightQ_(0), lightQBar_(0), lightP_(0), lightPBar_(0),
48  udscResolutions_(udscResolutions), bResolutions_(bResolutions),
49  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors),
50  jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
52 {
53  setupFitter();
54 }
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
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 = 0,
const std::vector< edm::ParameterSet > *  bResolutions = 0,
const std::vector< double > *  jetEnergyResolutionScaleFactors = 0,
const std::vector< double > *  jetEnergyResolutionEtaBinning = 0 
)

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 57 of file TtFullHadKinFitter.cc.

References setupFitter().

62  :
63  TopKinFitter(maxNrIter, maxDeltaS, maxF, mW, mTop),
64  b_(0), bBar_(0), lightQ_(0), lightQBar_(0), lightP_(0), lightPBar_(0),
65  udscResolutions_(udscResolutions), bResolutions_(bResolutions),
66  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors),
67  jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
69 {
70  setupFitter();
71 }
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 74 of file TtFullHadKinFitter.cc.

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

75 {
76  delete b_;
77  delete bBar_;
78  delete lightQ_;
79  delete lightQBar_;
80  delete lightP_;
81  delete lightPBar_;
82  delete covM_;
83  for(std::map<Constraint, TFitConstraintM*>::iterator it = massConstr_.begin(); it != massConstr_.end(); ++it)
84  delete it->second;
85 }
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 265 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().

266 {
267  TtHadEvtSolution fitsol(*asol);
268 
269  std::vector<pat::Jet> jets;
270  jets.resize(6);
271  jets[TtFullHadEvtPartons::LightQ ] = fitsol.getCalHadp();
272  jets[TtFullHadEvtPartons::LightQBar] = fitsol.getCalHadq();
273  jets[TtFullHadEvtPartons::B ] = fitsol.getCalHadb();
274  jets[TtFullHadEvtPartons::LightP ] = fitsol.getCalHadj();
275  jets[TtFullHadEvtPartons::LightPBar] = fitsol.getCalHadk();
276  jets[TtFullHadEvtPartons::BBar ] = fitsol.getCalHadbbar();
277 
278  fit( jets);
279 
280  // add fitted information to the solution
281  if (fitter_->getStatus() == 0) {
282  // finally fill the fitted particles
283  fitsol.setFitHadb(fittedB_);
284  fitsol.setFitHadp(fittedLightQ_);
285  fitsol.setFitHadq(fittedLightQBar_);
286  fitsol.setFitHadk(fittedLightP_);
287  fitsol.setFitHadj(fittedLightPBar_);
288  fitsol.setFitHadbbar(fittedBBar_);
289 
290  // store the fit's chi2 probability
291  fitsol.setProbChi2( fitProb() );
292  }
293  return fitsol;
294 }
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:36
vector< PseudoJet > jets
Int_t getStatus()
Definition: TKinFitter.h:41
pat::Particle fittedLightP_
pat::Particle fittedBBar_
pat::Particle fittedLightQ_
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
int TtFullHadKinFitter::fit ( const std::vector< pat::Jet > &  jets)

kinematic fit interface

Definition at line 199 of file TtFullHadKinFitter.cc.

References TtFullHadEvtPartons::B, b, b_, TtFullHadEvtPartons::BBar, bBar_, edm::errors::Configuration, covM_, reco::LeafCandidate::energy(), edm::hlt::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_, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), TAbsFitParticle::setCovMatrix(), TAbsFitParticle::setIni4Vec(), and CovarianceMatrix::setupMatrix().

Referenced by addKinFitInfo().

200 {
201  if( jets.size()<6 ){
202  throw edm::Exception( edm::errors::Configuration, "Cannot run the TtFullHadKinFitter with less than 6 jets" );
203  }
204 
205  // get jets in right order
207  const pat::Jet& bBar = jets[TtFullHadEvtPartons::BBar ];
208  const pat::Jet& lightQ = jets[TtFullHadEvtPartons::LightQ ];
209  const pat::Jet& lightQBar = jets[TtFullHadEvtPartons::LightQBar];
210  const pat::Jet& lightP = jets[TtFullHadEvtPartons::LightP ];
211  const pat::Jet& lightPBar = jets[TtFullHadEvtPartons::LightPBar];
212 
213  // initialize particles
214  const TLorentzVector p4B( b.px(), b.py(), b.pz(), b.energy() );
215  const TLorentzVector p4BBar( bBar.px(), bBar.py(), bBar.pz(), bBar.energy() );
216  const TLorentzVector p4LightQ( lightQ.px(), lightQ.py(), lightQ.pz(), lightQ.energy() );
217  const TLorentzVector p4LightQBar( lightQBar.px(), lightQBar.py(), lightQBar.pz(), lightQBar.energy() );
218  const TLorentzVector p4LightP( lightP.px(), lightP.py(), lightP.pz(), lightP.energy() );
219  const TLorentzVector p4LightPBar( lightPBar.px(), lightPBar.py(), lightPBar.pz(), lightPBar.energy() );
220 
221  // initialize covariance matrices
222  TMatrixD m1 = covM_->setupMatrix(lightQ, jetParam_);
223  TMatrixD m2 = covM_->setupMatrix(lightQBar, jetParam_);
224  TMatrixD m3 = covM_->setupMatrix(b, jetParam_, "bjets");
225  TMatrixD m4 = covM_->setupMatrix(lightP, jetParam_);
226  TMatrixD m5 = covM_->setupMatrix(lightPBar, jetParam_);
227  TMatrixD m6 = covM_->setupMatrix(bBar , jetParam_, "bjets");
228 
229  // set the kinematics of the objects to be fitted
230  b_ ->setIni4Vec(&p4B );
231  bBar_ ->setIni4Vec(&p4BBar );
232  lightQ_ ->setIni4Vec(&p4LightQ );
233  lightQBar_->setIni4Vec(&p4LightQBar);
234  lightP_ ->setIni4Vec(&p4LightP );
235  lightPBar_->setIni4Vec(&p4LightPBar);
236 
237  // initialize covariance matrices
238  lightQ_ ->setCovMatrix( &m1);
239  lightQBar_->setCovMatrix( &m2);
240  b_ ->setCovMatrix( &m3);
241  lightP_ ->setCovMatrix( &m4);
242  lightPBar_->setCovMatrix( &m5);
243  bBar_ ->setCovMatrix( &m6);
244 
245  // perform the fit!
246  fitter_->fit();
247 
248  // add fitted information to the solution
249  if( fitter_->getStatus()==0 ){
250  // read back jet kinematics
254 
255 
259  }
260  return fitter_->getStatus();
261 }
TAbsFitParticle * lightQ_
CovarianceMatrix * covM_
get object resolutions and put them into a matrix
TAbsFitParticle * lightP_
Int_t fit()
Definition: TKinFitter.cc:309
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_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual double energy() const
energy
vector< PseudoJet > jets
TAbsFitParticle * b_
input particles
Int_t getStatus()
Definition: TKinFitter.h:41
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
pat::Particle fittedLightP_
TAbsFitParticle * lightQBar_
pat::Particle fittedBBar_
Param jetParam_
jet parametrization
pat::Particle fittedLightQ_
virtual double px() const
x coordinate of momentum vector
TAbsFitParticle * bBar_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Analysis-level particle class.
Definition: Particle.h:32
double b
Definition: hdecay.h:120
Analysis-level calorimeter jet class.
Definition: Jet.h:77
virtual double pz() const
z coordinate of momentum vector
const TLorentzVector * getCurr4Vec()
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
virtual double py() const
y coordinate of momentum vector
TAbsFitParticle * lightPBar_
const pat::Particle TtFullHadKinFitter::fittedB ( ) const
inline

return fitted b quark candidate

Definition at line 60 of file TtFullHadKinFitter.h.

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

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

return fitted b quark candidate

Definition at line 62 of file TtFullHadKinFitter.h.

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

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

return fitted light quark candidate

Definition at line 68 of file TtFullHadKinFitter.h.

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

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

return fitted light quark candidate

Definition at line 70 of file TtFullHadKinFitter.h.

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

70 { return (fitter_->getStatus()==0 ? fittedLightPBar_ : pat::Particle()); };
pat::Particle fittedLightPBar_
Int_t getStatus()
Definition: TKinFitter.h:41
Analysis-level particle class.
Definition: Particle.h:32
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
const pat::Particle TtFullHadKinFitter::fittedLightQ ( ) const
inline

return fitted light quark candidate

Definition at line 64 of file TtFullHadKinFitter.h.

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

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

return fitted light quark candidate

Definition at line 66 of file TtFullHadKinFitter.h.

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

66 { return (fitter_->getStatus()==0 ? fittedLightQBar_ : pat::Particle()); };
pat::Particle fittedLightQBar_
Int_t getStatus()
Definition: TKinFitter.h:41
Analysis-level particle class.
Definition: Particle.h:32
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
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 28 of file TtFullHadKinFitter.cc.

References i.

29 {
30  std::vector<TtFullHadKinFitter::Constraint> cConstraints;
31  cConstraints.resize(constraints.size());
32  for(unsigned int i=0;i<constraints.size();++i)
33  {
34  cConstraints[i]=(Constraint)constraints[i];
35  }
36  return cConstraints;
37 }
int i
Definition: DBlmapReader.cc:9
Constraint
supported constraints
void TtFullHadKinFitter::printSetup ( ) const
private

print fitter setup

Definition at line 89 of file TtFullHadKinFitter.cc.

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

Referenced by setupFitter().

90 {
91  std::stringstream constr;
92  for(unsigned int i=0; i<constraints_.size(); ++i){
93  switch(constraints_[i]){
94  case kWPlusMass : constr << " * W+-mass (" << mW_ << " GeV) \n"; break;
95  case kWMinusMass : constr << " * W--mass (" << mW_ << " GeV) \n"; break;
96  case kTopMass : constr << " * t-mass (" << mTop_ << " GeV) \n"; break;
97  case kTopBarMass : constr << " * tBar-mass (" << mTop_ << " GeV) \n"; break;
98  case kEqualTopMasses : constr << " * equal t-masses \n"; break;
99  }
100  }
101  edm::LogVerbatim( "TtFullHadKinFitter" )
102  << "\n"
103  << "+++++++++++ TtFullHadKinFitter Setup ++++++++++++ \n"
104  << " Parametrization: \n"
105  << " * jet : " << param(jetParam_) << "\n"
106  << " Constraints: \n"
107  << constr.str()
108  << " Max(No iterations): " << maxNrIter_ << "\n"
109  << " Max(deltaS) : " << maxDeltaS_ << "\n"
110  << " Max(F) : " << maxF_ << "\n"
111  << "+++++++++++++++++++++++++++++++++++++++++++++++++ \n";
112 }
int i
Definition: DBlmapReader.cc:9
std::string param(const Param &param) const
convert Param to human readable form
Definition: TopKinFitter.cc:23
int maxNrIter_
maximal allowed number of iterations to be used for the fit
Definition: TopKinFitter.h:48
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:54
double maxDeltaS_
maximal allowed chi2 (not normalized to degrees of freedom)
Definition: TopKinFitter.h:50
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:56
double maxF_
maximal allowed distance from constraints
Definition: TopKinFitter.h:52
void TtFullHadKinFitter::setupConstraints ( )
private

initialize constraints

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

151 {
152  massConstr_[kWPlusMass ] = new TFitConstraintM("WPlusMass" , "WPlusMass" , 0, 0, mW_ );
153  massConstr_[kWMinusMass ] = new TFitConstraintM("WMinusMass" , "WMinusMass" , 0, 0, mW_ );
154  massConstr_[kTopMass ] = new TFitConstraintM("TopMass" , "TopMass" , 0, 0, mTop_ );
155  massConstr_[kTopBarMass ] = new TFitConstraintM("TopBarMass" , "TopBarMass" , 0, 0, mTop_ );
156  massConstr_[kEqualTopMasses] = new TFitConstraintM("EqualTopMasses", "EqualTopMasses" , 0, 0, 0 );
157 
158  massConstr_[kWPlusMass ]->addParticles1(lightQ_, lightQBar_);
159  massConstr_[kWMinusMass ]->addParticles1(lightP_, lightPBar_);
160  massConstr_[kTopMass ]->addParticles1(b_, lightQ_, lightQBar_);
161  massConstr_[kTopBarMass ]->addParticles1(bBar_, lightP_, lightPBar_);
162  massConstr_[kEqualTopMasses]->addParticles1(b_, lightQ_, lightQBar_);
164 
165 }
TAbsFitParticle * lightQ_
TAbsFitParticle * lightP_
TAbsFitParticle * b_
input particles
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:54
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
TAbsFitParticle * lightQBar_
TAbsFitParticle * bBar_
double mTop_
top mass value used for constraints
Definition: TopKinFitter.h:56
TAbsFitParticle * lightPBar_
void TtFullHadKinFitter::setupFitter ( )
private

setup fitter

Definition at line 169 of file TtFullHadKinFitter.cc.

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

Referenced by TtFullHadKinFitter().

170 {
171  printSetup();
172  setupJets();
174 
175  // add measured particles
182 
183  // add constraints
184  for(unsigned int i=0; i<constraints_.size(); i++){
186  }
187 
188  // initialize helper class used to bring the resolutions into covariance matrices
189  if(udscResolutions_->size() && bResolutions_->size())
193  else
194  covM_ = new CovarianceMatrix();
195 }
TAbsFitParticle * lightQ_
int i
Definition: DBlmapReader.cc:9
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:281
TAbsFitParticle * b_
input particles
void addMeasParticle(TAbsFitParticle *particle)
Definition: TKinFitter.cc:209
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:46
TAbsFitParticle * lightPBar_
void TtFullHadKinFitter::setupJets ( )
private

initialize jet inputs

Definition at line 116 of file TtFullHadKinFitter.cc.

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

Referenced by setupFitter().

117 {
118  TMatrixD empty3x3(3,3);
119  TMatrixD empty4x4(4,4);
120  switch(jetParam_){ // setup jets according to parameterization
121  case kEMom :
122  b_ = new TFitParticleEMomDev ("Jet1", "Jet1", 0, &empty4x4);
123  bBar_ = new TFitParticleEMomDev ("Jet2", "Jet2", 0, &empty4x4);
124  lightQ_ = new TFitParticleEMomDev ("Jet3", "Jet3", 0, &empty4x4);
125  lightQBar_= new TFitParticleEMomDev ("Jet4", "Jet4", 0, &empty4x4);
126  lightP_ = new TFitParticleEMomDev ("Jet5", "Jet5", 0, &empty4x4);
127  lightPBar_= new TFitParticleEMomDev ("Jet6", "Jet6", 0, &empty4x4);
128  break;
129  case kEtEtaPhi :
130  b_ = new TFitParticleEtEtaPhi ("Jet1", "Jet1", 0, &empty3x3);
131  bBar_ = new TFitParticleEtEtaPhi ("Jet2", "Jet2", 0, &empty3x3);
132  lightQ_ = new TFitParticleEtEtaPhi ("Jet3", "Jet3", 0, &empty3x3);
133  lightQBar_= new TFitParticleEtEtaPhi ("Jet4", "Jet4", 0, &empty3x3);
134  lightP_ = new TFitParticleEtEtaPhi ("Jet5", "Jet5", 0, &empty3x3);
135  lightPBar_= new TFitParticleEtEtaPhi ("Jet6", "Jet6", 0, &empty3x3);
136  break;
137  case kEtThetaPhi :
138  b_ = new TFitParticleEtThetaPhi("Jet1", "Jet1", 0, &empty3x3);
139  bBar_ = new TFitParticleEtThetaPhi("Jet2", "Jet2", 0, &empty3x3);
140  lightQ_ = new TFitParticleEtThetaPhi("Jet3", "Jet3", 0, &empty3x3);
141  lightQBar_= new TFitParticleEtThetaPhi("Jet4", "Jet4", 0, &empty3x3);
142  lightP_ = new TFitParticleEtThetaPhi("Jet5", "Jet5", 0, &empty3x3);
143  lightPBar_= new TFitParticleEtThetaPhi("Jet6", "Jet6", 0, &empty3x3);
144  break;
145  }
146 }
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 86 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 94 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

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

vector of constraints to be used

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

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

pat::Particle TtFullHadKinFitter::fittedB_
private

output particles

Definition at line 101 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedBBar_
private

Definition at line 102 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightP_
private

Definition at line 105 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightPBar_
private

Definition at line 106 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightQ_
private

Definition at line 103 of file TtFullHadKinFitter.h.

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

pat::Particle TtFullHadKinFitter::fittedLightQBar_
private

Definition at line 104 of file TtFullHadKinFitter.h.

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

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

Definition at line 97 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

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

scale factors for the jet energy resolution

Definition at line 96 of file TtFullHadKinFitter.h.

Referenced by setupFitter().

Param TtFullHadKinFitter::jetParam_
private

jet parametrization

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

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

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

resolutions

Definition at line 93 of file TtFullHadKinFitter.h.

Referenced by setupFitter().