CMS 3D CMS Logo

NeutralCandidateConverter.cc
Go to the documentation of this file.
2 
3 namespace btagbtvdeep {
4 
6  const pat::Jet& jet,
7  const float drminpfcandsv,
8  const float jetR,
9  NeutralCandidateFeatures& n_pf_features) {
10  commonCandidateToFeatures(n_pf, jet, drminpfcandsv, jetR, n_pf_features);
11 
12  n_pf_features.hadFrac = n_pf->hcalFraction();
13  n_pf_features.puppiw = n_pf->puppiWeight();
14  }
15 
17  const reco::Jet& jet,
18  const float drminpfcandsv,
19  const float jetR,
20  const float puppiw,
21  NeutralCandidateFeatures& n_pf_features) {
22  commonCandidateToFeatures(n_pf, jet, drminpfcandsv, jetR, n_pf_features);
23  n_pf_features.puppiw = puppiw;
24 
25  // need to get a value map and more stuff to do properly
26  // otherwise will be different than for PackedCandidates
27  // https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py
28  if (abs(n_pf->pdgId()) == 1 || abs(n_pf->pdgId()) == 130) {
29  n_pf_features.hadFrac = n_pf->hcalEnergy() / (n_pf->ecalEnergy() + n_pf->hcalEnergy());
30  } else {
31  n_pf_features.hadFrac = 0;
32  }
33  }
34 
35 } // namespace btagbtvdeep
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:37
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
btagbtvdeep::NeutralCandidateFeatures::hadFrac
float hadFrac
Definition: NeutralCandidateFeatures.h:20
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
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
NeutralCandidateConverter.h
pat::PackedCandidate::puppiWeight
float puppiWeight() const
Definition: PackedCandidate.cc:380
btagbtvdeep::NeutralCandidateFeatures
Definition: NeutralCandidateFeatures.h:6
pat::PackedCandidate
Definition: PackedCandidate.h:22
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
reco::PFCandidate::ecalEnergy
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
pat::PackedCandidate::hcalFraction
float hcalFraction() const
Definition: PackedCandidate.h:934
reco::PFCandidate::hcalEnergy
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
metsig::jet
Definition: SignAlgoResolutions.h:47
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
btagbtvdeep::NeutralCandidateFeatures::puppiw
float puppiw
Definition: NeutralCandidateFeatures.h:15