#include <TopQuarkAnalysis/TopLeptonSelection/interface/TtSemiSimpleBestJetComb.h>
Public Member Functions | |
int | operator() (std::vector< TtSemiEvtSolution > &) |
TtSemiSimpleBestJetComb () | |
~TtSemiSimpleBestJetComb () |
This method starts from a vector of fitted TtSemiEvtSolutions. This class returns the solution with the highest probChi^2 value. In case that there are more possibilities (eg when only a hadrW constraint was applied), the correct hadronic b is assumed to be the one with the smallest DR angle wrt the Whadr direction.
Definition at line 33 of file TtSemiSimpleBestJetComb.h.
TtSemiSimpleBestJetComb::TtSemiSimpleBestJetComb | ( | ) |
TtSemiSimpleBestJetComb::~TtSemiSimpleBestJetComb | ( | ) |
int TtSemiSimpleBestJetComb::operator() | ( | std::vector< TtSemiEvtSolution > & | sols | ) |
Definition at line 15 of file TtSemiSimpleBestJetComb.cc.
00016 { 00017 // search the highest probChi^2 value in the among the different jet combination solutions 00018 double maxProbChi2 = 0; 00019 for(unsigned int s=0; s<sols.size(); s++) maxProbChi2 = std::max(maxProbChi2,sols[s].getProbChi2()); 00020 00021 //search indices of original solutions with highest probChi2 value 00022 std::vector<unsigned int> indices; 00023 indices.clear(); 00024 for(unsigned int s=0; s<sols.size(); s++){ 00025 if(fabs(sols[s].getProbChi2()-maxProbChi2) < 0.0001) indices.push_back(s); 00026 } 00027 00028 int bestSol = -999; 00029 if(maxProbChi2 > 0.){ 00030 if(indices.size() == 1) bestSol = indices[0]; 00031 if(indices.size() == 2) { 00032 //typically only light jets constraints applied, so still b-jet ambiguity to resolve 00033 // -> look at DPhi(Whadr,bhadr) and choose smallest value 00034 double DPhi_Wb0 = fabs(sols[indices[0]].getFitHadW().phi()-sols[indices[0]].getFitHadb().phi()); 00035 double DPhi_Wb1 = fabs(sols[indices[1]].getFitHadW().phi()-sols[indices[1]].getFitHadb().phi()); 00036 if(DPhi_Wb0>3.1415) DPhi_Wb0 = 2.*3.1415-DPhi_Wb0; 00037 if(DPhi_Wb1>3.1415) DPhi_Wb1 = 2.*3.1415-DPhi_Wb1; 00038 if(DPhi_Wb0 < DPhi_Wb1){ 00039 bestSol = indices[0]; 00040 } 00041 else{ 00042 bestSol = indices[1]; 00043 } 00044 } 00045 } 00046 return bestSol; 00047 }