CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackCountingTagPlotter Class Reference

#include <TrackCountingTagPlotter.h>

Inheritance diagram for TrackCountingTagPlotter:
BaseTagInfoPlotter BaseBTagPlotter

Public Member Functions

void analyzeTag (const reco::BaseTagInfo *baseTagInfo, double jec, int jetFlavour, float w) override
 
void epsPlot (const std::string &name) override
 
void finalize (DQMStore::IBooker &ibook_, DQMStore::IGetter &igetter_) override
 
void psPlot (const std::string &name) override
 
 TrackCountingTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin, const edm::ParameterSet &pSet, unsigned int mc, bool willfinalize, DQMStore::IBooker &ibook)
 
 ~TrackCountingTagPlotter () override
 
- Public Member Functions inherited from BaseTagInfoPlotter
virtual void analyzeTag (const std::vector< const reco::BaseTagInfo * > &tagInfos, double jec, int jetFlavour, float w=1)
 
 BaseTagInfoPlotter (const std::string &tagName, const EtaPtBin &etaPtBin)
 
virtual void setEventSetup (const edm::EventSetup &setup)
 
virtual std::vector< std::string > tagInfoRequirements () const
 
 ~BaseTagInfoPlotter () override
 
- Public Member Functions inherited from BaseBTagPlotter
 BaseBTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin)
 
const EtaPtBinetaPtBin ()
 
virtual ~BaseBTagPlotter ()
 

Private Attributes

std::vector< std::unique_ptr< EffPurFromHistos > > effPurFromHistos
 
double endEffPur_
 
double lowerIPSBound
 
unsigned int mcPlots_
 
int nBinEffPur_
 
double startEffPur_
 
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig2D
 
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig3D
 
std::unique_ptr< FlavourHistograms< int > > trkNbr2D
 
std::unique_ptr< FlavourHistograms< int > > trkNbr3D
 
double upperIPSBound
 
bool willFinalize_
 

Additional Inherited Members

- Protected Attributes inherited from BaseBTagPlotter
const EtaPtBin etaPtBin_
 
const std::string tagName_
 
const std::string theExtensionString
 

Detailed Description

Definition at line 11 of file TrackCountingTagPlotter.h.

Constructor & Destructor Documentation

TrackCountingTagPlotter::TrackCountingTagPlotter ( const std::string &  tagName,
const EtaPtBin etaPtBin,
const edm::ParameterSet pSet,
unsigned int  mc,
bool  willfinalize,
DQMStore::IBooker ibook 
)

Definition at line 7 of file TrackCountingTagPlotter.cc.

References dir, mps_fire::i, lowerIPSBound, CaloTowersParam_cfi::mc, AlCaHLTBitMon_QueryRunRegistry::string, BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, upperIPSBound, and willFinalize_.

10  :
11  BaseTagInfoPlotter(tagName, etaPtBin), mcPlots_(mc),
12  nBinEffPur_(pSet.getParameter<int>("nBinEffPur")),
13  startEffPur_(pSet.getParameter<double>("startEffPur")),
14  endEffPur_(pSet.getParameter<double>("endEffPur")),
15  willFinalize_(wf), lowerIPSBound(-35.0), upperIPSBound(35.0)
16 {
17  const std::string dir(theExtensionString.substr(1));
18  if (willFinalize_) return;
19 
20  trkNbr3D = std::make_unique<FlavourHistograms<int>>
21  ("selTrksNbr_3D" + theExtensionString, "Number of selected tracks for 3D IPS" + theExtensionString, 31, -0.5, 30.5,
22  false, true, true, "b", dir, mc, ibook);
23 
24  trkNbr2D = std::make_unique<FlavourHistograms<int>>
25  ("selTrksNbr_2D" + theExtensionString, "Number of selected tracks for 2D IPS" + theExtensionString, 31, -0.5, 30.5,
26  false, true, true, "b", dir, mc, ibook);
27 
28  for (unsigned int i = 1; i <= 4; i++) {
29  tkcntHistosSig3D.push_back(std::make_unique<FlavourHistograms<double>>
30  ("ips" + std::to_string(i) + "_3D" + theExtensionString, "3D Significance of impact parameter " + std::to_string(i) + ". trk",
31  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook));
32  }
33  tkcntHistosSig3D.push_back(std::make_unique<FlavourHistograms<double>>
34  ("ips_3D" + theExtensionString, "3D Significance of impact parameter",
35  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook));
36 
37  for (unsigned int i = 1; i <= 4; i++) {
38  tkcntHistosSig2D.push_back(std::make_unique<FlavourHistograms<double>>
39  ("ips" + std::to_string(i) + "_2D" + theExtensionString, "2D Significance of impact parameter " + std::to_string(i) + ". trk",
40  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook));
41  }
42 
43  tkcntHistosSig2D.push_back(std::make_unique<FlavourHistograms<double>>
44  ("ips_2D" + theExtensionString, "2D Significance of impact parameter",
45  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook));
46 }
T getParameter(std::string const &) const
std::unique_ptr< FlavourHistograms< int > > trkNbr3D
std::unique_ptr< FlavourHistograms< int > > trkNbr2D
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig2D
const std::string theExtensionString
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig3D
BaseTagInfoPlotter(const std::string &tagName, const EtaPtBin &etaPtBin)
dbl *** dir
Definition: mlp_gen.cc:35
TrackCountingTagPlotter::~TrackCountingTagPlotter ( )
override

Definition at line 49 of file TrackCountingTagPlotter.cc.

49 {}

Member Function Documentation

void TrackCountingTagPlotter::analyzeTag ( const reco::BaseTagInfo baseTagInfo,
double  jec,
int  jetFlavour,
float  w 
)
overridevirtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 51 of file TrackCountingTagPlotter.cc.

References Exception, lumiContext::fill, lowerIPSBound, gen::n, reco::TrackCountingTagInfo::selectedTracks(), reco::TrackCountingTagInfo::significance(), tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, and w.

52 {
53 
54  const reco::TrackCountingTagInfo * tagInfo =
55  dynamic_cast<const reco::TrackCountingTagInfo *>(baseTagInfo);
56 
57  if (!tagInfo) {
58  throw cms::Exception("Configuration")
59  << "BTagPerformanceAnalyzer: Extended TagInfo not of type TrackCountingTagInfo. " << endl;
60  }
61 
62  trkNbr3D->fill(jetFlavour, tagInfo->selectedTracks(0), w);
63  trkNbr2D->fill(jetFlavour, tagInfo->selectedTracks(1), w);
64 
65  for (int n = 0; n != tagInfo->selectedTracks(1) && n != 4; ++n)
66  tkcntHistosSig2D[n]->fill(jetFlavour, tagInfo->significance(n, 1), w);
67  for (int n = tagInfo->selectedTracks(1); n < 4; ++n)
68  tkcntHistosSig2D[n]->fill(jetFlavour, lowerIPSBound - 1.0, w);
69 
70  for (int n = 0; n != tagInfo->selectedTracks(0) && n != 4; ++n)
71  tkcntHistosSig3D[n]->fill(jetFlavour, tagInfo->significance(n, 0), w);
72  for (int n = tagInfo->selectedTracks(0); n < 4; ++n)
73  tkcntHistosSig3D[n]->fill(jetFlavour, lowerIPSBound - 1.0, w);
74 
75  for (int n = 0; n != tagInfo->selectedTracks(1); ++n)
76  tkcntHistosSig2D[4]->fill(jetFlavour, tagInfo->significance(n, 1), w);
77  for (int n = 0; n != tagInfo->selectedTracks(0); ++n)
78  tkcntHistosSig3D[4]->fill(jetFlavour, tagInfo->significance(n, 0), w);
79 }
std::unique_ptr< FlavourHistograms< int > > trkNbr3D
std::unique_ptr< FlavourHistograms< int > > trkNbr2D
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig2D
const double w
Definition: UKUtility.cc:23
virtual int selectedTracks(int ipType) const
virtual float significance(size_t n, int ip) const
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig3D
void TrackCountingTagPlotter::epsPlot ( const std::string &  name)
overridevirtual

Implements BaseBTagPlotter.

Definition at line 174 of file TrackCountingTagPlotter.cc.

References effPurFromHistos, gen::n, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, and willFinalize_.

175 {
176  if (willFinalize_) {
177  for (int n = 0; n != 4; ++n)
179  return;
180  }
181 
182  trkNbr2D->epsPlot(name);
183  trkNbr3D->epsPlot(name);
184  for (int n = 0; n != 5; ++n) {
185  tkcntHistosSig2D[n]->epsPlot(name);
186  tkcntHistosSig3D[n]->epsPlot(name);
187  }
188 }
std::unique_ptr< FlavourHistograms< int > > trkNbr3D
std::unique_ptr< FlavourHistograms< int > > trkNbr2D
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig2D
void epsPlot(const std::string &name) override
std::vector< std::unique_ptr< EffPurFromHistos > > effPurFromHistos
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig3D
void TrackCountingTagPlotter::finalize ( DQMStore::IBooker ibook_,
DQMStore::IGetter igetter_ 
)
overridevirtual

Implements BaseBTagPlotter.

Definition at line 81 of file TrackCountingTagPlotter.cc.

References bookConverter::compute(), dir, effPurFromHistos, endEffPur_, mps_fire::i, lowerIPSBound, mcPlots_, gen::n, nBinEffPur_, startEffPur_, AlCaHLTBitMon_QueryRunRegistry::string, BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, tkcntHistosSig3D, and upperIPSBound.

82 {
83  //
84  // final processing:
85  // produce the misid. vs. eff histograms
86  //
87  const std::string dir("TrackCounting" + theExtensionString);
88 
89  tkcntHistosSig3D.clear();
90  tkcntHistosSig2D.clear();
91  effPurFromHistos.clear();
92 
93  for (unsigned int i = 2; i <= 3; i++) {
94  tkcntHistosSig3D.push_back(
95  std::make_unique<FlavourHistograms<double>>
96  ("ips" + std::to_string(i) + "_3D" + theExtensionString, "3D Significance of impact parameter " + std::to_string(i) + ". trk",
97  50, lowerIPSBound, upperIPSBound, "b", dir, mcPlots_, igetter_));
98  effPurFromHistos.push_back(
99  std::make_unique<EffPurFromHistos>(*tkcntHistosSig3D.back(), dir, mcPlots_, ibook,
101  }
102 
103  for (unsigned int i = 2; i <= 3; i++) {
104  tkcntHistosSig2D.push_back(
105  std::make_unique<FlavourHistograms<double>>
106  ("ips" + std::to_string(i) + "_2D" + theExtensionString, "2D Significance of impact parameter " + std::to_string(i) + ". trk",
107  50, lowerIPSBound, upperIPSBound, "b", dir, mcPlots_, igetter_));
108  effPurFromHistos.push_back(
109  std::make_unique<EffPurFromHistos>(*tkcntHistosSig2D.back(), dir, mcPlots_, ibook,
111  }
112 
113  for (int n = 0; n != 4; ++n) effPurFromHistos[n]->compute(ibook);
114 }
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig2D
const std::string theExtensionString
std::vector< std::unique_ptr< EffPurFromHistos > > effPurFromHistos
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig3D
def compute(min, max)
dbl *** dir
Definition: mlp_gen.cc:35
void TrackCountingTagPlotter::psPlot ( const std::string &  name)
overridevirtual

Implements BaseBTagPlotter.

Definition at line 116 of file TrackCountingTagPlotter.cc.

References svgfig::canvas(), effPurFromHistos, gen::n, plotscripts::setTDRStyle(), AlCaHLTBitMon_QueryRunRegistry::string, BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, and willFinalize_.

117 {
118  const std::string cName("TrackCountingPlots"+ theExtensionString);
119  setTDRStyle()->cd();
120  TCanvas canvas(cName.c_str(), cName.c_str(), 600, 900);
121  canvas.UseCurrentStyle();
122  if (willFinalize_) {
123  for (int n = 0; n != 2; ++n) {
124  canvas.Print((name + cName + ".ps").c_str());
125  canvas.Clear();
126  canvas.Divide(2,3);
127  canvas.cd(1);
128  effPurFromHistos[0+n]->discriminatorNoCutEffic().plot();
129  canvas.cd(2);
130  effPurFromHistos[0+n]->discriminatorCutEfficScan().plot();
131  canvas.cd(3);
132  effPurFromHistos[0+n]->plot();
133  canvas.cd(4);
134  effPurFromHistos[1+n]->discriminatorNoCutEffic().plot();
135  canvas.cd(5);
136  effPurFromHistos[1+n]->discriminatorCutEfficScan().plot();
137  canvas.cd(6);
138  effPurFromHistos[1+n]->plot();
139  }
140  return;
141  }
142 
143  canvas.Clear();
144  canvas.Divide(2,3);
145  canvas.Print((name + cName + ".ps[").c_str());
146 
147  canvas.cd(1);
148  trkNbr3D->plot();
149  canvas.cd(2);
150  tkcntHistosSig3D[4]->plot();
151  for (int n = 0; n < 4; n++) {
152  canvas.cd(3+n);
153  tkcntHistosSig3D[n]->plot();
154  }
155 
156  canvas.Print((name + cName + ".ps").c_str());
157  canvas.Clear();
158  canvas.Divide(2,3);
159 
160  canvas.cd(1);
161  trkNbr2D->plot();
162  canvas.cd(2);
163  tkcntHistosSig2D[4]->plot();
164  for (int n = 0; n != 4; ++n) {
165  canvas.cd(3+n);
166  tkcntHistosSig2D[n]->plot();
167  }
168 
169  canvas.Print((name + cName + ".ps").c_str());
170  canvas.Print((name + cName + ".ps]").c_str());
171 }
std::unique_ptr< FlavourHistograms< int > > trkNbr3D
std::unique_ptr< FlavourHistograms< int > > trkNbr2D
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig2D
const std::string theExtensionString
std::vector< std::unique_ptr< EffPurFromHistos > > effPurFromHistos
def setTDRStyle()
Definition: plotscripts.py:89
std::vector< std::unique_ptr< FlavourHistograms< double > > > tkcntHistosSig3D
def canvas(sub, attr)
Definition: svgfig.py:482

Member Data Documentation

std::vector< std::unique_ptr<EffPurFromHistos> > TrackCountingTagPlotter::effPurFromHistos
private

Definition at line 43 of file TrackCountingTagPlotter.h.

Referenced by epsPlot(), finalize(), and psPlot().

double TrackCountingTagPlotter::endEffPur_
private

Definition at line 34 of file TrackCountingTagPlotter.h.

Referenced by finalize().

double TrackCountingTagPlotter::lowerIPSBound
private

Definition at line 41 of file TrackCountingTagPlotter.h.

Referenced by analyzeTag(), finalize(), and TrackCountingTagPlotter().

unsigned int TrackCountingTagPlotter::mcPlots_
private

Definition at line 31 of file TrackCountingTagPlotter.h.

Referenced by finalize().

int TrackCountingTagPlotter::nBinEffPur_
private

Definition at line 32 of file TrackCountingTagPlotter.h.

Referenced by finalize().

double TrackCountingTagPlotter::startEffPur_
private

Definition at line 33 of file TrackCountingTagPlotter.h.

Referenced by finalize().

std::vector< std::unique_ptr<FlavourHistograms<double> > > TrackCountingTagPlotter::tkcntHistosSig2D
private
std::vector< std::unique_ptr<FlavourHistograms<double> > > TrackCountingTagPlotter::tkcntHistosSig3D
private
std::unique_ptr<FlavourHistograms<int> > TrackCountingTagPlotter::trkNbr2D
private

Definition at line 40 of file TrackCountingTagPlotter.h.

Referenced by analyzeTag(), epsPlot(), psPlot(), and TrackCountingTagPlotter().

std::unique_ptr<FlavourHistograms<int> > TrackCountingTagPlotter::trkNbr3D
private

Definition at line 40 of file TrackCountingTagPlotter.h.

Referenced by analyzeTag(), epsPlot(), psPlot(), and TrackCountingTagPlotter().

double TrackCountingTagPlotter::upperIPSBound
private

Definition at line 41 of file TrackCountingTagPlotter.h.

Referenced by finalize(), and TrackCountingTagPlotter().

bool TrackCountingTagPlotter::willFinalize_
private

Definition at line 36 of file TrackCountingTagPlotter.h.

Referenced by epsPlot(), psPlot(), and TrackCountingTagPlotter().