Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:36

0001 #include <limits>
0002 
0003 #include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"
0004 #include "RecoBTag/SoftLepton/interface/LeptonSelector.h"
0005 #include "RecoBTag/SoftLepton/interface/MuonTaggerNoIP.h"
0006 
0007 /// b-tag a jet based on track-to-jet parameters in the extened info collection
0008 float MuonTaggerNoIP::discriminator(const TagInfoHelper& tagInfo) const {
0009   MuonTaggerNoIPMLP theNet{};
0010   // default value, used if there are no leptons associated to this jet
0011   float bestTag = -std::numeric_limits<float>::infinity();
0012   const reco::SoftLeptonTagInfo& info = tagInfo.get<reco::SoftLeptonTagInfo>();
0013   // if there are multiple leptons, look for the highest tag result
0014   for (unsigned int i = 0; i < info.leptons(); i++) {
0015     const reco::SoftLeptonProperties& properties = info.properties(i);
0016     if (m_selector(properties)) {
0017       float tag =
0018           theNet.value(
0019               0, properties.ptRel, properties.ratioRel, properties.deltaR, info.jet()->energy(), info.jet()->eta()) +
0020           theNet.value(
0021               1, properties.ptRel, properties.ratioRel, properties.deltaR, info.jet()->energy(), info.jet()->eta());
0022       if (tag > bestTag)
0023         bestTag = tag;
0024     }
0025   }
0026   return bestTag;
0027 }