Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PFCand_NoPU_WithAM_h
0002 #define PFCand_NoPU_WithAM_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    PFCand_NoPU_WithAM
0007 // Class:      PFCand_NoPU_WithAM
0008 //
0009 /**\class PF_PU_AssoMap PFCand_NoPU_WithAM.cc CommonTools/RecoUtils/plugins/PFCand_NoPU_WithAM.cc
0010 
0011  Description: Produces a collection of PFCandidates associated to the first vertex based on the association map
0012 
0013 */
0014 //
0015 // Original Author:  Matthias Geisler,32 4-B20,+41227676487,
0016 //         Created:  Thu Dec  1 16:07:41 CET 2011
0017 // $Id: PFCand_NoPU_WithAM.h,v 1.2 2012/04/18 15:09:23 mgeisler Exp $
0018 //
0019 //
0020 #include <string>
0021 
0022 #include "FWCore/Framework/interface/Frameworkfwd.h"
0023 #include "FWCore/Framework/interface/global/EDProducer.h"
0024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0025 #include "FWCore/Utilities/interface/InputTag.h"
0026 
0027 #include "DataFormats/Common/interface/AssociationMap.h"
0028 #include "DataFormats/Common/interface/Handle.h"
0029 #include "DataFormats/Common/interface/OneToManyWithQuality.h"
0030 #include "DataFormats/Common/interface/OneToManyWithQualityGeneric.h"
0031 
0032 #include "DataFormats/VertexReco/interface/Vertex.h"
0033 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0034 
0035 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0036 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0037 
0038 //
0039 // constants, enums and typedefs
0040 //
0041 typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::VertexCollection, reco::PFCandidateCollection, int> >
0042     PFCandToVertexAssMap;
0043 typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::PFCandidateCollection, reco::VertexCollection, int> >
0044     VertexToPFCandAssMap;
0045 
0046 typedef std::pair<reco::PFCandidateRef, int> PFCandQualityPair;
0047 typedef std::vector<PFCandQualityPair> PFCandQualityPairVector;
0048 
0049 //
0050 // class declaration
0051 //
0052 
0053 class PFCand_NoPU_WithAM : public edm::global::EDProducer<> {
0054 public:
0055   explicit PFCand_NoPU_WithAM(const edm::ParameterSet&);
0056 
0057   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0058 
0059 private:
0060   void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0061 
0062   // ----------member data ---------------------------
0063 
0064   edm::InputTag input_AssociationType_;
0065 
0066   edm::EDGetTokenT<PFCandToVertexAssMap> token_PFCandToVertexAssMap_;
0067   edm::EDGetTokenT<VertexToPFCandAssMap> token_VertexToPFCandAssMap_;
0068 
0069   edm::EDGetTokenT<reco::VertexCollection> token_VertexCollection_;
0070 
0071   int input_MinQuality_;
0072 };
0073 
0074 #endif