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