Skip to content

Commit

Permalink
Add a default PrimaryVertexProducer config including all possible opt…
Browse files Browse the repository at this point in the history
…ions with ifValue

Address Slava's comments on vertexCollections definition
Add in fillDescription TkClusParameters conditional definition, xor for TkFilterParameters, do not build dynamically cfi but just use AddDefaults
  • Loading branch information
fabiocos committed Feb 15, 2024
1 parent 5f2258f commit 8eea085
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 96 deletions.
55 changes: 5 additions & 50 deletions RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,9 @@
TkClusParameters = DA2D_vectParameters,
TrackTimesLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModel"),
TrackTimeResosLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModelResolution"),
vertexCollections = cms.VPSet(
cms.PSet(
algorithm = cms.string('AdaptiveVertexFitter'),
chi2cutoff = cms.double(2.5),
label = cms.string(''),
maxDistanceToBeam = cms.double(1.0),
minNdof = cms.double(0.0),
useBeamConstraint = cms.bool(False),
vertexTimeParameters = cms.PSet(
algorithm = cms.string('legacy4D')
)
),
cms.PSet(
algorithm = cms.string('AdaptiveVertexFitter'),
chi2cutoff = cms.double(2.5),
label = cms.string('WithBS'),
maxDistanceToBeam = cms.double(1.0),
minNdof = cms.double(2.0),
useBeamConstraint = cms.bool(True),
vertexTimeParameters = cms.PSet(
algorithm = cms.string('legacy4D')
)
)
vertexCollections = {0: dict(vertexTimeParameters = cms.PSet( algorithm = cms.string('legacy4D'))),
1: dict(vertexTimeParameters = cms.PSet( algorithm = cms.string('legacy4D')))}
)
)
trackWithVertexRefSelectorBeforeSorting4D = trackWithVertexRefSelector.clone(
vertexTag = "unsortedOfflinePrimaryVertices4D",
ptMax = 9e99,
Expand Down Expand Up @@ -85,30 +63,7 @@
from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
phase2_timing_layer.toModify(tofPID, vtxsSrc='unsortedOfflinePrimaryVertices4D', vertexReassignment=False)
phase2_timing_layer.toModify(tofPID3D, vertexReassignment=False)
phase2_timing_layer.toModify(unsortedOfflinePrimaryVertices,
vertexCollections = cms.VPSet(
cms.PSet(
algorithm = cms.string('AdaptiveVertexFitter'),
chi2cutoff = cms.double(2.5),
label = cms.string(''),
maxDistanceToBeam = cms.double(1.0),
minNdof = cms.double(0.0),
useBeamConstraint = cms.bool(False),
vertexTimeParameters = cms.PSet(
algorithm = cms.string('fromTracksPID')
)
),
cms.PSet(
algorithm = cms.string('AdaptiveVertexFitter'),
chi2cutoff = cms.double(2.5),
label = cms.string('WithBS'),
maxDistanceToBeam = cms.double(1.0),
minNdof = cms.double(2.0),
useBeamConstraint = cms.bool(True),
vertexTimeParameters = cms.PSet(
algorithm = cms.string('fromTracksPID')
)
)
)
phase2_timing_layer.toModify(unsortedOfflinePrimaryVertices,
vertexCollections = {0: dict(vertexTimeParameters = cms.PSet( algorithm = cms.string('fromTracksPID'))),
1: dict(vertexTimeParameters = cms.PSet( algorithm = cms.string('fromTracksPID')))}
)

30 changes: 19 additions & 11 deletions RecoVertex/PrimaryVertexProducer/plugins/PrimaryVertexProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,12 @@ void PrimaryVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& des
desc.addUntracked<bool>("verbose", false);
{
edm::ParameterSetDescription psd0;
TrackFilterForPVFinding::fillPSetDescription(psd0);
psd0.add<int>("numTracksThreshold", 0); // HI only
psd0.add<int>("maxNumTracksThreshold", 10000000); // HI only
psd0.add<double>("minPtTight", 0.0); // HI only
desc.add<edm::ParameterSetDescription>("TkFilterParameters", psd0);
edm::ParameterSetDescription psd1;
TrackFilterForPVFinding::fillPSetDescription(psd1);
edm::ParameterSetDescription psd2;
HITrackFilterForPVFinding::fillPSetDescription(psd2);
psd0.addNode(edm::ParameterDescription<edm::ParameterSetDescription>("TkFilterParameters", psd1, true) xor
edm::ParameterDescription<edm::ParameterSetDescription>("TkFilterParameters", psd2, true));
}
desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot"));
desc.add<edm::InputTag>("TrackLabel", edm::InputTag("generalTracks"));
Expand All @@ -437,14 +438,21 @@ void PrimaryVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& des
edm::ParameterSetDescription psd0;
{
edm::ParameterSetDescription psd1;
DAClusterizerInZT_vect::fillPSetDescription(psd1);
psd0.add<edm::ParameterSetDescription>("TkDAClusParameters", psd1);
DAClusterizerInZ_vect::fillPSetDescription(psd1);

edm::ParameterSetDescription psd2;
GapClusterizerInZ::fillPSetDescription(psd2);
psd0.add<edm::ParameterSetDescription>("TkGapClusParameters", psd2);
DAClusterizerInZT_vect::fillPSetDescription(psd2);

edm::ParameterSetDescription psd3;
GapClusterizerInZ::fillPSetDescription(psd3);

psd0.ifValue(
edm::ParameterDescription<std::string>("algorithm", "DA_vect", true),
"DA_vect" >> edm::ParameterDescription<edm::ParameterSetDescription>("TkDAClusParameters", psd1, true) or
"DA2D_vect" >>
edm::ParameterDescription<edm::ParameterSetDescription>("TkDAClusParameters", psd2, true) or
"gap" >> edm::ParameterDescription<edm::ParameterSetDescription>("TkGapClusParameters", psd3, true));
}
psd0.add<std::string>("algorithm", "DA_vect");
desc.add<edm::ParameterSetDescription>("TkClusParameters", psd0);
}

Expand All @@ -453,7 +461,7 @@ void PrimaryVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& des
desc.add<bool>("useMVACut", false);
desc.add<double>("minTrackTimeQuality", 0.8);

descriptions.add("primaryVertexProducer", desc);
descriptions.addDefault(desc);
}

//define this as a plug-in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
import RecoVertex.PrimaryVertexProducer.primaryVertexProducer_cfi as _mod
from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices

pixelVertices = _mod.primaryVertexProducer.clone(
pixelVertices = offlinePrimaryVertices.clone(
TrackLabel = "pixelTracks",

TkFilterParameters = dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import FWCore.ParameterSet.Config as cms
import RecoVertex.PrimaryVertexProducer.primaryVertexProducer_cfi as _mod
from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices

offlinePrimaryVerticesFromCosmicTracks = _mod.primaryVertexProducer.clone(
offlinePrimaryVerticesFromCosmicTracks = offlinePrimaryVertices.clone(
TrackLabel = "ctfWithMaterialTracksP5",
beamSpotLabel = "offlineBeamSpot",

TkFilterParameters = dict(
maxNormalizedChi2 = 5.0,
minSiliconLayersWithHits = 7, ## hits > 7
Expand All @@ -15,11 +15,11 @@
minPixelLayersWithHits = 2, ## hits > 2
),

TkClusParameters = dict(
algorithm = "gap",
TkGapClusParameters = dict(
zSeparation = 0.1 ## 1 mm max separation betw. clusters
)
TkClusParameters = cms.PSet(
algorithm = cms.string("gap"),
TkGapClusParameters = cms.PSet(
zSeparation = cms.double(0.1) ## 1 mm max separation betw. clusters
)
),

vertexCollections = cms.VPSet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
verbose = cms.untracked.bool(False),
TrackLabel = cms.InputTag("generalTracks"),
beamSpotLabel = cms.InputTag("offlineBeamSpot"),

TkFilterParameters = cms.PSet(
algorithm=cms.string('filter'),
maxNormalizedChi2 = cms.double(10.0),
minPixelLayersWithHits=cms.int32(2),
minSiliconLayersWithHits = cms.int32(5),
maxD0Significance = cms.double(4.0),
maxD0Error = cms.double(1.0),
maxDzError = cms.double(1.0),
maxD0Significance = cms.double(4.0),
maxD0Error = cms.double(1.0),
maxDzError = cms.double(1.0),
minPt = cms.double(0.0),
maxEta = cms.double(2.4),
trackQuality = cms.string("any")
Expand All @@ -41,11 +41,11 @@
)
]
),

isRecoveryIteration = cms.bool(False),
recoveryVtxCollection = cms.InputTag("")


)

from Configuration.ProcessModifiers.weightedVertexing_cff import weightedVertexing
Expand Down Expand Up @@ -78,8 +78,8 @@


# higher eta cut for the phase 2 tracker
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(offlinePrimaryVertices,
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(offlinePrimaryVertices,
TkFilterParameters = dict(maxEta = 4.0))

from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
Expand All @@ -88,8 +88,8 @@
TkFilterParameters = dict(
algorithm="filterWithThreshold",
maxD0Significance = 2.0,
maxD0Error = 10.0,
maxDzError = 10.0,
maxD0Error = 10.0,
maxDzError = 10.0,
minPixelLayersWithHits=3,
minPt = 0.7,
trackQuality = "highPurity",
Expand All @@ -100,20 +100,20 @@
TkClusParameters = cms.PSet(
algorithm = cms.string("gap"),
TkGapClusParameters = cms.PSet(
zSeparation = cms.double(1.0)
zSeparation = cms.double(1.0)
)
)
)

from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
highBetaStar_2018.toModify(offlinePrimaryVertices,
TkFilterParameters = dict(
maxNormalizedChi2 = 80.0,
minPixelLayersWithHits = 1,
minSiliconLayersWithHits = 3,
maxD0Significance = 7.0,
maxD0Error = 10.0,
maxDzError = 10.0,
maxD0Error = 10.0,
maxDzError = 10.0,
maxEta = 2.5
),
vertexCollections = {
Expand Down
16 changes: 8 additions & 8 deletions RecoVertex/PrimaryVertexProducer/python/TkClusParameters_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
delta_lowT = cms.double(1.e-3), # convergence requirement at low T
convergence_mode = cms.int32(0), # 0 = two steps, 1 = dynamic with sqrt(T)
Tmin = cms.double(2.0), # end of vertex splitting
Tpurge = cms.double(2.0), # cleaning
Tstop = cms.double(0.5), # end of annealing
vertexSize = cms.double(0.006), # added in quadrature to track-z resolutions
d0CutOff = cms.double(3.), # downweight high IP tracks
dzCutOff = cms.double(3.), # outlier rejection after freeze-out (T<Tmin)
Tpurge = cms.double(2.0), # cleaning
Tstop = cms.double(0.5), # end of annealing
vertexSize = cms.double(0.006), # added in quadrature to track-z resolutions
d0CutOff = cms.double(3.), # downweight high IP tracks
dzCutOff = cms.double(3.), # outlier rejection after freeze-out (T<Tmin)
zmerge = cms.double(1e-2), # merge intermediat clusters separated by less than zmerge
uniquetrkweight = cms.double(0.8),# require at least two tracks with this weight at T=Tpurge
uniquetrkminp = cms.double(0.0), # minimal a priori track weight for counting unique tracks
Expand Down Expand Up @@ -61,11 +61,11 @@
delta_lowT = cms.double(1.e-3), # convergence requirement at low T
convergence_mode = cms.int32(0), # 0 = two steps, 1 = dynamic with sqrt(T)
Tmin = cms.double(4.0), # end of vertex splitting
Tpurge = cms.double(4.0), # cleaning
Tstop = cms.double(2.0), # end of annealing
Tpurge = cms.double(4.0), # cleaning
Tstop = cms.double(2.0), # end of annealing
vertexSize = cms.double(0.006), # added in quadrature to track-z resolutions
vertexSizeTime = cms.double(0.008),
d0CutOff = cms.double(3.), # downweight high IP tracks
d0CutOff = cms.double(3.), # downweight high IP tracks
dzCutOff = cms.double(3.), # outlier rejection after freeze-out (T<Tmin)
dtCutOff = cms.double(4.), # outlier rejection after freeze-out (T<Tmin)
t0Max = cms.double(1.0), # outlier rejection for use of timing information
Expand Down
6 changes: 3 additions & 3 deletions Validation/RecoVertex/python/pvRecoSequence_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import *

# 2010-like PV reconstruction
import RecoVertex.PrimaryVertexProducer.primaryVertexProducer_cfi as _mod
offlinePrimaryVerticesGAP = _mod.primaryVertexProducer.clone(
from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices
offlinePrimaryVerticesGAP = offlinePrimaryVertices.clone(
TrackLabel = "generalTracks", # label of tracks to be used
TkFilterParameters = dict(
maxNormalizedChi2 = 20.0, #
Expand Down Expand Up @@ -53,7 +53,7 @@
)
)

offlinePrimaryVerticesDA100um = _mod.primaryVertexProducer.clone(
offlinePrimaryVerticesDA100um = offlinePrimaryVertices.clone(
TrackLabel = "generalTracks",
TkFilterParameters = dict(
maxNormalizedChi2 = 20.0,
Expand Down

0 comments on commit 8eea085

Please sign in to comment.