Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:04

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     /// Structure to pack config for the constructor.
0012     /// Note that even if no cuts are selected (all values set to 0),
0013     /// this will still return 'false' for a null pat::VertexAssociation
0014     struct Config {
0015       Config() : dZ(0), dR(0), sigmasZ(0), sigmasR(0) {}  //, sigmas3d(0) {}
0016       /// cuts on Z and transverse distance from the vertex, absolute values or significances
0017       float dZ, dR, sigmasZ, sigmasR;  //, sigmas3d;
0018     };
0019 #if 0            
0020             /// Candidate selector made by a VertexAssociationSelector and a single vertex
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             /// Vertex selector made by a VertexAssociationSelector and a single candidate
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     /// an empty constructor is sometimes needed
0041     VertexAssociationSelector() {}
0042     /// constructor from a configuration
0043     VertexAssociationSelector(const Config &conf);
0044 
0045     /// check if this VertexAssociation is ok
0046     bool operator()(const pat::VertexAssociation &vass) const;
0047 
0048     /// check if this candidate and this vertex are compatible
0049     /// this will just use the basic candidate vertex position,
0050     /// without any fancy track extrapolation.
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             /// Make a Candidate selector from this association selector and a vertex
0056             SelectCandidates selectCandidates(const reco::Vertex    & vtx ) const { return SelectCandidates(*this, vtx  ); }
0057 
0058             /// Make a Vertex selector from this association selector and a candidate
0059             SelectVertices   selectVertices(  const reco::Candidate & cand) const { return SelectVertices(  *this, cand ); }
0060 #endif
0061   private:
0062     Config conf_;
0063 
0064   };  // class
0065 }  // namespace pat
0066 
0067 #endif