CMS 3D CMS Logo

PuppiCandidate.h
Go to the documentation of this file.
1 #ifndef CommonTools_PileupAlgos_PuppiCandidate
2 #define CommonTools_PileupAlgos_PuppiCandidate
3 
4 #include "fastjet/PseudoJet.hh"
5 
6 // Extension of fastjet::PseudoJet that caches eta and some other info
7 // Puppi uses register to decide between NHs, PV CHs, and PU CHs.
8 class PuppiCandidate : public fastjet::PseudoJet {
9 public:
10  using fastjet::PseudoJet::PseudoJet;
11  double pseudorapidity() const {
13  return _eta;
14  }
15  double eta() const { return pseudorapidity(); }
16  void _ensure_valid_eta() const {
17  if (_eta == fastjet::pseudojet_invalid_rap)
18  _eta = fastjet::PseudoJet::pseudorapidity();
19  }
21  inline int puppi_register() const { return _puppi_register; }
22 
23 private:
24  // variable names in fastjet style
25  mutable double _eta = fastjet::pseudojet_invalid_rap;
27 };
28 
29 #endif
PuppiCandidate::pseudorapidity
double pseudorapidity() const
Definition: PuppiCandidate.h:11
PuppiCandidate::eta
double eta() const
Definition: PuppiCandidate.h:15
PuppiCandidate
Definition: PuppiCandidate.h:8
PuppiCandidate::_puppi_register
int _puppi_register
Definition: PuppiCandidate.h:26
PuppiCandidate::set_info
void set_info(int puppi_register)
Definition: PuppiCandidate.h:20
PuppiCandidate::puppi_register
int puppi_register() const
Definition: PuppiCandidate.h:21
PuppiCandidate::_eta
double _eta
Definition: PuppiCandidate.h:25
PuppiCandidate::_ensure_valid_eta
void _ensure_valid_eta() const
Definition: PuppiCandidate.h:16