CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MiniAODSVAnalyzer Class Reference
Inheritance diagram for MiniAODSVAnalyzer:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 MiniAODSVAnalyzer (const edm::ParameterSet &pSet)
 
 ~MiniAODSVAnalyzer () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

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

Private Attributes

const double etaMax_
 
const edm::EDGetTokenT< std::vector< pat::Jet > > jetToken_
 
MonitorElementn_sv_
 
const double ptMin_
 
MonitorElementsv_chi2norm_
 
MonitorElementsv_chi2prob_
 
MonitorElementsv_d3d_
 
MonitorElementsv_d3dsig_
 
MonitorElementsv_deltaR_
 
MonitorElementsv_dxy_
 
MonitorElementsv_dxysig_
 
MonitorElementsv_energyratio_
 
MonitorElementsv_mass_
 
MonitorElementsv_ntracks_
 
MonitorElementsv_pt_
 
MonitorElementsv_ptrel_
 
const std::string svTagInfo_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Secondary Vertex Analyzer to run on MiniAOD

Definition at line 16 of file MiniAODSVAnalyzer.cc.

Constructor & Destructor Documentation

◆ MiniAODSVAnalyzer()

MiniAODSVAnalyzer::MiniAODSVAnalyzer ( const edm::ParameterSet pSet)
explicit

Definition at line 50 of file MiniAODSVAnalyzer.cc.

51  : jetToken_(consumes<std::vector<pat::Jet>>(pSet.getParameter<edm::InputTag>("JetTag"))),
52  svTagInfo_(pSet.getParameter<std::string>("svTagInfo")),
53  ptMin_(pSet.getParameter<double>("ptMin")),
54  etaMax_(pSet.getParameter<double>("etaMax")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< std::vector< pat::Jet > > jetToken_
const std::string svTagInfo_

◆ ~MiniAODSVAnalyzer()

MiniAODSVAnalyzer::~MiniAODSVAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

void MiniAODSVAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 99 of file MiniAODSVAnalyzer.cc.

References funct::abs(), ChiSquaredProbability(), reco::deltaR(), etaMax_, dqm::impl::MonitorElement::Fill(), reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::flightDistance(), mps_fire::i, iEvent, metsig::jet, jetfilter_cfi::jetCollection, jetToken_, n_sv_, reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::nVertices(), ptMin_, reco::TemplatedSecondaryVertexTagInfo< IPTI, VTX >::secondaryVertex(), Measurement1D::significance(), pfDeepBoostedJetPreprocessParams_cfi::sv, sv_chi2norm_, sv_chi2prob_, sv_d3d_, sv_d3dsig_, sv_deltaR_, sv_dxy_, sv_dxysig_, sv_energyratio_, sv_mass_, sv_ntracks_, sv_pt_, sv_ptrel_, svTagInfo_, and Measurement1D::value().

99  {
101  iEvent.getByToken(jetToken_, jetCollection);
102 
103  // Loop over the pat::Jets
104  for (std::vector<pat::Jet>::const_iterator jet = jetCollection->begin(); jet != jetCollection->end(); ++jet) {
105  // jet selection
106  if (jet->hasTagInfo(svTagInfo_) && jet->pt() > ptMin_ && std::abs(jet->eta()) < etaMax_) {
107  const reco::CandSecondaryVertexTagInfo* taginfo =
108  static_cast<const reco::CandSecondaryVertexTagInfo*>(jet->tagInfo(svTagInfo_));
109  n_sv_->Fill(taginfo->nVertices());
110 
111  // loop secondary vertices
112  for (unsigned int i = 0; i < taginfo->nVertices(); i++) {
114 
115  sv_mass_->Fill(sv.mass());
116  sv_pt_->Fill(sv.pt());
117  sv_ntracks_->Fill(sv.numberOfDaughters());
118  sv_chi2norm_->Fill(sv.vertexNormalizedChi2());
119  sv_chi2prob_->Fill(ChiSquaredProbability(sv.vertexChi2(), sv.vertexNdof()));
120 
121  sv_ptrel_->Fill(sv.pt() / jet->pt());
122  sv_energyratio_->Fill(sv.energy() / jet->energy());
123  sv_deltaR_->Fill(reco::deltaR(sv, jet->momentum()));
124 
125  sv_dxy_->Fill(taginfo->flightDistance(i, 2).value());
126  sv_dxysig_->Fill(taginfo->flightDistance(i, 2).significance());
127  sv_d3d_->Fill(taginfo->flightDistance(i, 3).value());
128  sv_d3dsig_->Fill(taginfo->flightDistance(i, 3).significance());
129  }
130  }
131  }
132 }
MonitorElement * sv_d3d_
MonitorElement * sv_dxy_
void Fill(long long x)
MonitorElement * sv_mass_
MonitorElement * sv_dxysig_
MonitorElement * sv_chi2norm_
MonitorElement * sv_ptrel_
int iEvent
Definition: GenABIO.cc:224
MonitorElement * sv_energyratio_
const edm::EDGetTokenT< std::vector< pat::Jet > > jetToken_
MonitorElement * sv_pt_
const std::string svTagInfo_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float ChiSquaredProbability(double chiSquared, double nrDOF)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
Measurement1D flightDistance(unsigned int index, int dim=0) const
MonitorElement * sv_deltaR_
MonitorElement * sv_chi2prob_
const VTX & secondaryVertex(unsigned int index) const
double value() const
Definition: Measurement1D.h:25
double significance() const
Definition: Measurement1D.h:29
MonitorElement * n_sv_
MonitorElement * sv_ntracks_
MonitorElement * sv_d3dsig_

◆ bookHistograms()

void MiniAODSVAnalyzer::bookHistograms ( DQMStore::IBooker ibook,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 56 of file MiniAODSVAnalyzer.cc.

References dqm::implementation::IBooker::book1D(), n_sv_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), sv_chi2norm_, sv_chi2prob_, sv_d3d_, sv_d3dsig_, sv_deltaR_, sv_dxy_, sv_dxysig_, sv_energyratio_, sv_mass_, sv_ntracks_, sv_pt_, and sv_ptrel_.

56  {
57  ibook.setCurrentFolder("Btag/SV");
58 
59  n_sv_ = ibook.book1D("n_sv", "number of SV in jet", 5, 0, 5);
60  n_sv_->setAxisTitle("number of SV in jet");
61 
62  sv_mass_ = ibook.book1D("sv_mass", "SV mass", 30, 0., 6.);
63  sv_mass_->setAxisTitle("SV mass");
64 
65  sv_pt_ = ibook.book1D("sv_pt", "SV transverse momentum", 40, 0., 120.);
66  sv_pt_->setAxisTitle("SV pt");
67 
68  sv_ntracks_ = ibook.book1D("sv_ntracks", "SV number of daugthers", 10, 0, 10);
69  sv_ntracks_->setAxisTitle("number of tracks at SV");
70 
71  sv_chi2norm_ = ibook.book1D("sv_chi2norm", "normalized Chi2 of vertex", 30, 0, 15);
72  sv_chi2norm_->setAxisTitle("normalized Chi2 of SV");
73 
74  sv_chi2prob_ = ibook.book1D("sv_chi2prob", "Chi2 probability of vertex", 20, 0., 1.);
75  sv_chi2prob_->setAxisTitle("Chi2 probability of SV");
76 
77  sv_ptrel_ = ibook.book1D("sv_ptrel", "SV jet transverse momentum ratio", 25, 0., 1.);
78  sv_ptrel_->setAxisTitle("pt(SV)/pt(jet)");
79 
80  sv_energyratio_ = ibook.book1D("sv_energyratio", "SV jet energy ratio", 25, 0., 1.);
81  sv_energyratio_->setAxisTitle("E(SV)/E(jet)");
82 
83  sv_deltaR_ = ibook.book1D("sv_deltaR", "SV jet deltaR", 40, 0., 0.4);
84  sv_deltaR_->setAxisTitle("deltaR(jet, SV)");
85 
86  sv_dxy_ = ibook.book1D("sv_dxy", "2D flight distance", 40, 0., 8.);
87  sv_dxy_->setAxisTitle("dxy");
88 
89  sv_dxysig_ = ibook.book1D("sv_dxysig", "2D flight distance significance", 25, 0., 250.);
90  sv_dxysig_->setAxisTitle("dxy significance");
91 
92  sv_d3d_ = ibook.book1D("sv_d3d", "3D flight distance", 40, 0., 8.);
93  sv_d3d_->setAxisTitle("d3d");
94 
95  sv_d3dsig_ = ibook.book1D("sv_d3dsig", "3D flight distance significance", 25, 0., 250.);
96  sv_d3dsig_->setAxisTitle("d3d significance");
97 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * sv_d3d_
MonitorElement * sv_dxy_
MonitorElement * sv_mass_
MonitorElement * sv_dxysig_
MonitorElement * sv_chi2norm_
MonitorElement * sv_ptrel_
MonitorElement * sv_energyratio_
MonitorElement * sv_pt_
MonitorElement * sv_deltaR_
MonitorElement * sv_chi2prob_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * n_sv_
MonitorElement * sv_ntracks_
MonitorElement * sv_d3dsig_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

◆ etaMax_

const double MiniAODSVAnalyzer::etaMax_
private

Definition at line 29 of file MiniAODSVAnalyzer.cc.

Referenced by analyze().

◆ jetToken_

const edm::EDGetTokenT<std::vector<pat::Jet> > MiniAODSVAnalyzer::jetToken_
private

Definition at line 26 of file MiniAODSVAnalyzer.cc.

Referenced by analyze().

◆ n_sv_

MonitorElement* MiniAODSVAnalyzer::n_sv_
private

Definition at line 31 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ ptMin_

const double MiniAODSVAnalyzer::ptMin_
private

Definition at line 28 of file MiniAODSVAnalyzer.cc.

Referenced by analyze().

◆ sv_chi2norm_

MonitorElement* MiniAODSVAnalyzer::sv_chi2norm_
private

Definition at line 36 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_chi2prob_

MonitorElement* MiniAODSVAnalyzer::sv_chi2prob_
private

Definition at line 37 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_d3d_

MonitorElement* MiniAODSVAnalyzer::sv_d3d_
private

Definition at line 46 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_d3dsig_

MonitorElement* MiniAODSVAnalyzer::sv_d3dsig_
private

Definition at line 47 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_deltaR_

MonitorElement* MiniAODSVAnalyzer::sv_deltaR_
private

Definition at line 42 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_dxy_

MonitorElement* MiniAODSVAnalyzer::sv_dxy_
private

Definition at line 44 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_dxysig_

MonitorElement* MiniAODSVAnalyzer::sv_dxysig_
private

Definition at line 45 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_energyratio_

MonitorElement* MiniAODSVAnalyzer::sv_energyratio_
private

Definition at line 41 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_mass_

MonitorElement* MiniAODSVAnalyzer::sv_mass_
private

Definition at line 33 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_ntracks_

MonitorElement* MiniAODSVAnalyzer::sv_ntracks_
private

Definition at line 35 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_pt_

MonitorElement* MiniAODSVAnalyzer::sv_pt_
private

Definition at line 34 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ sv_ptrel_

MonitorElement* MiniAODSVAnalyzer::sv_ptrel_
private

Definition at line 40 of file MiniAODSVAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ svTagInfo_

const std::string MiniAODSVAnalyzer::svTagInfo_
private

Definition at line 27 of file MiniAODSVAnalyzer.cc.

Referenced by analyze().