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
float puppiWeight() const
Base class for all types of Jets.
Definition: Jet.h:20
int pdgId() const final
PDG identifier.
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
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)
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:77
float hcalFraction() const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
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)