#include <TopQuarkAnalysis/TopJetCombination/interface/TtHadSimpleBestJetComb.h>
Public Member Functions | |
int | operator() (std::vector< TtHadEvtSolution > &) |
TtHadSimpleBestJetComb () | |
~TtHadSimpleBestJetComb () |
Simple method to get the correct jet combination in hadronic ttbar events. Returns the solution with the highest probChi^2 value, starting from TtHadEvtSolutions. If more than one solution has a low enough Chi^2, the chosen best solution is that which either have both b-jets closer to a particular W-jet or the one in which the two angles added together. WARNING WARNING WARNING, last option for selection best solution by taking the sum of angles needs to be checked/approved by experts!!!!
Definition at line 22 of file TtHadSimpleBestJetComb.h.
TtHadSimpleBestJetComb::TtHadSimpleBestJetComb | ( | ) |
TtHadSimpleBestJetComb::~TtHadSimpleBestJetComb | ( | ) |
int TtHadSimpleBestJetComb::operator() | ( | std::vector< TtHadEvtSolution > & | sols | ) |
Definition at line 28 of file TtHadSimpleBestJetComb.cc.
References i, max, phi, and s.
00029 { 00030 // search the highest probChi^2 value in the among the different jet combination solutions 00031 double maxProbChi2 = 0.; 00032 for(unsigned int s=0; s<sols.size(); s++){ 00033 maxProbChi2 = std::max(maxProbChi2,sols[s].getProbChi2()); 00034 } 00035 00036 //search indices of original solutions with highest probChi2 value and select those solutionsthat are close to the highest Chi^2 00037 std::vector<unsigned int> indices; 00038 indices.clear(); 00039 for(unsigned int s=0; s<sols.size(); s++){ 00040 if(fabs(sols[s].getProbChi2()-maxProbChi2) < 0.0001) indices.push_back(s); 00041 } 00042 00043 // TtHadSolutionMaker takes light jet combinations into account, but not b-jet ambiguity... 00044 int bestSol = -999; 00045 double prev_W1b = 999.; 00046 double prev_W2b = 999.; 00047 if(maxProbChi2 > 0.){ 00048 if(indices.size() == 1) bestSol = indices[0]; 00049 if(indices.size() > 1){ //for more than one solution... 00050 for(unsigned int i=0;i!=indices.size();i++){ 00051 double DPhi_W1b0 = fabs(sols[indices[i]].getFitHadW_plus().phi()-sols[indices[i]].getFitHadb().phi()); 00052 double DPhi_W1b1 = fabs(sols[indices[i]].getFitHadW_plus().phi()-sols[indices[i]].getFitHadbbar().phi()); 00053 double DPhi_W2b0 = fabs(sols[indices[i]].getFitHadW_minus().phi()-sols[indices[i]].getFitHadb().phi()); 00054 double DPhi_W2b1 = fabs(sols[indices[i]].getFitHadW_minus().phi()-sols[indices[i]].getFitHadbbar().phi()); 00055 00056 if(DPhi_W1b0>3.1415) DPhi_W1b0 = 2.*3.1415-DPhi_W1b0; 00057 if(DPhi_W1b1>3.1415) DPhi_W1b1 = 2.*3.1415-DPhi_W1b1; 00058 if(DPhi_W2b0>3.1415) DPhi_W2b0 = 2.*3.1415-DPhi_W2b0; 00059 if(DPhi_W2b1>3.1415) DPhi_W2b1 = 2.*3.1415-DPhi_W2b1; 00060 // Select as best solution the one which either has both b-jets closer to a particular W-jet 00061 // or the one in which the two angles added together are lower than the other.....FIXME!!! 00062 // W1b0 and W1b1 is a pair, W2b0 and W2b1 00063 if(DPhi_W1b0<DPhi_W2b0 && DPhi_W1b1<DPhi_W2b1){ 00064 if(DPhi_W1b0<prev_W1b && DPhi_W1b1<prev_W2b){ 00065 bestSol = indices[i]; 00066 } 00067 } 00068 if(DPhi_W1b0>DPhi_W2b0 && DPhi_W1b1>DPhi_W2b1){ 00069 if(DPhi_W2b0<prev_W1b && DPhi_W2b1<prev_W2b){ 00070 bestSol = indices[i]; 00071 } 00072 } 00073 if((DPhi_W1b0<DPhi_W2b0 && DPhi_W1b1>DPhi_W2b1)||(DPhi_W1b0>DPhi_W2b0 && DPhi_W1b1<DPhi_W2b1)){ 00074 if((DPhi_W1b0+DPhi_W1b1)<(DPhi_W2b0+DPhi_W2b1)){ 00075 if(DPhi_W1b0<prev_W1b && DPhi_W1b1<prev_W2b){ 00076 bestSol = indices[i]; 00077 } 00078 }else{ 00079 if(DPhi_W2b0<prev_W1b && DPhi_W2b1<prev_W2b){ 00080 bestSol = indices[i]; 00081 } 00082 } 00083 } 00084 } 00085 } 00086 } 00087 return bestSol; 00088 }