CMS 3D CMS Logo

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