Skip to content

Commit

Permalink
backporting changes from FastSim refinement commit: 4ca1787. Refined …
Browse files Browse the repository at this point in the history
…variables will carry the normal names in NANO.
  • Loading branch information
sbein committed Feb 24, 2023
1 parent 4b674c9 commit 64d138d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionMVA.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h"
#include "RecoVertex/VertexPrimitives/interface/VertexState.h"

#include "PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.h"
#include "PhysicsTools/PatAlgos/interface/BaseMVAValueMapProducer.h"
#include <vector>

class BJetEnergyRegressionMVA : public BaseMVAValueMapProducer<pat::Jet> {
Expand Down
5 changes: 3 additions & 2 deletions PhysicsTools/NanoAOD/python/jets_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@
from Configuration.Eras.Modifier_fastSim_cff import fastSim
def nanoAOD_refineFastSim_bTagDeepFlav(process):


fastSim.toModify( process.jetTable.variables,
btagDeepFlavBunrefined = process.jetTable.variables.btagDeepFlavB.clone(),
btagDeepFlavCvBunrefined = process.jetTable.variables.btagDeepFlavCvB.clone(),
Expand Down Expand Up @@ -565,7 +566,7 @@ def nanoAOD_refineFastSim_bTagDeepFlav(process):

src = cms.InputTag("linkedObjects","jets"),

weightFile=cms.FileInPath("PhysicsTools/NanoAOD/data/btagDeepFlavRefineNN_CHS.onnx"),
weightFile=cms.FileInPath("PhysicsTools/NanoAOD/data/btagDeepFlavRefineNN_CHS.onnx"),#local hack for backporting: cp /cvmfs/cms.cern.ch/slc7_amd64_gcc11/cms/data-PhysicsTools-NanoAOD/V01-03-00/PhysicsTools/NanoAOD/data/btagDeepFlavRefineNN_CHS.onnx PhysicsTools/NanoAOD/data/btagDeepFlavRefineNN_CHS.onnx # cp /nfs/dust/cms/user/wolfmor/Refinement/TrainingOutput/regression_model_20221127_opset11.onnx PhysicsTools/NanoAOD/data/btagDeepFlavRefineNN_CHS.onnx
name = cms.string("btagDeepFlavRefineNN"),

isClassifier = cms.bool(False),
Expand All @@ -586,7 +587,7 @@ def nanoAOD_refineFastSim_bTagDeepFlav(process):
outputFormulas = cms.vstring(["at(0)","at(1)","at(2)","at(3)"]),
)

fastSim.toModify(process.jetTablesTask, process.jetTablesTask.add(process.btagDeepFlavRefineNN))
fastSim.toModify(process.jetTables, process.jetTables.insert(0,process.btagDeepFlavRefineNN))

return process

Expand Down
2 changes: 2 additions & 0 deletions PhysicsTools/PatAlgos/interface/BaseMVAValueMapProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ void BaseMVAValueMapProducer<T>::produce(edm::Event& iEvent, const edm::EventSet
}
}


template <typename T>
edm::ParameterSetDescription BaseMVAValueMapProducer<T>::getDescription() {
edm::ParameterSetDescription desc;
Expand All @@ -299,6 +300,7 @@ edm::ParameterSetDescription BaseMVAValueMapProducer<T>::getDescription() {
desc.add<unsigned int>("nThreads", 1)->setComment("number of threads");
desc.add<std::string>("singleThreadPool", "no_threads");
desc.add<bool>("batch_eval", false)->setComment("Run inference in batch instead of per-object");
desc.add<bool>("disableONNXGraphOpt", false)->setComment("Disable ONNX runtime graph optimization");

return desc;
}
Expand Down
3 changes: 2 additions & 1 deletion PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Package: PhysicsTools/PatAlgos
// Class: BaseMVAValueMapProducer
//
//
/**\class BaseMVAValueMapProducer BaseMVAValueMapProducer.cc PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc
Description: [one line class summary]
Expand All @@ -26,3 +26,4 @@ typedef BaseMVAValueMapProducer<pat::Electron> EleBaseMVAValueMapProducer;
DEFINE_FWK_MODULE(JetBaseMVAValueMapProducer);
DEFINE_FWK_MODULE(MuonBaseMVAValueMapProducer);
DEFINE_FWK_MODULE(EleBaseMVAValueMapProducer);

0 comments on commit 64d138d

Please sign in to comment.