Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:49

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