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 #9120 from cms-btv-pog/BoostedDoubleSVTagger_from-…
…CMSSW_7_5_X_2015-05-16-1100 Boosted double SV tagger
- Loading branch information
Showing
24 changed files
with
529 additions
and
0 deletions.
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
10 changes: 10 additions & 0 deletions
10
RecoBTag/ImpactParameter/python/pfImpactParameterTagInfosAK8_cfi.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,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoBTag.ImpactParameter.pfImpactParameterTagInfos_cfi import * | ||
|
||
pfImpactParameterTagInfosAK8 = pfImpactParameterTagInfos.clone( | ||
computeProbabilities = cms.bool(False), | ||
computeGhostTrack = cms.bool(False), | ||
jets = cms.InputTag("ak8PFJetsCHS"), | ||
maxDeltaR = cms.double(0.8) | ||
) |
10 changes: 10 additions & 0 deletions
10
RecoBTag/ImpactParameter/python/pfImpactParameterTagInfosCA15_cfi.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,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoBTag.ImpactParameter.pfImpactParameterTagInfos_cfi import * | ||
|
||
pfImpactParameterTagInfosCA15 = pfImpactParameterTagInfos.clone( | ||
computeProbabilities = cms.bool(False), | ||
computeGhostTrack = cms.bool(False), | ||
jets = cms.InputTag("ca15PFJetsCHS"), | ||
maxDeltaR = cms.double(1.5) | ||
) |
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Utilities"/> | ||
<use name="CommonTools/Utils"/> | ||
<use name="DataFormats/Math"/> | ||
<use name="DataFormats/TrackReco"/> | ||
<use name="DataFormats/VertexReco"/> | ||
<use name="DataFormats/BTauReco"/> | ||
<use name="DataFormats/PatCandidates"/> | ||
<use name="RecoVertex/VertexTools"/> | ||
<use name="RecoBTau/JetTagComputer"/> | ||
<use name="rootmath"/> | ||
<use name="fastjet"/> | ||
<use name="fastjet-contrib"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
44 changes: 44 additions & 0 deletions
44
RecoBTag/SecondaryVertex/interface/CandidateBoostedDoubleSecondaryVertexComputer.h
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,44 @@ | ||
#ifndef RecoBTag_SecondaryVertex_CandidateBoostedDoubleSecondaryVertexComputer_h | ||
#define RecoBTag_SecondaryVertex_CandidateBoostedDoubleSecondaryVertexComputer_h | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "RecoBTau/JetTagComputer/interface/JetTagComputer.h" | ||
#include "DataFormats/JetReco/interface/JetCollection.h" | ||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" | ||
#include "RecoBTag/SecondaryVertex/interface/MvaBoostedDoubleSecondaryVertexEstimator.h" | ||
#include "RecoBTag/SecondaryVertex/interface/TrackKinematics.h" | ||
|
||
#include "fastjet/PseudoJet.hh" | ||
#include "fastjet/contrib/Njettiness.hh" | ||
|
||
#include <mutex> | ||
|
||
|
||
class CandidateBoostedDoubleSecondaryVertexComputer : public JetTagComputer { | ||
|
||
public: | ||
CandidateBoostedDoubleSecondaryVertexComputer(const edm::ParameterSet & parameters); | ||
|
||
float discriminator(const TagInfoHelper & tagInfos) const override; | ||
|
||
private: | ||
void calcNsubjettiness(const reco::JetBaseRef & jet, float & tau1, float & tau2, std::vector<fastjet::PseudoJet> & currentAxes) const; | ||
void setTracksPVBase(const reco::TrackRef & trackRef, const reco::VertexRef & vertexRef, float & PVweight) const; | ||
void setTracksPV(const reco::CandidatePtr & trackRef, const reco::VertexRef & vertexRef, float & PVweight) const; | ||
void vertexKinematics(const reco::VertexCompositePtrCandidate & vertex, reco::TrackKinematics & vertexKinematics) const; | ||
|
||
const double beta_ ; | ||
const double R0_; | ||
// N-subjettiness calculator | ||
fastjet::contrib::Njettiness njettiness_; | ||
|
||
const double maxSVDeltaRToJet_; | ||
|
||
edm::FileInPath weightFile_; | ||
mutable std::mutex m_mutex; | ||
[[cms::thread_guard("m_mutex")]] std::unique_ptr<MvaBoostedDoubleSecondaryVertexEstimator> mvaID; | ||
}; | ||
|
||
#endif // RecoBTag_SecondaryVertex_CandidateBoostedDoubleSecondaryVertexComputer_h |
29 changes: 29 additions & 0 deletions
29
RecoBTag/SecondaryVertex/interface/MvaBoostedDoubleSecondaryVertexEstimator.h
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,29 @@ | ||
#ifndef RecoBTag_SecondaryVertex_MvaBoostedDoubleSecondaryVertexEstimator_h | ||
#define RecoBTag_SecondaryVertex_MvaBoostedDoubleSecondaryVertexEstimator_h | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include <TROOT.h> | ||
#include "TMVA/Factory.h" | ||
#include "TMVA/Tools.h" | ||
#include "TMVA/Reader.h" | ||
|
||
class MvaBoostedDoubleSecondaryVertexEstimator { | ||
|
||
public: | ||
MvaBoostedDoubleSecondaryVertexEstimator(const std::string &); | ||
~MvaBoostedDoubleSecondaryVertexEstimator(); | ||
|
||
float mvaValue(float, float, float, float, float, float, float, float, float, float); | ||
|
||
private: | ||
|
||
TMVA::Reader* TMVAReader; | ||
|
||
float mva_PFLepton_ptrel, mva_z_ratio, mva_tau_dot, mva_SV_mass_0, mva_SV_EnergyRatio_0, | ||
mva_SV_EnergyRatio_1, mva_PFLepton_IP2D, mva_tau21, mva_nSL, mva_jetNTracksEtaRel; | ||
float mva_massGroomed, mva_flavour, mva_nbHadrons, mva_ptGroomed, mva_etaGroomed; | ||
}; | ||
|
||
#endif // RecoBTag_SecondaryVertex_MvaBoostedDoubleSecondaryVertexEstimator_h | ||
|
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
8 changes: 8 additions & 0 deletions
8
RecoBTag/SecondaryVertex/python/candidateBoostedDoubleSecondaryVertexAK8Computer_cfi.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,8 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
candidateBoostedDoubleSecondaryVertexAK8Computer = cms.ESProducer("CandidateBoostedDoubleSecondaryVertexESProducer", | ||
beta = cms.double(1.0), | ||
R0 = cms.double(0.8), | ||
maxSVDeltaRToJet = cms.double(0.7), | ||
weightFile = cms.FileInPath('RecoBTag/SecondaryVertex/data/BoostedDoubleSV_AK8_BDT.weights.xml.gz') | ||
) |
8 changes: 8 additions & 0 deletions
8
RecoBTag/SecondaryVertex/python/candidateBoostedDoubleSecondaryVertexCA15Computer_cfi.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,8 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
candidateBoostedDoubleSecondaryVertexCA15Computer = cms.ESProducer("CandidateBoostedDoubleSecondaryVertexESProducer", | ||
beta = cms.double(1.0), | ||
R0 = cms.double(1.5), | ||
maxSVDeltaRToJet = cms.double(1.3), | ||
weightFile = cms.FileInPath('RecoBTag/SecondaryVertex/data/BoostedDoubleSV_CA15_BDT.weights.xml.gz') | ||
) |
9 changes: 9 additions & 0 deletions
9
RecoBTag/SecondaryVertex/python/pfBoostedDoubleSecondaryVertexAK8BJetTags_cfi.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,9 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
pfBoostedDoubleSecondaryVertexAK8BJetTags = cms.EDProducer("JetTagProducer", | ||
jetTagComputer = cms.string('candidateBoostedDoubleSecondaryVertexAK8Computer'), | ||
tagInfos = cms.VInputTag(cms.InputTag("pfImpactParameterTagInfosAK8"), | ||
cms.InputTag("pfInclusiveSecondaryVertexFinderTagInfosAK8"), | ||
cms.InputTag("softPFMuonsTagInfosAK8"), | ||
cms.InputTag("softPFElectronsTagInfosAK8")) | ||
) |
9 changes: 9 additions & 0 deletions
9
RecoBTag/SecondaryVertex/python/pfBoostedDoubleSecondaryVertexCA15BJetTags_cfi.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,9 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
pfBoostedDoubleSecondaryVertexCA15BJetTags = cms.EDProducer("JetTagProducer", | ||
jetTagComputer = cms.string('candidateBoostedDoubleSecondaryVertexCA15Computer'), | ||
tagInfos = cms.VInputTag(cms.InputTag("pfImpactParameterTagInfosCA15"), | ||
cms.InputTag("pfInclusiveSecondaryVertexFinderTagInfosCA15"), | ||
cms.InputTag("softPFMuonsTagInfosCA15"), | ||
cms.InputTag("softPFElectronsTagInfosCA15")) | ||
) |
10 changes: 10 additions & 0 deletions
10
RecoBTag/SecondaryVertex/python/pfInclusiveSecondaryVertexFinderTagInfosAK8_cfi.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,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoBTag.SecondaryVertex.pfInclusiveSecondaryVertexFinderTagInfos_cfi import * | ||
|
||
pfInclusiveSecondaryVertexFinderTagInfosAK8 = pfInclusiveSecondaryVertexFinderTagInfos.clone( | ||
trackIPTagInfos = cms.InputTag("pfImpactParameterTagInfosAK8"), | ||
extSVDeltaRToJet = cms.double(0.8) | ||
) | ||
pfInclusiveSecondaryVertexFinderTagInfosAK8.trackSelection.jetDeltaRMax = cms.double(0.8) # plays no role since using IVF vertices | ||
pfInclusiveSecondaryVertexFinderTagInfosAK8.vertexCuts.maxDeltaRToJetAxis = cms.double(0.8) |
10 changes: 10 additions & 0 deletions
10
RecoBTag/SecondaryVertex/python/pfInclusiveSecondaryVertexFinderTagInfosCA15_cfi.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,10 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoBTag.SecondaryVertex.pfInclusiveSecondaryVertexFinderTagInfos_cfi import * | ||
|
||
pfInclusiveSecondaryVertexFinderTagInfosCA15 = pfInclusiveSecondaryVertexFinderTagInfos.clone( | ||
trackIPTagInfos = cms.InputTag("pfImpactParameterTagInfosCA15"), | ||
extSVDeltaRToJet = cms.double(1.5) | ||
) | ||
pfInclusiveSecondaryVertexFinderTagInfosCA15.trackSelection.jetDeltaRMax = cms.double(1.5) # plays no role since using IVF vertices | ||
pfInclusiveSecondaryVertexFinderTagInfosCA15.vertexCuts.maxDeltaRToJetAxis = cms.double(1.5) |
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
Oops, something went wrong.