CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
void npf_tensor_filler(float *&ptr, const btagbtvdeep::NeutralCandidateFeatures &n_pf_features)
void cpf_tensor_filler(float *&ptr, const btagbtvdeep::ChargedCandidateFeatures &c_pf_features)
ShallowTagInfoFeatures tag_info_features
std::vector< NeutralCandidateFeatures > n_pf_features
std::vector< SecondaryVertexFeatures > sv_features
std::vector< ChargedCandidateFeatures > c_pf_features
void sv_tensor_filler(float *&ptr, const btagbtvdeep::SecondaryVertexFeatures &sv_features)
std::vector< float > features(const reco::PreId &ecal, const reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
void neighbourTrack_tensor_filler(float *&ptr, const btagbtvdeep::TrackPairFeatures &neighbourTrack_features)
void jet_tensor_filler(float *&ptr, const btagbtvdeep::DeepFlavourFeatures &features)
void seedTrack_tensor_filler(float *&ptr, const btagbtvdeep::SeedingTrackFeatures &seed_features)
void jet4vec_tensor_filler(float *&ptr, const btagbtvdeep::JetFeatures &jet_features)