-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHS and PUPPI track-vertex-association for Run3 #36639
Changes from 2 commits
01f7cf7
c168e8a
6a1da9f
684c851
38aecdb
e9cca62
692bae3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
from CommonTools.ParticleFlow.pfNoPileUpJME_cff import adapt, pfPileUpJME | ||
from CommonTools.RecoAlgos.sortedPackedPrimaryVertices_cfi import sortedPackedPrimaryVertices | ||
from CommonTools.ParticleFlow.pfNoPileUpJME_cff import primaryVertexAssociationJME | ||
|
||
packedPrimaryVertexAssociationJME = sortedPackedPrimaryVertices.clone( | ||
produceSortedVertices = False, | ||
producePileUpCollection = False, | ||
produceNoPileUpCollection = False | ||
) | ||
adapt(packedPrimaryVertexAssociationJME) | ||
|
||
from CommonTools.ParticleFlow.pfNoPileUpPacked_cfi import pfNoPileUpPacked as _pfNoPileUpPacked | ||
pfCHS = _pfNoPileUpPacked.clone( | ||
vertexAssociationQuality=pfPileUpJME.vertexAssociationQuality | ||
pfCHS = cms.EDFilter("CandPtrSelector", | ||
src = cms.InputTag("packedPFCandidates"), | ||
cut = cms.string("fromPV(0)>0"+\ | ||
" || (vertexRef().key<="+str(primaryVertexAssociationJME.assignment.NumOfPUVtxsForCharged.value())+" && "+\ | ||
"abs(dz(0))<"+str(primaryVertexAssociationJME.assignment.DzCutForChargedFromPUVtxs.value())+")" | ||
) | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ | |
useVertexAssociation = cms.bool(False), | ||
vertexAssociationQuality = cms.int32(0), | ||
vertexAssociation = cms.InputTag(''), | ||
NumOfPUVtxsForCharged = cms.uint32(0), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PFPileup could be a good candidate to add fillDescriptions, what do you think? |
||
DzCutForChargedFromPUVtxs = cms.double(0.2), | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,9 @@ void PFPileUpAlgo::process(const PFCollection& pfCandidates, const reco::VertexC | |
|
||
// no associated vertex, or primary vertex | ||
// not pile-up | ||
if (ivertex == -1 || ivertex == 0) { | ||
if ((ivertex == -1 || ivertex == 0 || | ||
(fNumOfPUVtxsForCharged_ > 0 && !vertices.empty() && ivertex <= int(fNumOfPUVtxsForCharged_) && | ||
std::abs(cand.vertex().z() - vertices.at(0).z()) < fDzCutForChargedFromPUVtxs_))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically for performance reasons the non-throwing |
||
if (verbose_) | ||
std::cout << "VTX " << i << " " << *(pfCandidates[i]) << std::endl; | ||
pfCandidatesFromVtx_.push_back(pfCandidates[i]); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
preferHighRanked = cms.bool(False), | ||
|
||
#options used in PUPPI | ||
NumOfPUVtxsForCharged = cms.int32(-1), | ||
NumOfPUVtxsForCharged = cms.uint32(0), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch on the incorrect parameter type... it looks like |
||
DzCutForChargedFromPUVtxs = cms.double(0.2), | ||
PtMaxCharged = cms.double(-1), | ||
EtaMinUseDz = cms.double(-1), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ std::pair<int, PrimaryVertexAssignment::Quality> PrimaryVertexAssignment::charge | |
if (!vertices.empty()) | ||
firstVertexDz = std::abs(track->dz(vertices.at(0).position())); | ||
// recover cases where the primary vertex is split | ||
if (useVertexFit_ && (iVertex > 0) && (iVertex <= fNumOfPUVtxsForCharged_) && | ||
if (useVertexFit_ && (iVertex > 0) && (iVertex <= int(fNumOfPUVtxsForCharged_)) && | ||
firstVertexDz < fDzCutForChargedFromPUVtxs_) | ||
return {0, PrimaryVertexAssignment::PrimaryDz}; | ||
|
||
|
@@ -121,14 +121,12 @@ std::pair<int, PrimaryVertexAssignment::Quality> PrimaryVertexAssignment::charge | |
(!useTime or dtmin / timeReso < maxDtSigForPrimaryAssignment_)) | ||
iVertex = vtxIdMinSignif; | ||
} else { | ||
// consider only distances to first vertex for association of pileup vertices (originally used in PUPPI) | ||
if ((vtxIdMinSignif >= 0) && (std::abs(track->eta()) > fEtaMinUseDz_)) | ||
iVertex = | ||
((firstVertexDz < maxDzForPrimaryAssignment_ and firstVertexDz / dzE < maxDzSigForPrimaryAssignment_ and | ||
track->dzError() < maxDzErrorForPrimaryAssignment_) and | ||
(!useTime or std::abs(time - vertices.at(0).t()) / timeReso < maxDtSigForPrimaryAssignment_)) | ||
? 0 | ||
: vtxIdMinSignif; | ||
// consider only distances to first vertex for association (originally used in PUPPI) | ||
if ((vtxIdMinSignif >= 0) && (std::abs(track->eta()) > fEtaMinUseDz_) and | ||
((firstVertexDz < maxDzForPrimaryAssignment_ and firstVertexDz / dzE < maxDzSigForPrimaryAssignment_ and | ||
track->dzError() < maxDzErrorForPrimaryAssignment_) and | ||
(!useTime or std::abs(time - vertices.at(0).t()) / timeReso < maxDtSigForPrimaryAssignment_))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment here about |
||
iVertex = 0; | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a format string can be considered: