9 const double dR2Min = 0.01 * 0.01;
17 if (pfCandidate->charge() != 0) {
20 pfCandToVertexAssociation != pfCandToVertexAssociations.
end();
21 ++pfCandToVertexAssociation) {
24 for (noPuUtils::CandQualityPairVector::const_iterator pfCandidate_vertex = pfCandidates_vertex.begin();
25 pfCandidate_vertex != pfCandidates_vertex.end();
26 ++pfCandidate_vertex) {
30 if (pfCandidate != pfcVtx)
34 double z = pfCandToVertexAssociation->key->position().z();
35 int quality = pfCandidate_vertex->second;
41 return vtxAssociationType;
49 pfCandToVertexAssociation != pfCandToVertexAssociations.
end();
50 ++pfCandToVertexAssociation) {
54 for (noPuUtils::CandQualityPairVector::const_iterator pfCandidate_vertex = pfCandidates_vertex.begin();
55 pfCandidate_vertex != pfCandidates_vertex.end();
56 ++pfCandidate_vertex) {
57 revPfCandToVtxAssoc.
insert(pfCandidate_vertex->first, std::make_pair(vertex, pfCandidate_vertex->second));
61 return revPfCandToVtxAssoc;
72 if (pfCandidate->charge() != 0) {
77 pfCandToVertexAssociations.
find(pfCandidate);
78 if (itPfcToVtxAss != pfCandToVertexAssociations.
end()) {
79 pfCandAssocVtxs = &itPfcToVtxAss->
val;
82 pfcToVtxAssoc != pfCandToVertexAssociations.
end();
85 pfCandAssocVtxs = &pfcToVtxAssoc->val;
90 if (pfCandAssocVtxs !=
nullptr) {
91 for (noPuUtils::VertexQualityPairVector::const_iterator pfcAssVtx = pfCandAssocVtxs->begin();
92 pfcAssVtx != pfCandAssocVtxs->end();
94 double z = pfcAssVtx->first->position().z();
95 int quality = pfcAssVtx->second;
101 return vtxAssociationType;
108 int& vtxAssociationType,
111 for (reco::VertexCollection::const_iterator vertex = vertices.begin(); vertex != vertices.end(); ++vertex) {
112 if (
std::abs(z - vertex->position().z()) < dZ) {
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
const_iterator end() const
last iterator over the map (read only)
const_iterator find(const key_type &k) const
find element with specified reference key
std::vector< Vertex > VertexCollection
collection of Vertex objects
noPuUtils::reversedPFCandToVertexAssMap reversePFCandToVertexAssociation(const PFCandToVertexAssMap &)
key_type key() const
Accessor for product key.
Abs< T >::type abs(const T &t)
std::vector< std::pair< reco::PFCandidateRef, int > > CandQualityPairVector
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
int isVertexAssociated(const reco::PFCandidatePtr &, const PFCandToVertexAssMap &, const reco::VertexCollection &, double)
void promoteAssocToHSAssoc(int quality, double z, const reco::VertexCollection &vertices, double dZ, int &vtxAssociationType, bool checkdR2)
void insert(const key_type &k, const data_type &v)
insert an association
std::vector< std::pair< reco::VertexRef, int > > VertexQualityPairVector
int isVertexAssociated_fast(const reco::PFCandidateRef &, const noPuUtils::reversedPFCandToVertexAssMap &, const reco::VertexCollection &, double, int &, int)
const_iterator begin() const
first iterator over the map (read only)