Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions DQMOffline/RecoB/plugins/MiniAODSVAnalyzer.cc
Original file line number Diff line number Diff line change
@@ -1,16 +1,57 @@
#include "DQMOffline/RecoB/plugins/MiniAODSVAnalyzer.h"

#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DataFormats/PatCandidates/interface/Jet.h"
#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h"
#include "CommonTools/Statistics/interface/ChiSquaredProbability.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/Event.h"

/** \class MiniAODSVAnalyzer
*
* Secondary Vertex Analyzer to run on MiniAOD
*
*/

class MiniAODSVAnalyzer : public DQMEDAnalyzer {
public:
explicit MiniAODSVAnalyzer(const edm::ParameterSet& pSet);
~MiniAODSVAnalyzer() override = default;

void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;

private:
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;

const edm::EDGetTokenT<std::vector<pat::Jet>> jetToken_;
const std::string svTagInfo_;
const double ptMin_;
const double etaMax_;

MonitorElement* n_sv_;

MonitorElement* sv_mass_;
MonitorElement* sv_pt_;
MonitorElement* sv_ntracks_;
MonitorElement* sv_chi2norm_;
MonitorElement* sv_chi2prob_;

// relation to jet
MonitorElement* sv_ptrel_;
MonitorElement* sv_energyratio_;
MonitorElement* sv_deltaR_;

MonitorElement* sv_dxy_;
MonitorElement* sv_dxysig_;
MonitorElement* sv_d3d_;
MonitorElement* sv_d3dsig_;
};

MiniAODSVAnalyzer::MiniAODSVAnalyzer(const edm::ParameterSet& pSet)
: jetToken_(consumes<std::vector<pat::Jet>>(pSet.getParameter<edm::InputTag>("JetTag"))),
svTagInfo_(pSet.getParameter<std::string>("svTagInfo")),
ptMin_(pSet.getParameter<double>("ptMin")),
etaMax_(pSet.getParameter<double>("etaMax"))

{}

MiniAODSVAnalyzer::~MiniAODSVAnalyzer() {}
etaMax_(pSet.getParameter<double>("etaMax")) {}

void MiniAODSVAnalyzer::bookHistograms(DQMStore::IBooker& ibook, edm::Run const& run, edm::EventSetup const& es) {
ibook.setCurrentFolder("Btag/SV");
Expand Down
50 changes: 0 additions & 50 deletions DQMOffline/RecoB/plugins/MiniAODSVAnalyzer.h

This file was deleted.

54 changes: 45 additions & 9 deletions DQMOffline/RecoB/plugins/MiniAODTaggerAnalyzer.cc
Original file line number Diff line number Diff line change
@@ -1,30 +1,66 @@
#include "DQMOffline/RecoB/plugins/MiniAODTaggerAnalyzer.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DataFormats/PatCandidates/interface/Jet.h"
#include "DQMOffline/RecoB/interface/JetTagPlotter.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/Event.h"

/** \class MiniAODTaggerAnalyzer
*
* Tagger analyzer to run on MiniAOD
*
*/

class MiniAODTaggerAnalyzer : public DQMEDAnalyzer {
public:
explicit MiniAODTaggerAnalyzer(const edm::ParameterSet& pSet);
~MiniAODTaggerAnalyzer() override = default;

void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;

private:
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
typedef std::vector<std::string> vstring;

// using JetTagPlotter object for all the hard work ;)
std::unique_ptr<JetTagPlotter> jetTagPlotter_;

const edm::EDGetTokenT<std::vector<pat::Jet> > jetToken_;
const edm::ParameterSet discrParameters_;

const std::string folder_;
const vstring discrNumerator_;
const vstring discrDenominator_;

const int mclevel_;
const bool doCTagPlots_;
const bool dodifferentialPlots_;
const double discrCut_;

const bool etaActive_;
const double etaMin_;
const double etaMax_;
const bool ptActive_;
const double ptMin_;
const double ptMax_;
};

MiniAODTaggerAnalyzer::MiniAODTaggerAnalyzer(const edm::ParameterSet& pSet)
: jetToken_(consumes<std::vector<pat::Jet> >(pSet.getParameter<edm::InputTag>("JetTag"))),
discrParameters_(pSet.getParameter<edm::ParameterSet>("parameters")),

folder_(pSet.getParameter<std::string>("folder")),
discrNumerator_(pSet.getParameter<vstring>("numerator")),
discrDenominator_(pSet.getParameter<vstring>("denominator")),

mclevel_(pSet.getParameter<int>("MClevel")),
doCTagPlots_(pSet.getParameter<bool>("CTagPlots")),
dodifferentialPlots_(pSet.getParameter<bool>("differentialPlots")),
discrCut_(pSet.getParameter<double>("discrCut")),

etaActive_(pSet.getParameter<bool>("etaActive")),
etaMin_(pSet.getParameter<double>("etaMin")),
etaMax_(pSet.getParameter<double>("etaMax")),
ptActive_(pSet.getParameter<bool>("ptActive")),
ptMin_(pSet.getParameter<double>("ptMin")),
ptMax_(pSet.getParameter<double>("ptMax"))

{}

MiniAODTaggerAnalyzer::~MiniAODTaggerAnalyzer() {}
ptMax_(pSet.getParameter<double>("ptMax")) {}

void MiniAODTaggerAnalyzer::bookHistograms(DQMStore::IBooker& ibook, edm::Run const& run, edm::EventSetup const& es) {
jetTagPlotter_ = std::make_unique<JetTagPlotter>(folder_,
Expand Down
49 changes: 0 additions & 49 deletions DQMOffline/RecoB/plugins/MiniAODTaggerAnalyzer.h

This file was deleted.

2 changes: 1 addition & 1 deletion DQMOffline/RecoB/python/bTagMiniDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# add jets with pfSecondaryVertexTagInfos
patJetsSVInfo = patJets.clone(
tagInfoSources = cms.VInputTag('pfSecondaryVertexTagInfos'),
tagInfoSources = ['pfSecondaryVertexTagInfos'],
addTagInfos = True
)
patJetsSVInfoTask = cms.Task(patJetsSVInfo)
Expand Down