Skip to content

Commit

Permalink
Merge pull request #17247 from mverzett/DeepFlavourPR-from-CMSSW_9_0_X
Browse files Browse the repository at this point in the history
Deep flavour PR
  • Loading branch information
cmsbuild committed Feb 9, 2017
2 parents a658575 + 6f1e3b6 commit c223087
Show file tree
Hide file tree
Showing 24 changed files with 1,022 additions and 19 deletions.
39 changes: 39 additions & 0 deletions DataFormats/BTauReco/interface/ShallowTagInfo.h
@@ -0,0 +1,39 @@
#ifndef DataFormats_BTauReco_ShallowTagInfo_h
#define DataFormats_BTauReco_ShallowTagInfo_h

#include "DataFormats/BTauReco/interface/RefMacros.h"
#include "DataFormats/BTauReco/interface/BaseTagInfo.h"
#include "DataFormats/BTauReco/interface/CandIPTagInfo.h"
#include "DataFormats/BTauReco/interface/CandSecondaryVertexTagInfo.h"
#include "DataFormats/BTauReco/interface/TaggingVariable.h"

namespace reco {

class ShallowTagInfo : public BaseTagInfo {
public:
ShallowTagInfo(void) { }

ShallowTagInfo(
const TaggingVariableList & list,
const edm::RefToBase<Jet> & jetref) :
list_(list),
jetRef_(jetref) { }

virtual ~ShallowTagInfo(void) { }

virtual ShallowTagInfo* clone(void) const { return new ShallowTagInfo(*this); }

virtual edm::RefToBase<Jet> jet(void) const { return jetRef_; }

virtual TaggingVariableList taggingVariables(void) const { return list_; }

protected:
/*const*/ TaggingVariableList list_;
/*const*/ edm::RefToBase<Jet> jetRef_;
};

DECLARE_EDM_REFS( ShallowTagInfo )

}

#endif // DataFormats_BTauReco_ShallowTagInfo_h
8 changes: 8 additions & 0 deletions DataFormats/BTauReco/interface/TaggingVariable.h
Expand Up @@ -35,8 +35,11 @@ namespace reco {
jetPt, // jet transverse momentum
trackJetPt, // track-based jet transverse momentum
jetEta, // jet pseudorapidity
jetAbsEta, // jet pseudorapidity
jetPhi, // jet polar angle
jetNTracks, // tracks associated to jet
jetNSelectedTracks, // tracks associated to jet
jetNTracksEtaRel, // number of tracks for which etaRel is computed

trackMomentum, // track momentum
trackEta, // track pseudorapidity
Expand Down Expand Up @@ -153,6 +156,11 @@ namespace reco {
tau2_flightDistance2dSig, // transverse distance significance between primary and secondary vertex associated to the 2nd N-subjettiness axis
tau2_vertexDeltaR, // pseudoangular distance between the 2nd N-subjettiness axis and secondary vertex direction
z_ratio, // z ratio

Jet_SoftMu, // discriminator output of SoftMuon Tagger, used as input to (Deep)CMVA
Jet_SoftEl, // discriminator output of SoftElectron Tagger, used as input to (Deep)CMVA
Jet_JBP, // discriminator output of JPB Tagger, used as input to (Deep)CMVA
Jet_JP, // discriminator output of JP Tagger, used as input to (Deep)CMVA
// #################################################################################

algoDiscriminator, // discriminator output of an algorithm
Expand Down
14 changes: 14 additions & 0 deletions DataFormats/BTauReco/src/TaggingVariable.cc
Expand Up @@ -12,8 +12,11 @@ const char* const TaggingVariableDescription[] = {
/* [jetPt] = */ "jet transverse momentum",
/* [trackJetPt] = */ "track-based jet transverse momentum",
/* [jetEta] = */ "jet pseudorapidity",
/* [jetAbsEta] = */ "jet absolute pseudorapidity",
/* [jetPhi] = */ "jet polar angle",
/* [jetNTracks] = */ "tracks associated to jet",
/* [jetNSelectedTracks] = */ "selected tracks in the jet",
/* [jetNTracksEtaRel] = */ "number of tracks for which etaRel is computed",

/* [trackMomentum] = */ "track momentum",
/* [trackEta] = */ "track pseudorapidity",
Expand Down Expand Up @@ -129,6 +132,10 @@ const char* const TaggingVariableDescription[] = {
/* [tau2_flightDistance2dSig] = */ "transverse distance significance between primary and secondary vertex associated to the 2nd N-subjettiness axis",
/* [tau2_vertexDeltaR] = */ "pseudoangular distance between the 2nd N-subjettiness axis and secondary vertex direction",
/* [z_ratio] = */ "z ratio",
/* [Jet_SoftMu] = */ "SoftMu Tagger discriminator",
/* [Jet_SoftEl] = */ "SoftEl Tagger discriminator",
/* [Jet_JBP] = */ "JBP Tagger discriminator",
/* [Jet_JP] = */ "JP Tagger discriminator",

/* [algoDiscriminator] = */ "discriminator output of an algorithm",

Expand All @@ -140,8 +147,11 @@ const char* const TaggingVariableTokens[] = {
/* [jetPt] = */ "jetPt",
/* [trackJetPt] = */ "trackJetPt",
/* [jetEta] = */ "jetEta",
/* [jetAbsEta] = */ "jetAbsEta",
/* [jetPhi] = */ "jetPhi",
/* [jetNTracks] = */ "jetNTracks",
/* [jetNSelectedTracks] = */ "jetNSelectedTracks",
/* [jetNTracksEtaRel] = */ "jetNTracksEtaRel",

/* [trackMomentum] = */ "trackMomentum",
/* [trackEta] = */ "trackEta",
Expand Down Expand Up @@ -258,6 +268,10 @@ const char* const TaggingVariableTokens[] = {
/* [tau2_flightDistance2dSig] = */ "tau2_flightDistance2dSig",
/* [tau2_vertexDeltaR] = */ "tau2_vertexDeltaR",
/* [z_ratio] = */ "z_ratio",
/* [Jet_SoftMu] = */ "Jet_SoftMu",
/* [Jet_SoftEl] = */ "Jet_SoftEl",
/* [Jet_JBP] = */ "Jet_JBP",
/* [Jet_JP] = */ "Jet_JP",

/* [algoDiscriminator] = */ "algoDiscriminator",

Expand Down
13 changes: 13 additions & 0 deletions DataFormats/BTauReco/src/classes.h
Expand Up @@ -33,6 +33,7 @@
#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h"
#include "DataFormats/BTauReco/interface/CandSecondaryVertexTagInfo.h"
#include "DataFormats/BTauReco/interface/BoostedDoubleSVTagInfo.h"
#include "DataFormats/BTauReco/interface/ShallowTagInfo.h"
#include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"
#include "DataFormats/BTauReco/interface/CandSoftLeptonTagInfo.h"
#include "DataFormats/BTauReco/interface/TauImpactParameterInfo.h"
Expand Down Expand Up @@ -88,6 +89,14 @@ namespace DataFormats_BTauReco {
reco::BoostedDoubleSVTagInfoRefVector bdsv_rv;
edm::Wrapper<reco::BoostedDoubleSVTagInfoCollection> bdsv_wc;

reco::ShallowTagInfo dnn;
reco::ShallowTagInfoCollection dnn_c;
reco::ShallowTagInfoRef dnn_r;
reco::ShallowTagInfoFwdRef dnn_fr;
reco::ShallowTagInfoRefProd dnn_rp;
reco::ShallowTagInfoRefVector dnn_rv;
edm::Wrapper<reco::ShallowTagInfoCollection> dnn_wc;

reco::CombinedTauTagInfo ct;
reco::CombinedTauTagInfoCollection ct_c;
reco::CombinedTauTagInfoRef ct_r;
Expand Down Expand Up @@ -296,6 +305,8 @@ namespace DataFormats_BTauReco {
edm::reftobase::RefHolder<reco::CandSecondaryVertexTagInfoRef> rbh_casv;
edm::reftobase::Holder<reco::BaseTagInfo, reco::BoostedDoubleSVTagInfoRef> rb_bdsv;
edm::reftobase::RefHolder<reco::BoostedDoubleSVTagInfoRef> rbh_bdsv;
edm::reftobase::Holder<reco::BaseTagInfo, reco::ShallowTagInfoRef> rb_dnn;
edm::reftobase::RefHolder<reco::ShallowTagInfoRef> rbh_dnn;
edm::reftobase::Holder<reco::BaseTagInfo, reco::CombinedTauTagInfoRef> rb_ct;
edm::reftobase::RefHolder<reco::CombinedTauTagInfoRef> rbh_ct;
edm::reftobase::Holder<reco::BaseTagInfo, reco::IsolatedTauTagInfoRef> rb_it;
Expand Down Expand Up @@ -327,6 +338,8 @@ namespace DataFormats_BTauReco {
edm::reftobase::RefHolder<reco::CandSecondaryVertexTagInfoFwdRef> rbh_casvf;
edm::reftobase::Holder<reco::BaseTagInfo, reco::BoostedDoubleSVTagInfoFwdRef> rb_bdsvf;
edm::reftobase::RefHolder<reco::BoostedDoubleSVTagInfoFwdRef> rbh_bdsvf;
edm::reftobase::Holder<reco::BaseTagInfo, reco::ShallowTagInfoFwdRef> rb_dnnf;
edm::reftobase::RefHolder<reco::ShallowTagInfoFwdRef> rbh_dnnf;
edm::reftobase::Holder<reco::BaseTagInfo, reco::CombinedTauTagInfoFwdRef> rb_ctf;
edm::reftobase::RefHolder<reco::CombinedTauTagInfoFwdRef> rbh_ctf;
edm::reftobase::Holder<reco::BaseTagInfo, reco::IsolatedTauTagInfoFwdRef> rb_itf;
Expand Down
15 changes: 15 additions & 0 deletions DataFormats/BTauReco/src/classes_def.xml
Expand Up @@ -71,6 +71,17 @@
<class name="reco::BoostedDoubleSVTagInfoRefVector"/>
<class name="edm::Wrapper<reco::BoostedDoubleSVTagInfoCollection>"/>

<class name="reco::ShallowTagInfo" ClassVersion="3">
<version ClassVersion="3" checksum="3904302444"/>
</class>
<class name="reco::ShallowTagInfoCollection"/>
<class name="reco::ShallowTagInfoRef"/>
<class name="reco::ShallowTagInfoFwdRef"/>
<class name="reco::ShallowTagInfoRefProd"/>
<class name="reco::ShallowTagInfoRefVector"/>
<class name="edm::Wrapper<reco::ShallowTagInfoCollection>"/>
<class name="edm::Wrapper<std::vector<reco::ShallowTagInfo> >"/>

<class name="reco::CombinedTauTagInfo" ClassVersion="11">
<version ClassVersion="11" checksum="224969361"/>
<version ClassVersion="10" checksum="3920242404"/>
Expand Down Expand Up @@ -333,6 +344,8 @@
<class name="edm::reftobase::RefHolder<reco::CandSecondaryVertexTagInfoRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::BoostedDoubleSVTagInfoRef>" />
<class name="edm::reftobase::RefHolder<reco::BoostedDoubleSVTagInfoRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::ShallowTagInfoRef>" />
<class name="edm::reftobase::RefHolder<reco::ShallowTagInfoRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::CombinedTauTagInfoRef>" />
<class name="edm::reftobase::RefHolder<reco::CombinedTauTagInfoRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::IsolatedTauTagInfoRef>" />
Expand Down Expand Up @@ -364,6 +377,8 @@
<class name="edm::reftobase::RefHolder<reco::CandSecondaryVertexTagInfoFwdRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::BoostedDoubleSVTagInfoFwdRef>" />
<class name="edm::reftobase::RefHolder<reco::BoostedDoubleSVTagInfoFwdRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::ShallowTagInfoFwdRef>" />
<class name="edm::reftobase::RefHolder<reco::ShallowTagInfoFwdRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::CombinedTauTagInfoFwdRef>" />
<class name="edm::reftobase::RefHolder<reco::CombinedTauTagInfoFwdRef>" />
<class name="edm::reftobase::Holder<reco::BaseTagInfo, reco::IsolatedTauTagInfoFwdRef>" />
Expand Down
4 changes: 3 additions & 1 deletion PhysicsTools/PatAlgos/plugins/PATJetProducer.cc
Expand Up @@ -36,7 +36,6 @@
#include <memory>
#include <algorithm>


using namespace pat;


Expand Down Expand Up @@ -100,6 +99,9 @@ PATJetProducer::PATJetProducer(const edm::ParameterSet& iConfig) :
if ((pos != std::string::npos) && (pos != label.length() - 7)) {
label.erase(pos+7); // trim a tail after "JetTags"
}
if(it->instance().size()) {
label = (label+std::string(":")+it->instance());
}
discriminatorLabels_.push_back(label);
}
}
Expand Down
4 changes: 3 additions & 1 deletion PhysicsTools/PatAlgos/plugins/PATJetUpdater.cc
Expand Up @@ -21,7 +21,6 @@
#include <memory>
#include <algorithm>


using namespace pat;


Expand Down Expand Up @@ -51,6 +50,9 @@ PATJetUpdater::PATJetUpdater(const edm::ParameterSet& iConfig) :
if ((pos != std::string::npos) && (pos != label.length() - 7)) {
label.erase(pos+7); // trim a tail after "JetTags"
}
if(it->instance().size()) {
label = (label+std::string(":")+it->instance());
}
discriminatorLabels_.push_back(label);
}
}
Expand Down
16 changes: 15 additions & 1 deletion PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
Expand Up @@ -48,7 +48,21 @@
cms.InputTag("pfCombinedMVAV2BJetTags"),
# CTagging
cms.InputTag('pfCombinedCvsLJetTags'),
cms.InputTag('pfCombinedCvsBJetTags')
cms.InputTag('pfCombinedCvsBJetTags'),
# The following code is commented-out to avoid breaking any unit test
# waiting for a set of AOD RelVals which have the jet tags in the event content
# DeepFlavour
# cms.InputTag('pfDeepCSVJetTags:probb'),
# cms.InputTag('pfDeepCSVJetTags:probc'),
# cms.InputTag('pfDeepCSVJetTags:probudsg'),
# cms.InputTag('pfDeepCSVJetTags:probbb'),
# cms.InputTag('pfDeepCSVJetTags:probcc'),
# DeepCMVA
# cms.InputTag('pfDeepCMVAJetTags:probb'),
# cms.InputTag('pfDeepCMVAJetTags:probc'),
# cms.InputTag('pfDeepCMVAJetTags:probudsg'),
# cms.InputTag('pfDeepCMVAJetTags:probbb'),
# cms.InputTag('pfDeepCMVAJetTags:probcc'),
),
# clone tag infos ATTENTION: these take lots of space!
# usually the discriminators from the default algos
Expand Down

0 comments on commit c223087

Please sign in to comment.