CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BPHRecoSelect.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHRecoSelect_h
2 #define HeavyFlavorAnalysis_RecoDecay_BPHRecoSelect_h
3 
12 //----------------------
13 // Base Class Headers --
14 //----------------------
15 
16 //------------------------------------
17 // Collaborating Class Declarations --
18 //------------------------------------
20 
21 namespace reco {
22  class Candidate;
23 }
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 #include <string>
29 #include <map>
30 
31 // ---------------------
32 // -- Class Interface --
33 // ---------------------
34 
36 public:
40 
41  // deleted copy constructor and assignment operator
42  BPHRecoSelect(const BPHRecoSelect& x) = delete;
43  BPHRecoSelect& operator=(const BPHRecoSelect& x) = delete;
44 
47  virtual ~BPHRecoSelect() {}
48 
50 
53  virtual bool accept(const reco::Candidate& cand) const = 0;
58  virtual bool accept(const reco::Candidate& cand, const BPHRecoBuilder* build) const { return accept(cand); }
59 
60 protected:
61  // function to get other particles pointers
62  const reco::Candidate* get(const std::string& name, const BPHRecoBuilder* build) const {
63  if (build == nullptr)
64  return nullptr;
65  std::map<std::string, const reco::Candidate*>& cMap = build->daugMap;
66  std::map<std::string, const reco::Candidate*>::iterator iter = cMap.find(name);
67  return (iter != cMap.end() ? iter->second : nullptr);
68  }
69 };
70 
71 #endif
virtual bool accept(const reco::Candidate &cand, const BPHRecoBuilder *build) const
Definition: BPHRecoSelect.h:58
virtual bool accept(const reco::Candidate &cand) const =0
virtual ~BPHRecoSelect()
Definition: BPHRecoSelect.h:47
BPHRecoSelect & operator=(const BPHRecoSelect &x)=delete