Skip to content

Commit

Permalink
Merge pull request #39995 from GPUOfflinePV-CMS/cpu_only_cleanup
Browse files Browse the repository at this point in the history
New Vertex Clustering in Blocks and Weighted Mean Estimator
  • Loading branch information
cmsbuild committed Nov 28, 2022
2 parents e37c35f + 0178162 commit d6cfe02
Show file tree
Hide file tree
Showing 11 changed files with 971 additions and 25 deletions.
6 changes: 6 additions & 0 deletions Configuration/ProcessModifiers/python/vertexInBlocks_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms

# This modifier enables, in the primary vertex producer,
# - da clustering for PV in blocks
vertexInBlocks = cms.Modifier()

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import FWCore.ParameterSet.Config as cms

# This modifier enables, in the primary vertex producer,
# - vertex fitting with weighted mean
weightedVertexing = cms.Modifier()
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ The offsets currently in use are:
* 0.302: FastSim Run-3 trackingOnly validation
* 0.303: FastSim Run-3 MB for mixing
* 0.9001: Sonic Triton
* 0.278: Weighted Vertexing in Blocks
* 0.279: Weighted Vertexing in Blocks and tracking only wf
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def condition(self, fragment, stepList, key, hasHarvest):

# some commonalities among tracking WFs
class UpgradeWorkflowTracking(UpgradeWorkflow):
# skip the PU argument since PU workflows never used here

def __init__(self, steps, PU, suffix, offset):
# always include some steps that will be skipped
steps = steps + ["ALCA","Nano"]
Expand All @@ -265,9 +265,13 @@ class UpgradeWorkflow_trackingOnly(UpgradeWorkflowTracking):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Reco' in step: stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
elif 'HARVEST' in step: stepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation+@trackingOnlyDQM'}, stepDict[step][k]])

def condition(self, fragment, stepList, key, hasHarvest):
result = (fragment=="TTbar_13" or fragment=="TTbar_14TeV") and hasHarvest and self.condition_(fragment, stepList, key, hasHarvest)
return result



upgradeWFs['trackingOnly'] = UpgradeWorkflow_trackingOnly(
steps = [
'Reco',
Expand Down Expand Up @@ -462,6 +466,79 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.9,
)

# WeightedMeanFitter vertexing workflows
class UpgradeWorkflow_weightedVertex(UpgradeWorkflow):
def __init__(self, reco = {}, harvest = {}, **kwargs):
# adapt the parameters for the UpgradeWorkflow init method
super(UpgradeWorkflow_weightedVertex, self).__init__(
steps = [
'Reco',
'HARVEST',
'RecoGlobal',
'HARVESTGlobal',
'RecoNano',
'HARVESTNano',
'RecoFakeHLT',
'HARVESTFakeHLT',
],
PU = [
'Reco',
'HARVEST',
'RecoGlobal',
'HARVESTGlobal',
'RecoNano',
'HARVESTNano',
'RecoFakeHLT',
'HARVESTFakeHLT',
],
**kwargs)
self.__reco = reco
self.__harvest = harvest

def setup_(self, step, stepName, stepDict, k, properties):
# temporarily remove trigger & downstream steps
if 'Reco' in step:
mod = {'--procModifiers': 'weightedVertexing,vertexInBlocks', '--datatier':'GEN-SIM-RECO,DQMIO',
'--eventcontent':'RECOSIM,DQM'}
stepDict[stepName][k] = merge([mod,self.step3, stepDict[step][k]])
if 'HARVEST' in step:
stepDict[stepName][k] = merge([self.step4,stepDict[step][k]])

def condition(self, fragment, stepList, key, hasHarvest):
# select only a subset of the workflows
selected = [
('2021' in key and fragment == "TTbar_14TeV" and 'FS' not in key),
('2024' in key and fragment == "TTbar_14TeV"),
('2026' in key and fragment == "TTbar_14TeV")
]
result = any(selected) and hasHarvest

return result


upgradeWFs['weightedVertex'] = UpgradeWorkflow_weightedVertex(
suffix = '_weightedVertex',
offset = 0.278,
)

upgradeWFs['weightedVertex'].step3 = {}
upgradeWFs['weightedVertex'].step4 = {}

upgradeWFs['weightedVertexTrackingOnly'] = UpgradeWorkflow_weightedVertex(
suffix = '_weightedVertexTrackingOnly',
offset = 0.279,
)

upgradeWFs['weightedVertexTrackingOnly'].step3 = {
'-s': 'RAW2DIGI,RECO:reconstruction_trackingOnly,VALIDATION:@trackingOnlyValidation,DQM:@trackingOnlyDQM',
'--datatier':'GEN-SIM-RECO,DQMIO',
'--eventcontent':'RECOSIM,DQM',
}

upgradeWFs['weightedVertexTrackingOnly'].step4 = {
'-s': 'HARVESTING:@trackingOnlyValidation+@pixelTrackingOnlyDQM'
}

# Special TICL Pattern recognition Workflows
class UpgradeWorkflow_ticl_clue3D(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class DAClusterizerInZ_vect final : public TrackClusterizerInZ {
const std::vector<reco::TransientTrack> &tracks) const override;

std::vector<TransientVertex> vertices(const std::vector<reco::TransientTrack> &tracks) const;
std::vector<TransientVertex> vertices_in_blocks(const std::vector<reco::TransientTrack> &tracks) const;

track_t fill(const std::vector<reco::TransientTrack> &tracks) const;

Expand Down Expand Up @@ -222,6 +223,10 @@ class DAClusterizerInZ_vect final : public TrackClusterizerInZ {

double sel_zrange_;
const double zrange_min_ = 0.1; // smallest z-range to be included in a tracks cluster list

bool runInBlocks_;
unsigned int block_size_;
double overlap_frac_;
};

//#ifndef DAClusterizerInZ_vect_h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "RecoVertex/PrimaryVertexProducer/interface/HITrackFilterForPVFinding.h"
#include "RecoVertex/PrimaryVertexProducer/interface/GapClusterizerInZ.h"
#include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZ.h"
#include "RecoVertex/PrimaryVertexProducer/interface/WeightedMeanFitter.h"
#include "RecoVertex/KalmanVertexFit/interface/KalmanVertexFitter.h"
#include "RecoVertex/AdaptiveVertexFit/interface/AdaptiveVertexFitter.h"
//#include "RecoVertex/VertexTools/interface/VertexDistanceXY.h"
Expand Down Expand Up @@ -95,4 +96,5 @@ class PrimaryVertexProducer : public edm::stream::EDProducer<> {
edm::EDGetTokenT<edm::ValueMap<float> > trkTimeResosToken;

bool f4D;
bool weightFit;
};
Loading

0 comments on commit d6cfe02

Please sign in to comment.