Fork me on GitHub

Changeset 423 in svn for trunk


Ignore:
Timestamp:
Jun 3, 2009, 2:17:37 PM (15 years ago)
Author:
Xavier Rouby
Message:

BinEtaPhi : put the particle in the middle of the towers

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r418 r423  
    33   - Nevents implemented in DetectorCards
    44   - bug removed in bad inputfile type identification (".hep" vs ".lhe")
     5   - BinEtaPhi : now use the middle of the tower and not its lower edge in eta and in phi
    56 /-----------------------------------------\
    67| 22 May 2009: release Version1.7           |
  • trunk/src/SmearUtil.cc

    r422 r423  
    13221322
    13231323  //********** returns a segmented value for eta and phi, for calo towers *****
     1324/*
    13241325void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){
    13251326   iEta = UNDEFINED;
    13261327   int index= iUNDEFINED;
    13271328   for (unsigned int i=1; i< TOWER_number+1; i++) {
    1328         if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) {
    1329                 iEta = (eta>0) ? TOWER_eta_edges[i-1] : -TOWER_eta_edges[i];
     1329        if(fabs(eta)>=TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) {
     1330        //if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) {
     1331                float deta = TOWER_eta_edges[i] - TOWER_eta_edges[i-1];
     1332        //      iEta = (eta>0) ? TOWER_eta_edges[i-1] : -TOWER_eta_edges[i];
     1333                iEta + deta/2.; // update Delphes > 1.7
    13301334                index = i-1;
    13311335                break;
     
    13381342        float low = -pi+(i-1)*dphi;
    13391343        float high= low+dphi;
    1340         if(phi > low && phi < high ){
    1341                 iPhi = low;
     1344        if(phi >= low && phi < high ){
     1345        //if(phi > low && phi < high ){
     1346                //iPhi = low;
     1347                iPhi = low+dphi/2.;  // update Delphes > 1.7
    13421348                break;
    13431349        }
     
    13451351   if (phi > pi-dphi) iPhi = pi-dphi;
    13461352}
    1347 
    1348 
     1353*/
     1354void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){
     1355   iEta = UNDEFINED;
     1356   int index= iUNDEFINED;
     1357   for (unsigned int i=1; i< TOWER_number+1; i++) {
     1358        if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<=TOWER_eta_edges[i]) {
     1359                iEta = (eta>0) ? ((TOWER_eta_edges[i-1]+TOWER_eta_edges[i])/2.0) : -((TOWER_eta_edges[i-1]+TOWER_eta_edges[i])/2.0);
     1360                index = i-1;
     1361                break;
     1362        }
     1363   }
     1364   if(index==UNDEFINED) return;
     1365   iPhi = UNDEFINED;
     1366   float dphi = TOWER_dphi[index]*pi/180.;
     1367   for (unsigned int i=1; i < 360/TOWER_dphi[index]; i++ ) {
     1368        float low = -pi+(i-1)*dphi;
     1369        float high= low+dphi;
     1370        if(phi > low && phi <= high ){
     1371                iPhi = (low+high)/2.0;
     1372                break;
     1373        }
     1374   }
     1375   if (phi > pi-dphi) iPhi = pi-dphi;
     1376}
    13491377
    13501378//**************************** Returns the delta Phi ****************************
Note: See TracChangeset for help on using the changeset viewer.