Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy csvV2 calibrations for 2018 PbPb data #31660

Merged
merged 5 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from RecoBTag.SecondaryVertex.simpleSecondaryVertex2TrkComputer_cfi import *
from RecoBTag.SecondaryVertex.simpleSecondaryVertex3TrkComputer_cfi import *
from RecoBTag.SecondaryVertex.combinedSecondaryVertexV2Computer_cfi import *
from RecoBTag.Combined.heavyIonCSVComputer_cfi import *
from RecoBTag.ImpactParameter.jetBProbabilityComputer_cfi import *
from RecoBTag.ImpactParameter.jetProbabilityComputer_cfi import *
from RecoBTag.ImpactParameter.trackCounting3D2ndComputer_cfi import *
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ def _add_jetsPuppi(process):

_run2_miniAOD_ANY.toModify(process.patJets, addTagInfos = False )

_hiGeneral.toModify(process.patJets, addTagInfos = True )
_hiGeneral.toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfos","secondaryVertexTagInfos"]) )

## puppi met
Expand Down
1 change: 1 addition & 0 deletions RecoBTag/Combined/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="RecoBTau/JetTagComputer"/>
<use name="RecoBTag/SecondaryVertex"/>
<use name="boost"/>
<export>
<lib name="1"/>
Expand Down
55 changes: 55 additions & 0 deletions RecoBTag/Combined/interface/HeavyIonCSVTagger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#ifndef RecoBTag_Combined_HeavyIonCSVTagger_h
#define RecoBTag_Combined_HeavyIonCSVTagger_h

#include "FWCore/Framework/interface/ESConsumesCollector.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/MVAUtils/interface/TMVAEvaluator.h"
#include "RecoBTau/JetTagComputer/interface/JetTagComputer.h"
#include "RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h"
#include "DataFormats/BTauReco/interface/TaggingVariable.h"
#include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h"

#include <memory>
#include <type_traits>

/** \class HeavyIonCSVTagger
* \author M. Nguyen
* copied from CharmTagger.h (by M. Verzetti)
*/

class HeavyIonCSVTagger : public JetTagComputer {
public:
struct Tokens {
Tokens(const edm::ParameterSet& configuration, edm::ESConsumesCollector&& cc);
edm::ESGetToken<GBRForest, GBRWrapperRcd> gbrForest_;
};

/// explicit ctor
HeavyIonCSVTagger(const edm::ParameterSet&, Tokens);
~HeavyIonCSVTagger();
float discriminator(const TagInfoHelper& tagInfo) const override;
void initialize(const JetTagComputerRecord& record) override;

typedef std::vector<edm::ParameterSet> vpset;

struct MVAVar {
std::string name;
reco::btau::TaggingVariableName id;
size_t index;
bool has_index;
float default_value;
};

private:
std::unique_ptr<TMVAEvaluator> mvaID_;
CombinedSVComputer sv_computer_;
std::vector<MVAVar> variables_;

std::string mva_name_;
edm::FileInPath weight_file_;
bool use_GBRForest_;
bool use_adaBoost_;
Tokens tokens_;
};

#endif
8 changes: 8 additions & 0 deletions RecoBTag/Combined/plugins/HeavyIonCSVESProducer.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "RecoBTau/JetTagComputer/interface/JetTagComputerESProducer.h"
#include "RecoBTag/Combined/interface/HeavyIonCSVTagger.h"

typedef JetTagComputerESProducer<HeavyIonCSVTagger> HeavyIonCSVESProducer;
DEFINE_FWK_EVENTSETUP_MODULE(HeavyIonCSVESProducer);
24 changes: 24 additions & 0 deletions RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import FWCore.ParameterSet.Config as cms
import RecoBTag.SecondaryVertex.candidateCombinedSecondaryVertexV2Computer_cfi as sv_cfg
from RecoBTag.Combined.heavyIonCSV_trainingSettings import heavyIonCSV_vpset

heavyIonCSVComputer = cms.ESProducer(
'HeavyIonCSVESProducer',
sv_cfg = cms.PSet(
**sv_cfg.candidateCombinedSecondaryVertexV2Computer.parameters_()
),
weightFile = cms.FileInPath('RecoBTag/Combined/data/TMVA_Btag_CsJets_PbPb2018_BDTG.weights.xml'),

variables = heavyIonCSV_vpset,
tagInfos = cms.VInputTag(
cms.InputTag('impactParameterTagInfos'),
cms.InputTag('secondaryVertexFinderTagInfos'),
),
mvaName = cms.string('BDT'),
useCondDB = cms.bool(False),
gbrForestLabel = cms.string(''),
useGBRForest = cms.bool(True),
useAdaBoost = cms.bool(False)
)


10 changes: 10 additions & 0 deletions RecoBTag/Combined/python/heavyIonCSVJetTags_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import FWCore.ParameterSet.Config as cms

heavyIonCSVJetTags = cms.EDProducer(
"JetTagProducer",
jetTagComputer = cms.string('heavyIonCSVTags'),
tagInfos = cms.VInputTag(
cms.InputTag('impactParameterTagInfos'),
cms.InputTag('secondaryVertexFinderTagInfos'),
)
)
183 changes: 183 additions & 0 deletions RecoBTag/Combined/python/heavyIonCSV_trainingSettings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
import FWCore.ParameterSet.Config as cms
heavyIonCSV_vpset = cms.VPSet([
cms.PSet(
default = cms.double(-100),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackSip3dSig_0'),
taggingVarName = cms.string('trackSip3dSig')
), cms.PSet(
default = cms.double(-100),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackSip3dSig_1'),
taggingVarName = cms.string('trackSip3dSig')
), cms.PSet(
default = cms.double(-100),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackSip3dSig_2'),
taggingVarName = cms.string('trackSip3dSig')
), cms.PSet(
default = cms.double(-100),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackSip3dSig_3'),
taggingVarName = cms.string('trackSip3dSig')
), cms.PSet(
default = cms.double(-999),
name = cms.string('TagVarCSV_trackSip3dSigAboveCharm'),
taggingVarName = cms.string('trackSip3dSigAboveCharm')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackPtRel_0'),
taggingVarName = cms.string('trackPtRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackPtRel_1'),
taggingVarName = cms.string('trackPtRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackPtRel_2'),
taggingVarName = cms.string('trackPtRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackPtRel_3'),
taggingVarName = cms.string('trackPtRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackEtaRel_0'),
taggingVarName = cms.string('trackEtaRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackEtaRel_1'),
taggingVarName = cms.string('trackEtaRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackEtaRel_2'),
taggingVarName = cms.string('trackEtaRel')
), cms.PSet(
default = cms.double(-1),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackEtaRel_3'),
taggingVarName = cms.string('trackEtaRel')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackDeltaR_0'),
taggingVarName = cms.string('trackDeltaR')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackDeltaR_1'),
taggingVarName = cms.string('trackDeltaR')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackDeltaR_2'),
taggingVarName = cms.string('trackDeltaR')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackDeltaR_3'),
taggingVarName = cms.string('trackDeltaR')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackPtRatio_0'),
taggingVarName = cms.string('trackPtRatio')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackPtRatio_1'),
taggingVarName = cms.string('trackPtRatio')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackPtRatio_2'),
taggingVarName = cms.string('trackPtRatio')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackPtRatio_3'),
taggingVarName = cms.string('trackPtRatio')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackJetDist_0'),
taggingVarName = cms.string('trackJetDist')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackJetDist_1'),
taggingVarName = cms.string('trackJetDist')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackJetDist_2'),
taggingVarName = cms.string('trackJetDist')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackJetDist_3'),
taggingVarName = cms.string('trackJetDist')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(0),
name = cms.string('TagVarCSV_trackDecayLenVal_0'),
taggingVarName = cms.string('trackDecayLenVal')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(1),
name = cms.string('TagVarCSV_trackDecayLenVal_1'),
taggingVarName = cms.string('trackDecayLenVal')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(2),
name = cms.string('TagVarCSV_trackDecayLenVal_2'),
taggingVarName = cms.string('trackDecayLenVal')
), cms.PSet(
default = cms.double(-0.1),
idx = cms.int32(3),
name = cms.string('TagVarCSV_trackDecayLenVal_3'),
taggingVarName = cms.string('trackDecayLenVal')
), cms.PSet(
default = cms.double(-0.1),
name = cms.string('TagVarCSV_trackSumJetEtRatio'),
taggingVarName = cms.string('trackSumJetEtRatio')
), cms.PSet(
default = cms.double(-0.1),
name = cms.string('TagVarCSV_trackSumJetDeltaR'),
taggingVarName = cms.string('trackSumJetDeltaR')
), cms.PSet(
default = cms.double(-0.1),
name = cms.string('TagVarCSV_vertexMass'),
taggingVarName = cms.string('vertexMass')
), cms.PSet(
default = cms.double(0),
name = cms.string('TagVarCSV_vertexNTracks'),
taggingVarName = cms.string('vertexNTracks')
), cms.PSet(
default = cms.double(-10),
name = cms.string('TagVarCSV_vertexEnergyRatio'),
taggingVarName = cms.string('vertexEnergyRatio')
), cms.PSet(
default = cms.double(-0.1),
name = cms.string('TagVarCSV_vertexJetDeltaR'),
taggingVarName = cms.string('vertexJetDeltaR')
), cms.PSet(
default = cms.double(-1),
name = cms.string('TagVarCSV_flightDistance2dSig'),
taggingVarName = cms.string('flightDistance2dSig')
), cms.PSet(
default = cms.double(0),
name = cms.string('TagVarCSV_jetNSecondaryVertices'),
taggingVarName = cms.string('jetNSecondaryVertices')
),cms.PSet(
default = cms.double(0),
name = cms.string('TagVarCSV_vertexCategory'),
taggingVarName = cms.string('vertexCategory')
)])
Loading