From 6463571fb7112bce163493b62a031ee07f3253d4 Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen Date: Wed, 30 Oct 2024 21:16:37 +0100 Subject: [PATCH 1/5] Put all taggers and selections in single files --- DQMOffline/RecoB/python/bTagMiniDQMTaggers.py | 230 ++++++++++++++++++ .../RecoB/python/tagGenericAnalysis_cff.py | 62 +++++ 2 files changed, 292 insertions(+) create mode 100644 DQMOffline/RecoB/python/bTagMiniDQMTaggers.py create mode 100644 DQMOffline/RecoB/python/tagGenericAnalysis_cff.py diff --git a/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py b/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py new file mode 100644 index 0000000000000..4ac60fc14e4c0 --- /dev/null +++ b/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py @@ -0,0 +1,230 @@ +import FWCore.ParameterSet.Config as cms + +from DQMOffline.RecoB.tagGenericAnalysis_cff import bTagGenericAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import cTagGenericAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import tauTagGenericAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import sTagGenericAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import qgTagGenericAnalysisBlock + +############################################################ +# +# DeepCSV +# +############################################################ +# recommendation for UL18: https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL18 +deepCSVWP = { + 'BvsAll': 0.1208, # loose + 'CvsL': 0.153, # medium + 'CvsB': 0.363, # medium +} + +DeepCSVDiscriminators = { + 'BvsAll': cms.PSet( + bTagGenericAnalysisBlock, + + folder = cms.string('DeepCSV_BvsAll'), + CTagPlots = cms.bool(False), + discrCut = cms.double(deepCSVWP['BvsAll']), + numerator = cms.vstring( + 'pfDeepCSVJetTags:probb', + 'pfDeepCSVJetTags:probbb', + ), + denominator = cms.vstring(), + ), + + 'CvsL': cms.PSet( + cTagGenericAnalysisBlock, + + folder = cms.string('DeepCSV_CvsL'), + CTagPlots = cms.bool(True), + discrCut = cms.double(deepCSVWP['CvsL']), + numerator = cms.vstring('pfDeepCSVJetTags:probc'), + denominator = cms.vstring( + 'pfDeepCSVJetTags:probc', + 'pfDeepCSVJetTags:probudsg', + ), + ), + + 'CvsB': cms.PSet( + cTagGenericAnalysisBlock, + + folder = cms.string('DeepCSV_CvsB'), + CTagPlots = cms.bool(True), + discrCut = cms.double(deepCSVWP['CvsB']), + numerator = cms.vstring('pfDeepCSVJetTags:probc'), + denominator = cms.vstring( + 'pfDeepCSVJetTags:probc', + 'pfDeepCSVJetTags:probb', + 'pfDeepCSVJetTags:probbb', + ), + ), +} + + +############################################################ +# +# DeepFlavour (aka DeepJet) +# +############################################################ +# recommendation for UL18: https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL18 +deepFlavourWP = { + 'BvsAll': 0.0490, # loose + 'CvsL': 0.099, # medium + 'CvsB': 0.325, # medium +} + +DeepFlavourDiscriminators = { + 'BvsAll': cms.PSet( + bTagGenericAnalysisBlock, + + folder = cms.string('DeepFlavour_BvsAll'), + CTagPlots = cms.bool(False), + discrCut = cms.double(deepFlavourWP['BvsAll']), + numerator = cms.vstring( + 'pfDeepFlavourJetTags:probb', + 'pfDeepFlavourJetTags:probbb', + 'pfDeepFlavourJetTags:problepb', + ), + denominator = cms.vstring(), + ), + + 'CvsL': cms.PSet( + cTagGenericAnalysisBlock, + + folder = cms.string('DeepFlavour_CvsL'), + CTagPlots = cms.bool(True), + discrCut = cms.double(deepFlavourWP['CvsL']), + numerator = cms.vstring('pfDeepFlavourJetTags:probc'), + denominator = cms.vstring( + 'pfDeepFlavourJetTags:probc', + 'pfDeepFlavourJetTags:probuds', + 'pfDeepFlavourJetTags:probg', + ), + ), + + 'CvsB': cms.PSet( + cTagGenericAnalysisBlock, + + folder = cms.string('DeepFlavour_CvsB'), + CTagPlots = cms.bool(True), + discrCut = cms.double(deepFlavourWP['CvsB']), + numerator = cms.vstring('pfDeepFlavourJetTags:probc'), + denominator = cms.vstring( + 'pfDeepFlavourJetTags:probc', + 'pfDeepFlavourJetTags:probb', + 'pfDeepFlavourJetTags:probbb', + 'pfDeepFlavourJetTags:problepb', + ), + ), +} + +############################################################ +# +# AK4 ParticleNet for Puppi jets +# +############################################################ +from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr as pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr +from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr as pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr + +ParticleNetPuppiCentralDiscriminators = {} + +for meta_tagger in pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr: + discr = meta_tagger.split(':')[1] + + commonTaggerConfig = cms.PSet( + folder = cms.string('ParticleNetCentral_'+discr), + numerator = cms.vstring(meta_tagger), + denominator = cms.vstring(), + discrCut = cms.double(0.3),#Dummy, + CTagPlots = cms.bool(False) + ) + if "Bvs" in discr: + ParticleNetPuppiCentralDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + bTagGenericAnalysisBlock + ) + elif "Cvs" in discr: + ParticleNetPuppiCentralDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock, + ) + ParticleNetPuppiCentralDiscriminators[discr].CTagPlots = True + elif "TauVs" in discr: + ParticleNetPuppiCentralDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock + ) + elif "QvsG" in discr: + ParticleNetPuppiCentralDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock + ) + +ParticleNetPuppiForwardDiscriminators = {} + +for meta_tagger in pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr: + discr = meta_tagger.split(':')[1] + + commonTaggerConfig = cms.PSet( + folder = cms.string('ParticleNetForward_'+discr), + numerator = cms.vstring(meta_tagger), + denominator = cms.vstring(), + discrCut = cms.double(0.3),#Dummy, + CTagPlots = cms.bool(False) + ) + if "QvsG" in discr: + ParticleNetPuppiForwardDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + qgTagGenericAnalysisBlock, + ) + +############################################################ +# +# UParT +# +############################################################ +from RecoBTag.ONNXRuntime.pfUnifiedParticleTransformerAK4_cff import _pfUnifiedParticleTransformerAK4JetTagsMetaDiscrs as pfUnifiedParticleTransformerAK4JetTagsMetaDiscrs + +UParTDiscriminators = {} +# +# +# +for meta_tagger in pfUnifiedParticleTransformerAK4JetTagsMetaDiscrs: + discr = meta_tagger.split(':')[1] #split input tag to get thcde producer label + # + # + # + commonTaggerConfig = cms.PSet( + folder = cms.string('UParT_'+discr), + numerator = cms.vstring(meta_tagger), + denominator = cms.vstring(), + discrCut = cms.double(0.3),#Dummy, + CTagPlots = cms.bool(False) + ) + if "Bvs" in discr: + UParTDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + bTagGenericAnalysisBlock + ) + elif "Cvs" in discr: + UParTDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock, + ) + UParTDiscriminators[discr].CTagPlots = True + elif "QvsG" in discr: + UParTDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock + ) + elif "Svs" in discr: + UParTDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock + ) + elif "TauVs" in discr: + UParTDiscriminators[discr] = cms.PSet( + commonTaggerConfig, + cTagGenericAnalysisBlock + ) + diff --git a/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py b/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py new file mode 100644 index 0000000000000..88893df206069 --- /dev/null +++ b/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py @@ -0,0 +1,62 @@ +import FWCore.ParameterSet.Config as cms + +bTagGenericAnalysisBlock = cms.PSet( + parameters = cms.PSet( + discriminatorStart = cms.double(-0.01), + nBinEffPur = cms.int32(200), + # the constant b-efficiency for the differential plots versus pt and eta + effBConst = cms.double(0.7), + endEffPur = cms.double(1.005), + discriminatorEnd = cms.double(1.011), + startEffPur = cms.double(0.005) + ) +) + +cTagGenericAnalysisBlock = cms.PSet( + parameters = cms.PSet( + discriminatorStart = cms.double(-0.01), + nBinEffPur = cms.int32(200), + # the constant c-efficiency for the differential plots versus pt and eta + effBConst = cms.double(0.7), + endEffPur = cms.double(1.005), + discriminatorEnd = cms.double(1.011), + startEffPur = cms.double(0.005) + ) +) + +tauTagGenericAnalysisBlock = cms.PSet( + parameters = cms.PSet( + discriminatorStart = cms.double(-0.01), + nBinEffPur = cms.int32(200), + # the constant tau-efficiency for the differential plots versus pt and eta + effBConst = cms.double(0.7), + endEffPur = cms.double(1.005), + discriminatorEnd = cms.double(1.011), + startEffPur = cms.double(0.005) + ) +) + +sTagGenericAnalysisBlock = cms.PSet( + parameters = cms.PSet( + discriminatorStart = cms.double(-0.01), + nBinEffPur = cms.int32(200), + # the constant s-efficiency for the differential plots versus pt and eta + effBConst = cms.double(0.7), + endEffPur = cms.double(1.005), + discriminatorEnd = cms.double(1.011), + startEffPur = cms.double(0.005) + ) +) + +qgTagGenericAnalysisBlock = cms.PSet( + parameters = cms.PSet( + discriminatorStart = cms.double(-0.01), + nBinEffPur = cms.int32(200), + # the constant q-efficiency for the differential plots versus pt and eta + effBConst = cms.double(0.7), + endEffPur = cms.double(1.005), + discriminatorEnd = cms.double(1.011), + startEffPur = cms.double(0.005) + ) +) + From 6bd8901127fa89e1589670439ee23d15408e1eef Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen Date: Wed, 30 Oct 2024 21:17:41 +0100 Subject: [PATCH 2/5] Switch to slimmedJetsPuppi. Schedule to make histograms for all taggers produced during PAT step. Unify DQM and Validation. --- DQMOffline/RecoB/python/bTagMiniDQM_cff.py | 123 ++++++++++++--------- 1 file changed, 68 insertions(+), 55 deletions(-) diff --git a/DQMOffline/RecoB/python/bTagMiniDQM_cff.py b/DQMOffline/RecoB/python/bTagMiniDQM_cff.py index 955b62c3a3977..194762a8aa43f 100644 --- a/DQMOffline/RecoB/python/bTagMiniDQM_cff.py +++ b/DQMOffline/RecoB/python/bTagMiniDQM_cff.py @@ -2,13 +2,14 @@ from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer from DQMServices.Core.DQMEDHarvester import DQMEDHarvester -from DQMOffline.RecoB.bTagMiniDQMDeepFlavour import * -from DQMOffline.RecoB.bTagMiniDQMDeepCSV import * +from DQMOffline.RecoB.bTagMiniDQMTaggers import DeepCSVDiscriminators +from DQMOffline.RecoB.bTagMiniDQMTaggers import DeepFlavourDiscriminators +from DQMOffline.RecoB.bTagMiniDQMTaggers import ParticleNetPuppiCentralDiscriminators +from DQMOffline.RecoB.bTagMiniDQMTaggers import ParticleNetPuppiForwardDiscriminators +from DQMOffline.RecoB.bTagMiniDQMTaggers import UParTDiscriminators from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff import patJets - - # add jets with pfSecondaryVertexTagInfos patJetsSVInfo = patJets.clone( tagInfoSources = ['pfSecondaryVertexTagInfos'], @@ -17,25 +18,28 @@ patJetsSVInfoTask = cms.Task(patJetsSVInfo) -bTagSVDQM = DQMEDAnalyzer('MiniAODSVAnalyzer', - cms.PSet(JetTag = cms.InputTag('patJetsSVInfo'), - svTagInfo = cms.string('pfSecondaryVertex'), - ptMin = cms.double(30.), - etaMax = cms.double(2.5), - ) - ) - +bTagSVDQM = DQMEDAnalyzer('MiniAODSVAnalyzer', cms.PSet( + JetTag = cms.InputTag('patJetsSVInfo'), + svTagInfo = cms.string('pfSecondaryVertex'), + ptMin = cms.double(30.), + etaMax = cms.double(2.5), + ) +) bTagMiniDQMGlobal = cms.PSet( - JetTag = cms.InputTag('slimmedJets'), + JetTag = cms.InputTag('slimmedJetsPuppi'), MClevel = cms.int32(0), differentialPlots = cms.bool(True), - ptActive = cms.bool(False), ptMin = cms.double(30.), ptMax = cms.double(40000.), ) - +bTagMiniValidationGlobal = bTagMiniDQMGlobal.clone( + MClevel = 1 # produce flavour plots for b, c ,light (dusg) +) +bTagMiniValidationGlobalUParT = bTagMiniDQMGlobal.clone( + MClevel = 4 # produce flavour plots for b, c ,light (dusg) +) # Eta regions Etaregions = { @@ -44,13 +48,11 @@ etaMin = cms.double(0.), etaMax = cms.double(2.5), ), - 'Barrel': cms.PSet( etaActive = cms.bool(True), etaMin = cms.double(0.), etaMax = cms.double(1.4), ), - 'Endcap': cms.PSet( etaActive = cms.bool(True), etaMin = cms.double(1.4), @@ -70,56 +72,67 @@ def addSequences(Analyzer, Harvester, discriminators, regions, globalPSet, label Analyzer.insert(-1, globals()[name + 'Analyzer']) Harvester.insert(-1, globals()[name + 'Harvester']) +# +# +# +taggersToAnalyze = { + 'bTagDeepFlavour': { + 'discriminators': DeepFlavourDiscriminators, + 'regions':Etaregions + }, + 'bTagDeepCSV': { + 'discriminators': DeepCSVDiscriminators, + 'regions':Etaregions + }, + 'bTagParticleNetCentral': { + 'discriminators': ParticleNetPuppiCentralDiscriminators, + 'regions': Etaregions + }, + 'bTagParticleNetForward': { + 'discriminators': ParticleNetPuppiForwardDiscriminators, + 'regions': { + 'Forward': cms.PSet( + etaActive = cms.bool(True), + etaMin = cms.double(2.5), + etaMax = cms.double(5.0), + ), + }, + }, + 'bTagUParT': { + 'discriminators': UParTDiscriminators, + 'regions': Etaregions + } +} - +# For DQM bTagMiniDQMSource = cms.Sequence(bTagSVDQM, patJetsSVInfoTask) bTagMiniDQMHarvesting = cms.Sequence() -addSequences(bTagMiniDQMSource, - bTagMiniDQMHarvesting, - discriminators=DeepFlavourDiscriminators, - regions=Etaregions, - globalPSet=bTagMiniDQMGlobal, - label='bTagDeepFlavourDQM') - -addSequences(bTagMiniDQMSource, - bTagMiniDQMHarvesting, - discriminators=DeepCSVDiscriminators, - regions=Etaregions, - globalPSet=bTagMiniDQMGlobal, - label='bTagDeepCSVDQM') - - - -# Validation addSequences - -bTagMiniValidationGlobal = bTagMiniDQMGlobal.clone( - MClevel = 1 # produce flavour plots for b, c ,light (dusg) -) - +# For Validation bTagMiniValidationSource = cms.Sequence(bTagSVDQM, patJetsSVInfoTask) bTagMiniValidationHarvesting = cms.Sequence() +for tagger in taggersToAnalyze: -addSequences(bTagMiniValidationSource, - bTagMiniValidationHarvesting, - discriminators=DeepFlavourDiscriminators, - regions={'Global': Etaregions['Global']}, # only for global Eta range - globalPSet=bTagMiniValidationGlobal, - label='bTagDeepFlavourValidation') - -addSequences(bTagMiniValidationSource, - bTagMiniValidationHarvesting, - discriminators=DeepCSVDiscriminators, - regions={'Global': Etaregions['Global']}, # only for global Eta range - globalPSet=bTagMiniValidationGlobal, - label='bTagDeepCSVValidation') - + # DQM + addSequences(bTagMiniDQMSource, + bTagMiniDQMHarvesting, + discriminators=taggersToAnalyze[tagger]['discriminators'], + regions=taggersToAnalyze[tagger]['regions'], + globalPSet=bTagMiniDQMGlobal, + label=tagger+'DQM') + # Validation + addSequences(bTagMiniValidationSource, + bTagMiniValidationHarvesting, + discriminators=taggersToAnalyze[tagger]['discriminators'], + regions=taggersToAnalyze[tagger]['regions'], + globalPSet=bTagMiniValidationGlobalUParT if "UParT" in tagger else bTagMiniValidationGlobal, + label=tagger+'Validation') from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA from Configuration.ProcessModifiers.miniAOD_skip_trackExtras_cff import miniAOD_skip_trackExtras _mAOD = (pp_on_AA | miniAOD_skip_trackExtras) _mAOD.toReplaceWith(bTagMiniDQMSource, bTagMiniDQMSource.copyAndExclude([bTagSVDQM, patJetsSVInfoTask])) -_mAOD.toReplaceWith(bTagMiniValidationSource, bTagMiniValidationSource.copyAndExclude([bTagSVDQM, patJetsSVInfoTask])) +_mAOD.toReplaceWith(bTagMiniValidationSource, bTagMiniValidationSource.copyAndExclude([bTagSVDQM, patJetsSVInfoTask])) \ No newline at end of file From 82153f3c87098d01a2fb9aa32127b230b40e179b Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen Date: Mon, 11 Nov 2024 22:33:50 +0100 Subject: [PATCH 3/5] Delete old tagger files. They are now in bTagMiniDQMTaggers.py --- DQMOffline/RecoB/python/bTagMiniDQMDeepCSV.py | 55 ------------------ .../RecoB/python/bTagMiniDQMDeepFlavour.py | 58 ------------------- 2 files changed, 113 deletions(-) delete mode 100644 DQMOffline/RecoB/python/bTagMiniDQMDeepCSV.py delete mode 100644 DQMOffline/RecoB/python/bTagMiniDQMDeepFlavour.py diff --git a/DQMOffline/RecoB/python/bTagMiniDQMDeepCSV.py b/DQMOffline/RecoB/python/bTagMiniDQMDeepCSV.py deleted file mode 100644 index 4b4aa01dbd327..0000000000000 --- a/DQMOffline/RecoB/python/bTagMiniDQMDeepCSV.py +++ /dev/null @@ -1,55 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from DQMOffline.RecoB.bTagGenericAnalysis_cff import bTagGenericAnalysisBlock -from DQMOffline.RecoB.cTagGenericAnalysis_cff import cTagGenericAnalysisBlock - - -# recommendation for UL18: https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL18 -deepCSVWP = { - 'BvsAll': 0.1208, # loose - 'CvsL': 0.153, # medium - 'CvsB': 0.363, # medium -} - - -DeepCSVDiscriminators = { - 'BvsAll': cms.PSet( - bTagGenericAnalysisBlock, - - folder = cms.string('DeepCSV_BvsAll'), - CTagPlots = cms.bool(False), - discrCut = cms.double(deepCSVWP['BvsAll']), - numerator = cms.vstring( - 'pfDeepCSVJetTags:probb', - 'pfDeepCSVJetTags:probbb', - ), - denominator = cms.vstring(), - ), - - 'CvsL': cms.PSet( - cTagGenericAnalysisBlock, - - folder = cms.string('DeepCSV_CvsL'), - CTagPlots = cms.bool(True), - discrCut = cms.double(deepCSVWP['CvsL']), - numerator = cms.vstring('pfDeepCSVJetTags:probc'), - denominator = cms.vstring( - 'pfDeepCSVJetTags:probc', - 'pfDeepCSVJetTags:probudsg', - ), - ), - - 'CvsB': cms.PSet( - cTagGenericAnalysisBlock, - - folder = cms.string('DeepCSV_CvsB'), - CTagPlots = cms.bool(True), - discrCut = cms.double(deepCSVWP['CvsB']), - numerator = cms.vstring('pfDeepCSVJetTags:probc'), - denominator = cms.vstring( - 'pfDeepCSVJetTags:probc', - 'pfDeepCSVJetTags:probb', - 'pfDeepCSVJetTags:probbb', - ), - ), -} diff --git a/DQMOffline/RecoB/python/bTagMiniDQMDeepFlavour.py b/DQMOffline/RecoB/python/bTagMiniDQMDeepFlavour.py deleted file mode 100644 index 59d29ef737a8f..0000000000000 --- a/DQMOffline/RecoB/python/bTagMiniDQMDeepFlavour.py +++ /dev/null @@ -1,58 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from DQMOffline.RecoB.bTagGenericAnalysis_cff import bTagGenericAnalysisBlock -from DQMOffline.RecoB.cTagGenericAnalysis_cff import cTagGenericAnalysisBlock - - -# recommendation for UL18: https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL18 -deepFlavourWP = { - 'BvsAll': 0.0490, # loose - 'CvsL': 0.099, # medium - 'CvsB': 0.325, # medium -} - - -DeepFlavourDiscriminators = { - 'BvsAll': cms.PSet( - bTagGenericAnalysisBlock, - - folder = cms.string('DeepFlavour_BvsAll'), - CTagPlots = cms.bool(False), - discrCut = cms.double(deepFlavourWP['BvsAll']), - numerator = cms.vstring( - 'pfDeepFlavourJetTags:probb', - 'pfDeepFlavourJetTags:probbb', - 'pfDeepFlavourJetTags:problepb', - ), - denominator = cms.vstring(), - ), - - 'CvsL': cms.PSet( - cTagGenericAnalysisBlock, - - folder = cms.string('DeepFlavour_CvsL'), - CTagPlots = cms.bool(True), - discrCut = cms.double(deepFlavourWP['CvsL']), - numerator = cms.vstring('pfDeepFlavourJetTags:probc'), - denominator = cms.vstring( - 'pfDeepFlavourJetTags:probc', - 'pfDeepFlavourJetTags:probuds', - 'pfDeepFlavourJetTags:probg', - ), - ), - - 'CvsB': cms.PSet( - cTagGenericAnalysisBlock, - - folder = cms.string('DeepFlavour_CvsB'), - CTagPlots = cms.bool(True), - discrCut = cms.double(deepFlavourWP['CvsB']), - numerator = cms.vstring('pfDeepFlavourJetTags:probc'), - denominator = cms.vstring( - 'pfDeepFlavourJetTags:probc', - 'pfDeepFlavourJetTags:probb', - 'pfDeepFlavourJetTags:probbb', - 'pfDeepFlavourJetTags:problepb', - ), - ), -} From e594a4914f9313606f9a24d8662c5a212b382e49 Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen Date: Tue, 12 Nov 2024 10:16:31 +0100 Subject: [PATCH 4/5] Consolidate all tag analysis block into cff file --- DQMOffline/RecoB/python/bTagCommon_cff.py | 12 +++---- .../RecoB/python/bTagGenericAnalysis_cff.py | 16 --------- .../RecoB/python/bTagTrackIPAnalysis_cff.py | 26 -------------- .../bTagTrackProbabilityAnalysis_cff.py | 16 --------- .../RecoB/python/cTagGenericAnalysis_cff.py | 15 -------- .../RecoB/python/tagGenericAnalysis_cff.py | 35 +++++++++++++++++++ 6 files changed, 40 insertions(+), 80 deletions(-) delete mode 100644 DQMOffline/RecoB/python/bTagGenericAnalysis_cff.py delete mode 100644 DQMOffline/RecoB/python/bTagTrackIPAnalysis_cff.py delete mode 100644 DQMOffline/RecoB/python/bTagTrackProbabilityAnalysis_cff.py delete mode 100644 DQMOffline/RecoB/python/cTagGenericAnalysis_cff.py diff --git a/DQMOffline/RecoB/python/bTagCommon_cff.py b/DQMOffline/RecoB/python/bTagCommon_cff.py index 84dee731be624..0755db90683b9 100644 --- a/DQMOffline/RecoB/python/bTagCommon_cff.py +++ b/DQMOffline/RecoB/python/bTagCommon_cff.py @@ -1,12 +1,10 @@ import FWCore.ParameterSet.Config as cms -# BTagPerformanceAnalyzer configuration -from DQMOffline.RecoB.bTagGenericAnalysis_cff import bTagGenericAnalysisBlock -from DQMOffline.RecoB.cTagGenericAnalysis_cff import cTagGenericAnalysisBlock -from DQMOffline.RecoB.bTagTrackIPAnalysis_cff import bTagTrackIPAnalysisBlock -from DQMOffline.RecoB.bTagTrackProbabilityAnalysis_cff import bTagProbabilityAnalysisBlock - - +# BTagPerformanceAnalyzer configuration +from DQMOffline.RecoB.tagGenericAnalysis_cff import bTagGenericAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import cTagGenericAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import bTagTrackIPAnalysisBlock +from DQMOffline.RecoB.tagGenericAnalysis_cff import bTagProbabilityAnalysisBlock bTagCommonBlock = cms.PSet( # use pre-computed jet flavour identification diff --git a/DQMOffline/RecoB/python/bTagGenericAnalysis_cff.py b/DQMOffline/RecoB/python/bTagGenericAnalysis_cff.py deleted file mode 100644 index ae9d7861d4b2f..0000000000000 --- a/DQMOffline/RecoB/python/bTagGenericAnalysis_cff.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# Generic jetTag configuration -bTagGenericAnalysisBlock = cms.PSet( - parameters = cms.PSet( - discriminatorStart = cms.double(-0.01), - nBinEffPur = cms.int32(200), - # the constant b-efficiency for the differential plots versus pt and eta - effBConst = cms.double(0.5), - endEffPur = cms.double(1.005), - discriminatorEnd = cms.double(1.011), - startEffPur = cms.double(0.005) - ) -) - - diff --git a/DQMOffline/RecoB/python/bTagTrackIPAnalysis_cff.py b/DQMOffline/RecoB/python/bTagTrackIPAnalysis_cff.py deleted file mode 100644 index 2ecdd3441c45d..0000000000000 --- a/DQMOffline/RecoB/python/bTagTrackIPAnalysis_cff.py +++ /dev/null @@ -1,26 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# TrackIP tag info configuration -bTagTrackIPAnalysisBlock = cms.PSet( - parameters = cms.PSet( - QualityPlots = cms.bool(False), - endEffPur = cms.double(1.005), - nBinEffPur = cms.int32(200), - startEffPur = cms.double(0.005), - LowerIPSBound = cms.double(-35.0), - UpperIPSBound = cms.double(35.0), - LowerIPBound = cms.double(-0.1), - UpperIPBound = cms.double(0.1), - LowerIPEBound = cms.double(0.0), - UpperIPEBound = cms.double(0.04), - NBinsIPS = cms.int32(100), - NBinsIP = cms.int32(100), - NBinsIPE = cms.int32(100), - MinDecayLength = cms.double(-9999.0), - MaxDecayLength = cms.double(5.0), - MinJetDistance = cms.double(0.0), - MaxJetDistance = cms.double(0.07), - ) -) - - diff --git a/DQMOffline/RecoB/python/bTagTrackProbabilityAnalysis_cff.py b/DQMOffline/RecoB/python/bTagTrackProbabilityAnalysis_cff.py deleted file mode 100644 index fab7e62c87c4c..0000000000000 --- a/DQMOffline/RecoB/python/bTagTrackProbabilityAnalysis_cff.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# TrackProbability jetTag configuration -bTagProbabilityAnalysisBlock = cms.PSet( - parameters = cms.PSet( - discriminatorStart = cms.double(-0.025), - nBinEffPur = cms.int32(200), - # the constant b-efficiency for the differential plots versus pt and eta - effBConst = cms.double(0.5), - endEffPur = cms.double(1.005), - discriminatorEnd = cms.double(2.525), - startEffPur = cms.double(0.005) - ) -) - - diff --git a/DQMOffline/RecoB/python/cTagGenericAnalysis_cff.py b/DQMOffline/RecoB/python/cTagGenericAnalysis_cff.py deleted file mode 100644 index 3825efe25e6d5..0000000000000 --- a/DQMOffline/RecoB/python/cTagGenericAnalysis_cff.py +++ /dev/null @@ -1,15 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# Generic jetTag configuration -cTagGenericAnalysisBlock = cms.PSet( - parameters = cms.PSet( - discriminatorStart = cms.double(-0.01), - nBinEffPur = cms.int32(200), - # the constant b-efficiency for the differential plots versus pt and eta - effBConst = cms.double(0.5), - endEffPur = cms.double(1.005), - discriminatorEnd = cms.double(1.011), - startEffPur = cms.double(0.005) - ) -) - diff --git a/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py b/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py index 88893df206069..ddb927a98186a 100644 --- a/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py +++ b/DQMOffline/RecoB/python/tagGenericAnalysis_cff.py @@ -60,3 +60,38 @@ ) ) +# TrackProbability jetTag configuration +bTagProbabilityAnalysisBlock = cms.PSet( + parameters = cms.PSet( + discriminatorStart = cms.double(-0.025), + nBinEffPur = cms.int32(200), + # the constant b-efficiency for the differential plots versus pt and eta + effBConst = cms.double(0.5), + endEffPur = cms.double(1.005), + discriminatorEnd = cms.double(2.525), + startEffPur = cms.double(0.005) + ) +) + +# TrackIP tag info configuration +bTagTrackIPAnalysisBlock = cms.PSet( + parameters = cms.PSet( + QualityPlots = cms.bool(False), + endEffPur = cms.double(1.005), + nBinEffPur = cms.int32(200), + startEffPur = cms.double(0.005), + LowerIPSBound = cms.double(-35.0), + UpperIPSBound = cms.double(35.0), + LowerIPBound = cms.double(-0.1), + UpperIPBound = cms.double(0.1), + LowerIPEBound = cms.double(0.0), + UpperIPEBound = cms.double(0.04), + NBinsIPS = cms.int32(100), + NBinsIP = cms.int32(100), + NBinsIPE = cms.int32(100), + MinDecayLength = cms.double(-9999.0), + MaxDecayLength = cms.double(5.0), + MinJetDistance = cms.double(0.0), + MaxJetDistance = cms.double(0.07), + ) +) From 046c953bf35075b98173ad67ae28fb54746f6022 Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen Date: Tue, 12 Nov 2024 10:56:29 +0100 Subject: [PATCH 5/5] Update WP cut values for DeepJet and ParticleNet. Use Summer23BPix. --- DQMOffline/RecoB/python/bTagMiniDQMTaggers.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py b/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py index 4ac60fc14e4c0..f8bb0c98ede01 100644 --- a/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py +++ b/DQMOffline/RecoB/python/bTagMiniDQMTaggers.py @@ -66,11 +66,11 @@ # DeepFlavour (aka DeepJet) # ############################################################ -# recommendation for UL18: https://twiki.cern.ch/twiki/bin/view/CMS/BtagRecommendation106XUL18 +# Summer23BPix Working points deepFlavourWP = { - 'BvsAll': 0.0490, # loose - 'CvsL': 0.099, # medium - 'CvsB': 0.325, # medium + 'BvsAll': 0.048, # loose + 'CvsL': 0.102, # medium + 'CvsB': 0.328, # medium } DeepFlavourDiscriminators = { @@ -143,12 +143,18 @@ commonTaggerConfig, bTagGenericAnalysisBlock ) + if "BvsAll" in discr: + ParticleNetPuppiCentralDiscriminators[discr].discrCut = cms.double(0.0359)#Summer23BPix Loose WP elif "Cvs" in discr: ParticleNetPuppiCentralDiscriminators[discr] = cms.PSet( commonTaggerConfig, cTagGenericAnalysisBlock, ) ParticleNetPuppiCentralDiscriminators[discr].CTagPlots = True + if "CvsB" in discr: + ParticleNetPuppiCentralDiscriminators[discr].discrCut = cms.double(0.358)#Summer23BPix Medium WP + if "CvsL" in discr: + ParticleNetPuppiCentralDiscriminators[discr].discrCut = cms.double(0.149)#Summer23BPix Medium WP elif "TauVs" in discr: ParticleNetPuppiCentralDiscriminators[discr] = cms.PSet( commonTaggerConfig,