Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "RecoBTag/FeatureTools/interface/deep_helpers.h"
0002 #include "DataFormats/BTauReco/interface/SecondaryVertexFeatures.h"
0003 
0004 #include "DataFormats/JetReco/interface/Jet.h"
0005 #include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h"
0006 #include "DataFormats/VertexReco/interface/Vertex.h"
0007 
0008 #include "RecoBTag/FeatureTools/interface/SecondaryVertexConverter.h"
0009 
0010 namespace btagbtvdeep {
0011 
0012   void svToFeatures(const reco::VertexCompositePtrCandidate& sv,
0013                     const reco::Vertex& pv,
0014                     const reco::Jet& jet,
0015                     SecondaryVertexFeatures& sv_features,
0016                     const bool flip) {
0017     math::XYZVector jet_dir = jet.momentum().Unit();
0018     sv_features.pt = sv.pt();
0019     sv_features.ptrel = sv.pt() / jet.pt();
0020     sv_features.deltaR = catch_infs_and_bound(std::fabs(reco::deltaR(sv, jet_dir)) - 0.5, 0, -2, 0);
0021     sv_features.mass = sv.mass();
0022     sv_features.ntracks = sv.numberOfDaughters();
0023     sv_features.chi2 = sv.vertexChi2();
0024     sv_features.normchi2 = catch_infs_and_bound(sv_features.chi2 / sv.vertexNdof(), 1000, -1000, 1000);
0025     const auto& dxy_meas = vertexDxy(sv, pv);
0026     sv_features.dxy = dxy_meas.value();
0027     sv_features.dxysig = catch_infs_and_bound(dxy_meas.value() / dxy_meas.error(), 0, -1, 800);
0028     const auto& d3d_meas = vertexD3d(sv, pv);
0029     sv_features.d3d = d3d_meas.value();
0030     sv_features.d3dsig = catch_infs_and_bound(d3d_meas.value() / d3d_meas.error(), 0, -1, 800);
0031     sv_features.costhetasvpv = (flip ? -1.f : 1.f) * vertexDdotP(sv, pv);
0032     sv_features.enratio = sv.energy() / jet.energy();
0033   }
0034 
0035 }  // namespace btagbtvdeep