CMS 3D CMS Logo

ChargedCandidateConverter.h
Go to the documentation of this file.
1 #ifndef RecoBTag_FeatureTools_ChargedCandidateConverter_h
2 #define RecoBTag_FeatureTools_ChargedCandidateConverter_h
3 
7 
11 
12 namespace btagbtvdeep {
13 
14  template <typename CandidateType>
15  void commonCandidateToFeatures(const CandidateType * c_pf,
16  const reco::Jet & jet,
17  const TrackInfoBuilder & track_info,
18  const float & drminpfcandsv, const float & jetR,
19  ChargedCandidateFeatures & c_pf_features,
20  const bool flip = false) {
21 
22 
23  float trackSip2dVal = track_info.getTrackSip2dVal();
24  float trackSip2dSig = track_info.getTrackSip2dSig();
25  float trackSip3dVal = track_info.getTrackSip3dVal();
26  float trackSip3dSig = track_info.getTrackSip3dSig();
27  if(flip == true){
28  trackSip2dVal = -trackSip2dVal;
29  trackSip2dSig = -trackSip2dSig;
30  trackSip3dSig = -trackSip3dSig;
31  trackSip3dVal = -trackSip3dVal;
32  }
33 
34  c_pf_features.ptrel = catch_infs_and_bound(c_pf->pt()/jet.pt(),
35  0,-1,0,-1);
36 
37  c_pf_features.btagPf_trackEtaRel =catch_infs_and_bound(track_info.getTrackEtaRel(), 0,-5,15);
38  c_pf_features.btagPf_trackPtRel =catch_infs_and_bound(track_info.getTrackPtRel(), 0,-1,4);
39  c_pf_features.btagPf_trackPPar =catch_infs_and_bound(track_info.getTrackPPar(), 0,-1e5,1e5 );
40  c_pf_features.btagPf_trackDeltaR =catch_infs_and_bound(track_info.getTrackDeltaR(), 0,-5,5 );
41  c_pf_features.btagPf_trackPtRatio =catch_infs_and_bound(track_info.getTrackPtRatio(), 0,-1,10);
42  c_pf_features.btagPf_trackPParRatio =catch_infs_and_bound(track_info.getTrackPParRatio(),0,-10,100);
43  c_pf_features.btagPf_trackSip3dVal =catch_infs_and_bound(trackSip3dVal, 0, -1,1e5 );
44  c_pf_features.btagPf_trackSip3dSig =catch_infs_and_bound(trackSip3dSig, 0, -1,4e4 );
45  c_pf_features.btagPf_trackSip2dVal =catch_infs_and_bound(trackSip2dVal, 0, -1,70 );
46  c_pf_features.btagPf_trackSip2dSig =catch_infs_and_bound(trackSip2dSig, 0, -1,4e4 );
47  c_pf_features.btagPf_trackJetDistVal =catch_infs_and_bound(track_info.getTrackJetDistVal(),0,-20,1 );
48 
49  c_pf_features.drminsv = catch_infs_and_bound(drminpfcandsv,0,-1.*jetR,0,-1.*jetR);
50 
51  }
52 
54  const pat::Jet & jet,
55  const TrackInfoBuilder & track_info,
56  const float drminpfcandsv, const float jetR,
57  ChargedCandidateFeatures & c_pf_features,
58  const bool flip = false) ;
59 
60 
62  const reco::Jet & jet,
63  const TrackInfoBuilder & track_info,
64  const float drminpfcandsv, const float jetR, const float puppiw,
65  const int pv_ass_quality,
66  const reco::VertexRef & pv,
67  ChargedCandidateFeatures & c_pf_features,
68  const bool flip = false) ;
69 
70 
71 }
72 
73 #endif //RecoBTag_FeatureTools_ChargedCandidateConverter_h
Base class for all types of Jets.
Definition: Jet.h:20
double pt() const final
transverse momentum
const float getTrackEtaRel() const
const float getTrackDeltaR() const
const float getTrackPParRatio() const
const float getTrackSip2dSig() const
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:34
const float getTrackPPar() const
def pv(vc)
Definition: MetAnalyzer.py:6
const float getTrackPtRatio() const
const float getTrackSip3dVal() const
void packedCandidateToFeatures(const pat::PackedCandidate *c_pf, const pat::Jet &jet, const TrackInfoBuilder &track_info, const float drminpfcandsv, const float jetR, ChargedCandidateFeatures &c_pf_features, const bool flip=false)
const float getTrackJetDistVal() const
void recoCandidateToFeatures(const reco::PFCandidate *c_pf, const reco::Jet &jet, const TrackInfoBuilder &track_info, const float drminpfcandsv, const float jetR, const float puppiw, const int pv_ass_quality, const reco::VertexRef &pv, ChargedCandidateFeatures &c_pf_features, const bool flip=false)
Analysis-level calorimeter jet class.
Definition: Jet.h:80
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
const float getTrackPtRel() const
const float getTrackSip2dVal() const
void commonCandidateToFeatures(const CandidateType *c_pf, const reco::Jet &jet, const TrackInfoBuilder &track_info, const float &drminpfcandsv, const float &jetR, ChargedCandidateFeatures &c_pf_features, const bool flip=false)
const float getTrackSip3dSig() const