CMS 3D CMS Logo

SeedingTrackInfoBuilder.cc
Go to the documentation of this file.
8 
9 namespace btagbtvdeep{
10 
12  pt_(0),
13  eta_(0),
14  phi_(0),
15  mass_(0),
16  dz_(0),
17  dxy_(0),
18  ip3D_(0),
19  sip3D_(0),
20  ip2D_(0),
21  sip2D_(0),
22  ip3D_signed_(0),
23  sip3D_signed_(0),
24  ip2D_signed_(0),
25  sip2D_signed_(0),
26  chi2reduced_(0),
27  nPixelHits_(0),
28  nHits_(0),
29  jetAxisDistance_(0),
30  jetAxisDlength_(0),
31  trackProbability3D_(0),
32  trackProbability2D_(0)
33 {
34 
35 }
36 
37 
38  void SeedingTrackInfoBuilder::buildSeedingTrackInfo(const reco::TransientTrack * it , const reco::Vertex & pv, const reco::Jet & jet,/*GlobalVector jetdirection,*/
39  float mass, const std::pair<bool,Measurement1D> & ip, const std::pair<bool,Measurement1D> & ip2d,
40  float jet_distance, float jaxis_dlength, HistogramProbabilityEstimator* m_probabilityEstimator, bool m_computeProbabilities=false ){
41 
42  GlobalPoint pvp(pv.x(),pv.y(),pv.z());
43  GlobalVector jetdirection(jet.px(),jet.py(),jet.pz());
44 
45  auto const& aTrack = it->track();
46 
47  pt_=aTrack.pt();
48  eta_=aTrack.eta();
49  phi_=aTrack.phi();
50  dz_=aTrack.dz(pv.position());
51  dxy_=aTrack.dxy(pv.position());
52  mass_=mass;
53 
54  std::pair<bool,Measurement1D> ipSigned = IPTools::signedImpactParameter3D(*it,jetdirection, pv);
55  std::pair<bool,Measurement1D> ip2dSigned = IPTools::signedTransverseImpactParameter(*it,jetdirection, pv);
56 
57  ip3D_=ip.second.value();
58  sip3D_=ip.second.significance();
59  ip2D_=ip2d.second.value();
60  sip2D_=ip2d.second.significance();
61  ip3D_signed_=ipSigned.second.value();
62  sip3D_signed_=ipSigned.second.significance();
63  ip2D_signed_=ip2dSigned.second.value();
64  sip2D_signed_=ip2dSigned.second.significance();
65 
66  chi2reduced_=aTrack.normalizedChi2();
67  nPixelHits_=aTrack.hitPattern().numberOfValidPixelHits();
68  nHits_=aTrack.hitPattern().numberOfValidHits();
69 
70  jetAxisDistance_=std::fabs(jet_distance);
71  jetAxisDlength_=jaxis_dlength;
72 
75 
76  if (m_computeProbabilities) {
77 
78  //probability with 3D ip
79  std::pair<bool,double> probability = m_probabilityEstimator->probability(false,0,ip.second.significance(),aTrack,jet,pv);
80  double prob3D=(probability.first ? probability.second : -1.);
81 
82  //probability with 2D ip
83  probability = m_probabilityEstimator->probability(false,1,ip2d.second.significance(),aTrack,jet,pv);
84  double prob2D=(probability.first ? probability.second : -1.);
85 
86  trackProbability3D_=prob3D;
87  trackProbability2D_=prob2D;
88 
89  }
90 
93 
94 
95  }
96 
97 
98 
99 
100 
101 }
double y() const
y coordinate
Definition: Vertex.h:113
Base class for all types of Jets.
Definition: Jet.h:20
double px() const final
x coordinate of momentum vector
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
constexpr bool isFinite(T x)
const Point & position() const
position
Definition: Vertex.h:109
double pz() const final
z coordinate of momentum vector
def pv(vc)
Definition: MetAnalyzer.py:7
double z() const
z coordinate
Definition: Vertex.h:115
void buildSeedingTrackInfo(const reco::TransientTrack *it, const reco::Vertex &pv, const reco::Jet &jet, float mass, const std::pair< bool, Measurement1D > &ip, const std::pair< bool, Measurement1D > &ip2d, float jet_distance, float jaxis_dlength, HistogramProbabilityEstimator *m_probabilityEstimator, bool m_computeProbabilities)
double x() const
x coordinate
Definition: Vertex.h:111
const Track & track() const
double py() const final
y coordinate of momentum vector
std::pair< bool, double > probability(bool quality, int ipType, float significance, const reco::Track &, const reco::Jet &, const reco::Vertex &) const