File indexing completed on 2024-09-07 04:37:54
0001 #ifndef RecoTauTag_RecoTau_RecoTauVertexAssociator_h
0002 #define RecoTauTag_RecoTau_RecoTauVertexAssociator_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "FWCore/Framework/interface/ConsumesCollector.h"
0021 #include "FWCore/Framework/interface/EDConsumerBase.h"
0022 #include "FWCore/Utilities/interface/InputTag.h"
0023 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0024 #include "DataFormats/Common/interface/Handle.h"
0025 #include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h"
0026
0027 #include "DataFormats/Common/interface/AssociationMap.h"
0028 #include "DataFormats/JetReco/interface/JetCollection.h"
0029
0030 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0031
0032 #include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
0033
0034 #include <map>
0035
0036
0037 namespace edm {
0038 class ParameterSet;
0039 class Event;
0040 }
0041
0042 namespace reco {
0043 class PFTau;
0044 class Jet;
0045 }
0046
0047 namespace reco {
0048 namespace tau {
0049
0050 class RecoTauVertexAssociator {
0051 public:
0052 enum Algorithm { kHighestPtInEvent, kClosestDeltaZ, kHighestWeigtForLeadTrack, kCombined };
0053
0054 RecoTauVertexAssociator(const edm::ParameterSet& pset, edm::ConsumesCollector&& iC);
0055 virtual ~RecoTauVertexAssociator() {}
0056
0057
0058 reco::VertexRef associatedVertex(const Jet& jet) const;
0059
0060
0061
0062 reco::VertexRef associatedVertex(const PFTau& tau, bool useJet = false) const;
0063 reco::VertexRef associatedVertex(const TrackBaseRef& track) const;
0064 reco::VertexRef associatedVertex(const Track* track) const;
0065
0066
0067 void setEvent(const edm::Event& evt);
0068 const Track* getLeadTrack(const Jet&) const;
0069 const TrackBaseRef getLeadTrackRef(const Jet&) const;
0070 const CandidatePtr getLeadCand(const Jet&) const;
0071
0072 private:
0073 edm::InputTag vertexTag_;
0074 bool vxTrkFiltering_;
0075 std::unique_ptr<StringCutObjectSelector<reco::Vertex>> vertexSelector_;
0076 std::vector<reco::VertexRef> selectedVertices_;
0077 std::string algorithm_;
0078 Algorithm algo_;
0079
0080 std::unique_ptr<RecoTauQualityCuts> qcuts_;
0081 bool recoverLeadingTrk_;
0082 enum { kLeadTrack, kLeadPFCand, kMinLeadTrackOrPFCand, kFirstTrack };
0083 int leadingTrkOrPFCandOption_;
0084 edm::EDGetTokenT<reco::VertexCollection> vxToken_;
0085
0086 typedef std::map<const reco::Jet*, reco::VertexRef> JetToVtxAssoc;
0087 std::unique_ptr<JetToVtxAssoc> jetToVertexAssociation_;
0088 edm::EventNumber_t lastEvent_;
0089 int verbosity_;
0090 };
0091
0092 }
0093 }
0094
0095 #endif