Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:47

0001 #ifndef RecoMET_METPUSubtraction_noPileUpMEtAuxFunctions_h
0002 #define RecoMET_METPUSubtraction_noPileUpMEtAuxFunctions_h
0003 
0004 #include "DataFormats/Common/interface/AssociationMap.h"
0005 #include "DataFormats/Common/interface/OneToManyWithQuality.h"
0006 #include "DataFormats/Common/interface/Ref.h"
0007 
0008 #include "DataFormats/Candidate/interface/Candidate.h"
0009 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0010 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0011 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0012 #include "DataFormats/VertexReco/interface/Vertex.h"
0013 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0014 
0015 #include "CommonTools/RecoUtils/interface/PFCand_AssoMapAlgos.h"
0016 
0017 // 0 = neutral particle,
0018 // 1 = charged particle not associated to any vertex
0019 // 2 = charged particle associated to pile-up vertex
0020 // 3 = charged particle associated to vertex of hard-scatter event
0021 namespace noPuUtils {
0022   enum { kNeutral = 0, kChNoAssoc, kChPUAssoc, kChHSAssoc };
0023 
0024   typedef std::vector<std::pair<reco::PFCandidateRef, int> > CandQualityPairVector;
0025   typedef std::vector<std::pair<reco::VertexRef, int> > VertexQualityPairVector;
0026 
0027   typedef edm::AssociationMap<edm::OneToManyWithQuality<reco::PFCandidateCollection, reco::VertexCollection, int> >
0028       reversedPFCandToVertexAssMap;
0029 
0030   // check if the pf candidate is associated with a vertex,
0031   // return the type of association
0032   int isVertexAssociated(const reco::PFCandidatePtr&,
0033                          const PFCandToVertexAssMap&,
0034                          const reco::VertexCollection&,
0035                          double);
0036 
0037   // reverse the vertex-pfcandidate association map
0038   noPuUtils::reversedPFCandToVertexAssMap reversePFCandToVertexAssociation(const PFCandToVertexAssMap&);
0039 
0040   // check if the pf candidate is associated with a vertex,
0041   // based over references keys
0042   // return the type of association
0043   int isVertexAssociated_fast(const reco::PFCandidateRef&,
0044                               const noPuUtils::reversedPFCandToVertexAssMap&,
0045                               const reco::VertexCollection&,
0046                               double,
0047                               int&,
0048                               int);
0049 
0050   //promote a low quality association to a better level
0051   // if dz justifies it
0052   void promoteAssocToHSAssoc(
0053       int quality, double z, const reco::VertexCollection& vertices, double dZ, int& vtxAssociationType, bool checkdR2);
0054 
0055 }  // namespace noPuUtils
0056 
0057 #endif