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 bool isWeightedJet,
8  const float drminpfcandsv,
9  const float jetR,
10  const float puppiw,
11  NeutralCandidateFeatures& n_pf_features) {
12  commonCandidateToFeatures(n_pf, jet, isWeightedJet, drminpfcandsv, jetR, puppiw, n_pf_features);
13 
14  n_pf_features.hadFrac = n_pf->hcalFraction();
15  n_pf_features.puppiw = puppiw;
16  }
17 
19  const reco::Jet& jet,
20  const bool isWeightedJet,
21  const float drminpfcandsv,
22  const float jetR,
23  const float puppiw,
24  NeutralCandidateFeatures& n_pf_features) {
25  commonCandidateToFeatures(n_pf, jet, isWeightedJet, drminpfcandsv, jetR, puppiw, n_pf_features);
26  n_pf_features.puppiw = puppiw;
27 
28  // need to get a value map and more stuff to do properly
29  // otherwise will be different than for PackedCandidates
30  // https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py
31  if (abs(n_pf->pdgId()) == 1 || abs(n_pf->pdgId()) == 130) {
32  n_pf_features.hadFrac = n_pf->hcalEnergy() / (n_pf->ecalEnergy() + n_pf->hcalEnergy());
33  } else {
34  n_pf_features.hadFrac = 0;
35  }
36  }
37 
38 } // namespace btagbtvdeep
Base class for all types of Jets.
Definition: Jet.h:20
void packedCandidateToFeatures(const pat::PackedCandidate *c_pf, const pat::Jet &jet, const TrackInfoBuilder &track_info, const bool isWeightedJet, const float drminpfcandsv, const float jetR, const float puppiw, ChargedCandidateFeatures &c_pf_features, const bool flip=false, const float distminpfcandsv=0)
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 commonCandidateToFeatures(const CandidateType *c_pf, const reco::Jet &jet, const TrackInfoBuilder &track_info, const bool &isWeightedJet, const float &drminpfcandsv, const float &jetR, const float &puppiw, ChargedCandidateFeatures &c_pf_features, const bool flip=false, const float &distminpfcandsv=0)
Analysis-level calorimeter jet class.
Definition: Jet.h:77
float hcalFraction() const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
void recoCandidateToFeatures(const reco::PFCandidate *c_pf, const reco::Jet &jet, const TrackInfoBuilder &track_info, const bool isWeightedJet, 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, const float distminpfcandsv=0)