CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/CommonTools/RecoUtils/interface/PFCand_AssoMapAlgos.h

Go to the documentation of this file.
00001 #ifndef PFCand_AssoMapAlgos_h
00002 #define PFCand_AssoMapAlgos_h
00003 
00004 
00009 //
00010 // Original Author:  Matthias Geisler,32 4-B20,+41227676487,
00011 // $Id: PFCand_AssoMapAlgos.h,v 1.1 2012/11/21 09:46:43 mgeisler Exp $
00012 //
00013 //
00014 #include "CommonTools/RecoUtils/interface/PF_PU_AssoMapAlgos.h"
00015 
00016 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00017 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
00018 
00019 //
00020 // constants, enums and typedefs
00021 //
00022 
00023 typedef edm::AssociationMap<edm::OneToManyWithQuality< reco::VertexCollection, reco::PFCandidateCollection, int> > PFCandToVertexAssMap;
00024 typedef edm::AssociationMap<edm::OneToManyWithQuality< reco::PFCandidateCollection, reco::VertexCollection, int> > VertexToPFCandAssMap;
00025 
00026 typedef std::pair<reco::PFCandidateRef, int> PFCandQualityPair;
00027 typedef std::vector<PFCandQualityPair > PFCandQualityPairVector;
00028 
00029 typedef std::pair<reco::VertexRef, PFCandQualityPair> VertexPfcQuality;
00030 
00031 typedef std::pair <reco::VertexRef, float>  VertexPtsumPair;
00032 typedef std::vector< VertexPtsumPair > VertexPtsumVector;
00033 
00034 class PFCand_AssoMapAlgos : public PF_PU_AssoMapAlgos  {
00035 
00036  public:
00037 
00038    //dedicated constructor for the algorithms
00039    PFCand_AssoMapAlgos(const edm::ParameterSet&); 
00040 
00041    //get all needed collections at the beginning
00042    void GetInputCollections(edm::Event&, const edm::EventSetup&);
00043 
00044    //create the pf candidate to vertex association map
00045    std::auto_ptr<PFCandToVertexAssMap> CreatePFCandToVertexMap(edm::Handle<reco::PFCandidateCollection>, const edm::EventSetup&);
00046 
00047    //create the vertex to pf candidate association map
00048    std::auto_ptr<VertexToPFCandAssMap> CreateVertexToPFCandMap(edm::Handle<reco::PFCandidateCollection>, const edm::EventSetup&);
00049 
00050    //function to sort the vertices in the AssociationMap by the sum of (pT - pT_Error)**2
00051    std::auto_ptr<PFCandToVertexAssMap> SortPFCandAssociationMap(PFCandToVertexAssMap*); 
00052 
00053  protected:
00054   //protected functions 
00055 
00056  private: 
00057   //private functions
00058 
00059    int input_MaxNumAssociations_;
00060 
00061    edm::InputTag input_VertexCollection_;
00062    edm::Handle<reco::VertexCollection> vtxcollH;
00063 
00064    edm::InputTag input_BeamSpot_;
00065    edm::Handle<reco::BeamSpot> beamspotH;
00066 
00067    edm::ESHandle<MagneticField> bFieldH;
00068 
00069 };
00070 
00071 #endif