From 94971d45ce9a5eed332616ed301fdaabdc2d51b8 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Mon, 26 Oct 2015 16:37:38 +0100 Subject: [PATCH 1/4] customise the PFProducer to read the PF calibrations with the "HLT" label --- HLTrigger/Configuration/python/customizeHLTforCMSSW.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index cca106a29dbd7..1f09562d2bb3a 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -184,13 +184,15 @@ def customiseFor11497(process): process.CaloTowerTopologyEP = cms.ESProducer( 'CaloTowerTopologyEP' ) return process + def customiseFor12044(process): # add a label to indentify the PFProducer calibrations for module in producers_by_type(process, 'PFProducer'): if not 'calibrationsLabel' in module.__dict__: - module.calibrationsLabel = cms.string('') + module.calibrationsLabel = cms.string('HLT') return process + # CMSSW version specific customizations def customiseHLTforCMSSW(process, menuType="GRun", fastSim=False): import os From c43a59ab926c07dfcc9ea64e8b64c1eb8f9e69db Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Mon, 26 Oct 2015 16:39:38 +0100 Subject: [PATCH 2/4] GenericMVAJetTagComputer: add a label to choose calibrations - rename private variables to match CMSSW coding conventions - add a label to choose which calibrations to use --- ...inedSecondaryVertexSoftLeptonCvsLComputer_cfi.py | 1 + .../python/candidateCombinedMVAComputer_cfi.py | 1 + .../candidateNegativeCombinedMVAComputer_cfi.py | 1 + .../candidatePositiveCombinedMVAComputer_cfi.py | 1 + RecoBTag/Combined/python/combinedMVAComputer_cfi.py | 1 + .../python/negativeCombinedMVAComputer_cfi.py | 1 + .../python/positiveCombinedMVAComputer_cfi.py | 1 + .../python/impactParameterMVAComputer_cfi.py | 5 ++--- .../candidateCombinedSecondaryVertexComputer_cfi.py | 1 + ...CombinedSecondaryVertexSoftLeptonComputer_cfi.py | 1 + ...andidateCombinedSecondaryVertexV2Computer_cfi.py | 1 + .../python/combinedSecondaryVertexComputer_cfi.py | 1 + ...combinedSecondaryVertexSoftLeptonComputer_cfi.py | 1 + .../python/combinedSecondaryVertexV2Computer_cfi.py | 1 + .../python/ghostTrackComputer_cfi.py | 1 + .../interface/GenericMVAJetTagComputer.h | 5 +++-- .../JetTagComputer/src/GenericMVAJetTagComputer.cc | 13 +++++++------ 17 files changed, 26 insertions(+), 11 deletions(-) diff --git a/RecoBTag/CTagging/python/candidateCombinedSecondaryVertexSoftLeptonCvsLComputer_cfi.py b/RecoBTag/CTagging/python/candidateCombinedSecondaryVertexSoftLeptonCvsLComputer_cfi.py index 786b97d8bc641..83da46478e741 100644 --- a/RecoBTag/CTagging/python/candidateCombinedSecondaryVertexSoftLeptonCvsLComputer_cfi.py +++ b/RecoBTag/CTagging/python/candidateCombinedSecondaryVertexSoftLeptonCvsLComputer_cfi.py @@ -16,6 +16,7 @@ 'CombinedSVRecoVertexSoftElectronCvsL', 'CombinedSVPseudoVertexSoftElectronCvsL', 'CombinedSVNoVertexSoftElectronCvsL'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexLeptonCategory') ) diff --git a/RecoBTag/Combined/python/candidateCombinedMVAComputer_cfi.py b/RecoBTag/Combined/python/candidateCombinedMVAComputer_cfi.py index 726b4d7cdd96b..3c3a9ece0418f 100644 --- a/RecoBTag/Combined/python/candidateCombinedMVAComputer_cfi.py +++ b/RecoBTag/Combined/python/candidateCombinedMVAComputer_cfi.py @@ -3,6 +3,7 @@ candidateCombinedMVAComputer = cms.ESProducer("CombinedMVAJetTagESProducer", useCategories = cms.bool(False), calibrationRecord = cms.string('CombinedMVA'), + recordLabel = cms.string(''), jetTagComputers = cms.VPSet( cms.PSet( discriminator = cms.bool(True), diff --git a/RecoBTag/Combined/python/candidateNegativeCombinedMVAComputer_cfi.py b/RecoBTag/Combined/python/candidateNegativeCombinedMVAComputer_cfi.py index a763f55f35b53..7bb2fa5fdaa86 100644 --- a/RecoBTag/Combined/python/candidateNegativeCombinedMVAComputer_cfi.py +++ b/RecoBTag/Combined/python/candidateNegativeCombinedMVAComputer_cfi.py @@ -3,6 +3,7 @@ candidateNegativeCombinedMVAComputer = cms.ESProducer("CombinedMVAJetTagESProducer", useCategories = cms.bool(False), calibrationRecord = cms.string('CombinedMVA'), + recordLabel = cms.string(''), jetTagComputers = cms.VPSet( cms.PSet( discriminator = cms.bool(True), diff --git a/RecoBTag/Combined/python/candidatePositiveCombinedMVAComputer_cfi.py b/RecoBTag/Combined/python/candidatePositiveCombinedMVAComputer_cfi.py index 4fe782a27add1..5d0fe6bb79594 100644 --- a/RecoBTag/Combined/python/candidatePositiveCombinedMVAComputer_cfi.py +++ b/RecoBTag/Combined/python/candidatePositiveCombinedMVAComputer_cfi.py @@ -3,6 +3,7 @@ candidatePositiveCombinedMVAComputer = cms.ESProducer("CombinedMVAJetTagESProducer", useCategories = cms.bool(False), calibrationRecord = cms.string('CombinedMVA'), + recordLabel = cms.string(''), jetTagComputers = cms.VPSet( cms.PSet( discriminator = cms.bool(True), diff --git a/RecoBTag/Combined/python/combinedMVAComputer_cfi.py b/RecoBTag/Combined/python/combinedMVAComputer_cfi.py index 5d9f8d4230962..b7891da0e5b8c 100644 --- a/RecoBTag/Combined/python/combinedMVAComputer_cfi.py +++ b/RecoBTag/Combined/python/combinedMVAComputer_cfi.py @@ -3,6 +3,7 @@ combinedMVAComputer = cms.ESProducer("CombinedMVAJetTagESProducer", useCategories = cms.bool(False), calibrationRecord = cms.string('CombinedMVA'), + recordLabel = cms.string(''), jetTagComputers = cms.VPSet( cms.PSet( discriminator = cms.bool(True), diff --git a/RecoBTag/Combined/python/negativeCombinedMVAComputer_cfi.py b/RecoBTag/Combined/python/negativeCombinedMVAComputer_cfi.py index 18fde5345db5f..482fa70bdbf04 100644 --- a/RecoBTag/Combined/python/negativeCombinedMVAComputer_cfi.py +++ b/RecoBTag/Combined/python/negativeCombinedMVAComputer_cfi.py @@ -3,6 +3,7 @@ negativeCombinedMVAComputer = cms.ESProducer("CombinedMVAJetTagESProducer", useCategories = cms.bool(False), calibrationRecord = cms.string('CombinedMVA'), + recordLabel = cms.string(''), jetTagComputers = cms.VPSet( cms.PSet( discriminator = cms.bool(True), diff --git a/RecoBTag/Combined/python/positiveCombinedMVAComputer_cfi.py b/RecoBTag/Combined/python/positiveCombinedMVAComputer_cfi.py index d8964ec15a0a5..b4f51be140410 100644 --- a/RecoBTag/Combined/python/positiveCombinedMVAComputer_cfi.py +++ b/RecoBTag/Combined/python/positiveCombinedMVAComputer_cfi.py @@ -3,6 +3,7 @@ positiveCombinedMVAComputer = cms.ESProducer("CombinedMVAJetTagESProducer", useCategories = cms.bool(False), calibrationRecord = cms.string('CombinedMVA'), + recordLabel = cms.string(''), jetTagComputers = cms.VPSet( cms.PSet( discriminator = cms.bool(True), diff --git a/RecoBTag/ImpactParameter/python/impactParameterMVAComputer_cfi.py b/RecoBTag/ImpactParameter/python/impactParameterMVAComputer_cfi.py index 9a0ee0f0225cd..66fecf856fe98 100644 --- a/RecoBTag/ImpactParameter/python/impactParameterMVAComputer_cfi.py +++ b/RecoBTag/ImpactParameter/python/impactParameterMVAComputer_cfi.py @@ -3,7 +3,6 @@ # impactParameterMVAComputer btag computer impactParameterMVAComputer = cms.ESProducer("GenericMVAJetTagESProducer", useCategories = cms.bool(False), - calibrationRecord = cms.string('ImpactParameterMVA') + calibrationRecord = cms.string('ImpactParameterMVA'), + recordLabel = cms.string('') ) - - diff --git a/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexComputer_cfi.py b/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexComputer_cfi.py index dcbcb29812281..1b4450d579a68 100644 --- a/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexComputer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexComputer_cfi.py @@ -9,5 +9,6 @@ 'CombinedSVRecoVertex', 'CombinedSVPseudoVertex', 'CombinedSVNoVertex'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexCategory') ) diff --git a/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexSoftLeptonComputer_cfi.py b/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexSoftLeptonComputer_cfi.py index 776465286fe40..03af4a7fad4e4 100644 --- a/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexSoftLeptonComputer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexSoftLeptonComputer_cfi.py @@ -15,6 +15,7 @@ 'CombinedSVRecoVertexSoftElectron', 'CombinedSVPseudoVertexSoftElectron', 'CombinedSVNoVertexSoftElectron'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexLeptonCategory') ) diff --git a/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexV2Computer_cfi.py b/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexV2Computer_cfi.py index 53ab68d6d3ef4..aba9d16530e47 100644 --- a/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexV2Computer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/candidateCombinedSecondaryVertexV2Computer_cfi.py @@ -9,5 +9,6 @@ 'CombinedSVIVFV2RecoVertex', 'CombinedSVIVFV2PseudoVertex', 'CombinedSVIVFV2NoVertex'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexCategory') ) diff --git a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexComputer_cfi.py b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexComputer_cfi.py index c8a613c4cc145..ac3d03982ed01 100644 --- a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexComputer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexComputer_cfi.py @@ -9,5 +9,6 @@ 'CombinedSVRecoVertex', 'CombinedSVPseudoVertex', 'CombinedSVNoVertex'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexCategory') ) diff --git a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexSoftLeptonComputer_cfi.py b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexSoftLeptonComputer_cfi.py index a256d826042ae..8a5002c2686b9 100644 --- a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexSoftLeptonComputer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexSoftLeptonComputer_cfi.py @@ -15,6 +15,7 @@ 'CombinedSVRecoVertexSoftElectron', 'CombinedSVPseudoVertexSoftElectron', 'CombinedSVNoVertexSoftElectron'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexLeptonCategory') ) diff --git a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2Computer_cfi.py b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2Computer_cfi.py index 40a323a69d0aa..4a4c64a8b5985 100644 --- a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2Computer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2Computer_cfi.py @@ -9,5 +9,6 @@ 'CombinedSVIVFV2RecoVertex', 'CombinedSVIVFV2PseudoVertex', 'CombinedSVIVFV2NoVertex'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexCategory') ) diff --git a/RecoBTag/SecondaryVertex/python/ghostTrackComputer_cfi.py b/RecoBTag/SecondaryVertex/python/ghostTrackComputer_cfi.py index 9e9f10e1cb9d1..e2bcbf5c23d93 100644 --- a/RecoBTag/SecondaryVertex/python/ghostTrackComputer_cfi.py +++ b/RecoBTag/SecondaryVertex/python/ghostTrackComputer_cfi.py @@ -9,5 +9,6 @@ 'GhostTrackRecoVertex', 'GhostTrackPseudoVertex', 'GhostTrackNoVertex'), + recordLabel = cms.string(''), categoryVariableName = cms.string('vertexCategory') ) diff --git a/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h b/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h index 72e0d7c3760fc..bd9d0e2c569b7 100644 --- a/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h +++ b/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h @@ -28,8 +28,9 @@ class GenericMVAJetTagComputer : public JetTagComputer { taggingVariables(const TagInfoHelper &info) const; private: - std::auto_ptr categorySelector; - GenericMVAComputerCache computerCache; + std::auto_ptr categorySelector_; + GenericMVAComputerCache computerCache_; + std::string recordLabel_; }; #endif // RecoBTau_JetTagComputer_GenericMVAJetTagComputer_h diff --git a/RecoBTau/JetTagComputer/src/GenericMVAJetTagComputer.cc b/RecoBTau/JetTagComputer/src/GenericMVAJetTagComputer.cc index bb719066cff51..d0a8945f39928 100644 --- a/RecoBTau/JetTagComputer/src/GenericMVAJetTagComputer.cc +++ b/RecoBTau/JetTagComputer/src/GenericMVAJetTagComputer.cc @@ -39,7 +39,8 @@ getCalibrationLabels(const edm::ParameterSet ¶ms, GenericMVAJetTagComputer::GenericMVAJetTagComputer( const edm::ParameterSet ¶ms) : - computerCache(getCalibrationLabels(params, categorySelector)) + computerCache_(getCalibrationLabels(params, categorySelector_)), + recordLabel_(params.getParameter("recordLabel")) { } @@ -53,11 +54,11 @@ void GenericMVAJetTagComputer::initialize(const JetTagComputerRecord & record) { // retrieve MVAComputer calibration container edm::ESHandle calibHandle; - dependentRecord.get(calibHandle); + dependentRecord.get(recordLabel_, calibHandle); const Calibration::MVAComputerContainer *calib = calibHandle.product(); // check for updates - computerCache.update(calib); + computerCache_.update(calib); } float GenericMVAJetTagComputer::discriminator(const TagInfoHelper &info) const @@ -66,13 +67,13 @@ float GenericMVAJetTagComputer::discriminator(const TagInfoHelper &info) const // retrieve index of computer in case categories are used int index = 0; - if (categorySelector.get()) { - index = categorySelector->findCategory(variables); + if (categorySelector_.get()) { + index = categorySelector_->findCategory(variables); if (index < 0) return -10.0; } - GenericMVAComputer const* computer = computerCache.getComputer(index); + GenericMVAComputer const* computer = computerCache_.getComputer(index); if (!computer) return -10.0; From eb202c2cf4fa6a637a39d85d810e77f913355a95 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Mon, 26 Oct 2015 16:58:14 +0100 Subject: [PATCH 3/4] customise the CombinedSecondaryVertexESProducer to read b-tagging calibrations with the "HLT" label --- .../Configuration/python/customizeHLTforCMSSW.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 1f09562d2bb3a..fd637daee91b8 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -1,8 +1,11 @@ import FWCore.ParameterSet.Config as cms # reusable functions -def producers_by_type(process, type): - return (module for module in process._Process__producers.values() if module._TypedParameterizable__type == type) +def producers_by_type(process, *types): + return (module for module in process._Process__producers.values() if module._TypedParameterizable__type in types) + +def esproducers_by_type(process, *types): + return (module for module in process._Process__esproducers.values() if module._TypedParameterizable__type in types) # Update to replace old jet corrector mechanism @@ -193,6 +196,14 @@ def customiseFor12044(process): return process +def customiseFor12062(process): + # add a label to indentify the b-tagging calibrations + for module in esproducers_by_type(process, 'CombinedSecondaryVertexESProducer'): + if not 'recordLabel' in module.__dict__: + module.recordLabel = cms.string('HLT') + return process + + # CMSSW version specific customizations def customiseHLTforCMSSW(process, menuType="GRun", fastSim=False): import os @@ -205,6 +216,7 @@ def customiseHLTforCMSSW(process, menuType="GRun", fastSim=False): process = customiseFor11183(process) process = customiseFor11497(process) process = customiseFor12044(process) + process = customiseFor12062(process) if cmsswVersion >= "CMSSW_7_5": process = customiseFor10927(process) process = customiseFor9232(process) From cb1273cd198da985834965d59356c472b54e6e96 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 27 Oct 2015 10:53:17 +0100 Subject: [PATCH 4/4] Adding label HLT for PFCalibrationRcd --- Configuration/AlCa/python/autoCond.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index b015fe70159be..c4ed59261bd26 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -18,9 +18,9 @@ # GlobalTag for MC production (Heavy Ions collisions) with optimistic alignment and calibrations for Run2 'run2_mc_hi' : '76X_mcRun2_HeavyIon_v10', # GlobalTag for Run1 data reprocessing - 'run1_data' : '76X_dataRun1_v9', + 'run1_data' : '76X_dataRun1_v10', # GlobalTag for Run2 data reprocessing - 'run2_data' : '76X_dataRun2_v9', + 'run2_data' : '76X_dataRun2_v10', # GlobalTag for Run1 HLT: it points to the online GT 'run1_hlt' : '76X_dataRun1_HLT_frozen_v9', # GlobalTag for Run2 HLT: it points to the online GT