Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:11

0001 #ifndef PF_PU_FirstVertexTracks_h
0002 #define PF_PU_FirstVertexTracks_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    PF_PU_AssoMap
0007 // Class:      PF_PU_FirstVertexTracks
0008 //
0009 /**\class PF_PU_AssoMap PF_PU_FirstVertexTracks.cc CommonTools/RecoUtils/plugins/PF_PU_FirstVertexTracks.cc
0010 
0011   Description: Produces collection of tracks associated to the first vertex based on the pf_pu Association Map
0012 */
0013 //
0014 
0015 // Original Author:  Matthias Geisler
0016 //         Created:  Wed Apr 18 14:48:37 CEST 2012
0017 //
0018 //
0019 
0020 // system include files
0021 #include <memory>
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/global/EDProducer.h"
0026 
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/Run.h"
0029 #include "FWCore/Framework/interface/MakerMacros.h"
0030 
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032 
0033 #include "DataFormats/Common/interface/AssociationMap.h"
0034 #include "DataFormats/Common/interface/OneToManyWithQuality.h"
0035 #include "DataFormats/TrackReco/interface/Track.h"
0036 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0037 #include "DataFormats/VertexReco/interface/Vertex.h"
0038 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0039 
0040 typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::VertexCollection, reco::TrackCollection, int> >
0041     TrackToVertexAssMap;
0042 typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::TrackCollection, reco::VertexCollection, int> >
0043     VertexToTrackAssMap;
0044 
0045 //
0046 // class declaration
0047 //
0048 
0049 class PF_PU_FirstVertexTracks : public edm::global::EDProducer<> {
0050 public:
0051   explicit PF_PU_FirstVertexTracks(const edm::ParameterSet&);
0052 
0053   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0054 
0055 private:
0056   void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0057   bool trackMatch(const reco::Track&, const reco::Track&) const;
0058 
0059   // ----------member data ---------------------------
0060 
0061   edm::InputTag input_AssociationType_;
0062 
0063   edm::EDGetTokenT<TrackToVertexAssMap> token_TrackToVertexAssMap_;
0064   edm::EDGetTokenT<VertexToTrackAssMap> token_VertexToTrackAssMap_;
0065   edm::EDGetTokenT<reco::TrackCollection> token_generalTracksCollection_;
0066   edm::EDGetTokenT<reco::VertexCollection> token_VertexCollection_;
0067 
0068   int input_MinQuality_;
0069 };
0070 
0071 #endif