File indexing completed on 2021-02-14 12:49:20
0001 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHRecoSelect_h
0002 #define HeavyFlavorAnalysis_RecoDecay_BPHRecoSelect_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoBuilder.h"
0020
0021 namespace reco {
0022 class Candidate;
0023 }
0024
0025
0026
0027
0028 #include <string>
0029 #include <map>
0030
0031
0032
0033
0034
0035 class BPHRecoSelect {
0036 public:
0037
0038
0039 BPHRecoSelect() {}
0040
0041
0042 BPHRecoSelect(const BPHRecoSelect& x) = delete;
0043 BPHRecoSelect& operator=(const BPHRecoSelect& x) = delete;
0044
0045
0046
0047 virtual ~BPHRecoSelect() {}
0048
0049 using AcceptArg = reco::Candidate;
0050
0051
0052
0053
0054
0055
0056
0057 virtual bool accept(const reco::Candidate& cand) const = 0;
0058 virtual bool accept(const reco::Candidate& cand, const BPHRecoBuilder* build) const { return accept(cand); }
0059
0060 protected:
0061
0062 const reco::Candidate* get(const std::string& name, const BPHRecoBuilder* build) const {
0063 if (build == nullptr)
0064 return nullptr;
0065 std::map<std::string, const reco::Candidate*>& cMap = build->daugMap;
0066 std::map<std::string, const reco::Candidate*>::iterator iter = cMap.find(name);
0067 return (iter != cMap.end() ? iter->second : nullptr);
0068 }
0069 };
0070
0071 #endif