Changeset 551 in svn for trunk/src/SmearUtil.cc
- Timestamp:
- Feb 23, 2010, 2:20:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SmearUtil.cc
r550 r551 1445 1445 // iTower is the index of the tower, in [0, n_tower]. iTower points only towers in positive range 1446 1446 1447 // etrat, which is a percentage between 00 and 99. It is the ratio of the transverse energy1448 // in a NÃN grid surrounding the muon to the pT of the muon. For well-isolated muons, both ptiso and etrat will be small.1449 // available parameters: ISOL_Calo_ET , ISOL_Calo_Grid1450 1451 1447 if(ISOL_Calo_ET>1E10) return UNDEFINED; // avoid doing anything unreasonable... 1452 1448 float et_sum=0; … … 1457 1453 // !! TOWER_eta_edges is only with eta>0 1458 1454 1459 cout << "iEta= " << iEta << "\tiPhi= " << iPhi << endl; 1460 //cout << "la particule est dans la " << index << "eme cellule, entre " << TOWER_eta_edges[index] << " et " << TOWER_eta_edges[index+1] << endl; 1461 //float centre = (iEta>0) ? ((TOWER_eta_edges[index]+TOWER_eta_edges[index+1])/2.0) : -((TOWER_eta_edges[index]+TOWER_eta_edges[index+1])/2.0); 1462 //cout << "le centre de cette tour est " << centre << endl; 1463 1455 //cout << "iEta= " << iEta << "\tiPhi= " << iPhi << endl; 1464 1456 if(index != iUNDEFINED) { 1465 1457 int range = (int) (N-1)/2; // the (int) conversion is needed, as N is "unsigned int" … … 1467 1459 // goal : to identify the center of each cell in the NxN grid. 1468 1460 // the eta/phi coordinates of each center will be in (eta_ith_tower,phi_ith_tower) 1469 1470 1461 unsigned int i_eta = (index+i>=0) ? index + i : (int) -1*(index + i +1); // i_eta is the index in [0; index_eta_max] 1471 //cout << i_eta << "\t"; 1462 if(i_eta>=TOWER_number) continue; // avoid going too far: TOWER_dphi[TOWER_number], TOWER_eta_edges[TOWER_number+1] 1463 //cout << "i_eta" << i_eta << "\t TOWER_number = " << TOWER_number << endl; 1464 1472 1465 float dphi = TOWER_dphi[i_eta]*pi/180.; // in rad // size in phi of the cells for this eta 1473 1466 float eta_ith_tower = (TOWER_eta_edges[i_eta]+TOWER_eta_edges[i_eta+1])/2.0; 1474 1467 if(iEta<0) eta_ith_tower *= -1; // needed if the central tower is in negative region 1475 if(index+i<0) eta_ith_tower *= -1; // needed if the central partis crossed by the grid1468 if(index+i<0) eta_ith_tower *= -1; // needed if the "eta=0"-axis is crossed by the grid 1476 1469 //cout << "pour eta_ith_tower=" << eta_ith_tower << ", on va dphi = " << dphi << endl; 1477 1470 // !!! at this point, eta_ith_tower is the value in eta of the center of the current calo cell … … 1484 1477 1485 1478 D_CaloTower calMuon(towers.getElement(eta_ith_tower,phi_ith_tower)); 1486 cout << "eta_ith_tower= " << eta_ith_tower << "\tphi_ith_tower= " << phi_ith_tower <<"\t" 1487 << "calMuon.getEta= " << calMuon.getEta() << "\tcalMuon.getPhi()= " << calMuon.getPhi() <<"\t"; 1488 1489 if(calMuon.getEta() != UNDEFINED ) 1490 if(calMuon.getET() > ISOL_Calo_ET) { 1491 et_sum += calMuon.getET(); 1492 //cout << "eta/phi/Et = " << eta_ith_tower << "\t" << phi_ith_tower << "\t" << calMuon.getET() << " GeV" << endl; 1493 cout << calMuon.getET() << " GeV"; 1479 //cout << "eta_ith_tower= " << eta_ith_tower << "\tphi_ith_tower= " << phi_ith_tower <<"\t" 1480 // << "calMuon.getEta= " << calMuon.getEta() << "\tcalMuon.getPhi()= " << calMuon.getPhi() <<"\t"; 1481 1482 if(calMuon.getEta() != UNDEFINED && calMuon.getET() > ISOL_Calo_ET) { 1483 et_sum += calMuon.getET(); 1484 //cout << calMuon.getET() << " GeV"; 1494 1485 } 1495 //else cout << "eta/phi = " << eta_ith_tower << "\t" << phi_ith_tower << "\tnot active\n"; 1496 else cout << phi_ith_tower << "\tnot active"; 1497 cout << endl; 1498 } 1499 } 1486 //else cout << " not active"; 1487 } // j-loop (phi indices) 1488 } // i-loop (eta indices) 1500 1489 } // undefined index 1501 1490 else { … … 1503 1492 if (CEN_max_mu < CEN_max_calo_fwd) 1504 1493 cout << "** ERROR in RESOLution::CaloIsolation: 'muon'-tower not found! **" << endl; 1505 } 1506 // should never happen ! this would be a bug 1507 //cout << "etrat = " << et_sum << "\t Pt=" << part.Pt() << endl; 1508 1509 // should return a number between 0 and 99 (due to LHCO definitions) 1510 // which is Pt(muon) / sum(ET) 1511 float etrat = 0.; 1512 /* if(et_sum==0) etrat = 99.; 1513 //else if(et_sum>0) etrat = 100*part.Pt()/et_sum; 1514 if(etrat<0) cout << "Error: negative etrat in CaloIsolation (" << etrat <<")\n"; 1515 //else if(etrat>99) cout << "Error: etrat should be in [0;99] in CaloIsolation (" << etrat <<")\n"; 1516 if(etrat>99) etrat = 99; 1517 */ 1518 etrat = et_sum/part.Pt(); 1519 return etrat; 1494 } // should never happen ! this would be a bug 1495 1496 return (part.Pt()==0)? UNDEFINED: et_sum/part.Pt(); 1520 1497 } 1521 1498
Note:
See TracChangeset
for help on using the changeset viewer.