CMS 3D CMS Logo

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

#include <TtSemiLepKinFitter.h>

Inheritance diagram for TtSemiLepKinFitter:
TopKinFitter

Public Types

enum  Constraint {
  kWHadMass = 1, kWLepMass, kTopHadMass, kTopLepMass,
  kNeutrinoMass, kEqualTopMasses, kSumPt
}
 supported constraints More...
 
- Public Types inherited from TopKinFitter
enum  Param { kEMom, kEtEtaPhi, kEtThetaPhi }
 supported parameterizations More...
 

Public Member Functions

TtSemiEvtSolution addKinFitInfo (TtSemiEvtSolution *asol)
 add kin fit information to the old event solution (in for legacy reasons) More...
 
template<class LeptonType >
int fit (const std::vector< pat::Jet > &jets, const pat::Lepton< LeptonType > &leps, const pat::MET &met)
 kinematic fit interface for PAT objects More...
 
int fit (const TLorentzVector &p4HadP, const TLorentzVector &p4HadQ, const TLorentzVector &p4HadB, const TLorentzVector &p4LepB, const TLorentzVector &p4Lepton, const TLorentzVector &p4Neutrino, const int leptonCharge, const CovarianceMatrix::ObjectType leptonType)
 kinematic fit interface for plain 4-vecs More...
 
int fit (const TLorentzVector &p4HadP, const TLorentzVector &p4HadQ, const TLorentzVector &p4HadB, const TLorentzVector &p4LepB, const TLorentzVector &p4Lepton, const TLorentzVector &p4Neutrino, const TMatrixD &covHadP, const TMatrixD &covHadQ, const TMatrixD &covHadB, const TMatrixD &covLepB, const TMatrixD &covLepton, const TMatrixD &covNeutrino, const int leptonCharge)
 common core of the fit interface More...
 
const pat::Particle fittedHadB () const
 return hadronic b quark candidate More...
 
const pat::Particle fittedHadP () const
 return hadronic light quark candidate More...
 
const pat::Particle fittedHadQ () const
 return hadronic light quark candidate More...
 
const pat::Particle fittedLepB () const
 return leptonic b quark candidate More...
 
const pat::Particle fittedLepton () const
 return lepton candidate More...
 
const pat::Particle fittedNeutrino () const
 return neutrino candidate More...
 
 TtSemiLepKinFitter ()
 default constructor More...
 
 TtSemiLepKinFitter (Param jetParam, Param lepParam, Param metParam, 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< edm::ParameterSet > *lepResolutions=0, const std::vector< edm::ParameterSet > *metResolutions=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...
 
 ~TtSemiLepKinFitter ()
 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...
 
void setupLeptons ()
 initialize lepton inputs More...
 

Private Attributes

const std::vector
< edm::ParameterSet > * 
bResolutions_
 
bool constrainSumPt_
 internally use simple boolean for this constraint to reduce the per-event computing time More...
 
std::vector< ConstraintconstrList_
 vector of constraints to be used More...
 
CovarianceMatrixcovM_
 object used to construct the covariance matrices for the individual particles More...
 
pat::Particle fittedHadB_
 output particles More...
 
pat::Particle fittedHadP_
 
pat::Particle fittedHadQ_
 
pat::Particle fittedLepB_
 
pat::Particle fittedLepton_
 
pat::Particle fittedNeutrino_
 
TAbsFitParticlehadB_
 input particles More...
 
TAbsFitParticlehadP_
 
TAbsFitParticlehadQ_
 
const std::vector< double > * jetEnergyResolutionEtaBinning_
 
const std::vector< double > * jetEnergyResolutionScaleFactors_
 scale factors for the jet energy resolution More...
 
Param jetParam_
 jet parametrization More...
 
TAbsFitParticlelepB_
 
Param lepParam_
 lepton parametrization More...
 
const std::vector
< edm::ParameterSet > * 
lepResolutions_
 
TAbsFitParticlelepton_
 
std::map< Constraint,
TFitConstraintM * > 
massConstr_
 supported constraints More...
 
Param metParam_
 met parametrization More...
 
const std::vector
< edm::ParameterSet > * 
metResolutions_
 
TAbsFitParticleneutrino_
 
TFitConstraintEpsumPxConstr_
 
TFitConstraintEpsumPyConstr_
 
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 32 of file TtSemiLepKinFitter.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

TtSemiLepKinFitter::TtSemiLepKinFitter ( )
explicit

default constructor

default configuration is: Parametrization kEMom, Max iterations = 200, deltaS<= 5e-5, maxF<= 1e-4, no constraints

Definition at line 15 of file TtSemiLepKinFitter.cc.

References setupFitter().

15  :
16  TopKinFitter(),
17  hadB_(0), hadP_(0), hadQ_(0), lepB_(0), lepton_(0), neutrino_(0),
21 {
22  setupFitter();
23 }
TAbsFitParticle * hadB_
input particles
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
TAbsFitParticle * neutrino_
TAbsFitParticle * hadQ_
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 lepParam_
lepton parametrization
const std::vector< edm::ParameterSet > * bResolutions_
TAbsFitParticle * lepton_
const std::vector< edm::ParameterSet > * lepResolutions_
TAbsFitParticle * hadP_
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
Param jetParam_
jet parametrization
Param metParam_
met parametrization
void setupFitter()
setup fitter
const std::vector< double > * jetEnergyResolutionEtaBinning_
TAbsFitParticle * lepB_
const std::vector< edm::ParameterSet > * metResolutions_
TtSemiLepKinFitter::TtSemiLepKinFitter ( Param  jetParam,
Param  lepParam,
Param  metParam,
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< edm::ParameterSet > *  lepResolutions = 0,
const std::vector< edm::ParameterSet > *  metResolutions = 0,
const std::vector< double > *  jetEnergyResolutionScaleFactors = 0,
const std::vector< double > *  jetEnergyResolutionEtaBinning = 0 
)
explicit

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

Definition at line 25 of file TtSemiLepKinFitter.cc.

References setupFitter().

33  :
34  TopKinFitter(maxNrIter, maxDeltaS, maxF, mW, mTop),
35  hadB_(0), hadP_(0), hadQ_(0), lepB_(0), lepton_(0), neutrino_(0),
36  udscResolutions_(udscResolutions), bResolutions_(bResolutions), lepResolutions_(lepResolutions), metResolutions_(metResolutions),
37  jetEnergyResolutionScaleFactors_(jetEnergyResolutionScaleFactors), jetEnergyResolutionEtaBinning_(jetEnergyResolutionEtaBinning),
38  jetParam_(jetParam), lepParam_(lepParam), metParam_(metParam), constrList_(constraints)
39 {
40  setupFitter();
41 }
TAbsFitParticle * hadB_
input particles
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
TAbsFitParticle * neutrino_
TAbsFitParticle * hadQ_
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 lepParam_
lepton parametrization
const std::vector< edm::ParameterSet > * bResolutions_
TAbsFitParticle * lepton_
const std::vector< edm::ParameterSet > * lepResolutions_
TAbsFitParticle * hadP_
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
Param jetParam_
jet parametrization
Param metParam_
met parametrization
std::vector< Constraint > constrList_
vector of constraints to be used
void setupFitter()
setup fitter
const std::vector< double > * jetEnergyResolutionEtaBinning_
TAbsFitParticle * lepB_
const std::vector< edm::ParameterSet > * metResolutions_
TtSemiLepKinFitter::~TtSemiLepKinFitter ( )

default destructor

Definition at line 43 of file TtSemiLepKinFitter.cc.

References covM_, hadB_, hadP_, hadQ_, lepB_, lepton_, massConstr_, neutrino_, sumPxConstr_, and sumPyConstr_.

44 {
45  delete hadB_;
46  delete hadP_;
47  delete hadQ_;
48  delete lepB_;
49  delete lepton_;
50  delete neutrino_;
51  delete covM_;
52  for(std::map<Constraint, TFitConstraintM*>::iterator it = massConstr_.begin(); it != massConstr_.end(); ++it)
53  delete it->second;
54  delete sumPxConstr_;
55  delete sumPyConstr_;
56 }
TAbsFitParticle * hadB_
input particles
TAbsFitParticle * neutrino_
TAbsFitParticle * hadQ_
TFitConstraintEp * sumPyConstr_
TAbsFitParticle * lepton_
TAbsFitParticle * hadP_
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
CovarianceMatrix * covM_
object used to construct the covariance matrices for the individual particles
TFitConstraintEp * sumPxConstr_
TAbsFitParticle * lepB_

Member Function Documentation

TtSemiEvtSolution TtSemiLepKinFitter::addKinFitInfo ( TtSemiEvtSolution asol)

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

Definition at line 258 of file TtSemiLepKinFitter.cc.

References fit(), TopKinFitter::fitProb(), fittedHadB(), fittedHadP(), fittedHadQ(), fittedLepB(), fittedLepton(), fittedNeutrino(), TopKinFitter::fitter_, TtSemiEvtSolution::getCalHadb(), TtSemiEvtSolution::getCalHadp(), TtSemiEvtSolution::getCalHadq(), TtSemiEvtSolution::getCalLepb(), TtSemiEvtSolution::getCalLepe(), TtSemiEvtSolution::getCalLepm(), TtSemiEvtSolution::getCalLepn(), TtSemiEvtSolution::getDecay(), TKinFitter::getStatus(), TtSemiLepEvtPartons::HadB, fwrapper::jets, TtSemiLepEvtPartons::LepB, TtSemiLepEvtPartons::LightQ, TtSemiLepEvtPartons::LightQBar, TtSemiEvtSolution::setFitHadb(), TtSemiEvtSolution::setFitHadp(), TtSemiEvtSolution::setFitHadq(), TtSemiEvtSolution::setFitLepb(), TtSemiEvtSolution::setFitLepl(), TtSemiEvtSolution::setFitLepn(), and TtSemiEvtSolution::setProbChi2().

Referenced by TtSemiEvtSolutionMaker::produce().

259 {
260 
261  TtSemiEvtSolution fitsol(*asol);
262 
263  std::vector<pat::Jet> jets;
264  jets.resize(4);
265  jets[TtSemiLepEvtPartons::LightQ ] = fitsol.getCalHadp();
266  jets[TtSemiLepEvtPartons::LightQBar] = fitsol.getCalHadq();
267  jets[TtSemiLepEvtPartons::HadB ] = fitsol.getCalHadb();
268  jets[TtSemiLepEvtPartons::LepB ] = fitsol.getCalLepb();
269 
270  // perform the fit, either using the electron or the muon
271  if(fitsol.getDecay() == "electron") fit( jets, fitsol.getCalLepe(), fitsol.getCalLepn() );
272  if(fitsol.getDecay() == "muon" ) fit( jets, fitsol.getCalLepm(), fitsol.getCalLepn() );
273 
274  // add fitted information to the solution
275  if (fitter_->getStatus() == 0) {
276  // fill the fitted particles
277  fitsol.setFitHadb( fittedHadB() );
278  fitsol.setFitHadp( fittedHadP() );
279  fitsol.setFitHadq( fittedHadQ() );
280  fitsol.setFitLepb( fittedLepB() );
281  fitsol.setFitLepl( fittedLepton() );
282  fitsol.setFitLepn( fittedNeutrino() );
283  // store the fit's chi2 probability
284  fitsol.setProbChi2( fitProb() );
285  }
286  return fitsol;
287 }
const pat::Particle fittedHadP() const
return hadronic light quark candidate
const pat::Particle fittedNeutrino() const
return neutrino candidate
const pat::Particle fittedLepB() const
return leptonic b quark candidate
double fitProb() const
return fit probability
Definition: TopKinFitter.h:36
int fit(const std::vector< pat::Jet > &jets, const pat::Lepton< LeptonType > &leps, const pat::MET &met)
kinematic fit interface for PAT objects
vector< PseudoJet > jets
Int_t getStatus()
Definition: TKinFitter.h:41
const pat::Particle fittedHadB() const
return hadronic b quark candidate
const pat::Particle fittedHadQ() const
return hadronic light quark candidate
const pat::Particle fittedLepton() const
return lepton candidate
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
template<class LeptonType >
int TtSemiLepKinFitter::fit ( const std::vector< pat::Jet > &  jets,
const pat::Lepton< LeptonType > &  leps,
const pat::MET met 
)

kinematic fit interface for PAT objects

Definition at line 134 of file TtSemiLepKinFitter.h.

References edm::errors::Configuration, covM_, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), TtSemiLepEvtPartons::HadB, jetParam_, TtSemiLepEvtPartons::LepB, lepParam_, TtSemiLepEvtPartons::LightQ, TtSemiLepEvtPartons::LightQBar, metParam_, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), and CovarianceMatrix::setupMatrix().

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

135 {
136  if( jets.size()<4 )
137  throw edm::Exception( edm::errors::Configuration, "Cannot run the TtSemiLepKinFitter with less than 4 jets" );
138 
139  // get jets in right order
142  const pat::Jet hadB = jets[TtSemiLepEvtPartons::HadB ];
143  const pat::Jet lepB = jets[TtSemiLepEvtPartons::LepB ];
144 
145  // initialize particles
146  const TLorentzVector p4HadP( hadP.px(), hadP.py(), hadP.pz(), hadP.energy() );
147  const TLorentzVector p4HadQ( hadQ.px(), hadQ.py(), hadQ.pz(), hadQ.energy() );
148  const TLorentzVector p4HadB( hadB.px(), hadB.py(), hadB.pz(), hadB.energy() );
149  const TLorentzVector p4LepB( lepB.px(), lepB.py(), lepB.pz(), lepB.energy() );
150  const TLorentzVector p4Lepton ( lepton.px(), lepton.py(), lepton.pz(), lepton.energy() );
151  const TLorentzVector p4Neutrino( neutrino.px(), neutrino.py(), 0, neutrino.et() );
152 
153  // initialize covariance matrices
154  TMatrixD covHadP = covM_->setupMatrix(hadP, jetParam_);
155  TMatrixD covHadQ = covM_->setupMatrix(hadQ, jetParam_);
156  TMatrixD covHadB = covM_->setupMatrix(hadB, jetParam_, "bjets");
157  TMatrixD covLepB = covM_->setupMatrix(lepB, jetParam_, "bjets");
158  TMatrixD covLepton = covM_->setupMatrix(lepton , lepParam_);
159  TMatrixD covNeutrino = covM_->setupMatrix(neutrino, metParam_);
160 
161  // now do the part that is fully independent of PAT features
162  return fit(p4HadP, p4HadQ, p4HadB, p4LepB, p4Lepton, p4Neutrino,
163  covHadP, covHadQ, covHadB, covLepB, covLepton, covNeutrino,
164  lepton.charge());
165 }
virtual double energy() const final
energy
TMatrixD setupMatrix(const pat::PATObject< T > &object, const TopKinFitter::Param param, const std::string &resolutionProvider="")
return covariance matrix for a PAT object
Param lepParam_
lepton parametrization
int fit(const std::vector< pat::Jet > &jets, const pat::Lepton< LeptonType > &leps, const pat::MET &met)
kinematic fit interface for PAT objects
vector< PseudoJet > jets
Param jetParam_
jet parametrization
virtual double py() const final
y coordinate of momentum vector
Param metParam_
met parametrization
CovarianceMatrix * covM_
object used to construct the covariance matrices for the individual particles
virtual double pz() const final
z coordinate of momentum vector
Analysis-level calorimeter jet class.
Definition: Jet.h:78
virtual double px() const final
x coordinate of momentum vector
int TtSemiLepKinFitter::fit ( const TLorentzVector &  p4HadP,
const TLorentzVector &  p4HadQ,
const TLorentzVector &  p4HadB,
const TLorentzVector &  p4LepB,
const TLorentzVector &  p4Lepton,
const TLorentzVector &  p4Neutrino,
const int  leptonCharge,
const CovarianceMatrix::ObjectType  leptonType 
)

kinematic fit interface for plain 4-vecs

Definition at line 188 of file TtSemiLepKinFitter.cc.

References covM_, fit(), jetParam_, CovarianceMatrix::kBJet, CovarianceMatrix::kMet, CovarianceMatrix::kUdscJet, lepParam_, metParam_, and CovarianceMatrix::setupMatrix().

Referenced by trackingPlots.Iteration::modules().

190 {
191  // initialize covariance matrices
192  TMatrixD covHadP = covM_->setupMatrix(p4HadP, CovarianceMatrix::kUdscJet, jetParam_);
193  TMatrixD covHadQ = covM_->setupMatrix(p4HadQ, CovarianceMatrix::kUdscJet, jetParam_);
194  TMatrixD covHadB = covM_->setupMatrix(p4HadB, CovarianceMatrix::kBJet, jetParam_);
195  TMatrixD covLepB = covM_->setupMatrix(p4LepB, CovarianceMatrix::kBJet, jetParam_);
196  TMatrixD covLepton = covM_->setupMatrix(p4Lepton , leptonType , lepParam_);
197  TMatrixD covNeutrino = covM_->setupMatrix(p4Neutrino, CovarianceMatrix::kMet , metParam_);
198 
199  // now do the part that is fully independent of PAT features
200  return fit(p4HadP, p4HadQ, p4HadB, p4LepB, p4Lepton, p4Neutrino,
201  covHadP, covHadQ, covHadB, covLepB, covLepton, covNeutrino,
202  leptonCharge);
203 }
TMatrixD setupMatrix(const pat::PATObject< T > &object, const TopKinFitter::Param param, const std::string &resolutionProvider="")
return covariance matrix for a PAT object
Param lepParam_
lepton parametrization
int fit(const std::vector< pat::Jet > &jets, const pat::Lepton< LeptonType > &leps, const pat::MET &met)
kinematic fit interface for PAT objects
Param jetParam_
jet parametrization
Param metParam_
met parametrization
CovarianceMatrix * covM_
object used to construct the covariance matrices for the individual particles
tuple leptonType
LEPTON
Definition: autophobj.py:48
int TtSemiLepKinFitter::fit ( const TLorentzVector &  p4HadP,
const TLorentzVector &  p4HadQ,
const TLorentzVector &  p4HadB,
const TLorentzVector &  p4LepB,
const TLorentzVector &  p4Lepton,
const TLorentzVector &  p4Neutrino,
const TMatrixD &  covHadP,
const TMatrixD &  covHadQ,
const TMatrixD &  covHadB,
const TMatrixD &  covLepB,
const TMatrixD &  covLepton,
const TMatrixD &  covNeutrino,
const int  leptonCharge 
)

common core of the fit interface

Definition at line 205 of file TtSemiLepKinFitter.cc.

References constrainSumPt_, TKinFitter::fit(), fittedHadB_, fittedHadP_, fittedHadQ_, fittedLepB_, fittedLepton_, fittedNeutrino_, TopKinFitter::fitter_, TAbsFitParticle::getCurr4Vec(), TKinFitter::getStatus(), hadB_, hadP_, hadQ_, lepB_, lepton_, neutrino_, TFitConstraintEp::setConstraint(), TAbsFitParticle::setCovMatrix(), TAbsFitParticle::setIni4Vec(), sumPxConstr_, and sumPyConstr_.

Referenced by trackingPlots.Iteration::modules().

209 {
210  // set the kinematics of the objects to be fitted
211  hadP_->setIni4Vec( &p4HadP );
212  hadQ_->setIni4Vec( &p4HadQ );
213  hadB_->setIni4Vec( &p4HadB );
214  lepB_->setIni4Vec( &p4LepB );
215  lepton_->setIni4Vec( &p4Lepton );
216  neutrino_->setIni4Vec( &p4Neutrino );
217 
218  hadP_->setCovMatrix( &covHadP );
219  hadQ_->setCovMatrix( &covHadQ );
220  hadB_->setCovMatrix( &covHadB );
221  lepB_->setCovMatrix( &covLepB );
222  lepton_ ->setCovMatrix( &covLepton );
223  neutrino_->setCovMatrix( &covNeutrino );
224 
225  if(constrainSumPt_){
226  // setup Px and Py constraint for curent event configuration so that sum Pt will be conserved
227  sumPxConstr_->setConstraint( p4HadP.Px() + p4HadQ.Px() + p4HadB.Px() + p4LepB.Px() + p4Lepton.Px() + p4Neutrino.Px() );
228  sumPyConstr_->setConstraint( p4HadP.Py() + p4HadQ.Py() + p4HadB.Py() + p4LepB.Py() + p4Lepton.Py() + p4Neutrino.Py() );
229  }
230 
231  // now do the fit
232  fitter_->fit();
233 
234  // read back the resulting particles if the fit converged
235  if(fitter_->getStatus()==0){
236  // read back jet kinematics
238  hadP_->getCurr4Vec()->Y(), hadP_->getCurr4Vec()->Z(), hadP_->getCurr4Vec()->E()), math::XYZPoint()));
240  hadQ_->getCurr4Vec()->Y(), hadQ_->getCurr4Vec()->Z(), hadQ_->getCurr4Vec()->E()), math::XYZPoint()));
242  hadB_->getCurr4Vec()->Y(), hadB_->getCurr4Vec()->Z(), hadB_->getCurr4Vec()->E()), math::XYZPoint()));
244  lepB_->getCurr4Vec()->Y(), lepB_->getCurr4Vec()->Z(), lepB_->getCurr4Vec()->E()), math::XYZPoint()));
245 
246  // read back lepton kinematics
248  lepton_->getCurr4Vec()->Y(), lepton_->getCurr4Vec()->Z(), lepton_->getCurr4Vec()->E()), math::XYZPoint()));
249 
250  // read back the MET kinematics
253 
254  }
255  return fitter_->getStatus();
256 }
TAbsFitParticle * hadB_
input particles
TAbsFitParticle * neutrino_
Int_t fit()
Definition: TKinFitter.cc:309
TAbsFitParticle * hadQ_
virtual void setIni4Vec(const TLorentzVector *pini)=0
bool constrainSumPt_
internally use simple boolean for this constraint to reduce the per-event computing time ...
TFitConstraintEp * sumPyConstr_
pat::Particle fittedHadP_
pat::Particle fittedLepB_
pat::Particle fittedHadB_
output particles
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
TAbsFitParticle * lepton_
pat::Particle fittedLepton_
TAbsFitParticle * hadP_
Int_t getStatus()
Definition: TKinFitter.h:41
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
pat::Particle fittedHadQ_
void setConstraint(Double_t constraint)
TFitConstraintEp * sumPxConstr_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Analysis-level particle class.
Definition: Particle.h:32
const TLorentzVector * getCurr4Vec()
pat::Particle fittedNeutrino_
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
TAbsFitParticle * lepB_
const pat::Particle TtSemiLepKinFitter::fittedHadB ( ) const
inline

return hadronic b quark candidate

Definition at line 66 of file TtSemiLepKinFitter.h.

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

Referenced by addKinFitInfo().

66 { return (fitter_->getStatus()==0 ? fittedHadB_ : pat::Particle()); };
pat::Particle fittedHadB_
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 TtSemiLepKinFitter::fittedHadP ( ) const
inline

return hadronic light quark candidate

Definition at line 68 of file TtSemiLepKinFitter.h.

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

Referenced by addKinFitInfo().

68 { return (fitter_->getStatus()==0 ? fittedHadP_ : pat::Particle()); };
pat::Particle fittedHadP_
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 TtSemiLepKinFitter::fittedHadQ ( ) const
inline

return hadronic light quark candidate

Definition at line 70 of file TtSemiLepKinFitter.h.

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

Referenced by addKinFitInfo().

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

return leptonic b quark candidate

Definition at line 72 of file TtSemiLepKinFitter.h.

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

Referenced by addKinFitInfo().

72 { return (fitter_->getStatus()==0 ? fittedLepB_ : pat::Particle()); };
pat::Particle fittedLepB_
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 TtSemiLepKinFitter::fittedLepton ( ) const
inline

return lepton candidate

Definition at line 74 of file TtSemiLepKinFitter.h.

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

Referenced by addKinFitInfo().

74 { return (fitter_->getStatus()==0 ? fittedLepton_ : pat::Particle()); };
pat::Particle fittedLepton_
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 TtSemiLepKinFitter::fittedNeutrino ( ) const
inline

return neutrino candidate

Definition at line 76 of file TtSemiLepKinFitter.h.

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

Referenced by addKinFitInfo().

76 { return (fitter_->getStatus()==0 ? fittedNeutrino_ : pat::Particle()); };
Int_t getStatus()
Definition: TKinFitter.h:41
Analysis-level particle class.
Definition: Particle.h:32
pat::Particle fittedNeutrino_
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
void TtSemiLepKinFitter::printSetup ( ) const
private

print fitter setup

Definition at line 58 of file TtSemiLepKinFitter.cc.

References constrList_, i, jetParam_, kEqualTopMasses, kNeutrinoMass, kSumPt, kTopHadMass, kTopLepMass, kWHadMass, kWLepMass, lepParam_, TopKinFitter::maxDeltaS_, TopKinFitter::maxF_, TopKinFitter::maxNrIter_, metParam_, TopKinFitter::mTop_, TopKinFitter::mW_, and TopKinFitter::param().

Referenced by setupFitter().

59 {
60  std::stringstream constr;
61  for(unsigned int i=0; i<constrList_.size(); ++i){
62  switch(constrList_[i]){
63  case kWHadMass : constr << " * hadronic W-mass (" << mW_ << " GeV) \n"; break;
64  case kWLepMass : constr << " * leptonic W-mass (" << mW_ << " GeV) \n"; break;
65  case kTopHadMass : constr << " * hadronic t-mass (" << mTop_ << " GeV) \n"; break;
66  case kTopLepMass : constr << " * leptonic t-mass (" << mTop_ << " GeV) \n"; break;
67  case kNeutrinoMass : constr << " * neutrino mass (0 GeV) \n"; break;
68  case kEqualTopMasses : constr << " * equal t-masses \n"; break;
69  case kSumPt : constr << " * summed transverse momentum \n"; break;
70  }
71  }
72  edm::LogVerbatim( "TtSemiLepKinFitter" )
73  << "\n"
74  << "+++++++++++ TtSemiLepKinFitter Setup ++++++++++++ \n"
75  << " Parametrization: \n"
76  << " * jet : " << param(jetParam_) << "\n"
77  << " * lep : " << param(lepParam_) << "\n"
78  << " * met : " << param(metParam_) << "\n"
79  << " Constraints: \n"
80  << constr.str()
81  << " Max(No iterations): " << maxNrIter_ << "\n"
82  << " Max(deltaS) : " << maxDeltaS_ << "\n"
83  << " Max(F) : " << maxF_ << "\n"
84  << "+++++++++++++++++++++++++++++++++++++++++++++++++ \n";
85 }
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
Param lepParam_
lepton parametrization
Param jetParam_
jet parametrization
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:54
Param metParam_
met parametrization
double maxDeltaS_
maximal allowed chi2 (not normalized to degrees of freedom)
Definition: TopKinFitter.h:50
std::vector< Constraint > constrList_
vector of constraints to be used
double mTop_
top mass value used for constraints
Definition: TopKinFitter.h:56
double maxF_
maximal allowed distance from constraints
Definition: TopKinFitter.h:52
void TtSemiLepKinFitter::setupConstraints ( )
private

initialize constraints

Definition at line 128 of file TtSemiLepKinFitter.cc.

References TFitConstraintEp::addParticles(), constrainSumPt_, constrList_, spr::find(), hadB_, hadP_, hadQ_, kEqualTopMasses, kNeutrinoMass, kSumPt, kTopHadMass, kTopLepMass, kWHadMass, kWLepMass, lepB_, lepton_, massConstr_, TopKinFitter::mTop_, TopKinFitter::mW_, neutrino_, TFitConstraintEp::pX, TFitConstraintEp::pY, sumPxConstr_, and sumPyConstr_.

Referenced by setupFitter().

129 {
130  massConstr_[kWHadMass ] = new TFitConstraintM("WMassHad", "WMassHad", 0, 0, mW_ );
131  massConstr_[kWLepMass ] = new TFitConstraintM("WMassLep", "WMassLep", 0, 0, mW_ );
132  massConstr_[kTopHadMass ] = new TFitConstraintM("TopMassHad", "TopMassHad", 0, 0, mTop_);
133  massConstr_[kTopLepMass ] = new TFitConstraintM("TopMassLep", "TopMassLep", 0, 0, mTop_);
134  massConstr_[kNeutrinoMass ] = new TFitConstraintM("NeutrinoMass", "NeutrinoMass", 0, 0, 0.);
135  massConstr_[kEqualTopMasses] = new TFitConstraintM("EqualTopMasses","EqualTopMasses",0, 0, 0.);
136  sumPxConstr_ = new TFitConstraintEp("SumPx", "SumPx", 0, TFitConstraintEp::pX, 0.);
137  sumPyConstr_ = new TFitConstraintEp("SumPy", "SumPy", 0, TFitConstraintEp::pY, 0.);
138 
139  massConstr_[kWHadMass ]->addParticles1(hadP_, hadQ_ );
140  massConstr_[kWLepMass ]->addParticles1(lepton_, neutrino_);
141  massConstr_[kTopHadMass ]->addParticles1(hadP_, hadQ_, hadB_);
142  massConstr_[kTopLepMass ]->addParticles1(lepton_, neutrino_, lepB_);
143  massConstr_[kNeutrinoMass ]->addParticle1 (neutrino_);
144  massConstr_[kEqualTopMasses]->addParticles1(hadP_, hadQ_, hadB_);
148 
149  if(std::find(constrList_.begin(), constrList_.end(), kSumPt)!=constrList_.end())
150  constrainSumPt_ = true;
151  constrainSumPt_ = false;
152 }
void addParticles(TAbsFitParticle *p1, TAbsFitParticle *p2=0, TAbsFitParticle *p3=0, TAbsFitParticle *p4=0, TAbsFitParticle *p5=0, TAbsFitParticle *p6=0, TAbsFitParticle *p7=0, TAbsFitParticle *p8=0, TAbsFitParticle *p9=0, TAbsFitParticle *p10=0)
TAbsFitParticle * hadB_
input particles
TAbsFitParticle * neutrino_
TAbsFitParticle * hadQ_
bool constrainSumPt_
internally use simple boolean for this constraint to reduce the per-event computing time ...
TFitConstraintEp * sumPyConstr_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
TAbsFitParticle * lepton_
TAbsFitParticle * hadP_
double mW_
W mass value used for constraints.
Definition: TopKinFitter.h:54
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
std::vector< Constraint > constrList_
vector of constraints to be used
TFitConstraintEp * sumPxConstr_
double mTop_
top mass value used for constraints
Definition: TopKinFitter.h:56
TAbsFitParticle * lepB_
void TtSemiLepKinFitter::setupFitter ( )
private

setup fitter

Definition at line 154 of file TtSemiLepKinFitter.cc.

References TKinFitter::addConstraint(), TKinFitter::addMeasParticle(), bResolutions_, constrainSumPt_, constrList_, covM_, TopKinFitter::fitter_, hadB_, hadP_, hadQ_, i, jetEnergyResolutionEtaBinning_, jetEnergyResolutionScaleFactors_, kSumPt, lepB_, lepResolutions_, lepton_, massConstr_, metResolutions_, neutrino_, printSetup(), setupConstraints(), setupJets(), setupLeptons(), sumPxConstr_, sumPyConstr_, and udscResolutions_.

Referenced by TtSemiLepKinFitter().

155 {
156  printSetup();
157 
158  setupJets();
159  setupLeptons();
161 
162  // add measured particles
169 
170  // add constraints
171  for(unsigned int i=0; i<constrList_.size(); i++){
172  if(constrList_[i]!=kSumPt)
174  }
175  if(constrainSumPt_) {
178  }
179 
180  // initialize helper class used to bring the resolutions into covariance matrices
181  if(udscResolutions_->size() && bResolutions_->size() && lepResolutions_->size() && metResolutions_->size())
184  else
185  covM_ = new CovarianceMatrix();
186 }
int i
Definition: DBlmapReader.cc:9
TAbsFitParticle * hadB_
input particles
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
TAbsFitParticle * neutrino_
TAbsFitParticle * hadQ_
bool constrainSumPt_
internally use simple boolean for this constraint to reduce the per-event computing time ...
TFitConstraintEp * sumPyConstr_
math::Error< 5 >::type CovarianceMatrix
const std::vector< edm::ParameterSet > * bResolutions_
TAbsFitParticle * lepton_
void setupJets()
initialize jet inputs
const std::vector< edm::ParameterSet > * lepResolutions_
void printSetup() const
print fitter setup
void addConstraint(TAbsFitConstraint *constraint)
Definition: TKinFitter.cc:281
TAbsFitParticle * hadP_
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
void addMeasParticle(TAbsFitParticle *particle)
Definition: TKinFitter.cc:209
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
CovarianceMatrix * covM_
object used to construct the covariance matrices for the individual particles
void setupConstraints()
initialize constraints
std::vector< Constraint > constrList_
vector of constraints to be used
void setupLeptons()
initialize lepton inputs
TFitConstraintEp * sumPxConstr_
const std::vector< double > * jetEnergyResolutionEtaBinning_
TKinFitter * fitter_
kinematic fitter
Definition: TopKinFitter.h:46
TAbsFitParticle * lepB_
const std::vector< edm::ParameterSet > * metResolutions_
void TtSemiLepKinFitter::setupJets ( )
private

initialize jet inputs

Definition at line 87 of file TtSemiLepKinFitter.cc.

References hadB_, hadP_, hadQ_, jetParam_, TopKinFitter::kEMom, TopKinFitter::kEtEtaPhi, TopKinFitter::kEtThetaPhi, and lepB_.

Referenced by setupFitter().

88 {
89  TMatrixD empty3x3(3,3);
90  TMatrixD empty4x4(4,4);
91  switch(jetParam_){ // setup jets according to parameterization
92  case kEMom :
93  hadB_= new TFitParticleEMomDev ("Jet1", "Jet1", 0, &empty4x4);
94  hadP_= new TFitParticleEMomDev ("Jet2", "Jet2", 0, &empty4x4);
95  hadQ_= new TFitParticleEMomDev ("Jet3", "Jet3", 0, &empty4x4);
96  lepB_= new TFitParticleEMomDev ("Jet4", "Jet4", 0, &empty4x4);
97  break;
98  case kEtEtaPhi :
99  hadB_= new TFitParticleEtEtaPhi ("Jet1", "Jet1", 0, &empty3x3);
100  hadP_= new TFitParticleEtEtaPhi ("Jet2", "Jet2", 0, &empty3x3);
101  hadQ_= new TFitParticleEtEtaPhi ("Jet3", "Jet3", 0, &empty3x3);
102  lepB_= new TFitParticleEtEtaPhi ("Jet4", "Jet4", 0, &empty3x3);
103  break;
104  case kEtThetaPhi :
105  hadB_= new TFitParticleEtThetaPhi("Jet1", "Jet1", 0, &empty3x3);
106  hadP_= new TFitParticleEtThetaPhi("Jet2", "Jet2", 0, &empty3x3);
107  hadQ_= new TFitParticleEtThetaPhi("Jet3", "Jet3", 0, &empty3x3);
108  lepB_= new TFitParticleEtThetaPhi("Jet4", "Jet4", 0, &empty3x3);
109  break;
110  }
111 }
TAbsFitParticle * hadB_
input particles
TAbsFitParticle * hadQ_
TAbsFitParticle * hadP_
Param jetParam_
jet parametrization
TAbsFitParticle * lepB_
void TtSemiLepKinFitter::setupLeptons ( )
private

initialize lepton inputs

Definition at line 113 of file TtSemiLepKinFitter.cc.

References TopKinFitter::kEMom, TopKinFitter::kEtEtaPhi, TopKinFitter::kEtThetaPhi, lepParam_, lepton_, metParam_, and neutrino_.

Referenced by setupFitter().

114 {
115  TMatrixD empty3x3(3,3);
116  switch(lepParam_){ // setup lepton according to parameterization
117  case kEMom : lepton_ = new TFitParticleEScaledMomDev("Lepton", "Lepton", 0, &empty3x3); break;
118  case kEtEtaPhi : lepton_ = new TFitParticleEtEtaPhi ("Lepton", "Lepton", 0, &empty3x3); break;
119  case kEtThetaPhi : lepton_ = new TFitParticleEtThetaPhi ("Lepton", "Lepton", 0, &empty3x3); break;
120  }
121  switch(metParam_){ // setup neutrino according to parameterization
122  case kEMom : neutrino_= new TFitParticleEScaledMomDev("Neutrino", "Neutrino", 0, &empty3x3); break;
123  case kEtEtaPhi : neutrino_= new TFitParticleEtEtaPhi ("Neutrino", "Neutrino", 0, &empty3x3); break;
124  case kEtThetaPhi : neutrino_= new TFitParticleEtThetaPhi ("Neutrino", "Neutrino", 0, &empty3x3); break;
125  }
126 }
TAbsFitParticle * neutrino_
Param lepParam_
lepton parametrization
TAbsFitParticle * lepton_
Param metParam_
met parametrization

Member Data Documentation

const std::vector<edm::ParameterSet>* TtSemiLepKinFitter::bResolutions_
private

Definition at line 102 of file TtSemiLepKinFitter.h.

Referenced by setupFitter().

bool TtSemiLepKinFitter::constrainSumPt_
private

internally use simple boolean for this constraint to reduce the per-event computing time

Definition at line 130 of file TtSemiLepKinFitter.h.

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

std::vector<Constraint> TtSemiLepKinFitter::constrList_
private

vector of constraints to be used

Definition at line 128 of file TtSemiLepKinFitter.h.

Referenced by printSetup(), setupConstraints(), and setupFitter().

CovarianceMatrix* TtSemiLepKinFitter::covM_
private

object used to construct the covariance matrices for the individual particles

Definition at line 109 of file TtSemiLepKinFitter.h.

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

pat::Particle TtSemiLepKinFitter::fittedHadB_
private

output particles

Definition at line 115 of file TtSemiLepKinFitter.h.

Referenced by fit(), and fittedHadB().

pat::Particle TtSemiLepKinFitter::fittedHadP_
private

Definition at line 116 of file TtSemiLepKinFitter.h.

Referenced by fit(), and fittedHadP().

pat::Particle TtSemiLepKinFitter::fittedHadQ_
private

Definition at line 117 of file TtSemiLepKinFitter.h.

Referenced by fit(), and fittedHadQ().

pat::Particle TtSemiLepKinFitter::fittedLepB_
private

Definition at line 118 of file TtSemiLepKinFitter.h.

Referenced by fit(), and fittedLepB().

pat::Particle TtSemiLepKinFitter::fittedLepton_
private

Definition at line 119 of file TtSemiLepKinFitter.h.

Referenced by fit(), and fittedLepton().

pat::Particle TtSemiLepKinFitter::fittedNeutrino_
private

Definition at line 120 of file TtSemiLepKinFitter.h.

Referenced by fit(), and fittedNeutrino().

TAbsFitParticle* TtSemiLepKinFitter::hadB_
private

input particles

Definition at line 94 of file TtSemiLepKinFitter.h.

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

TAbsFitParticle* TtSemiLepKinFitter::hadP_
private
TAbsFitParticle* TtSemiLepKinFitter::hadQ_
private
const std::vector<double>* TtSemiLepKinFitter::jetEnergyResolutionEtaBinning_
private

Definition at line 107 of file TtSemiLepKinFitter.h.

Referenced by setupFitter().

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

scale factors for the jet energy resolution

Definition at line 106 of file TtSemiLepKinFitter.h.

Referenced by setupFitter().

Param TtSemiLepKinFitter::jetParam_
private

jet parametrization

Definition at line 122 of file TtSemiLepKinFitter.h.

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

TAbsFitParticle* TtSemiLepKinFitter::lepB_
private
Param TtSemiLepKinFitter::lepParam_
private

lepton parametrization

Definition at line 124 of file TtSemiLepKinFitter.h.

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

const std::vector<edm::ParameterSet>* TtSemiLepKinFitter::lepResolutions_
private

Definition at line 103 of file TtSemiLepKinFitter.h.

Referenced by setupFitter().

TAbsFitParticle* TtSemiLepKinFitter::lepton_
private
std::map<Constraint, TFitConstraintM*> TtSemiLepKinFitter::massConstr_
private

supported constraints

Definition at line 111 of file TtSemiLepKinFitter.h.

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

Param TtSemiLepKinFitter::metParam_
private

met parametrization

Definition at line 126 of file TtSemiLepKinFitter.h.

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

const std::vector<edm::ParameterSet>* TtSemiLepKinFitter::metResolutions_
private

Definition at line 104 of file TtSemiLepKinFitter.h.

Referenced by setupFitter().

TAbsFitParticle* TtSemiLepKinFitter::neutrino_
private
TFitConstraintEp* TtSemiLepKinFitter::sumPxConstr_
private

Definition at line 112 of file TtSemiLepKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and ~TtSemiLepKinFitter().

TFitConstraintEp* TtSemiLepKinFitter::sumPyConstr_
private

Definition at line 113 of file TtSemiLepKinFitter.h.

Referenced by fit(), setupConstraints(), setupFitter(), and ~TtSemiLepKinFitter().

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

resolutions

Definition at line 101 of file TtSemiLepKinFitter.h.

Referenced by setupFitter().