-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31660 from mandrenguyen/hiLegacyRun2CSVv2
Legacy csvV2 calibrations for 2018 PbPb data
- Loading branch information
Showing
10 changed files
with
391 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() override; | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
183
RecoBTag/Combined/python/heavyIonCSV_trainingSettings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
)]) |
Oops, something went wrong.