CMS 3D CMS Logo

SVConverter.h
Go to the documentation of this file.
1 #ifndef RecoBTag_DeepFlavour_SVConverter_h
2 #define RecoBTag_DeepFlavour_SVConverter_h
3 
4 #include "deep_helpers.h"
6 
10 
11 namespace btagbtvdeep {
12 
13  class SVConverter {
14  public:
15 
17  const reco::Vertex & pv, const reco::Jet & jet,
18  SecondaryVertexFeatures & sv_features) {
19 
20  sv_features.pt = sv.pt();
21  sv_features.deltaR = catch_infs_and_bound(
22  std::fabs(reco::deltaR(sv,jet))-0.5,
23  0,-2,0);
24  sv_features.mass = sv.mass();
25  sv_features.ntracks = sv.numberOfDaughters();
26  sv_features.chi2 = sv.vertexChi2();
27  sv_features.normchi2 = catch_infs_and_bound(sv_features.chi2/sv.vertexNdof(),
28  1000, -1000, 1000);
29  const auto & dxy_meas = vertexDxy(sv,pv);
30  sv_features.dxy = dxy_meas.value();
31  sv_features.dxysig = catch_infs_and_bound(dxy_meas.value()/dxy_meas.error(),
32  0,-1,800);
33  const auto & d3d_meas = vertexD3d(sv,pv);
34  sv_features.d3d = d3d_meas.value();
35  sv_features.d3dsig = catch_infs_and_bound(d3d_meas.value()/d3d_meas.error(),
36  0,-1,800);
37  sv_features.costhetasvpv = vertexDdotP(sv,pv);
38  sv_features.enratio = sv.energy()/jet.energy();
39 
40  }
41  };
42 
43 }
44 
45 #endif //RecoSV_DeepFlavour_SVConverter_h
float vertexDdotP(const reco::VertexCompositePtrCandidate &sv, const reco::Vertex &pv)
Definition: deep_helpers.h:58
Measurement1D vertexD3d(const reco::VertexCompositePtrCandidate &svcand, const reco::Vertex &pv)
Definition: deep_helpers.h:50
Base class for all types of Jets.
Definition: Jet.h:20
double pt() const final
transverse momentum
size_t numberOfDaughters() const override
number of daughters
const float catch_infs_and_bound(const float in, const float replace_value, const float lowerbound, const float upperbound, const float offset=0., const bool use_offsets=true)
Definition: deep_helpers.h:26
Measurement1D vertexDxy(const reco::VertexCompositePtrCandidate &svcand, const reco::Vertex &pv)
Definition: deep_helpers.h:42
double energy() const final
energy
def pv(vc)
Definition: MetAnalyzer.py:6
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
static void SVToFeatures(const reco::VertexCompositePtrCandidate &sv, const reco::Vertex &pv, const reco::Jet &jet, SecondaryVertexFeatures &sv_features)
Definition: SVConverter.h:16
double vertexChi2() const override
chi-squares
double mass() const final
mass