Skip to content

Commit

Permalink
partially revert cms-sw#34156 (CSV Tag still needed in BTV OfflineDQM)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Link authored and marco-link committed Oct 26, 2021
1 parent 0db5699 commit d5d14f7
Show file tree
Hide file tree
Showing 7 changed files with 372 additions and 4 deletions.
1 change: 1 addition & 0 deletions DQMOffline/RecoB/doc/RecoB.doc
Expand Up @@ -32,6 +32,7 @@ offline DQM package for b-tagging : allowed to produce histograms for the differ
- HistoProviderDQM
- HistoShifter
- JetTagPlotter : fill histograms for informations related to the jets which are used by the taggers (jet pt, eta, phi, p, discriminant value and jet multiplicity)
- MVAJetTagPlotter : in association with TaggingVariablePlotter allow to access to the variables defined in bTagCombinedSVVariables_cff.py and for the appropriate categories. Theses variables are taken from the tag infos in the reco::btau::TaggingVariableName list.
- MatchJet : check if it's needed the jet references when looking at the flavour map, could be also used to match collections
- SoftLeptonTagPlotter : tag info for variables related to the soft lepton taggers
- TagCorrelationPlotter : to look at correlation
Expand Down
49 changes: 49 additions & 0 deletions DQMOffline/RecoB/interface/MVAJetTagPlotter.h
@@ -0,0 +1,49 @@
#ifndef MVAJetTagPlotter_H
#define MVAJetTagPlotter_H

#include <vector>
#include <string>

#include "DQMOffline/RecoB/interface/BaseTagInfoPlotter.h"
#include "DQMOffline/RecoB/interface/TaggingVariablePlotter.h"
#include "DataFormats/BTauReco/interface/BaseTagInfo.h"
#include "RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h"
#include "DQMOffline/RecoB/interface/FlavourHistorgrams.h"
// #include "RecoBTag/MCTools/interface/JetFlavour.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

class MVAJetTagPlotter : public BaseTagInfoPlotter {
public:
MVAJetTagPlotter(const std::string& tagName,
const EtaPtBin& etaPtBin,
const edm::ParameterSet& pSet,
const std::string& folderName,
unsigned int mc,
bool willFinalize,
DQMStore::IBooker& ibook);

~MVAJetTagPlotter() override;

void analyzeTag(const std::vector<const reco::BaseTagInfo*>& baseTagInfos,
double jec,
int jetFlavour,
float w = 1) override;

void finalize(DQMStore::IBooker& ibook_, DQMStore::IGetter& igetter_) override;

void epsPlot(const std::string& name) override;

void psPlot(const std::string& name) override;

void setEventSetup(const edm::EventSetup& setup) override;
std::vector<std::string> tagInfoRequirements() const override;

private:
std::string jetTagComputer;
const GenericMVAJetTagComputer* computer;

reco::TaggingVariableName categoryVariable;
std::vector<std::unique_ptr<TaggingVariablePlotter>> categoryPlotters;
};

#endif
29 changes: 29 additions & 0 deletions DQMOffline/RecoB/python/bTagCombinedSVAnalysis_cff.py
@@ -0,0 +1,29 @@
import FWCore.ParameterSet.Config as cms
from DQMOffline.RecoB.bTagCombinedSVVariables_cff import *


# combinedSecondaryVertex jet tag computer configuration
bTagCombinedSVAnalysisBlock = cms.PSet(
parameters = cms.PSet(
categoryVariable = cms.string('vertexCategory'),
categories = cms.VPSet(cms.PSet(
combinedSVNoVertexVariables,
combinedSVPseudoVertexVariables,
combinedSVRecoVertexVariables
),
cms.PSet(
combinedSVNoVertexVariables,
combinedSVPseudoVertexVariables,
combinedSVRecoVertexVariables
),
cms.PSet(
combinedSVNoVertexVariables,
combinedSVPseudoVertexVariables
),
cms.PSet(
combinedSVNoVertexVariables
))
)
)


186 changes: 186 additions & 0 deletions DQMOffline/RecoB/python/bTagCombinedSVVariables_cff.py
@@ -0,0 +1,186 @@
import FWCore.ParameterSet.Config as cms

combinedSVRecoVertexVariables = cms.PSet(
flightDistance3dVal = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(10.0),
min = cms.double(0.0)
),
flightDistance3dSig = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(80.0),
min = cms.double(0.0)
),
flightDistance2dVal = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(2.5),
min = cms.double(0.0)
),
flightDistance2dSig = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(80.0),
min = cms.double(0.0)
),
jetNSecondaryVertices = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(11),
max = cms.double(10.5),
min = cms.double(-0.5)
)
)

combinedSVPseudoVertexVariables = cms.PSet(
vertexMass = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(10.0),
min = cms.double(0.0)
),
vertexNTracks = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(21),
max = cms.double(20.5),
min = cms.double(-0.5)
),
vertexJetDeltaR = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(0.5),
min = cms.double(0.0)
),
vertexEnergyRatio = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(1.0),
min = cms.double(0.0)
)
)
combinedSVNoVertexVariables = cms.PSet(
trackPPar = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(200.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.0)
),
trackSip2dVal = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(0.2),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(-0.2)
),
trackDeltaR = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(0.3),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.0)
),
trackSip2dSigAboveCharm = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(60.0),
min = cms.double(-40.0)
),
trackEtaRel = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(9.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(1.3)
),
vertexCategory = cms.PSet(
logScale = cms.bool(False),
nBins = cms.uint32(3),
max = cms.double(2.5),
min = cms.double(-0.5)
),
trackSip2dSig = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(60.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(-40.0)
),
trackDecayLenVal = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(5.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.0)
),
trackSip3dVal = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(1.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(-1.0)
),
trackSumJetDeltaR = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(0.3),
min = cms.double(0.0)
),
trackJetDist = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(100),
max = cms.double(0.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(-0.1)
),
trackSumJetEtRatio = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(4.0),
min = cms.double(0.0)
),
trackPtRel = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(15.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.0)
),
trackPtRatio = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(0.5),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.0)
),
trackMomentum = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(200.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.0)
),
trackPParRatio = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(1.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(0.86)
),
trackSip3dSig = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(60.0),
indices = cms.vuint32(0, 1, 2, 3),
min = cms.double(-40.0)
),
trackSip3dSigAboveCharm = cms.PSet(
logScale = cms.bool(True),
nBins = cms.uint32(50),
max = cms.double(60.0),
min = cms.double(-40.0)
)
)


16 changes: 12 additions & 4 deletions DQMOffline/RecoB/python/bTagCommon_cff.py
@@ -1,12 +1,11 @@
import FWCore.ParameterSet.Config as cms

# BTagPerformanceAnalyzer configuration
# BTagPerformanceAnalyzer configuration
from DQMOffline.RecoB.bTagGenericAnalysis_cff import bTagGenericAnalysisBlock
from DQMOffline.RecoB.cTagGenericAnalysis_cff import cTagGenericAnalysisBlock
from DQMOffline.RecoB.bTagTrackIPAnalysis_cff import bTagTrackIPAnalysisBlock
from DQMOffline.RecoB.bTagTrackProbabilityAnalysis_cff import bTagProbabilityAnalysisBlock


from DQMOffline.RecoB.bTagCombinedSVAnalysis_cff import bTagCombinedSVAnalysisBlock

bTagCommonBlock = cms.PSet(
# use pre-computed jet flavour identification
Expand Down Expand Up @@ -36,7 +35,6 @@
JECsourceData = cms.InputTag("ak4PFCHSL1FastL2L3ResidualCorrector"),
#tagger configuration
tagConfig = cms.VPSet(

cms.PSet(
bTagTrackIPAnalysisBlock,
type = cms.string('CandIP'),
Expand All @@ -50,5 +48,15 @@
folder = cms.string("JP")
),

cms.PSet(
bTagCombinedSVAnalysisBlock,
listTagInfos = cms.VInputTag(
cms.InputTag("pfImpactParameterTagInfos"),
cms.InputTag("pfInclusiveSecondaryVertexFinderTagInfos")
),
type = cms.string('GenericMVA'),
label = cms.InputTag("candidateCombinedSecondaryVertexV2Computer"),
folder = cms.string("CSVTag")
),
)
)

0 comments on commit d5d14f7

Please sign in to comment.