CMS 3D CMS Logo

SecondaryVertexConverter.cc
Go to the documentation of this file.
3 
7 
9 
10 namespace btagbtvdeep {
11 
13  const reco::Vertex& pv,
14  const reco::Jet& jet,
15  SecondaryVertexFeatures& sv_features,
16  const bool flip) {
17  math::XYZVector jet_dir = jet.momentum().Unit();
18  sv_features.pt = sv.pt();
19  sv_features.ptrel = sv.pt() / jet.pt();
20  sv_features.deltaR = catch_infs_and_bound(std::fabs(reco::deltaR(sv, jet_dir)) - 0.5, 0, -2, 0);
21  sv_features.mass = sv.mass();
22  sv_features.ntracks = sv.numberOfDaughters();
23  sv_features.chi2 = sv.vertexChi2();
24  sv_features.normchi2 = catch_infs_and_bound(sv_features.chi2 / sv.vertexNdof(), 1000, -1000, 1000);
25  const auto& dxy_meas = vertexDxy(sv, pv);
26  sv_features.dxy = dxy_meas.value();
27  sv_features.dxysig = catch_infs_and_bound(dxy_meas.value() / dxy_meas.error(), 0, -1, 800);
28  const auto& d3d_meas = vertexD3d(sv, pv);
29  sv_features.d3d = d3d_meas.value();
30  sv_features.d3dsig = catch_infs_and_bound(d3d_meas.value() / d3d_meas.error(), 0, -1, 800);
31  sv_features.costhetasvpv = (flip ? -1.f : 1.f) * vertexDdotP(sv, pv);
32  sv_features.enratio = sv.energy() / jet.energy();
33  }
34 
35 } // namespace btagbtvdeep
btagbtvdeep
Definition: BoostedDoubleSVTagInfoFeatures.h:4
SecondaryVertexConverter.h
reco::Jet
Base class for all types of Jets.
Definition: Jet.h:20
btagbtvdeep::SecondaryVertexFeatures::mass
float mass
Definition: SecondaryVertexFeatures.h:10
SecondaryVertexFeatures.h
btagbtvdeep::vertexDxy
Measurement1D vertexDxy(const reco::VertexCompositePtrCandidate &svcand, const reco::Vertex &pv)
Definition: deep_helpers.cc:47
btagbtvdeep::SecondaryVertexFeatures::deltaR
float deltaR
Definition: SecondaryVertexFeatures.h:12
Jet.h
reco::VertexCompositePtrCandidate
Definition: VertexCompositePtrCandidate.h:16
btagbtvdeep::SecondaryVertexFeatures::ntracks
float ntracks
Definition: SecondaryVertexFeatures.h:14
pfNegativeDeepFlavourTagInfos_cfi.flip
flip
Definition: pfNegativeDeepFlavourTagInfos_cfi.py:8
btagbtvdeep::SecondaryVertexFeatures::dxy
float dxy
Definition: SecondaryVertexFeatures.h:17
btagbtvdeep::SecondaryVertexFeatures
Definition: SecondaryVertexFeatures.h:6
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
btagbtvdeep::SecondaryVertexFeatures::costhetasvpv
float costhetasvpv
Definition: SecondaryVertexFeatures.h:22
VertexCompositePtrCandidate.h
btagbtvdeep::catch_infs_and_bound
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.cc:30
btagbtvdeep::SecondaryVertexFeatures::pt
float pt
Definition: SecondaryVertexFeatures.h:8
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
btagbtvdeep::SecondaryVertexFeatures::chi2
float chi2
Definition: SecondaryVertexFeatures.h:15
btagbtvdeep::svToFeatures
void svToFeatures(const reco::VertexCompositePtrCandidate &sv, const reco::Vertex &pv, const reco::Jet &jet, SecondaryVertexFeatures &sv_features, const bool flip=false)
Definition: SecondaryVertexConverter.cc:12
btagbtvdeep::SecondaryVertexFeatures::enratio
float enratio
Definition: SecondaryVertexFeatures.h:23
btagbtvdeep::SecondaryVertexFeatures::ptrel
float ptrel
Definition: SecondaryVertexFeatures.h:9
Vertex.h
btagbtvdeep::SecondaryVertexFeatures::d3dsig
float d3dsig
Definition: SecondaryVertexFeatures.h:20
metsig::jet
Definition: SignAlgoResolutions.h:47
btagbtvdeep::SecondaryVertexFeatures::d3d
float d3d
Definition: SecondaryVertexFeatures.h:19
btagbtvdeep::vertexD3d
Measurement1D vertexD3d(const reco::VertexCompositePtrCandidate &svcand, const reco::Vertex &pv)
Definition: deep_helpers.cc:56
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
deep_helpers.h
btagbtvdeep::SecondaryVertexFeatures::normchi2
float normchi2
Definition: SecondaryVertexFeatures.h:16
btagbtvdeep::SecondaryVertexFeatures::dxysig
float dxysig
Definition: SecondaryVertexFeatures.h:18
reco::Vertex
Definition: Vertex.h:35
btagbtvdeep::vertexDdotP
float vertexDdotP(const reco::VertexCompositePtrCandidate &sv, const reco::Vertex &pv)
Definition: deep_helpers.cc:65