File indexing completed on 2023-03-17 11:16:34
0001 #ifndef PhysicsTools_PatUtils_interface_VertexAssociationSelector_h
0002 #define PhysicsTools_PatUtils_interface_VertexAssociationSelector_h
0003
0004 #include "DataFormats/VertexReco/interface/Vertex.h"
0005 #include "DataFormats/Candidate/interface/Candidate.h"
0006 #include "DataFormats/PatCandidates/interface/Vertexing.h"
0007
0008 namespace pat {
0009 class VertexAssociationSelector {
0010 public:
0011
0012
0013
0014 struct Config {
0015 Config() : dZ(0), dR(0), sigmasZ(0), sigmasR(0) {}
0016
0017 float dZ, dR, sigmasZ, sigmasR;
0018 };
0019 #if 0
0020
0021 class SelectCandidates {
0022 public:
0023 SelectCandidates(const VertexAssociationSelector &asso, const reco::Vertex &vtx) : vtx_(vtx), asso_(asso) { }
0024 bool operator()(const reco::Candidate &c) const { return asso_(c, vtx_); }
0025 private:
0026 const reco::Vertex & vtx_;
0027 const VertexAssociationSelector & asso_;
0028 };
0029
0030 class SelectVertices {
0031 public:
0032 SelectVertices(const VertexAssociationSelector &asso, const reco::Candidate &cand) : cand_(cand), asso_(asso) { }
0033 bool operator()(const reco::Vertex &vtx) const { return asso_(cand_, vtx); }
0034 private:
0035 const reco::Candidate & cand_;
0036 const VertexAssociationSelector & asso_;
0037 };
0038 #endif
0039
0040
0041 VertexAssociationSelector() {}
0042
0043 VertexAssociationSelector(const Config &conf);
0044
0045
0046 bool operator()(const pat::VertexAssociation &vass) const;
0047
0048
0049
0050
0051 bool operator()(const reco::Candidate &c, const reco::Vertex &) const;
0052
0053 pat::VertexAssociation simpleAssociation(const reco::Candidate &c, const reco::VertexRef &vtx) const;
0054 #if 0
0055
0056 SelectCandidates selectCandidates(const reco::Vertex & vtx ) const { return SelectCandidates(*this, vtx ); }
0057
0058
0059 SelectVertices selectVertices( const reco::Candidate & cand) const { return SelectVertices( *this, cand ); }
0060 #endif
0061 private:
0062 Config conf_;
0063
0064 };
0065 }
0066
0067 #endif