Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PFCandidate.hh
Go to the documentation of this file.
1 #ifndef ICHiggsTauTau_PFCandidate_hh
2 #define ICHiggsTauTau_PFCandidate_hh
3 #include <vector>
4 #include "Math/Point3D.h"
5 #include "Math/Point3Dfwd.h"
6 #include "../interface/Candidate.hh"
7 #include "Rtypes.h"
8 
9 namespace ic {
10 
11 #if !defined(__GCCXML__) && !defined(__CINT__)
12 enum PFType { X, h, e, mu, gamma, h0, h_HF, egamma_HF };
13 enum PFFlag {
14  NORMAL = 0,
31 };
32 #endif
33 
37 class PFCandidate : public Candidate {
38  private:
39  // typedef ROOT::Math::XYZPoint Point;
40 
41  public:
42  PFCandidate();
43  virtual ~PFCandidate();
44  virtual void Print() const;
45 
47 
49  inline int pdgid() const { return pdgid_; }
51 
53  inline unsigned flags() const { return flags_; }
54 
56  inline std::vector<std::size_t> const& constituent_tracks() const {
57  return constituent_tracks_;
58  }
59 
61  inline std::vector<std::size_t> const& constituent_gsf_tracks() const {
62  return constituent_gsf_tracks_;
63  }
64 
65 #if !defined(__GCCXML__) && !defined(__CINT__)
66  inline PFType type() const {
70  switch (std::abs(pdgid())) {
71  case 211:
72  return PFType::h;
73  case 11:
74  return PFType::e;
75  case 13:
76  return PFType::mu;
77  case 22:
78  return PFType::gamma;
79  case 130:
80  return PFType::h0;
81  case 1:
82  return PFType::h_HF;
83  case 2:
84  return PFType::egamma_HF;
85  case 0:
86  return PFType::X;
87  default:
88  return PFType::X;
89  }
90  }
91 
92  inline bool has_flag(PFFlag const& f) const { return (flags_ >> f) & 1; }
93 #endif
94 
96 
98  inline void set_pdgid(int const& pdgid) { pdgid_ = pdgid; }
100 
102  inline void set_flags(unsigned const& flags) { flags_ = flags; }
103 
106  std::vector<std::size_t> const& constituent_tracks) {
107  constituent_tracks_ = constituent_tracks;
108  }
109 
111  std::vector<std::size_t> const& constituent_gsf_tracks) {
112  constituent_gsf_tracks_ = constituent_gsf_tracks;
113  }
116  private:
117  int pdgid_;
118  std::vector<std::size_t> constituent_tracks_;
119  std::vector<std::size_t> constituent_gsf_tracks_;
120  unsigned flags_;
121 
122 
123  #ifndef SKIP_CINT_DICT
124  public:
125  ClassDef(PFCandidate, 3);
126  #endif
127 };
128 
129 typedef std::vector<ic::PFCandidate> PFCandidateCollection;
130 }
132 #endif
std::vector< std::size_t > const & constituent_gsf_tracks() const
A vector to refer to the constituent gsf track ic::Track::id() values.
Definition: PFCandidate.hh:61
unsigned flags() const
PF flags.
Definition: PFCandidate.hh:53
virtual void Print() const
Definition: PFCandidate.cc:9
void set_constituent_gsf_tracks(std::vector< std::size_t > const &constituent_gsf_tracks)
Definition: PFCandidate.hh:110
Stores a four-momentum, charge and identifier, and is the base class for most other physics objects...
Definition: Candidate.hh:13
Stores the basic properties of PFCandidates (and PackedCandidates for CMSSW 7_X_Y) ...
Definition: PFCandidate.hh:37
int pdgid() const
PDG number to identify the PF candidate type.
Definition: PFCandidate.hh:50
Definition: CaloJet.hh:9
std::vector< std::size_t > const & constituent_tracks() const
A vector to refer to the constituent track ic::Track::id() values.
Definition: PFCandidate.hh:56
void set_constituent_tracks(std::vector< std::size_t > const &constituent_tracks)
A vector to refer to the constituent track ic::Track::id() values.
Definition: PFCandidate.hh:105
PFType
Definition: PFCandidate.hh:12
std::vector< ic::PFCandidate > PFCandidateCollection
Definition: PFCandidate.hh:129
void set_pdgid(int const &pdgid)
PDG number to identify the PF candidate type.
Definition: PFCandidate.hh:99
PFFlag
Definition: PFCandidate.hh:13
PFType type() const
Converts the pdgid into the enumerated PFType Follows the convention of: DataFormats/ParticleFlowCand...
Definition: PFCandidate.hh:69
ClassDef(PFCandidate, 3)
void set_flags(unsigned const &flags)
PF flags.
Definition: PFCandidate.hh:102
virtual ~PFCandidate()
Definition: PFCandidate.cc:7
bool has_flag(PFFlag const &f) const
Definition: PFCandidate.hh:92