File indexing completed on 2024-04-06 12:01:11
0001 #ifndef PFCand_AssoMapAlgos_h
0002 #define PFCand_AssoMapAlgos_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "FWCore/Framework/interface/ConsumesCollector.h"
0014
0015 #include "CommonTools/RecoUtils/interface/PF_PU_AssoMapAlgos.h"
0016
0017 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0018 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0019 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0020
0021 namespace edm {
0022 class EDProductGetter;
0023 }
0024
0025
0026
0027
0028
0029 typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::VertexCollection, reco::PFCandidateCollection, int>>
0030 PFCandToVertexAssMap;
0031 typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::PFCandidateCollection, reco::VertexCollection, int>>
0032 VertexToPFCandAssMap;
0033
0034 typedef std::pair<reco::PFCandidateRef, int> PFCandQualityPair;
0035 typedef std::vector<PFCandQualityPair> PFCandQualityPairVector;
0036
0037 typedef std::pair<reco::VertexRef, PFCandQualityPair> VertexPfcQuality;
0038
0039 typedef std::pair<reco::VertexRef, float> VertexPtsumPair;
0040 typedef std::vector<VertexPtsumPair> VertexPtsumVector;
0041
0042 class PFCand_AssoMapAlgos : public PF_PU_AssoMapAlgos {
0043 public:
0044
0045 PFCand_AssoMapAlgos(const edm::ParameterSet&, edm::ConsumesCollector&&);
0046
0047
0048 void GetInputCollections(edm::Event&, const edm::EventSetup&) override;
0049
0050
0051 std::pair<std::unique_ptr<PFCandToVertexAssMap>, std::unique_ptr<VertexToPFCandAssMap>> createMappings(
0052 edm::Handle<reco::PFCandidateCollection> pfCandH);
0053
0054
0055 std::unique_ptr<PFCandToVertexAssMap> CreatePFCandToVertexMap(edm::Handle<reco::PFCandidateCollection>);
0056
0057
0058 std::unique_ptr<VertexToPFCandAssMap> CreateVertexToPFCandMap(edm::Handle<reco::PFCandidateCollection>);
0059
0060
0061 std::unique_ptr<PFCandToVertexAssMap> SortPFCandAssociationMap(PFCandToVertexAssMap*,
0062 edm::EDProductGetter const* getter);
0063
0064 protected:
0065
0066
0067 private:
0068
0069
0070 int input_MaxNumAssociations_;
0071
0072 edm::EDGetTokenT<reco::VertexCollection> token_VertexCollection_;
0073 edm::Handle<reco::VertexCollection> vtxcollH;
0074
0075 edm::EDGetTokenT<reco::BeamSpot> token_BeamSpot_;
0076 edm::Handle<reco::BeamSpot> beamspotH;
0077
0078 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> token_bField_;
0079 edm::ESHandle<MagneticField> bFieldH;
0080 const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> token_TrackingGeometry_;
0081 edm::ESHandle<GlobalTrackingGeometry> trackingGeometryH;
0082 };
0083
0084 #endif