CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/TopQuarkAnalysis/TopJetCombination/src/TtHadLRJetCombObservables.cc

Go to the documentation of this file.
00001 // $Id: TtHadLRJetCombObservables.cc,v 1.2 2008/02/17 11:27:55 rwolf Exp $
00002 
00003 #include "TopQuarkAnalysis/TopJetCombination/interface/TtHadLRJetCombObservables.h"
00004 
00005 // constructor with path; default should not be used
00006 TtHadLRJetCombObservables::TtHadLRJetCombObservables() 
00007 {
00008 }
00009 
00010 TtHadLRJetCombObservables::~TtHadLRJetCombObservables() 
00011 {
00012 }
00013 
00014 void  TtHadLRJetCombObservables::operator()(TtHadEvtSolution& sol)
00015 {
00016   jetCombVarVal.clear();
00017 
00018   //observable 1 : pt(had top)
00019   //Calculate the average pt for all possible combinations of light jets with the two b-jets
00020   double AverageTop =((sol.getHadb().p4()+sol.getHadq().p4()+sol.getHadp().p4()).pt()+
00021                       (sol.getHadbbar().p4()+sol.getHadq().p4()+sol.getHadp().p4()).pt()+
00022                       (sol.getHadb().p4()+sol.getHadbbar().p4()+sol.getHadp().p4()).pt()+
00023                       (sol.getHadb().p4()+sol.getHadbbar().p4()+sol.getHadq().p4()).pt()+
00024                       (sol.getHadb().p4()+sol.getHadk().p4()+sol.getHadj().p4()).pt()+
00025                       (sol.getHadbbar().p4()+sol.getHadk().p4()+sol.getHadj().p4()).pt()+
00026                       (sol.getHadb().p4()+sol.getHadbbar().p4()+sol.getHadj().p4()).pt()+
00027                       (sol.getHadb().p4()+sol.getHadbbar().p4()+sol.getHadk().p4()).pt()+
00028                       (sol.getHadb().p4()+sol.getHadq().p4()+sol.getHadj().p4()).pt()+
00029                       (sol.getHadb().p4()+sol.getHadq().p4()+sol.getHadk().p4()).pt()+
00030                       (sol.getHadbbar().p4()+sol.getHadq().p4()+sol.getHadj().p4()).pt()+
00031                       (sol.getHadbbar().p4()+sol.getHadq().p4()+sol.getHadk().p4()).pt())/12.;
00032 
00033   double Obs1 = ((sol.getHadb().p4()+sol.getHadq().p4()+sol.getHadp().p4()+sol.getHadbbar().p4()+sol.getHadk().p4()+sol.getHadj().p4()).pt())/AverageTop;
00034   jetCombVarVal.push_back(std::pair<unsigned int,double>(1,Obs1)); 
00035 
00036   //observable 2 : (pt_b1 + pt_b2)/(sum jetpt)
00037   double obs2 = (sol.getHadb().pt()+sol.getHadbbar().pt())/(sol.getHadp().pt()+sol.getHadq().pt()+sol.getHadj().pt()+sol.getHadk().pt());
00038   jetCombVarVal.push_back(std::pair<unsigned int,double>(2,obs2));
00039   
00040   //observable 3 and 4: delta R between had b and had W and delta R between had bbar and had W
00041   double Obs3 = ROOT::Math::VectorUtil::DeltaR( sol.getHadb().p4(),(sol.getHadq().p4()+sol.getHadp().p4()) );
00042   jetCombVarVal.push_back(std::pair<unsigned int,double>(3,Obs3));
00043  
00044   double Obs4 = ROOT::Math::VectorUtil::DeltaR( sol.getHadbbar().p4(),(sol.getHadk().p4()+sol.getHadj().p4()) );
00045   jetCombVarVal.push_back(std::pair<unsigned int,double>(4,Obs4));  
00046    
00047   //observalbe 5 and 6: delta R between light quarks pq and jk
00048   double Obs5 = ROOT::Math::VectorUtil::DeltaR( sol.getHadq().p4(),sol.getHadp().p4() );
00049   jetCombVarVal.push_back(std::pair<unsigned int,double>(5,Obs5)); 
00050   
00051   double Obs6 = ROOT::Math::VectorUtil::DeltaR( sol.getHadk().p4(),sol.getHadj().p4() );
00052   jetCombVarVal.push_back(std::pair<unsigned int,double>(6,Obs6)); 
00053 
00054   //observable 7: b-tagging information
00055   double Obs7 = 0;
00056   if ( fabs(sol.getHadb().bDiscriminator("trackCountingJetTags") +10) < 0.0001 || fabs(sol.getHadbbar().bDiscriminator("trackCountingJetTags") +10)< 0.0001 ){
00057     Obs7 = -10.;
00058   } else {
00059     Obs7 = (sol.getHadb().bDiscriminator("trackCountingJetTags")+sol.getHadbbar().bDiscriminator("trackCountingJetTags"));
00060   }
00061   jetCombVarVal.push_back(std::pair<unsigned int,double>(7,Obs7)); 
00062    
00063   //observable 8 : chi2 value of kinematical fit with W-mass constraint
00064   double Obs8 =0;
00065   if(sol.getProbChi2() <0){
00066     Obs8 = -0;
00067   } else { 
00068     Obs8 = log10(sol.getProbChi2()+.00001);
00069   }
00070   jetCombVarVal.push_back(std::pair<unsigned int,double>(8,Obs8)); 
00071  
00072   sol.setLRJetCombObservables(jetCombVarVal);
00073 }