-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Legacy csvV2 calibrations for 2018 PbPb data #31660
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0ae6f53
Run 2 csvV2 calibrations for 2018 PbPb data
mandrenguyen 6f84b7d
Change class name and clean up based code review
mandrenguyen a94522e
Upper case name, code streamlining
mandrenguyen eafdff2
loop to fill mva values restored
mandrenguyen 3f3a2f1
code checks again
mandrenguyen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,57 @@ | ||
| #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 "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.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; //{} | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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_; | ||
| //CombinedSVSoftLeptonComputer sl_computer_; | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.