CMS 3D CMS Logo

tensor_fillers.cc
Go to the documentation of this file.
2 
3 namespace btagbtvdeep {
4 
6  // jet variables
7  const auto& jet_features = features.jet_features;
8  *ptr = jet_features.pt;
9  *(++ptr) = jet_features.eta;
10  // number of elements in different collections
11  *(++ptr) = features.c_pf_features.size();
12  *(++ptr) = features.n_pf_features.size();
13  *(++ptr) = features.sv_features.size();
14  *(++ptr) = features.npv;
15  // variables from ShallowTagInfo
16  const auto& tag_info_features = features.tag_info_features;
17  *(++ptr) = tag_info_features.trackSumJetEtRatio;
18  *(++ptr) = tag_info_features.trackSumJetDeltaR;
19  *(++ptr) = tag_info_features.vertexCategory;
20  *(++ptr) = tag_info_features.trackSip2dValAboveCharm;
21  *(++ptr) = tag_info_features.trackSip2dSigAboveCharm;
22  *(++ptr) = tag_info_features.trackSip3dValAboveCharm;
23  *(++ptr) = tag_info_features.trackSip3dSigAboveCharm;
24  *(++ptr) = tag_info_features.jetNSelectedTracks;
25  *(++ptr) = tag_info_features.jetNTracksEtaRel;
26  }
27 
28  void cpf_tensor_filler(float*& ptr, const btagbtvdeep::ChargedCandidateFeatures& c_pf_features) {
29  *ptr = c_pf_features.btagPf_trackEtaRel;
30  *(++ptr) = c_pf_features.btagPf_trackPtRel;
31  *(++ptr) = c_pf_features.btagPf_trackPPar;
32  *(++ptr) = c_pf_features.btagPf_trackDeltaR;
33  *(++ptr) = c_pf_features.btagPf_trackPParRatio;
34  *(++ptr) = c_pf_features.btagPf_trackSip2dVal;
35  *(++ptr) = c_pf_features.btagPf_trackSip2dSig;
36  *(++ptr) = c_pf_features.btagPf_trackSip3dVal;
37  *(++ptr) = c_pf_features.btagPf_trackSip3dSig;
38  *(++ptr) = c_pf_features.btagPf_trackJetDistVal;
39  *(++ptr) = c_pf_features.ptrel;
40  *(++ptr) = c_pf_features.drminsv;
41  *(++ptr) = c_pf_features.vtx_ass;
42  *(++ptr) = c_pf_features.puppiw;
43  *(++ptr) = c_pf_features.chi2;
44  *(++ptr) = c_pf_features.quality;
45  }
46 
47  void npf_tensor_filler(float*& ptr, const btagbtvdeep::NeutralCandidateFeatures& n_pf_features) {
48  *ptr = n_pf_features.ptrel;
49  *(++ptr) = n_pf_features.deltaR;
50  *(++ptr) = n_pf_features.isGamma;
51  *(++ptr) = n_pf_features.hadFrac;
52  *(++ptr) = n_pf_features.drminsv;
53  *(++ptr) = n_pf_features.puppiw;
54  }
55 
56  void sv_tensor_filler(float*& ptr, const btagbtvdeep::SecondaryVertexFeatures& sv_features) {
57  *ptr = sv_features.pt;
58  *(++ptr) = sv_features.deltaR;
59  *(++ptr) = sv_features.mass;
60  *(++ptr) = sv_features.ntracks;
61  *(++ptr) = sv_features.chi2;
62  *(++ptr) = sv_features.normchi2;
63  *(++ptr) = sv_features.dxy;
64  *(++ptr) = sv_features.dxysig;
65  *(++ptr) = sv_features.d3d;
66  *(++ptr) = sv_features.d3dsig;
67  *(++ptr) = sv_features.costhetasvpv;
68  *(++ptr) = sv_features.enratio;
69  }
70 
71  void jet4vec_tensor_filler(float*& ptr, const btagbtvdeep::JetFeatures& jet_features) {
72  *ptr = jet_features.pt;
73  *(++ptr) = jet_features.eta;
74  *(++ptr) = jet_features.phi;
75  *(++ptr) = jet_features.mass;
76  }
77 
78  void seedTrack_tensor_filler(float*& ptr, const btagbtvdeep::SeedingTrackFeatures& seed_features) {
79  *ptr = seed_features.pt;
80  *(++ptr) = seed_features.eta;
81  *(++ptr) = seed_features.phi;
82  *(++ptr) = seed_features.mass;
83  *(++ptr) = seed_features.dz;
84  *(++ptr) = seed_features.dxy;
85  *(++ptr) = seed_features.ip3D;
86  *(++ptr) = seed_features.sip3D;
87  *(++ptr) = seed_features.ip2D;
88  *(++ptr) = seed_features.sip2D;
89  *(++ptr) = seed_features.signedIp3D;
90  *(++ptr) = seed_features.signedSip3D;
91  *(++ptr) = seed_features.signedIp2D;
92  *(++ptr) = seed_features.signedSip2D;
93  *(++ptr) = seed_features.trackProbability3D;
94  *(++ptr) = seed_features.trackProbability2D;
95  *(++ptr) = seed_features.chi2reduced;
96  *(++ptr) = seed_features.nPixelHits;
97  *(++ptr) = seed_features.nHits;
98  *(++ptr) = seed_features.jetAxisDistance;
99  *(++ptr) = seed_features.jetAxisDlength;
100  }
101 
102  void neighbourTrack_tensor_filler(float*& ptr, const btagbtvdeep::TrackPairFeatures& neighbourTrack_features) {
103  *ptr = neighbourTrack_features.pt;
104  *(++ptr) = neighbourTrack_features.eta;
105  *(++ptr) = neighbourTrack_features.phi;
106  *(++ptr) = neighbourTrack_features.dz;
107  *(++ptr) = neighbourTrack_features.dxy;
108  *(++ptr) = neighbourTrack_features.mass;
109  *(++ptr) = neighbourTrack_features.ip3D;
110  *(++ptr) = neighbourTrack_features.sip3D;
111  *(++ptr) = neighbourTrack_features.ip2D;
112  *(++ptr) = neighbourTrack_features.sip2D;
113  *(++ptr) = neighbourTrack_features.distPCA;
114  *(++ptr) = neighbourTrack_features.dsigPCA;
115  *(++ptr) = neighbourTrack_features.x_PCAonSeed;
116  *(++ptr) = neighbourTrack_features.y_PCAonSeed;
117  *(++ptr) = neighbourTrack_features.z_PCAonSeed;
118  *(++ptr) = neighbourTrack_features.xerr_PCAonSeed;
119  *(++ptr) = neighbourTrack_features.yerr_PCAonSeed;
120  *(++ptr) = neighbourTrack_features.zerr_PCAonSeed;
121  *(++ptr) = neighbourTrack_features.x_PCAonTrack;
122  *(++ptr) = neighbourTrack_features.y_PCAonTrack;
123  *(++ptr) = neighbourTrack_features.z_PCAonTrack;
124  *(++ptr) = neighbourTrack_features.xerr_PCAonTrack;
125  *(++ptr) = neighbourTrack_features.yerr_PCAonTrack;
126  *(++ptr) = neighbourTrack_features.zerr_PCAonTrack;
127  *(++ptr) = neighbourTrack_features.dotprodTrack;
128  *(++ptr) = neighbourTrack_features.dotprodSeed;
129  *(++ptr) = neighbourTrack_features.dotprodTrackSeed2D;
130  *(++ptr) = neighbourTrack_features.dotprodTrackSeed3D;
131  *(++ptr) = neighbourTrack_features.dotprodTrackSeedVectors2D;
132  *(++ptr) = neighbourTrack_features.dotprodTrackSeedVectors3D;
133  *(++ptr) = neighbourTrack_features.pvd_PCAonSeed;
134  *(++ptr) = neighbourTrack_features.pvd_PCAonTrack;
135  *(++ptr) = neighbourTrack_features.dist_PCAjetAxis;
136  *(++ptr) = neighbourTrack_features.dotprod_PCAjetMomenta;
137  *(++ptr) = neighbourTrack_features.deta_PCAjetDirs;
138  *(++ptr) = neighbourTrack_features.dphi_PCAjetDirs;
139  }
140 
141 } // namespace btagbtvdeep
btagbtvdeep
Definition: BoostedDoubleSVTagInfoFeatures.h:4
btagbtvdeep::SeedingTrackFeatures
Definition: SeedingTrackFeatures.h:9
btagbtvdeep::neighbourTrack_tensor_filler
void neighbourTrack_tensor_filler(float *&ptr, const btagbtvdeep::TrackPairFeatures &neighbourTrack_features)
Definition: tensor_fillers.cc:102
btagbtvdeep::TrackPairFeatures::dotprodTrack
float dotprodTrack
Definition: TrackPairFeatures.h:32
btagbtvdeep::TrackPairFeatures::dotprod_PCAjetMomenta
float dotprod_PCAjetMomenta
Definition: TrackPairFeatures.h:41
btagbtvdeep::SecondaryVertexFeatures::mass
float mass
Definition: SecondaryVertexFeatures.h:10
btagbtvdeep::JetFeatures::pt
float pt
Definition: JetFeatures.h:8
btagbtvdeep::NeutralCandidateFeatures::hadFrac
float hadFrac
Definition: NeutralCandidateFeatures.h:20
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackPParRatio
float btagPf_trackPParRatio
Definition: ChargedCandidateFeatures.h:20
postprocess-scan-build.features
features
Definition: postprocess-scan-build.py:8
btagbtvdeep::TrackPairFeatures::z_PCAonTrack
float z_PCAonTrack
Definition: TrackPairFeatures.h:28
btagbtvdeep::SeedingTrackFeatures::sip3D
float sip3D
Definition: SeedingTrackFeatures.h:18
btagbtvdeep::cpf_tensor_filler
void cpf_tensor_filler(float *&ptr, const btagbtvdeep::ChargedCandidateFeatures &c_pf_features)
Definition: tensor_fillers.cc:28
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackSip2dVal
float btagPf_trackSip2dVal
Definition: ChargedCandidateFeatures.h:23
btagbtvdeep::TrackPairFeatures::ip2D
float ip2D
Definition: TrackPairFeatures.h:16
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackEtaRel
float btagPf_trackEtaRel
Definition: ChargedCandidateFeatures.h:15
btagbtvdeep::DeepFlavourFeatures
Definition: DeepFlavourFeatures.h:15
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackPtRel
float btagPf_trackPtRel
Definition: ChargedCandidateFeatures.h:16
btagbtvdeep::SecondaryVertexFeatures::deltaR
float deltaR
Definition: SecondaryVertexFeatures.h:12
btagbtvdeep::SeedingTrackFeatures::signedIp3D
float signedIp3D
Definition: SeedingTrackFeatures.h:21
btagbtvdeep::TrackPairFeatures::pt
float pt
Definition: TrackPairFeatures.h:8
btagbtvdeep::SeedingTrackFeatures::signedIp2D
float signedIp2D
Definition: SeedingTrackFeatures.h:23
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackJetDistVal
float btagPf_trackJetDistVal
Definition: ChargedCandidateFeatures.h:26
btagbtvdeep::TrackPairFeatures::y_PCAonSeed
float y_PCAonSeed
Definition: TrackPairFeatures.h:21
btagbtvdeep::TrackPairFeatures::dotprodTrackSeed2D
float dotprodTrackSeed2D
Definition: TrackPairFeatures.h:34
btagbtvdeep::ChargedCandidateFeatures::vtx_ass
float vtx_ass
Definition: ChargedCandidateFeatures.h:13
btagbtvdeep::SeedingTrackFeatures::ip3D
float ip3D
Definition: SeedingTrackFeatures.h:17
btagbtvdeep::TrackPairFeatures
Definition: TrackPairFeatures.h:6
btagbtvdeep::SeedingTrackFeatures::phi
float phi
Definition: SeedingTrackFeatures.h:13
btagbtvdeep::TrackPairFeatures::z_PCAonSeed
float z_PCAonSeed
Definition: TrackPairFeatures.h:22
btagbtvdeep::TrackPairFeatures::mass
float mass
Definition: TrackPairFeatures.h:11
btagbtvdeep::JetFeatures::phi
float phi
Definition: JetFeatures.h:10
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackSip2dSig
float btagPf_trackSip2dSig
Definition: ChargedCandidateFeatures.h:24
btagbtvdeep::SeedingTrackFeatures::jetAxisDistance
float jetAxisDistance
Definition: SeedingTrackFeatures.h:30
btagbtvdeep::ChargedCandidateFeatures::ptrel
float ptrel
Definition: ChargedCandidateFeatures.h:8
btagbtvdeep::TrackPairFeatures::y_PCAonTrack
float y_PCAonTrack
Definition: TrackPairFeatures.h:27
btagbtvdeep::SecondaryVertexFeatures::ntracks
float ntracks
Definition: SecondaryVertexFeatures.h:14
btagbtvdeep::NeutralCandidateFeatures::deltaR
float deltaR
Definition: NeutralCandidateFeatures.h:16
btagbtvdeep::TrackPairFeatures::pvd_PCAonSeed
float pvd_PCAonSeed
Definition: TrackPairFeatures.h:38
btagbtvdeep::TrackPairFeatures::zerr_PCAonTrack
float zerr_PCAonTrack
Definition: TrackPairFeatures.h:31
btagbtvdeep::ChargedCandidateFeatures::quality
float quality
Definition: ChargedCandidateFeatures.h:37
btagbtvdeep::TrackPairFeatures::xerr_PCAonTrack
float xerr_PCAonTrack
Definition: TrackPairFeatures.h:29
btagbtvdeep::TrackPairFeatures::eta
float eta
Definition: TrackPairFeatures.h:9
btagbtvdeep::ChargedCandidateFeatures::puppiw
float puppiw
Definition: ChargedCandidateFeatures.h:12
btagbtvdeep::SecondaryVertexFeatures::dxy
float dxy
Definition: SecondaryVertexFeatures.h:17
btagbtvdeep::JetFeatures
Definition: JetFeatures.h:6
btagbtvdeep::SecondaryVertexFeatures
Definition: SecondaryVertexFeatures.h:6
btagbtvdeep::SecondaryVertexFeatures::costhetasvpv
float costhetasvpv
Definition: SecondaryVertexFeatures.h:22
btagbtvdeep::sv_tensor_filler
void sv_tensor_filler(float *&ptr, const btagbtvdeep::SecondaryVertexFeatures &sv_features)
Definition: tensor_fillers.cc:56
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackPPar
float btagPf_trackPPar
Definition: ChargedCandidateFeatures.h:18
btagbtvdeep::seedTrack_tensor_filler
void seedTrack_tensor_filler(float *&ptr, const btagbtvdeep::SeedingTrackFeatures &seed_features)
Definition: tensor_fillers.cc:78
btagbtvdeep::TrackPairFeatures::sip2D
float sip2D
Definition: TrackPairFeatures.h:17
btagbtvdeep::TrackPairFeatures::x_PCAonTrack
float x_PCAonTrack
Definition: TrackPairFeatures.h:26
btagbtvdeep::TrackPairFeatures::dotprodTrackSeed3D
float dotprodTrackSeed3D
Definition: TrackPairFeatures.h:35
btagbtvdeep::npf_tensor_filler
void npf_tensor_filler(float *&ptr, const btagbtvdeep::NeutralCandidateFeatures &n_pf_features)
Definition: tensor_fillers.cc:47
btagbtvdeep::TrackPairFeatures::phi
float phi
Definition: TrackPairFeatures.h:10
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackDeltaR
float btagPf_trackDeltaR
Definition: ChargedCandidateFeatures.h:19
btagbtvdeep::SecondaryVertexFeatures::pt
float pt
Definition: SecondaryVertexFeatures.h:8
btagbtvdeep::TrackPairFeatures::dphi_PCAjetDirs
float dphi_PCAjetDirs
Definition: TrackPairFeatures.h:43
btagbtvdeep::TrackPairFeatures::dotprodSeed
float dotprodSeed
Definition: TrackPairFeatures.h:33
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackSip3dSig
float btagPf_trackSip3dSig
Definition: ChargedCandidateFeatures.h:22
btagbtvdeep::JetFeatures::mass
float mass
Definition: JetFeatures.h:11
btagbtvdeep::NeutralCandidateFeatures::drminsv
float drminsv
Definition: NeutralCandidateFeatures.h:21
btagbtvdeep::TrackPairFeatures::xerr_PCAonSeed
float xerr_PCAonSeed
Definition: TrackPairFeatures.h:23
btagbtvdeep::SeedingTrackFeatures::trackProbability2D
float trackProbability2D
Definition: SeedingTrackFeatures.h:26
btagbtvdeep::ChargedCandidateFeatures::drminsv
float drminsv
Definition: ChargedCandidateFeatures.h:39
btagbtvdeep::NeutralCandidateFeatures
Definition: NeutralCandidateFeatures.h:6
btagbtvdeep::SeedingTrackFeatures::chi2reduced
float chi2reduced
Definition: SeedingTrackFeatures.h:27
btagbtvdeep::JetFeatures::eta
float eta
Definition: JetFeatures.h:9
btagbtvdeep::TrackPairFeatures::dotprodTrackSeedVectors2D
float dotprodTrackSeedVectors2D
Definition: TrackPairFeatures.h:36
btagbtvdeep::TrackPairFeatures::dxy
float dxy
Definition: TrackPairFeatures.h:13
btagbtvdeep::SecondaryVertexFeatures::chi2
float chi2
Definition: SecondaryVertexFeatures.h:15
btagbtvdeep::TrackPairFeatures::x_PCAonSeed
float x_PCAonSeed
Definition: TrackPairFeatures.h:20
btagbtvdeep::SeedingTrackFeatures::trackProbability3D
float trackProbability3D
Definition: SeedingTrackFeatures.h:25
btagbtvdeep::TrackPairFeatures::sip3D
float sip3D
Definition: TrackPairFeatures.h:15
btagbtvdeep::ChargedCandidateFeatures::chi2
float chi2
Definition: ChargedCandidateFeatures.h:36
btagbtvdeep::SeedingTrackFeatures::ip2D
float ip2D
Definition: SeedingTrackFeatures.h:19
btagbtvdeep::TrackPairFeatures::dz
float dz
Definition: TrackPairFeatures.h:12
btagbtvdeep::SeedingTrackFeatures::signedSip2D
float signedSip2D
Definition: SeedingTrackFeatures.h:24
btagbtvdeep::jet_tensor_filler
void jet_tensor_filler(float *&ptr, const btagbtvdeep::DeepFlavourFeatures &features)
Definition: tensor_fillers.cc:5
btagbtvdeep::TrackPairFeatures::dotprodTrackSeedVectors3D
float dotprodTrackSeedVectors3D
Definition: TrackPairFeatures.h:37
btagbtvdeep::TrackPairFeatures::pvd_PCAonTrack
float pvd_PCAonTrack
Definition: TrackPairFeatures.h:39
btagbtvdeep::TrackPairFeatures::distPCA
float distPCA
Definition: TrackPairFeatures.h:18
tensor_fillers.h
btagbtvdeep::SeedingTrackFeatures::pt
float pt
Definition: SeedingTrackFeatures.h:11
btagbtvdeep::SeedingTrackFeatures::jetAxisDlength
float jetAxisDlength
Definition: SeedingTrackFeatures.h:31
btagbtvdeep::SeedingTrackFeatures::signedSip3D
float signedSip3D
Definition: SeedingTrackFeatures.h:22
btagbtvdeep::SecondaryVertexFeatures::enratio
float enratio
Definition: SecondaryVertexFeatures.h:23
btagbtvdeep::NeutralCandidateFeatures::isGamma
float isGamma
Definition: NeutralCandidateFeatures.h:18
btagbtvdeep::TrackPairFeatures::dist_PCAjetAxis
float dist_PCAjetAxis
Definition: TrackPairFeatures.h:40
btagbtvdeep::ChargedCandidateFeatures
Definition: ChargedCandidateFeatures.h:6
btagbtvdeep::TrackPairFeatures::dsigPCA
float dsigPCA
Definition: TrackPairFeatures.h:19
btagbtvdeep::SeedingTrackFeatures::dz
float dz
Definition: SeedingTrackFeatures.h:15
btagbtvdeep::SecondaryVertexFeatures::d3dsig
float d3dsig
Definition: SecondaryVertexFeatures.h:20
btagbtvdeep::TrackPairFeatures::yerr_PCAonTrack
float yerr_PCAonTrack
Definition: TrackPairFeatures.h:30
btagbtvdeep::SeedingTrackFeatures::mass
float mass
Definition: SeedingTrackFeatures.h:14
btagbtvdeep::SecondaryVertexFeatures::d3d
float d3d
Definition: SecondaryVertexFeatures.h:19
btagbtvdeep::SeedingTrackFeatures::eta
float eta
Definition: SeedingTrackFeatures.h:12
btagbtvdeep::SeedingTrackFeatures::dxy
float dxy
Definition: SeedingTrackFeatures.h:16
btagbtvdeep::SeedingTrackFeatures::nPixelHits
float nPixelHits
Definition: SeedingTrackFeatures.h:28
btagbtvdeep::ChargedCandidateFeatures::btagPf_trackSip3dVal
float btagPf_trackSip3dVal
Definition: ChargedCandidateFeatures.h:21
btagbtvdeep::SeedingTrackFeatures::nHits
float nHits
Definition: SeedingTrackFeatures.h:29
btagbtvdeep::SecondaryVertexFeatures::normchi2
float normchi2
Definition: SecondaryVertexFeatures.h:16
btagbtvdeep::TrackPairFeatures::zerr_PCAonSeed
float zerr_PCAonSeed
Definition: TrackPairFeatures.h:25
btagbtvdeep::jet4vec_tensor_filler
void jet4vec_tensor_filler(float *&ptr, const btagbtvdeep::JetFeatures &jet_features)
Definition: tensor_fillers.cc:71
btagbtvdeep::NeutralCandidateFeatures::puppiw
float puppiw
Definition: NeutralCandidateFeatures.h:15
btagbtvdeep::NeutralCandidateFeatures::ptrel
float ptrel
Definition: NeutralCandidateFeatures.h:8
btagbtvdeep::SeedingTrackFeatures::sip2D
float sip2D
Definition: SeedingTrackFeatures.h:20
btagbtvdeep::TrackPairFeatures::ip3D
float ip3D
Definition: TrackPairFeatures.h:14
btagbtvdeep::TrackPairFeatures::deta_PCAjetDirs
float deta_PCAjetDirs
Definition: TrackPairFeatures.h:42
btagbtvdeep::SecondaryVertexFeatures::dxysig
float dxysig
Definition: SecondaryVertexFeatures.h:18
btagbtvdeep::TrackPairFeatures::yerr_PCAonSeed
float yerr_PCAonSeed
Definition: TrackPairFeatures.h:24