CMS 3D CMS Logo

NeutralCandidateConverter.h
Go to the documentation of this file.
1 #ifndef RecoBTag_FeatureTools_NeutralCandidateConverter_h
2 #define RecoBTag_FeatureTools_NeutralCandidateConverter_h
3 
6 
11 
12 namespace btagbtvdeep {
13 
15  const pat::Jet& jet,
16  const float drminpfcandsv,
17  const float jetR,
18  NeutralCandidateFeatures& n_pf_features);
19 
21  const reco::Jet& jet,
22  const float drminpfcandsv,
23  const float jetR,
24  const float puppiw,
25  NeutralCandidateFeatures& n_pf_features);
26 
27  template <typename CandidateType>
28  static void commonCandidateToFeatures(const CandidateType* n_pf,
29  const reco::Jet& jet,
30  const float& drminpfcandsv,
31  const float& jetR,
32  NeutralCandidateFeatures& n_pf_features) {
33  n_pf_features.ptrel = catch_infs_and_bound(n_pf->pt() / jet.pt(), 0, -1, 0, -1);
34  n_pf_features.deltaR = catch_infs_and_bound(reco::deltaR(*n_pf, jet), 0, -0.6, 0, -0.6);
35  n_pf_features.isGamma = 0;
36  if (std::abs(n_pf->pdgId()) == 22)
37  n_pf_features.isGamma = 1;
38 
39  n_pf_features.drminsv = catch_infs_and_bound(drminpfcandsv, 0, -1. * jetR, 0, -1. * jetR);
40  }
41 
42 } // namespace btagbtvdeep
43 
44 #endif //RecoBTag_FeatureTools_NeutralCandidateConverter_h
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::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
Jet.h
LHEJetFilter_cfi.jetR
jetR
Definition: LHEJetFilter_cfi.py:5
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
btagbtvdeep::NeutralCandidateFeatures::deltaR
float deltaR
Definition: NeutralCandidateFeatures.h:11
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
NeutralCandidateFeatures.h
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::NeutralCandidateFeatures::drminsv
float drminsv
Definition: NeutralCandidateFeatures.h:15
btagbtvdeep::NeutralCandidateFeatures
Definition: NeutralCandidateFeatures.h:6
pat::PackedCandidate
Definition: PackedCandidate.h:22
PackedCandidate.h
Jet.h
btagbtvdeep::NeutralCandidateFeatures::isGamma
float isGamma
Definition: NeutralCandidateFeatures.h:12
metsig::jet
Definition: SignAlgoResolutions.h:47
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
deep_helpers.h
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
btagbtvdeep::NeutralCandidateFeatures::ptrel
float ptrel
Definition: NeutralCandidateFeatures.h:8