- Timestamp:
- Aug 9, 2012, 11:48:52 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SmearUtil.cc
r665 r671 1382 1382 ///// Attention : bug removed => CONERADIUS/2 -> CONERADIUS !! 1383 1383 int RESOLution::Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi) { 1384 float emax=0;1384 int flav_max=0; 1385 1385 int Ppid=0; 1386 1386 if(subarray.GetEntries()>0) { 1387 1387 for(int i=0; i < subarray.GetEntries();i++) { // should have pt>PT_JETMIN and a small cone radius (r<CONE_JET) 1388 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); 1391 1391 Ppid=abs(subarray[i]->PID); 1392 1392 } 1393 1393 } 1394 1394 } 1395 return Ppid; 1396 } 1397 1395 return Ppid; 1396 } 1398 1397 1399 1398 //******************* Simulates the b-tagging efficiency for real bjet, or the misendentification for other jets**************** … … 1406 1405 1407 1406 // selects the correct formula 1408 int jet_id = Bjets(subarray,JET.Eta(),JET.Phi()); // gets the particle id of the most energetic parton inthe jet1407 int jet_id = Bjets(subarray,JET.Eta(),JET.Phi()); // gets the flavor of the jet 1409 1408 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; 1413 1411 default: efficiency_formula = BTAG_func_l; break; 1414 1412 } … … 1417 1415 float x = grandom->Uniform(); // randomisation 1418 1416 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;1422 1417 1423 1418 return tag;
Note:
See TracChangeset
for help on using the changeset viewer.