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.14 by khahn, Thu May 10 11:14:33 2012 UTC vs.
Revision 1.16 by khahn, Thu May 10 22:53:21 2012 UTC

# Line 16 | Line 16 | mithep::MuonTools       muT;
16   mithep::ElectronIDMVA * eleIsoMVA;
17   mithep::ElectronTools   eleT;
18  
19 + // global hack to sync
20 + double gChargedIso;
21 + double gGammaIso;
22 + double gNeutralIso;
23 +
24 +
25   //--------------------------------------------------------------------------------------------------
26   Float_t computePFMuonIso(const mithep::Muon *muon,
27                           const mithep::Vertex & vtx,
# Line 664 | Line 670 | double  muonPFIso04(ControlFlags &ctrl,
670            IsLeptonFootprint = kTRUE;
671        } // loop over electrons
672  
673 +      // KH, comment to sync
674 +      /*
675 +      //
676 +      // Check for muons
677 +      //
678 +      for (Int_t q=0; q < muonsToVeto.size(); ++q) {
679 +        const mithep::Muon *tmpmu = muonsToVeto[q];
680 +        // 4l muon
681 +        if( pf->HasTrackerTrk() ) {
682 +          if( pf->TrackerTrk() == tmpmu->TrackerTrk() )
683 +            IsLeptonFootprint = kTRUE;
684 +        }
685 +        // PF charged
686 +        if (pf->Charge() != 0 && mithep::MathUtils::DeltaR(tmpmu->Phi(),tmpmu->Eta(), pf->Phi(), pf->Eta()) < 0.01)
687 +          IsLeptonFootprint = kTRUE;
688 +      } // loop over muons
689 +      */
690 +
691 +    if (IsLeptonFootprint)
692 +      continue;
693 +
694 +    //
695 +    // Charged Iso
696 +    //
697 +    if (pf->Charge() != 0 ) {
698 +
699 +      //if( dr < 0.01 ) continue; // only for muon iso mva?
700 +      if (abs(pf->PFType()) == PFCandidate::eElectron || abs(pf->PFType()) == PFCandidate::eMuon) continue;
701 +
702 +      if( pf->HasTrackerTrk() ) {
703 +        if (abs(pf->TrackerTrk()->DzCorrected(vtx)) > 0.2) continue;
704 +        if( ctrl.debug ) cout << "charged:: " << pf->PFType() << " " << pf->Pt() << " "
705 +                              << abs(pf->TrackerTrk()->DzCorrected(vtx)) << " "
706 +                              << dr << endl;
707 +      }
708 +      if( pf->HasGsfTrk() ) {
709 +        if (abs(pf->GsfTrk()->DzCorrected(vtx)) > 0.2) continue;
710 +        if( ctrl.debug ) cout << "charged:: " << pf->PFType() << " " << pf->Pt() << " "
711 +                              << abs(pf->GsfTrk()->DzCorrected(vtx)) << " "
712 +                              << dr << endl;
713 +      }
714 +
715 +
716 +      fChargedIso += pf->Pt();
717 +    }
718 +
719 +    //
720 +    // Gamma Iso
721 +    //
722 +    else if (abs(pf->PFType()) == PFCandidate::eGamma) {
723 +      // KH, add to sync
724 +      if( pf->Pt() > 0.5 )
725 +      fGammaIso += pf->Pt();
726 +    }
727 +
728 +    //
729 +    // Other Neutrals
730 +    //
731 +    else {
732 +      // KH, add to sync
733 +      if( pf->Pt() > 0.5 )
734 +        fNeutralHadronIso += pf->Pt();
735 +    }
736 +    
737 +    }
738 +    
739 +  }
740 +  
741 +  double rho = 0;
742 + //   if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
743 + //     rho = fPUEnergyDensity->At(0)->Rho();
744 +  if (!(isnan(fPUEnergyDensity->At(0)->RhoLowEta()) || isinf(fPUEnergyDensity->At(0)->RhoLowEta())))
745 +    rho = fPUEnergyDensity->At(0)->RhoLowEta();
746 +
747 +  // WARNING!!!!  
748 +  // hardcode for sync ...
749 +  EffectiveAreaVersion = muT.kMuEAData2011;
750 +  // WARNING!!!!  
751 +
752 +
753 +  double pfIso = fChargedIso + max(0.0,(fGammaIso + fNeutralHadronIso
754 +                                        -rho*muT.MuonEffectiveArea(muT.kMuGammaAndNeutralHadronIso04,
755 +                                                                   mu->Eta(),EffectiveAreaVersion)));
756 +
757 +  gChargedIso = fChargedIso;
758 +  gGammaIso = fGammaIso;
759 +  gNeutralIso = fNeutralHadronIso;  
760 +  return pfIso;
761 + }
762 +
763 +
764 + //--------------------------------------------------------------------------------------------------
765 + // hacked version
766 + double  muonPFIso04(ControlFlags &ctrl,
767 +                    const mithep::Muon * mu,
768 +                    const mithep::Vertex & vtx,
769 +                    const mithep::Array<mithep::PFCandidate> * fPFCandidates,
770 +                    float rho,
771 +                    mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
772 +                    vector<const mithep::Muon*> muonsToVeto,
773 +                    vector<const mithep::Electron*> electronsToVeto)
774 + //--------------------------------------------------------------------------------------------------
775 + {
776 +
777 +  extern double gChargedIso;  
778 +  extern double  gGammaIso;      
779 +  extern double  gNeutralIso;
780 +  
781 +  if( ctrl.debug ) {
782 +    cout << "muonIsoMVASelection :: muons to veto " << endl;
783 +    for( int i=0; i<muonsToVeto.size(); i++ ) {
784 +      const mithep::Muon * vmu = muonsToVeto[i];
785 +      cout << "\tpt: " << vmu->Pt()
786 +           << "\teta: " << vmu->Eta()
787 +           << "\tphi: " << vmu->Phi()
788 +           << endl;
789 +    }
790 +    cout << "muonIsoMVASelection :: electrson to veto " << endl;
791 +    for( int i=0; i<electronsToVeto.size(); i++ ) {
792 +      const mithep::Electron * vel = electronsToVeto[i];
793 +      cout << "\tpt: " << vel->Pt()
794 +           << "\teta: " << vel->Eta()
795 +           << "\tphi: " << vel->Phi()
796 +           << endl;
797 +    }
798 +  }
799 +
800 +  //
801 +  // final iso
802 +  //
803 +  Double_t fChargedIso  = 0.0;
804 +  Double_t fGammaIso  = 0.0;
805 +  Double_t fNeutralHadronIso  = 0.0;
806 +
807 +  //
808 +  //Loop over PF Candidates
809 +  //
810 +  for(int k=0; k<fPFCandidates->GetEntries(); ++k) {
811 +    const mithep::PFCandidate *pf = (mithep::PFCandidate*)((*fPFCandidates)[k]);
812 +
813 +    Double_t deta = (mu->Eta() - pf->Eta());
814 +    Double_t dphi = mithep::MathUtils::DeltaPhi(Double_t(mu->Phi()),Double_t(pf->Phi()));
815 +    Double_t dr = mithep::MathUtils::DeltaR(mu->Phi(),mu->Eta(), pf->Phi(), pf->Eta());
816 +    if (dr > 0.4) continue;
817 +
818 +    if (pf->HasTrackerTrk() && (pf->TrackerTrk() == mu->TrackerTrk()) ) continue;
819 +
820 +    //
821 +    // Lepton Footprint Removal
822 +    //
823 +    Bool_t IsLeptonFootprint = kFALSE;
824 +    if (dr < 1.0) {
825 +
826 +      //
827 +      // Check for electrons
828 +      //
829 +      for (Int_t q=0; q < electronsToVeto.size(); ++q) {
830 +        const mithep::Electron *tmpele = electronsToVeto[q];
831 +        // 4l electron
832 +        if( pf->HasTrackerTrk() ) {
833 +          if( pf->TrackerTrk() == tmpele->TrackerTrk() )
834 +            IsLeptonFootprint = kTRUE;
835 +        }
836 +        if( pf->HasGsfTrk() ) {
837 +          if( pf->GsfTrk() == tmpele->GsfTrk() )
838 +            IsLeptonFootprint = kTRUE;
839 +        }
840 +        // PF charged
841 +        if (pf->Charge() != 0 && fabs(tmpele->SCluster()->Eta()) > 1.479
842 +            && mithep::MathUtils::DeltaR(tmpele->Phi(),tmpele->Eta(), pf->Phi(), pf->Eta()) < 0.015)
843 +          IsLeptonFootprint = kTRUE;
844 +        // PF gamma
845 +        if (abs(pf->PFType()) == PFCandidate::eGamma && fabs(tmpele->SCluster()->Eta()) > 1.479
846 +            && mithep::MathUtils::DeltaR(tmpele->Phi(),tmpele->Eta(), pf->Phi(), pf->Eta()) < 0.08)
847 +          IsLeptonFootprint = kTRUE;
848 +      } // loop over electrons
849 +
850        /* KH - comment for sync      
851        //
852        // Check for muons
# Line 729 | Line 912 | double  muonPFIso04(ControlFlags &ctrl,
912      
913    }
914    
915 <  double rho = 0;
916 <  if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
917 <    rho = fPUEnergyDensity->At(0)->Rho();
915 > //   double rho = 0;
916 > //   if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
917 > //     rho = fPUEnergyDensity->At(0)->Rho();
918  
919    // WARNING!!!!  
920    // hardcode for sync ...
# Line 742 | Line 925 | double  muonPFIso04(ControlFlags &ctrl,
925    double pfIso = fChargedIso + max(0.0,(fGammaIso + fNeutralHadronIso
926                                          -rho*muT.MuonEffectiveArea(muT.kMuGammaAndNeutralHadronIso04,
927                                                                     mu->Eta(),EffectiveAreaVersion)));
928 +  gChargedIso = fChargedIso;
929 +  gGammaIso   = fGammaIso;
930 +  gNeutralIso = fNeutralHadronIso;
931    
932    return pfIso;
933   }
934  
935 +
936   //--------------------------------------------------------------------------------------------------
937   SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
938                                            const mithep::Muon * mu,
# Line 759 | Line 946 | SelectionStatus muonReferenceIsoSelectio
946   {
947    
948    SelectionStatus status;
949 <  
949 >
950    double pfIso = muonPFIso04( ctrl, mu, vtx, fPFCandidates, fPUEnergyDensity,
951                                EffectiveAreaVersion, muonsToVeto ,electronsToVeto );
952 +  cout << "--------------> setting muon isoPF04 to" << pfIso << endl;
953 +  status.isoPF04 = pfIso;
954 +  status.chisoPF04 = gChargedIso;
955 +  status.gaisoPF04 = gGammaIso;
956 +  status.neisoPF04 = gNeutralIso;
957 +
958 +  bool pass = false;
959 +  if( (pfIso/mu->Pt()) < MUON_REFERENCE_PFISO_CUT ) pass = true;
960 +  
961 +  if( pass ) {
962 +    status.orStatus(SelectionStatus::LOOSEISO);
963 +    status.orStatus(SelectionStatus::TIGHTISO);
964 +  }
965 +  if(ctrl.debug) cout << "returning status : " << hex << status.getStatus() << dec << endl;
966 +  return status;
967 +  
968 + }
969 +
970 +
971 + //--------------------------------------------------------------------------------------------------
972 + // hacked version
973 + SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
974 +                                          const mithep::Muon * mu,
975 +                                          const mithep::Vertex & vtx,
976 +                                          const mithep::Array<mithep::PFCandidate> * fPFCandidates,
977 +                                          float rho,
978 +                                          mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
979 +                                          vector<const mithep::Muon*> muonsToVeto,
980 +                                          vector<const mithep::Electron*> electronsToVeto)
981 + //--------------------------------------------------------------------------------------------------
982 + {
983 +  
984 +  SelectionStatus status;
985 +  
986 +  double pfIso = muonPFIso04( ctrl, mu, vtx, fPFCandidates, rho,
987 +                              EffectiveAreaVersion, muonsToVeto ,electronsToVeto );
988    bool pass = false;
989    if( (pfIso/mu->Pt()) < MUON_REFERENCE_PFISO_CUT ) pass = true;
990    
# Line 1274 | Line 1497 | float electronPFIso04(ControlFlags &ctrl
1497          }
1498        } // loop over electrons
1499  
1500 +
1501 +      //
1502 +      // Check for muons
1503 +      //
1504 +      for (Int_t q=0; q < muonsToVeto.size(); ++q) {
1505 +        const mithep::Muon *tmpmu = muonsToVeto[q];
1506 +        // 4l muon
1507 +        if( pf->HasTrackerTrk() ) {
1508 +          if (pf->TrackerTrk() == tmpmu->TrackerTrk() ){
1509 +            if( ctrl.debug) cout << "\tmatches 4L mu ..." << endl;
1510 +            IsLeptonFootprint = kTRUE;
1511 +          }
1512 +        }
1513 +        // PF charged
1514 +        if (pf->Charge() != 0 && mithep::MathUtils::DeltaR(tmpmu->Phi(),tmpmu->Eta(), pf->Phi(), pf->Eta()) < 0.01) {
1515 +          if( ctrl.debug) cout << "\tcharged trk, dR matches 4L mu ..." << endl;
1516 +          IsLeptonFootprint = kTRUE;
1517 +        }
1518 +      } // loop over muons
1519 +
1520 +
1521 +    if (IsLeptonFootprint)
1522 +      continue;
1523 +
1524 +    //
1525 +    // Charged Iso
1526 +    //
1527 +    if (pf->Charge() != 0 ) {
1528 +
1529 +      if( pf->HasTrackerTrk() )
1530 +        if (abs(pf->TrackerTrk()->DzCorrected(vtx)) > 0.2) continue;
1531 +      if( pf->HasGsfTrk() )
1532 +        if (abs(pf->GsfTrk()->DzCorrected(vtx)) > 0.2) continue;
1533 +
1534 +      // Veto any PFmuon, or PFEle
1535 +      if (abs(pf->PFType()) == PFCandidate::eElectron || abs(pf->PFType()) == PFCandidate::eMuon) continue;
1536 +
1537 +      // Footprint Veto
1538 +      if (fabs(ele->SCluster()->Eta()) > 1.479 && dr < 0.015) continue;
1539 +
1540 +      if( ctrl.debug) cout << "charged:: pt: " << pf->Pt()
1541 +                           << "\ttype: " << pf->PFType()
1542 +                           << "\ttrk: " << pf->TrackerTrk() << endl;
1543 +
1544 +      fChargedIso += pf->Pt();
1545 +    }
1546 +
1547 +    //
1548 +    // Gamma Iso
1549 +    //
1550 +    else if (abs(pf->PFType()) == PFCandidate::eGamma) {
1551 +
1552 +      if (fabs(ele->SCluster()->Eta()) > 1.479) {
1553 +        if (mithep::MathUtils::DeltaR(ele->Phi(),ele->Eta(), pf->Phi(), pf->Eta()) < 0.08) continue;
1554 +      }
1555 +      if( ctrl.debug) cout << "gamma:: " << pf->Pt() << " "
1556 +                           << dr << endl;
1557 +      fGammaIso += pf->Pt();
1558 +    }
1559 +
1560 +    //
1561 +    // Neutral Iso
1562 +    //
1563 +    else {
1564 +      if( ctrl.debug) cout << "neutral:: " << pf->Pt() << " "
1565 +                           << dr << endl;
1566 +        fNeutralHadronIso += pf->Pt();
1567 +    }
1568 +
1569 +    }
1570 +
1571 +  }
1572 +
1573 +  double rho = 0;
1574 + //   if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
1575 + //     rho = fPUEnergyDensity->At(0)->Rho();
1576 +  if (!(isnan(fPUEnergyDensity->At(0)->RhoLowEta()) || isinf(fPUEnergyDensity->At(0)->RhoLowEta())))
1577 +    rho = fPUEnergyDensity->At(0)->RhoLowEta();
1578 +
1579 +  // WARNING!!!!  
1580 +  // hardcode for sync ...
1581 +  EffectiveAreaVersion = eleT.kEleEAData2011;
1582 +  // WARNING!!!!  
1583 +
1584 +
1585 +  double pfIso = fChargedIso +
1586 +    max(0.0,fGammaIso -rho*eleT.ElectronEffectiveArea(eleT.kEleGammaIso04,
1587 +                                                ele->Eta(),EffectiveAreaVersion)) +
1588 +    max(0.0,fNeutralHadronIso -rho*eleT.ElectronEffectiveArea(eleT.kEleNeutralHadronIso04,
1589 +                                                        ele->Eta(),EffectiveAreaVersion)) ;
1590 +
1591 +  gChargedIso = fChargedIso;
1592 +  gGammaIso = fGammaIso;
1593 +  gNeutralIso = fNeutralHadronIso;  
1594 +
1595 +  return pfIso;
1596 + }
1597 +
1598 + //--------------------------------------------------------------------------------------------------
1599 + // hacked version
1600 + float electronPFIso04(ControlFlags &ctrl,
1601 +                      const mithep::Electron * ele,
1602 +                      const mithep::Vertex & vtx,
1603 +                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1604 +                      float rho,
1605 +                      mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
1606 +                      vector<const mithep::Muon*> muonsToVeto,
1607 +                      vector<const mithep::Electron*> electronsToVeto)
1608 + //--------------------------------------------------------------------------------------------------
1609 + {
1610 +
1611 +  if( ctrl.debug ) {
1612 +    cout << "electronIsoMVASelection :: muons to veto " << endl;
1613 +    for( int i=0; i<muonsToVeto.size(); i++ ) {
1614 +      const mithep::Muon * vmu = muonsToVeto[i];
1615 +      cout << "\tpt: " << vmu->Pt()
1616 +           << "\teta: " << vmu->Eta()
1617 +           << "\tphi: " << vmu->Phi()
1618 +           << endl;
1619 +    }
1620 +    cout << "electronIsoMVASelection :: electrson to veto " << endl;
1621 +    for( int i=0; i<electronsToVeto.size(); i++ ) {
1622 +      const mithep::Electron * vel = electronsToVeto[i];
1623 +      cout << "\tpt: " << vel->Pt()
1624 +           << "\teta: " << vel->Eta()
1625 +           << "\tphi: " << vel->Phi()
1626 +           << "\ttrk: " << vel->TrackerTrk()
1627 +           << endl;
1628 +    }
1629 +  }
1630 +
1631 +
1632 +  //
1633 +  // final iso
1634 +  //
1635 +  Double_t fChargedIso = 0.0;
1636 +  Double_t fGammaIso = 0.0;
1637 +  Double_t fNeutralHadronIso = 0.0;
1638 +
1639 +
1640 +  //
1641 +  //Loop over PF Candidates
1642 +  //
1643 +  for(int k=0; k<fPFCandidates->GetEntries(); ++k) {
1644 +    const mithep::PFCandidate *pf = (mithep::PFCandidate*)((*fPFCandidates)[k]);
1645 +    Double_t deta = (ele->Eta() - pf->Eta());
1646 +    Double_t dphi = mithep::MathUtils::DeltaPhi(Double_t(ele->Phi()),Double_t(pf->Phi()));
1647 +    Double_t dr = mithep::MathUtils::DeltaR(ele->Phi(),ele->Eta(), pf->Phi(), pf->Eta());
1648 +    if (dr >= 0.4) continue;
1649 +    if(ctrl.debug) {
1650 +      cout << "pf :: type: " << pf->PFType() << "\tpt: " << pf->Pt();
1651 +      if( pf->HasTrackerTrk() ) cout << "\tdZ: " << pf->TrackerTrk()->DzCorrected(vtx);
1652 +      cout << endl;
1653 +    }
1654 +
1655 +
1656 +    if ( (pf->HasTrackerTrk() && (pf->TrackerTrk() == ele->TrackerTrk())) ||
1657 +         (pf->HasGsfTrk() && (pf->GsfTrk() == ele->GsfTrk()))) continue;
1658 +    
1659 +
1660 +    //
1661 +    // Lepton Footprint Removal
1662 +    //
1663 +    Bool_t IsLeptonFootprint = kFALSE;
1664 +    if (dr < 1.0) {
1665 +
1666 +      //
1667 +      // Check for electrons
1668 +      //
1669 +      for (Int_t q=0; q < electronsToVeto.size(); ++q) {
1670 +        const mithep::Electron *tmpele = electronsToVeto[q];
1671 +        // 4l electron
1672 +        if( pf->HasTrackerTrk()  ) {
1673 +          if( pf->TrackerTrk() == tmpele->TrackerTrk() ) {
1674 +            if( ctrl.debug) cout << "\tcharged tktrk, matches 4L ele ..." << endl;
1675 +            IsLeptonFootprint = kTRUE;
1676 +          }
1677 +        }
1678 +        if( pf->HasGsfTrk()  ) {
1679 +          if( pf->GsfTrk() == tmpele->GsfTrk() ) {
1680 +            if( ctrl.debug) cout << "\tcharged gsftrk, matches 4L ele ..." << endl;
1681 +            IsLeptonFootprint = kTRUE;
1682 +          }
1683 +        }
1684 +        // PF charged
1685 +        if (pf->Charge() != 0 && fabs(tmpele->SCluster()->Eta()) > 1.479
1686 +            && mithep::MathUtils::DeltaR(tmpele->Phi(),tmpele->Eta(), pf->Phi(), pf->Eta()) < 0.015) {
1687 +          if( ctrl.debug) cout << "\tcharged trk, dR matches 4L ele ..." << endl;
1688 +          IsLeptonFootprint = kTRUE;
1689 +        }
1690 +        // PF gamma
1691 +        if (abs(pf->PFType()) == PFCandidate::eGamma && fabs(tmpele->SCluster()->Eta()) > 1.479
1692 +            && mithep::MathUtils::DeltaR(tmpele->Phi(),tmpele->Eta(), pf->Phi(), pf->Eta()) < 0.08) {
1693 +          if( ctrl.debug) cout << "\tPF gamma, matches 4L ele ..." << endl;
1694 +          IsLeptonFootprint = kTRUE;
1695 +        }
1696 +      } // loop over electrons
1697 +
1698        /* KH - comment for sync            
1699        //
1700        // Check for muons
# Line 1349 | Line 1770 | float electronPFIso04(ControlFlags &ctrl
1770  
1771    }
1772  
1773 <  double rho = 0;
1774 <  if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
1775 <    rho = fPUEnergyDensity->At(0)->Rho();
1773 > //   double rho = 0;
1774 > //   if (!(isnan(fPUEnergyDensity->At(0)->Rho()) || isinf(fPUEnergyDensity->At(0)->Rho())))
1775 > //     rho = fPUEnergyDensity->At(0)->Rho();
1776  
1777    // WARNING!!!!  
1778    // hardcode for sync ...
# Line 1367 | Line 1788 | float electronPFIso04(ControlFlags &ctrl
1788    return pfIso;
1789   }
1790  
1791 +
1792   //--------------------------------------------------------------------------------------------------
1793   SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
1794                                                const mithep::Electron * ele,
# Line 1383 | Line 1805 | SelectionStatus electronReferenceIsoSele
1805  
1806    double pfIso = electronPFIso04( ctrl, ele, vtx, fPFCandidates, fPUEnergyDensity,
1807                                    EffectiveAreaVersion, muonsToVeto ,electronsToVeto );
1808 +  cout << "--------------> setting electron isoPF04 to " << pfIso << endl;
1809 +  status.isoPF04 = pfIso;
1810 +  status.chisoPF04 = gChargedIso;
1811 +  status.gaisoPF04 = gGammaIso;
1812 +  status.neisoPF04 = gNeutralIso;
1813 +
1814 +  bool pass = false;
1815 +  if( (pfIso/ele->Pt()) < ELECTRON_REFERENCE_PFISO_CUT ) pass = true;
1816 +
1817 +  if( pass ) {
1818 +    status.orStatus(SelectionStatus::LOOSEISO);
1819 +    status.orStatus(SelectionStatus::TIGHTISO);
1820 +  }
1821 +  if(ctrl.debug) cout << "returning status : " << hex << status.getStatus() << dec << endl;
1822 +  return status;
1823 +
1824 + }
1825 +
1826 +
1827 + //--------------------------------------------------------------------------------------------------
1828 + // hacked version
1829 + SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
1830 +                                              const mithep::Electron * ele,
1831 +                                              const mithep::Vertex & vtx,
1832 +                                              const mithep::Array<mithep::PFCandidate> * fPFCandidates,
1833 +                                              float rho,
1834 +                                              mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
1835 +                                              vector<const mithep::Muon*> muonsToVeto,
1836 +                                              vector<const mithep::Electron*> electronsToVeto)
1837 + //--------------------------------------------------------------------------------------------------
1838 + {
1839 +
1840 +  SelectionStatus status;
1841 +
1842 +  double pfIso = electronPFIso04( ctrl, ele, vtx, fPFCandidates, rho,
1843 +                                  EffectiveAreaVersion, muonsToVeto ,electronsToVeto );
1844    bool pass = false;
1845    if( (pfIso/ele->Pt()) < ELECTRON_REFERENCE_PFISO_CUT ) pass = true;
1846  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines