Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 8b4a47e
Author: Fabio Cossutti <[email protected]>
Date:   Thu Feb 15 10:20:08 2024 +0100

    Restore original values, for phase2 4D no further overwriting by python

commit 8a0bedb
Author: Fabio Cossutti <[email protected]>
Date:   Wed Feb 14 14:00:23 2024 +0100

    Adopt a fillDescription default based python solution, with no explicit declaration where not strictly needed

commit 0b33159
Author: Fabio Cossutti <[email protected]>
Date:   Sun Feb 11 19:27:53 2024 +0100

    Apply suggestions from code review

    Co-authored-by: Matti Kortelainen <[email protected]>

commit a3e12cf
Author: Fabio Cossutti <[email protected]>
Date:   Fri Feb 9 17:30:57 2024 +0100

    Update RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py

    Co-authored-by: Matti Kortelainen <[email protected]>

commit 324847b
Author: Fabio Cossutti <[email protected]>
Date:   Fri Feb 9 16:43:28 2024 +0100

    Update also RecoHI/HiTracking

commit 122b97c
Author: Fabio Cossutti <[email protected]>
Date:   Tue Feb 6 09:48:13 2024 +0100

    scram b code-format

commit aa62917
Author: Fabio Cossutti <[email protected]>
Date:   Tue Feb 6 09:33:05 2024 +0100

    Fix definition of TkFilterParameters

commit 8eea085
Author: Fabio Cossutti <[email protected]>
Date:   Fri Feb 2 15:01:16 2024 +0100

    Add a default PrimaryVertexProducer config including all possible options 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

commit 5f2258f
Author: Fabio Cossutti <[email protected]>
Date:   Mon Jan 29 16:37:00 2024 +0100

    Restore situation previous to RecoVertex/PrimaryVertexProducer configuration updates

Co-authored-by: Matti Kortelainen <[email protected]>
  • Loading branch information
fabiocos and makortel committed Feb 25, 2024
1 parent 7e61dec commit ca5c370
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
#include "Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "RecoVertex/PrimaryVertexProducer/interface/TrackFilterForPVFinding.h"
#include "RecoVertex/PrimaryVertexProducer/interface/HITrackFilterForPVFinding.h"
#include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZ_vect.h"
#include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZT_vect.h"
#include "RecoVertex/PrimaryVertexProducer/interface/GapClusterizerInZ.h"
#include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
Expand Down Expand Up @@ -3696,15 +3694,15 @@ void PrimaryVertexValidation::fillDescriptions(edm::ConfigurationDescriptions& d
// track filtering
edm::ParameterSetDescription psd0;
TrackFilterForPVFinding::fillPSetDescription(psd0);
HITrackFilterForPVFinding::fillPSetDescription(psd0); // HI only
psd0.add<int>("numTracksThreshold", 0); // HI only
desc.add<edm::ParameterSetDescription>("TkFilterParameters", psd0);

// PV Clusterization
{
edm::ParameterSetDescription psd0;
{
edm::ParameterSetDescription psd1;
DAClusterizerInZT_vect::fillPSetDescription(psd1);
DAClusterizerInZ_vect::fillPSetDescription(psd1);
psd0.add<edm::ParameterSetDescription>("TkDAClusParameters", psd1);

edm::ParameterSetDescription psd2;
Expand Down
11 changes: 6 additions & 5 deletions RecoHI/HiTracking/python/HIPixelAdaptiveVertex_cfi.py
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

hiPixelAdaptiveVertex = _mod.primaryVertexProducer.clone(
hiPixelAdaptiveVertex = offlinePrimaryVertices.clone(
verbose = False,
TkFilterParameters = dict(
algorithm = 'filterWithThreshold',
Expand All @@ -11,13 +11,12 @@
maxD0Significance = 3.0, ## keep most primary tracks (was 5.0)
minPt = 0.0, ## better for softish events
maxEta = 100.,
numTracksThreshold = 2
),
# label of tracks to be used
TrackLabel = "hiSelectedProtoTracks",
# clustering
TkClusParameters = dict(
algorithm = "gap",
TkClusParameters = cms.PSet(
algorithm = cms.string("gap"),
TkGapClusParameters = cms.PSet(
zSeparation = cms.double(1.0) ## 1 cm max separation between clusters
)
Expand All @@ -33,3 +32,5 @@
)
)
)

hiPixelAdaptiveVertex.TkFilterParameters.numTracksThreshold = cms.int32(2)
18 changes: 8 additions & 10 deletions RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
from RecoVertex.Configuration.RecoVertex_cff import unsortedOfflinePrimaryVertices, trackWithVertexRefSelector, trackRefsForJets, sortedPrimaryVertices, offlinePrimaryVertices, offlinePrimaryVerticesWithBS,vertexrecoTask

unsortedOfflinePrimaryVertices4D = unsortedOfflinePrimaryVertices.clone(
TkClusParameters = dict(
algorithm = "DA2D_vect",
TkDAClusParameters = dict(
Tmin = 4.0,
Tpurge = 4.0,
Tstop = 2.0
),
TkClusParameters = cms.PSet(algorithm = cms.string("DA2D_vect"),
TkDAClusParameters = cms.PSet(
Tmin = cms.double(4.0),
Tpurge = cms.double(4.0),
Tstop = cms.double(2.0),
)
),
TrackTimesLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModel"),
TrackTimeResosLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModelResolution"),
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 @@ -68,8 +67,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,
phase2_timing_layer.toModify(unsortedOfflinePrimaryVertices,
vertexCollections = {0: dict(vertexTimeParameters = cms.PSet( algorithm = cms.string('fromTracksPID'))),
1: dict(vertexTimeParameters = cms.PSet( algorithm = cms.string('fromTracksPID')))}
)

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class HITrackFilterForPVFinding : public TrackFilterForPVFinding {
}

static void fillPSetDescription(edm::ParameterSetDescription& desc) {
TrackFilterForPVFinding::fillPSetDescription(desc);
desc.add<int>("numTracksThreshold", 0); // HI only
desc.add<int>("maxNumTracksThreshold", std::numeric_limits<int>::max());
desc.add<double>("minPtTight", 0.0);
Expand Down
22 changes: 14 additions & 8 deletions RecoVertex/PrimaryVertexProducer/plugins/PrimaryVertexProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@ void PrimaryVertexProducer::fillDescriptions(edm::ConfigurationDescriptions& des
desc.addUntracked<bool>("verbose", false);
{
edm::ParameterSetDescription psd0;
TrackFilterForPVFinding::fillPSetDescription(psd0);
HITrackFilterForPVFinding::fillPSetDescription(psd0); // HI only
HITrackFilterForPVFinding::fillPSetDescription(psd0); // extension of TrackFilterForPVFinding
desc.add<edm::ParameterSetDescription>("TkFilterParameters", psd0);
}
desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot"));
Expand All @@ -435,14 +434,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 @@ -451,7 +457,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
109 changes: 88 additions & 21 deletions RecoVertex/PrimaryVertexProducer/python/OfflinePrimaryVertices_cfi.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,90 @@
import FWCore.ParameterSet.Config as cms

from RecoVertex.PrimaryVertexProducer.primaryVertexProducer_cfi import primaryVertexProducer
offlinePrimaryVertices = cms.EDProducer(
"PrimaryVertexProducer",

offlinePrimaryVertices = primaryVertexProducer.clone()
verbose = cms.untracked.bool(False),
TrackLabel = cms.InputTag("generalTracks"),
beamSpotLabel = cms.InputTag("offlineBeamSpot"),

DA_vectParameters = cms.PSet(primaryVertexProducer.TkClusParameters.clone())
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),
minPt = cms.double(0.0),
maxEta = cms.double(2.4),
trackQuality = cms.string("any")
),

TkClusParameters = cms.PSet(
algorithm = cms.string("DA_vect"),
TkDAClusParameters = cms.PSet(
coolingFactor = cms.double(0.6), # moderate annealing speed
zrange = cms.double(4.), # consider only clusters within 4 sigma*sqrt(T) of a track
delta_highT = cms.double(1.e-2), # convergence requirement at high T
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)
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
runInBlocks = cms.bool(False), # activate the DA running in blocks of z sorted tracks
block_size = cms.uint32(10000), # block size in tracks
overlap_frac = cms.double(0.0) # overlap between consecutive blocks (blocks_size*overlap_frac)
)
),

vertexCollections = cms.VPSet(
[cms.PSet(label=cms.string(""),
algorithm=cms.string("AdaptiveVertexFitter"),
chi2cutoff = cms.double(2.5),
minNdof=cms.double(0.0),
useBeamConstraint = cms.bool(False),
maxDistanceToBeam = cms.double(1.0)
),
cms.PSet(label=cms.string("WithBS"),
algorithm = cms.string('AdaptiveVertexFitter'),
chi2cutoff = cms.double(2.5),
minNdof=cms.double(2.0),
useBeamConstraint = cms.bool(True),
maxDistanceToBeam = cms.double(1.0),
)
]
),

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


)

from Configuration.ProcessModifiers.vertexInBlocks_cff import vertexInBlocks
vertexInBlocks.toModify(offlinePrimaryVertices,
TkClusParameters = dict(
TkDAClusParameters = dict(
runInBlocks = True,
block_size = 128,
overlap_frac = 0.5
runInBlocks = True,
block_size = 128,
overlap_frac = 0.5
)
)
)

from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
(phase2_tracker & vertexInBlocks).toModify(offlinePrimaryVertices,
TkClusParameters = dict(
TkDAClusParameters = dict(
block_size = 512,
overlap_frac = 0.5)
)
TkClusParameters = dict(
TkDAClusParameters = dict(
block_size = 512,
overlap_frac = 0.5)
)
)

from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
Expand All @@ -38,10 +99,12 @@
dzCutOff = 5.,
zmerge = 2.e-2,
uniquetrkweight = 0.9
)
)
)
)

DA_vectParameters = cms.PSet(offlinePrimaryVertices.TkClusParameters.clone())

from Configuration.ProcessModifiers.weightedVertexing_cff import weightedVertexing
weightedVertexing.toModify(offlinePrimaryVertices,
vertexCollections = cms.VPSet(
Expand Down Expand Up @@ -72,8 +135,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 @@ -82,33 +145,37 @@
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",
numTracksThreshold = cms.int32(10),
maxNumTracksThreshold = cms.int32(1000),
minPtTight = cms.double(1.0)
),
TkClusParameters = dict(
algorithm = "gap"
TkClusParameters = cms.PSet(
algorithm = cms.string("gap"),
TkGapClusParameters = cms.PSet(
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 = {
0: dict(chi2cutoff = 4.0, minNdof = -1.1),
1: dict(chi2cutoff = 4.0, minNdof = -2.0),
}
)

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 ca5c370

Please sign in to comment.