Fork me on GitHub

Changeset 671 in svn


Ignore:
Timestamp:
Aug 9, 2012, 11:48:52 AM (12 years ago)
Author:
cp3-support
Message:

corrected b-tagging by a.mertens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SmearUtil.cc

    r665 r671  
    13821382///// Attention : bug removed => CONERADIUS/2 -> CONERADIUS !!
    13831383int RESOLution::Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi) {
    1384   float emax=0;
     1384  int flav_max=0;
    13851385  int Ppid=0;
    13861386  if(subarray.GetEntries()>0) {
    13871387      for(int i=0; i < subarray.GetEntries();i++) { // should have pt>PT_JETMIN and a small cone radius (r<CONE_JET)
    1388           float genDeltaR = DeltaR(subarray[i]->Phi,subarray[i]->Eta,phi,eta);
    1389           if(genDeltaR < JET_coneradius && subarray[i]->E > emax) {
    1390               emax=subarray[i]->E;
     1388      float genDeltaR = DeltaR(subarray[i]->Phi,subarray[i]->Eta,phi,eta);
     1389          if(genDeltaR < JET_coneradius && (abs( subarray[i]->PID) < 6 && abs(subarray[i]->PID) > flav_max)) {
     1390              flav_max=abs(subarray[i]->PID);
    13911391              Ppid=abs(subarray[i]->PID);
    13921392          }
    13931393      }
    13941394  }
    1395   return Ppid;
    1396 }
    1397 
     1395  return Ppid;
     1396}
    13981397
    13991398//******************* Simulates the b-tagging efficiency for real bjet, or the misendentification for other jets****************
     
    14061405
    14071406  // selects the correct formula
    1408   int jet_id = Bjets(subarray,JET.Eta(),JET.Phi()); // gets the particle id of the most energetic parton in the jet
     1407  int jet_id = Bjets(subarray,JET.Eta(),JET.Phi()); // gets the flavor of the jet
    14091408  switch (jet_id) {
    1410     case pB: efficiency_formula = BTAG_func_b; break;
    1411     case pC: efficiency_formula = BTAG_func_c; break;
    1412     case pGLUON: efficiency_formula = BTAG_func_g; break;
     1409    case 5: efficiency_formula = BTAG_func_b; break;
     1410    case 4: efficiency_formula = BTAG_func_c; break;
    14131411    default: efficiency_formula = BTAG_func_l; break;
    14141412  }
     
    14171415  float x = grandom->Uniform(); // randomisation
    14181416  tag = (x < efficiency.Eval(JET.Pt(),JET.Eta())) ? true : false;
    1419   //cout << "formula = " << efficiency_formula << "\t Pt = " << JET.Pt()
    1420   //     << "\t value = " << efficiency.Eval(JET.Pt()) 
    1421   //     << "\t x = " << x << "\t tag= " << tag << endl;
    14221417
    14231418  return tag;
Note: See TracChangeset for help on using the changeset viewer.