CMS 3D CMS Logo

TrackPairInfoBuilder.cc
Go to the documentation of this file.
6 
7 namespace btagbtvdeep {
8 
10  :
11 
12  track_pt_(0),
13  track_eta_(0),
14  track_phi_(0),
15  track_dz_(0),
16  track_dxy_(0),
17 
18  pca_distance_(0),
19  pca_significance_(0),
20 
21  pcaSeed_x_(0),
22  pcaSeed_y_(0),
23  pcaSeed_z_(0),
24  pcaSeed_xerr_(0),
25  pcaSeed_yerr_(0),
26  pcaSeed_zerr_(0),
27  pcaTrack_x_(0),
28  pcaTrack_y_(0),
29  pcaTrack_z_(0),
30  pcaTrack_xerr_(0),
31  pcaTrack_yerr_(0),
32  pcaTrack_zerr_(0),
33 
34  dotprodTrack_(0),
35  dotprodSeed_(0),
36  pcaSeed_dist_(0),
37  pcaTrack_dist_(0),
38 
39  track_candMass_(0),
40  track_ip2d_(0),
41  track_ip2dSig_(0),
42  track_ip3d_(0),
43  track_ip3dSig_(0),
44 
45  dotprodTrackSeed2D_(0),
46  dotprodTrackSeed2DV_(0),
47  dotprodTrackSeed3D_(0),
48  dotprodTrackSeed3DV_(0),
49 
50  pca_jetAxis_dist_(0),
51  pca_jetAxis_dotprod_(0),
52  pca_jetAxis_dEta_(0),
53  pca_jetAxis_dPhi_(0)
54 
55  {}
56 
58  const reco::TransientTrack* tt,
59  const reco::Vertex& pv,
60  float mass,
61  GlobalVector jetdirection,
62  const std::pair<bool, Measurement1D>& t_ip,
63  const std::pair<bool, Measurement1D>& t_ip2d) {
64  GlobalPoint pvp(pv.x(), pv.y(), pv.z());
65 
66  VertexDistance3D distanceComputer;
68 
69  auto const& iImpactState = it->impactPointState();
70  auto const& tImpactState = tt->impactPointState();
71 
72  if (dist.calculate(tImpactState, iImpactState)) {
73  GlobalPoint ttPoint = dist.points().first;
74  GlobalError ttPointErr = tImpactState.cartesianError().position();
75  GlobalPoint seedPosition = dist.points().second;
76  GlobalError seedPositionErr = iImpactState.cartesianError().position();
77 
79  distanceComputer.distance(VertexState(seedPosition, seedPositionErr), VertexState(ttPoint, ttPointErr));
80 
82 
83  GlobalVector pairMomentum((Basic3DVector<float>)(it->track().momentum() + tt->track().momentum()));
84  GlobalVector pvToPCA(cp - pvp);
85 
86  float pvToPCAseed = (seedPosition - pvp).mag();
87  float pvToPCAtrack = (ttPoint - pvp).mag();
88  float distance = dist.distance();
89 
90  GlobalVector trackDir2D(tImpactState.globalDirection().x(), tImpactState.globalDirection().y(), 0.);
91  GlobalVector seedDir2D(iImpactState.globalDirection().x(), iImpactState.globalDirection().y(), 0.);
92  GlobalVector trackPCADir2D(ttPoint.x() - pvp.x(), ttPoint.y() - pvp.y(), 0.);
93  GlobalVector seedPCADir2D(seedPosition.x() - pvp.x(), seedPosition.y() - pvp.y(), 0.);
94 
95  float dotprodTrack = (ttPoint - pvp).unit().dot(tImpactState.globalDirection().unit());
96  float dotprodSeed = (seedPosition - pvp).unit().dot(iImpactState.globalDirection().unit());
97 
99  Line::DirectionType dir(jetdirection);
100  Line::DirectionType pairMomentumDir(pairMomentum);
101  Line jetLine(pos, dir);
102  Line PCAMomentumLine(cp, pairMomentumDir);
103 
104  track_pt_ = tt->track().pt();
105  track_eta_ = tt->track().eta();
106  track_phi_ = tt->track().phi();
107  track_dz_ = tt->track().dz(pv.position());
108  track_dxy_ = tt->track().dxy(pv.position());
109 
111  pca_significance_ = m.significance();
112 
113  pcaSeed_x_ = seedPosition.x();
114  pcaSeed_y_ = seedPosition.y();
115  pcaSeed_z_ = seedPosition.z();
116  pcaSeed_xerr_ = seedPositionErr.cxx();
117  pcaSeed_yerr_ = seedPositionErr.cyy();
118  pcaSeed_zerr_ = seedPositionErr.czz();
119  pcaTrack_x_ = ttPoint.x();
120  pcaTrack_y_ = ttPoint.y();
121  pcaTrack_z_ = ttPoint.z();
122  pcaTrack_xerr_ = ttPointErr.cxx();
123  pcaTrack_yerr_ = ttPointErr.cyy();
124  pcaTrack_zerr_ = ttPointErr.czz();
125 
128  pcaSeed_dist_ = pvToPCAseed;
129  pcaTrack_dist_ = pvToPCAtrack;
130 
132  track_ip2d_ = t_ip2d.second.value();
133  track_ip2dSig_ = t_ip2d.second.significance();
134  track_ip3d_ = t_ip.second.value();
135  track_ip3dSig_ = t_ip.second.significance();
136 
137  dotprodTrackSeed2D_ = trackDir2D.unit().dot(seedDir2D.unit());
138  dotprodTrackSeed3D_ = iImpactState.globalDirection().unit().dot(tImpactState.globalDirection().unit());
139  dotprodTrackSeed2DV_ = trackPCADir2D.unit().dot(seedPCADir2D.unit());
140  dotprodTrackSeed3DV_ = (seedPosition - pvp).unit().dot((ttPoint - pvp).unit());
141 
142  pca_jetAxis_dist_ = jetLine.distance(cp).mag();
143  pca_jetAxis_dotprod_ = pairMomentum.unit().dot(jetdirection.unit());
144  pca_jetAxis_dEta_ = std::fabs(pvToPCA.eta() - jetdirection.eta());
145  pca_jetAxis_dPhi_ = std::fabs(pvToPCA.phi() - jetdirection.phi());
146  }
147  }
148 
149 } // namespace btagbtvdeep
Vector3DBase
Definition: Vector3DBase.h:8
btagbtvdeep::TrackPairInfoBuilder::dotprodTrackSeed3DV_
float dotprodTrackSeed3DV_
Definition: TrackPairInfoBuilder.h:92
btagbtvdeep
Definition: BoostedDoubleSVTagInfoFeatures.h:4
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_dist_
float pcaTrack_dist_
Definition: TrackPairInfoBuilder.h:83
Measurement1D
Definition: Measurement1D.h:11
btagbtvdeep::TrackPairInfoBuilder::track_dxy_
float track_dxy_
Definition: TrackPairInfoBuilder.h:65
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_x_
float pcaSeed_x_
Definition: TrackPairInfoBuilder.h:68
TwoTrackMinimumDistance::crossingPoint
GlobalPoint crossingPoint() const override
Definition: TwoTrackMinimumDistance.cc:187
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_z_
float pcaSeed_z_
Definition: TrackPairInfoBuilder.h:70
btagbtvdeep::TrackPairInfoBuilder::track_ip3dSig_
float track_ip3dSig_
Definition: TrackPairInfoBuilder.h:88
pos
Definition: PixelAliasList.h:18
TwoTrackMinimumDistance
Definition: TwoTrackMinimumDistance.h:20
btagbtvdeep::TrackPairInfoBuilder::TrackPairInfoBuilder
TrackPairInfoBuilder()
Definition: TrackPairInfoBuilder.cc:9
TwoTrackMinimumDistance::calculate
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
Definition: TwoTrackMinimumDistance.cc:83
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_xerr_
float pcaTrack_xerr_
Definition: TrackPairInfoBuilder.h:77
btagbtvdeep::TrackPairInfoBuilder::dotprodTrackSeed2DV_
float dotprodTrackSeed2DV_
Definition: TrackPairInfoBuilder.h:90
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_zerr_
float pcaTrack_zerr_
Definition: TrackPairInfoBuilder.h:79
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
btagbtvdeep::TrackPairInfoBuilder::pca_significance_
float pca_significance_
Definition: TrackPairInfoBuilder.h:67
GlobalErrorBase::cyy
T cyy() const
Definition: GlobalErrorBase.h:101
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
btagbtvdeep::TrackPairInfoBuilder::dotprodTrackSeed2D_
float dotprodTrackSeed2D_
Definition: TrackPairInfoBuilder.h:89
btagbtvdeep::TrackPairInfoBuilder::dotprodTrack_
float dotprodTrack_
Definition: TrackPairInfoBuilder.h:80
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
btagbtvdeep::TrackPairInfoBuilder::dotprodTrack
const float dotprodTrack() const
Definition: TrackPairInfoBuilder.h:42
Basic3DVector::dot
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic3DVector.h:189
btagbtvdeep::TrackPairInfoBuilder::pca_jetAxis_dEta_
float pca_jetAxis_dEta_
Definition: TrackPairInfoBuilder.h:95
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_yerr_
float pcaTrack_yerr_
Definition: TrackPairInfoBuilder.h:78
VertexCompositePtrCandidate.h
VertexDistance3D
Definition: VertexDistance3D.h:13
Point3DBase< float, GlobalTag >
btagbtvdeep::TrackPairInfoBuilder::dotprodSeed
const float dotprodSeed() const
Definition: TrackPairInfoBuilder.h:43
GlobalErrorBase::cxx
T cxx() const
Definition: GlobalErrorBase.h:97
Vertex.h
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_y_
float pcaSeed_y_
Definition: TrackPairInfoBuilder.h:69
btagbtvdeep::TrackPairInfoBuilder::dotprodTrackSeed3D_
float dotprodTrackSeed3D_
Definition: TrackPairInfoBuilder.h:91
TwoTrackMinimumDistance::points
std::pair< GlobalPoint, GlobalPoint > points() const override
Definition: TwoTrackMinimumDistance.cc:75
TransientTrackBuilder.h
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_y_
float pcaTrack_y_
Definition: TrackPairInfoBuilder.h:75
btagbtvdeep::TrackPairInfoBuilder::track_eta_
float track_eta_
Definition: TrackPairInfoBuilder.h:62
btagbtvdeep::TrackPairInfoBuilder::track_dz_
float track_dz_
Definition: TrackPairInfoBuilder.h:64
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
reco::TransientTrack::impactPointState
TrajectoryStateOnSurface impactPointState() const
Definition: TransientTrack.h:98
btagbtvdeep::TrackPairInfoBuilder::pca_jetAxis_dist_
float pca_jetAxis_dist_
Definition: TrackPairInfoBuilder.h:93
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
Line
Definition: Line.h:10
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_yerr_
float pcaSeed_yerr_
Definition: TrackPairInfoBuilder.h:72
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_xerr_
float pcaSeed_xerr_
Definition: TrackPairInfoBuilder.h:71
GlobalErrorBase< double, ErrorMatrixTag >
btagbtvdeep::TrackPairInfoBuilder::track_ip2d_
float track_ip2d_
Definition: TrackPairInfoBuilder.h:85
Vector3DBase::dot
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_z_
float pcaTrack_z_
Definition: TrackPairInfoBuilder.h:76
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
TwoTrackMinimumDistance::distance
float distance() const override
Definition: TwoTrackMinimumDistance.cc:189
Line::distance
GlobalVector distance(const Line &aLine) const
Definition: Line.h:35
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
btagbtvdeep::TrackPairInfoBuilder::track_phi_
float track_phi_
Definition: TrackPairInfoBuilder.h:63
reco::TransientTrack
Definition: TransientTrack.h:19
btagbtvdeep::TrackPairInfoBuilder::pca_distance_
float pca_distance_
Definition: TrackPairInfoBuilder.h:66
reco::TransientTrack::track
const Track & track() const
Definition: TransientTrack.h:117
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_dist_
float pcaSeed_dist_
Definition: TrackPairInfoBuilder.h:82
VertexState
Definition: VertexState.h:13
btagbtvdeep::TrackPairInfoBuilder::track_ip2dSig_
float track_ip2dSig_
Definition: TrackPairInfoBuilder.h:86
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
GlobalErrorBase::czz
T czz() const
Definition: GlobalErrorBase.h:107
btagbtvdeep::TrackPairInfoBuilder::track_candMass_
float track_candMass_
Definition: TrackPairInfoBuilder.h:84
btagbtvdeep::TrackPairInfoBuilder::buildTrackPairInfo
void buildTrackPairInfo(const reco::TransientTrack *it, const reco::TransientTrack *tt, const reco::Vertex &pv, float mass, GlobalVector jetdirection, const std::pair< bool, Measurement1D > &t_ip, const std::pair< bool, Measurement1D > &t_ip2d)
Definition: TrackPairInfoBuilder.cc:57
Candidate.h
btagbtvdeep::TrackPairInfoBuilder::pca_jetAxis_dPhi_
float pca_jetAxis_dPhi_
Definition: TrackPairInfoBuilder.h:96
btagbtvdeep::TrackPairInfoBuilder::dotprodSeed_
float dotprodSeed_
Definition: TrackPairInfoBuilder.h:81
btagbtvdeep::TrackPairInfoBuilder::pcaTrack_x_
float pcaTrack_x_
Definition: TrackPairInfoBuilder.h:74
reco::TrackBase::momentum
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7799
btagbtvdeep::TrackPairInfoBuilder::track_pt_
float track_pt_
Definition: TrackPairInfoBuilder.h:61
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Basic3DVector< float >
reco::Vertex
Definition: Vertex.h:35
TrackPairInfoBuilder.h
btagbtvdeep::TrackPairInfoBuilder::track_ip3d_
float track_ip3d_
Definition: TrackPairInfoBuilder.h:87
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
btagbtvdeep::TrackPairInfoBuilder::pca_jetAxis_dotprod_
float pca_jetAxis_dotprod_
Definition: TrackPairInfoBuilder.h:94
btagbtvdeep::TrackPairInfoBuilder::pcaSeed_zerr_
float pcaSeed_zerr_
Definition: TrackPairInfoBuilder.h:73