18 b_(0), bBar_(0), lightQ_(0), lightQBar_(0), lightP_(0), lightPBar_(0),
19 udscResolutions_(0), bResolutions_(0),
20 jetEnergyResolutionScaleFactors_(0), jetEnergyResolutionEtaBinning_(0),
27 std::vector<TtFullHadKinFitter::Constraint>
30 std::vector<TtFullHadKinFitter::Constraint> cConstraints;
31 cConstraints.resize(constraints.size());
32 for(
unsigned int i=0;
i<constraints.size();++
i)
83 for(std::map<Constraint, TFitConstraintM*>::iterator it =
massConstr_.begin(); it !=
massConstr_.end(); ++it)
91 std::stringstream constr;
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;
103 <<
"+++++++++++ TtFullHadKinFitter Setup ++++++++++++ \n" 104 <<
" Parametrization: \n" 106 <<
" Constraints: \n" 108 <<
" Max(No iterations): " <<
maxNrIter_ <<
"\n" 110 <<
" Max(F) : " <<
maxF_ <<
"\n" 111 <<
"+++++++++++++++++++++++++++++++++++++++++++++++++ \n";
118 TMatrixD empty3x3(3,3);
119 TMatrixD empty4x4(4,4);
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() );
269 std::vector<pat::Jet>
jets;
301 bTagAlgo_(
"trackCountingHighPurBJetTags"),
302 minBTagValueBJet_(3.41),
303 maxBTagValueNonBJet_(3.41),
308 jetCorrectionLevel_(
"L3Absolute"),
317 useOnlyMatch_(
false),
318 match_(
std::vector<
int>(0)),
381 if( bJetCounter == 1 &&
390 else if( bJetCounter > 1 &&
401 if( bJetCounter == 0){
404 else if( bJetCounter == 1 &&
413 else if( bJetCounter > 1 &&
425 <<
"Wrong number of bTags (" <<
bTags_ <<
" bTags not supported)!\n";
438 <<
"Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
441 if( !(quarkType==
"wMix" ||
443 quarkType==
"charm" ||
444 quarkType==
"bottom") )
446 << quarkType <<
" is unknown as a quarkType for the jetCorrectionLevel.\n";
448 float jecFactor = 1.;
457 std::list<TtFullHadKinFitter::KinFitResult>
460 std::list<TtFullHadKinFitter::KinFitResult> fitResults;
470 std::vector<int> invalidCombi;
471 for(
unsigned int i = 0;
i <
nPartons; ++
i) invalidCombi.push_back( -1 );
489 fitResults.push_back( result );
498 std::vector<int> jetIndices;
500 for(
unsigned int idx=0;
idx<jets.size(); ++
idx){
502 jetIndices.push_back(
idx);
506 std::vector<int> combi;
512 unsigned int bJetCounter = 0;
513 for(std::vector<pat::Jet>::const_iterator
jet = jets.begin();
jet < jets.end(); ++
jet){
518 for(
int cnt=0; cnt<TMath::Factorial(combi.size()); ++cnt){
526 std::vector<pat::Jet> jetCombi;
527 jetCombi.resize(nPartons);
552 fitResults.push_back( result );
560 std::next_permutation( combi.begin(), combi.end() );
578 if( (
unsigned)fitResults.size() < 1 ) {
596 std::vector<int> invalidCombi(nPartons, -1);
599 fitResults.push_back( result );
608 switch(configParameter){
614 <<
"Chosen jet parametrization is not supported: " << configParameter <<
"\n";
624 switch(configParameter){
632 <<
"Chosen fit constraint is not supported: " << configParameter <<
"\n";
638 std::vector<TtFullHadKinFitter::Constraint>
641 std::vector<TtFullHadKinFitter::Constraint>
result;
642 for(
unsigned i=0;
i<configParameters.size(); ++
i){
TAbsFitParticle * lightQ_
double maxF_
maximal deviation for contstraints
const std::vector< double > * jetEnergyResolutionEtaBinning_
double maxDeltaS_
maximal chi2 equivalent
TtFullHadKinFitter::Param param(unsigned int configParameter)
pat::Jet getCalHadj() const
void setFitHadj(const pat::Particle &aFitHadj)
CovarianceMatrix * covM_
get object resolutions and put them into a matrix
Param
supported parameterizations
void setupConstraints()
initialize constraints
TtHadEvtSolution addKinFitInfo(TtHadEvtSolution *asol)
add kin fit information to the old event solution (in for legacy reasons)
TAbsFitParticle * lightP_
int maxNComb_
maximal number of combinations to be written to the event
TtFullHadKinFitter::Constraint constraint(unsigned int configParameter)
virtual void setIni4Vec(const TLorentzVector *pini)=0
const pat::Particle fittedLightPBar() const
return fitted light quark candidate
void setFitHadb(const pat::Particle &aFitHadb)
pat::Jet getCalHadq() const
pat::Particle fittedLightPBar_
std::string param(const Param ¶m) const
convert Param to human readable form
pat::Jet getCalHadp() const
void setFitHadp(const pat::Particle &aFitHadp)
pat::Particle fittedB_
output particles
jetEnergyResolutionScaleFactors
TMatrixD setupMatrix(const pat::PATObject< T > &object, const TopKinFitter::Param param, const std::string &resolutionProvider="")
return covariance matrix for a PAT object
int fit(const std::vector< pat::Jet > &jets)
kinematic fit interface
void printSetup() const
print fitter setup
TtFullHadKinFitter * fitter
kinematic fit interface
double mW_
W mass value used for constraints.
std::vector< unsigned > constraints_
numbering of different possible kinematic constraints
math::Error< 5 >::type CovarianceMatrix
pat::Particle fittedLightQBar_
const std::vector< double > * jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
std::list< TtFullHadKinFitter::KinFitResult > fit(const std::vector< pat::Jet > &jets)
do the fitting and return fit result
int maxNrIter_
maximal allowed number of iterations to be used for the fit
void setProbChi2(double c)
std::vector< double > jetEnergyResolutionScaleFactors_
scale factors for the jet energy resolution
const pat::Particle fittedBBar() const
return fitted b quark candidate
std::vector< edm::ParameterSet > udscResolutions_
store the resolutions for the jets
double fitProb() const
return fit probability
std::vector< edm::ParameterSet > bResolutions_
std::string jetCorrectionLevel_
correction level for jets
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool doBTagging(const std::vector< pat::Jet > &jets, const unsigned int &bJetCounter, std::vector< int > &combi)
pat::Jet corJet(const pat::Jet &jet, const std::string &quarkType)
helper function to construct the proper corrected jet for its corresponding quarkType ...
std::vector< double > jetEnergyResolutionEtaBinning_
unsigned int bTags_
minimal number of b-jets
Constraint
supported constraints
unsigned int maxNrIter_
maximal number of iterations to be performed for the fit
std::vector< int > match_
the combination that should be used
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>))
~TtFullHadKinFitter()
default destructor
virtual double px() const final
x coordinate of momentum vector
const std::vector< edm::ParameterSet > * bResolutions_
void addConstraint(TAbsFitConstraint *constraint)
virtual double energy() const final
energy
TAbsFitParticle * b_
input particles
jetEnergyResolutionEtaBinning
pat::Jet getCalHadb() const
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
double minBTagValueBJet_
min value of bTag for a b-jet
pat::Jet getCalHadk() const
double mW_
W mass value used for constraints.
void addMeasParticle(TAbsFitParticle *particle)
std::map< Constraint, TFitConstraintM * > massConstr_
supported constraints
std::vector< TtFullHadKinFitter::Constraint > constraints(const std::vector< unsigned int > &configParameters)
maxNJets
maximum number of jets taken into account per event for each hypothesis (this parameter is used in th...
pat::Particle fittedLightP_
TAbsFitParticle * lightQBar_
const pat::Particle fittedLightQ() const
return fitted light quark candidate
pat::Particle fittedBBar_
double maxDeltaS_
maximal allowed chi2 (not normalized to degrees of freedom)
double mTop_
top mass value used for constraints
std::vector< Constraint > constraints_
vector of constraints to be used
virtual double pz() const final
z coordinate of momentum vector
std::vector< int > JetCombi
Param jetParam_
jet parametrization
pat::Particle fittedLightQ_
void setupFitter()
setup fitter
~KinFit()
default destructor
XYZPointD XYZPoint
point in space with cartesian internal representation
Analysis-level particle class.
std::string bTagAlgo_
input tag for b-tagging algorithm
void setFitHadbbar(const pat::Particle &aFitHadbbar)
const std::vector< edm::ParameterSet > * udscResolutions_
resolutions
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
Analysis-level calorimeter jet class.
void setFitHadk(const pat::Particle &aFitHadk)
static const unsigned int nPartons
const TLorentzVector * getCurr4Vec()
unsigned int jetParam_
numbering of different possible jet parametrizations
void setFitHadq(const pat::Particle &aFitHadq)
bool useOnlyMatch_
fit or only a certain combination
int maxNJets_
maximal number of jets (-1 possible to indicate 'all')
TtFullHadKinFitter()
default constructor
const pat::Particle fittedLightP() const
return fitted light quark candidate
double fitS() const
return chi2 of fit (not normalized to degrees of freedom)
void setupJets()
initialize jet inputs
TKinFitter * fitter_
kinematic fitter
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
double maxBTagValueNonBJet_
max value of bTag for a non-b-jet
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
bool invalidMatch_
match is invalid
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
pat::Jet getCalHadbbar() const
const pat::Particle fittedLightQBar() const
return fitted light quark candidate
double mTop_
top mass value used for constraints
const pat::Particle fittedB() const
return fitted b quark candidate
virtual double py() const final
y coordinate of momentum vector
KinFit()
default constructor
TAbsFitParticle * lightPBar_
double maxF_
maximal allowed distance from constraints