ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/src/IsolationSelection.cc
(Generate patch)

Comparing UserCode/MitHzz4l/LeptonSelection/src/IsolationSelection.cc (file contents):
Revision 1.10 by khahn, Sat May 5 13:09:05 2012 UTC vs.
Revision 1.11 by khahn, Sat May 5 21:43:54 2012 UTC

# Line 612 | Line 612 | double  muonPFIso04(ControlFlags &ctrl,
612             << endl;
613      }
614    }
615  bool failiso=false;
616
617  //
618  // tmp iso
619  //
620  Double_t tmpChargedIso        = 0;
621  Double_t tmpGammaIso          = 0;
622  Double_t tmpNeutralHadronIso  = 0;
615  
616    //
617    // final iso
# Line 712 | Line 704 | double  muonPFIso04(ControlFlags &ctrl,
704        }
705  
706  
707 <      tmpChargedIso += pf->Pt();
707 >      fChargedIso += pf->Pt();
708      }
709  
710      //
711      // Gamma Iso
712      //
713      else if (abs(pf->PFType()) == PFCandidate::eGamma) {
714 <      tmpGammaIso += pf->Pt();
714 >      fGammaIso += pf->Pt();
715      }
716  
717      //
718      // Other Neutral Iso Rings
719      //
720      else {
721 <      tmpNeutralHadronIso += pf->Pt();
721 >      fNeutralHadronIso += pf->Pt();
722      }
723      
724      }
725      
726    }
727    
736  fChargedIso   = mu->Pt() * min((tmpChargedIso)/mu->Pt(), 2.5);
737  
738
728    double rho = 0;
729    if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
730      rho = fPUEnergyDensity->At(0)->Rho();
742  
743
744  fGammaIso = mu->Pt()*max(min((tmpGammaIso
745                                -rho*muT.MuonEffectiveArea(muT.kMuGammaIso04,mu->Eta(),EffectiveAreaVersion))/mu->Pt()
746                               ,2.5)
747                           ,0.0);
748  fNeutralHadronIso = mu->Pt()*max(min((tmpNeutralHadronIso
749                                        -rho*muT.MuonEffectiveArea(muT.kMuNeutralIso04,
750                                                                   mu->Eta(),EffectiveAreaVersion))/mu->Pt()
751                                       , 2.5)
752                                   , 0.0);
731  
732 <  double pfIso = fChargedIso + fGammaIso + fNeutralHadronIso;
732 >  // WARNING!!!!  
733 >  // hardcode for sync ...
734 >  EffectiveAreaVersion = muT.kMuEAData2011;
735 >  // WARNING!!!!  
736 >
737 >
738 >  double pfIso = fChargedIso + max(0.0,(fGammaIso + fNeutralHadronIso
739 >                                        -rho*muT.MuonEffectiveArea(muT.kMuGammaAndNeutralHadronIso04,
740 >                                                                   mu->Eta(),EffectiveAreaVersion)));
741    
742    return pfIso;
743   }
744  
745   //--------------------------------------------------------------------------------------------------
746 < SelectionStatus muonIsoReferenceSelection(ControlFlags &ctrl,
746 > SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
747                                            const mithep::Muon * mu,
748                                            const mithep::Vertex & vtx,
749                                            const mithep::Array<mithep::PFCandidate> * fPFCandidates,
# Line 1216 | Line 1202 | float electronPFIso04(ControlFlags &ctrl
1202      }
1203    }
1204  
1219  bool failiso=false;
1220
1221  //
1222  // tmp iso
1223  //
1224  Double_t tmpChargedIso        = 0;
1225  Double_t tmpGammaIso          = 0;
1226  Double_t tmpNeutralHadronIso  = 0;
1205  
1206    //
1207    // final iso
# Line 1334 | Line 1312 | float electronPFIso04(ControlFlags &ctrl
1312                             << "\ttype: " << pf->PFType()
1313                             << "\ttrk: " << pf->TrackerTrk() << endl;
1314  
1315 <      tmpChargedIso += pf->Pt();
1315 >      fChargedIso += pf->Pt();
1316      }
1317  
1318      //
# Line 1347 | Line 1325 | float electronPFIso04(ControlFlags &ctrl
1325        }
1326        if( ctrl.debug) cout << "gamma:: " << pf->Pt() << " "
1327                             << dr << endl;
1328 <      tmpGammaIso += pf->Pt();
1328 >      fGammaIso += pf->Pt();
1329      }
1330  
1331      //
# Line 1356 | Line 1334 | float electronPFIso04(ControlFlags &ctrl
1334      else {
1335        if( ctrl.debug) cout << "neutral:: " << pf->Pt() << " "
1336                             << dr << endl;
1337 <      tmpNeutralHadronIso += pf->Pt();
1337 >      fNeutralHadronIso += pf->Pt();
1338      }
1339  
1340      }
1341  
1342    }
1343  
1366  fChargedIso   = ele->Pt()*min((tmpChargedIso)/ele->Pt(), 2.5);
1367
1344    double rho = 0;
1345    if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
1346      rho = fPUEnergyDensity->At(0)->Rho();
1347  
1348 <  if( ctrl.debug) {
1349 <    cout << "RHO: " << rho << endl;
1350 <    cout << "eta: " << ele->SCluster()->Eta() << endl;
1351 <    cout << "target: " << EffectiveAreaVersion << endl;
1376 <    cout << "effA 0-1: " << eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIsoDR0p0To0p1,
1377 <                                                       ele->SCluster()->Eta(),
1378 <                                                       EffectiveAreaVersion)
1379 <         << endl;
1380 <    cout << "effA 1-2: " << eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIsoDR0p1To0p2,
1381 <                                                       ele->SCluster()->Eta(),
1382 <                                                       EffectiveAreaVersion)
1383 <         << endl;
1384 <    cout << "effA 2-3: " << eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIsoDR0p2To0p3,
1385 <                                                       ele->SCluster()->Eta(),
1386 <                                                       EffectiveAreaVersion)
1387 <         << endl;
1388 <    cout << "effA 3-4: " << eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIsoDR0p3To0p4,
1389 <                                                       ele->SCluster()->Eta(),
1390 <                                                       EffectiveAreaVersion)
1391 <         << endl;
1392 <  }
1393 <
1394 <  fGammaIso = ele->Pt()*max(min((tmpGammaIso
1395 <                       -rho*eleT.ElectronEffectiveArea(eleT.kEleGammaIso04,
1396 <                                                       ele->SCluster()->Eta(),
1397 <                                                       EffectiveAreaVersion))/ele->Pt()
1398 <                      ,2.5)
1399 <                  ,0.0);
1400 <  fNeutralHadronIso = ele->Pt()*max(min((tmpNeutralHadronIso
1401 <                               -rho*eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIso04,
1402 <                                                               ele->SCluster()->Eta(),EffectiveAreaVersion))/ele->Pt()
1403 <                              , 2.5)
1404 <                          , 0.0);
1348 >  // WARNING!!!!  
1349 >  // hardcode for sync ...
1350 >  EffectiveAreaVersion = eleT.kEleEAData2011;
1351 >  // WARNING!!!!  
1352  
1406  double pfiso = fChargedIso + fGammaIso + fNeutralHadronIso;
1353  
1354 <  return pfiso;
1354 >  double pfIso = fChargedIso +
1355 >    max(0.0,fGammaIso -rho*eleT.ElectronEffectiveArea(eleT.kEleGammaIso04,
1356 >                                                ele->Eta(),EffectiveAreaVersion)) +
1357 >    max(0.0,fNeutralHadronIso -rho*eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIso04,
1358 >                                                        ele->Eta(),EffectiveAreaVersion)) ;
1359 >  return pfIso;
1360   }
1361  
1362   //--------------------------------------------------------------------------------------------------
1363 < SelectionStatus electronIsoReferenceSelection(ControlFlags &ctrl,
1363 > SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
1364                                                const mithep::Electron * ele,
1365                                                const mithep::Vertex & vtx,
1366                                                const mithep::Array<mithep::PFCandidate> * fPFCandidates,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines