Fork me on GitHub

Changeset 551 in svn for trunk/src/SmearUtil.cc


Ignore:
Timestamp:
Feb 23, 2010, 2:20:23 AM (15 years ago)
Author:
Xavier Rouby
Message:

EtRatio for muon and electron; apparently bug free

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SmearUtil.cc

    r550 r551  
    14451445  // iTower is the index of the tower, in [0, n_tower]. iTower points only towers in positive range
    14461446
    1447   // etrat, which is a percentage between 00 and 99. It is the ratio of the transverse energy
    1448   // 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_Grid
    1450 
    14511447   if(ISOL_Calo_ET>1E10) return UNDEFINED; // avoid doing anything unreasonable...
    14521448   float et_sum=0;
     
    14571453                      // !! TOWER_eta_edges is only with eta>0
    14581454
    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;
    14641456   if(index != iUNDEFINED) {
    14651457      int range = (int) (N-1)/2;           // the (int) conversion is needed, as N is "unsigned int"
     
    14671459      // goal : to identify the center of each cell in the NxN grid.
    14681460      // the eta/phi coordinates of each center will be in (eta_ith_tower,phi_ith_tower)
    1469 
    14701461         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
    14721465         float dphi = TOWER_dphi[i_eta]*pi/180.; // in rad // size in phi of the cells for this eta
    14731466         float eta_ith_tower = (TOWER_eta_edges[i_eta]+TOWER_eta_edges[i_eta+1])/2.0;
    14741467         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 part is crossed by the grid
     1468         if(index+i<0) eta_ith_tower *= -1;  // needed if the "eta=0"-axis is crossed by the grid
    14761469         //cout << "pour eta_ith_tower=" << eta_ith_tower << ", on va dphi = " << dphi << endl;
    14771470         // !!! at this point, eta_ith_tower is the value in eta of the center of the current calo cell
     
    14841477           
    14851478            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";
    14941485            }
    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)
    15001489   }  // undefined index
    15011490   else {
     
    15031492     if (CEN_max_mu < CEN_max_calo_fwd)
    15041493        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();
    15201497}
    15211498
Note: See TracChangeset for help on using the changeset viewer.