CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, const double &jec, const int &jetFlavour)
 
void analyzeTag (const reco::BaseTagInfo *baseTagInfo, const double &jec, const int &jetFlavour, const float &w)
 
void epsPlot (const std::string &name)
 
virtual void finalize (DQMStore::IBooker &ibook_, DQMStore::IGetter &igetter_)
 
void psPlot (const std::string &name)
 
 TrackCountingTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin, const edm::ParameterSet &pSet, const unsigned int &mc, const bool &willfinalize, DQMStore::IBooker &ibook)
 
 ~TrackCountingTagPlotter ()
 
- Public Member Functions inherited from BaseTagInfoPlotter
virtual void analyzeTag (const std::vector< const reco::BaseTagInfo * > &tagInfos, const double &jec, const int &jetFlavour)
 
virtual void analyzeTag (const std::vector< const reco::BaseTagInfo * > &tagInfos, const double &jec, const int &jetFlavour, const float &w)
 
 BaseTagInfoPlotter (const std::string &tagName, const EtaPtBin &etaPtBin)
 
virtual void setEventSetup (const edm::EventSetup &setup)
 
virtual std::vector< std::string > tagInfoRequirements () const
 
virtual ~BaseTagInfoPlotter ()
 
- Public Member Functions inherited from BaseBTagPlotter
 BaseBTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin)
 
const EtaPtBinetaPtBin ()
 
virtual ~BaseBTagPlotter ()
 

Private Attributes

EffPurFromHistoseffPurFromHistos [4]
 
double endEffPur_
 
double lowerIPSBound
 
unsigned int mcPlots_
 
int nBinEffPur_
 
double startEffPur_
 
FlavourHistograms< double > * tkcntHistosSig2D [5]
 
FlavourHistograms< double > * tkcntHistosSig3D [5]
 
FlavourHistograms< int > * trkNbr2D
 
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,
const unsigned int &  mc,
const bool &  willfinalize,
DQMStore::IBooker ibook 
)

Definition at line 7 of file TrackCountingTagPlotter.cc.

References dir, lowerIPSBound, 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 
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 
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 
29  ("ips_3D" + theExtensionString, "3D Significance of impact parameter",
30  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
31 
32  tkcntHistosSig3D[0] = new FlavourHistograms<double>
33  ("ips1_3D" + theExtensionString, "3D Significance of impact parameter 1st trk",
34  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
35 
36  tkcntHistosSig3D[1] = new FlavourHistograms<double>
37  ("ips2_3D" + theExtensionString, "3D Significance of impact parameter 2nd trk",
38  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
39 
40  tkcntHistosSig3D[2] = new FlavourHistograms<double>
41  ("ips3_3D" + theExtensionString, "3D Significance of impact parameter 3rd trk",
42  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
43 
44  tkcntHistosSig3D[3] = new FlavourHistograms<double>
45  ("ips4_3D" + theExtensionString, "3D Significance of impact parameter 4th trk",
46  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
47 
49  ("ips_2D" + theExtensionString, "2D Significance of impact parameter",
50  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
51 
52  tkcntHistosSig2D[0] = new FlavourHistograms<double>
53  ("ips1_2D" + theExtensionString, "2D Significance of impact parameter 1st trk",
54  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
55 
56  tkcntHistosSig2D[1] = new FlavourHistograms<double>
57  ("ips2_2D" + theExtensionString, "2D Significance of impact parameter 2nd trk",
58  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
59 
60  tkcntHistosSig2D[2] = new FlavourHistograms<double>
61  ("ips3_2D" + theExtensionString, "2D Significance of impact parameter 3rd trk",
62  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
63 
64  tkcntHistosSig2D[3] = new FlavourHistograms<double>
65  ("ips4" + theExtensionString, "2D Significance of impact parameter 4th trk",
66  50, lowerIPSBound, upperIPSBound, false, true, true, "b", dir, mc, ibook) ;
67 }
T getParameter(std::string const &) const
FlavourHistograms< int > * trkNbr3D
FlavourHistograms< double > * tkcntHistosSig2D[5]
FlavourHistograms< int > * trkNbr2D
const std::string theExtensionString
FlavourHistograms< double > * tkcntHistosSig3D[5]
BaseTagInfoPlotter(const std::string &tagName, const EtaPtBin &etaPtBin)
dbl *** dir
Definition: mlp_gen.cc:35
TrackCountingTagPlotter::~TrackCountingTagPlotter ( )

Definition at line 70 of file TrackCountingTagPlotter.cc.

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

71 {
72 
73  if (willFinalize_) {
74  for(int n=0; n != 4; ++n) {
75  if(n==1 || n==2){
76  delete tkcntHistosSig2D[n];
77  delete tkcntHistosSig3D[n];
78  }
79  delete effPurFromHistos[n];
80  }
81  return;
82  }
83 
84  delete trkNbr3D;
85  delete trkNbr2D;
86 
87  for(int n=0; n != 5; ++n) {
88  delete tkcntHistosSig2D[n];
89  delete tkcntHistosSig3D[n];
90  }
91 }
FlavourHistograms< int > * trkNbr3D
FlavourHistograms< double > * tkcntHistosSig2D[5]
FlavourHistograms< int > * trkNbr2D
FlavourHistograms< double > * tkcntHistosSig3D[5]
EffPurFromHistos * effPurFromHistos[4]

Member Function Documentation

void TrackCountingTagPlotter::analyzeTag ( const reco::BaseTagInfo baseTagInfo,
const double &  jec,
const int &  jetFlavour 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 93 of file TrackCountingTagPlotter.cc.

95 {
96  analyzeTag(baseTagInfo,jetFlavour,1.);
97 }
void analyzeTag(const reco::BaseTagInfo *baseTagInfo, const double &jec, const int &jetFlavour)
void TrackCountingTagPlotter::analyzeTag ( const reco::BaseTagInfo baseTagInfo,
const double &  jec,
const int &  jetFlavour,
const float &  w 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 99 of file TrackCountingTagPlotter.cc.

References Exception, FlavourHistograms< T >::fill(), lumiContext::fill, lowerIPSBound, gen::n, reco::TrackCountingTagInfo::selectedTracks(), reco::TrackCountingTagInfo::significance(), dumpRecoGeometry_cfg::tagInfo, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, and w.

103 {
104 
106  dynamic_cast<const reco::TrackCountingTagInfo *>(baseTagInfo);
107 
108  if (!tagInfo) {
109  throw cms::Exception("Configuration")
110  << "BTagPerformanceAnalyzer: Extended TagInfo not of type TrackCountingTagInfo. " << endl;
111  }
112 
113  trkNbr3D->fill(jetFlavour, tagInfo->selectedTracks(0),w);
114  trkNbr2D->fill(jetFlavour, tagInfo->selectedTracks(1),w);
115 
116  for(int n=0; n != tagInfo->selectedTracks(1) && n != 4; ++n)
117  tkcntHistosSig2D[n]->fill(jetFlavour, tagInfo->significance(n,1),w);
118  for(int n=tagInfo->selectedTracks(1); n < 4; ++n)
119  tkcntHistosSig2D[n]->fill(jetFlavour, lowerIPSBound-1.0,w);
120 
121  for(int n=0; n != tagInfo->selectedTracks(0) && n != 4; ++n)
122  tkcntHistosSig3D[n]->fill(jetFlavour, tagInfo->significance(n,0),w);
123  for(int n=tagInfo->selectedTracks(0); n < 4; ++n)
124  tkcntHistosSig3D[n]->fill(jetFlavour, lowerIPSBound-1.0,w);
125 
126  for(int n=0; n != tagInfo->selectedTracks(1); ++n)
127  tkcntHistosSig2D[4]->fill(jetFlavour, tagInfo->significance(n,1),w);
128  for(int n=0; n != tagInfo->selectedTracks(0); ++n)
129  tkcntHistosSig3D[4]->fill(jetFlavour, tagInfo->significance(n,0),w);
130 }
FlavourHistograms< int > * trkNbr3D
FlavourHistograms< double > * tkcntHistosSig2D[5]
string fill
Definition: lumiContext.py:319
const double w
Definition: UKUtility.cc:23
FlavourHistograms< int > * trkNbr2D
void fill(const int &flavour, const T &variable) const
FlavourHistograms< double > * tkcntHistosSig3D[5]
virtual int selectedTracks(int ipType) const
virtual float significance(size_t n, int ip) const
void TrackCountingTagPlotter::epsPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 229 of file TrackCountingTagPlotter.cc.

References effPurFromHistos, FlavourHistograms< T >::epsPlot(), gen::n, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, and willFinalize_.

230 {
231  if (willFinalize_) {
232  for(int n=0; n != 4; ++n) effPurFromHistos[n]->epsPlot(name);
233  return;
234  }
235 
238  for(int n=0; n != 5; ++n) {
241  }
242 }
FlavourHistograms< int > * trkNbr3D
void epsPlot(const std::string &name)
FlavourHistograms< double > * tkcntHistosSig2D[5]
FlavourHistograms< int > * trkNbr2D
void epsPlot(const std::string &name)
FlavourHistograms< double > * tkcntHistosSig3D[5]
EffPurFromHistos * effPurFromHistos[4]
void TrackCountingTagPlotter::finalize ( DQMStore::IBooker ibook_,
DQMStore::IGetter igetter_ 
)
virtual

Implements BaseBTagPlotter.

Definition at line 132 of file TrackCountingTagPlotter.cc.

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

133 {
134  //
135  // final processing:
136  // produce the misid. vs. eff histograms
137  //
138  const std::string dir("TrackCounting"+theExtensionString);
139 
141  ("ips2_3D" + theExtensionString, "3D Significance of impact parameter 2nd trk",
142  50, lowerIPSBound, upperIPSBound, "b", dir, mcPlots_, igetter_) ;
143  effPurFromHistos[0] = new EffPurFromHistos (tkcntHistosSig3D[1],dir,mcPlots_, ibook,
145  endEffPur_);
146 
148  ("ips3_3D" + theExtensionString, "3D Significance of impact parameter 3rd trk",
149  50, lowerIPSBound, upperIPSBound, "b", dir, mcPlots_, igetter_) ;
150  effPurFromHistos[1] = new EffPurFromHistos (tkcntHistosSig3D[2],dir,mcPlots_, ibook,
152  endEffPur_);
153 
155  ("ips2_2D" + theExtensionString, "2D Significance of impact parameter 2nd trk",
156  50, lowerIPSBound, upperIPSBound, "b", dir, mcPlots_, igetter_) ;
157  effPurFromHistos[2] = new EffPurFromHistos (tkcntHistosSig2D[1],dir,mcPlots_, ibook,
159  endEffPur_);
160 
162  ("ips3_2D" + theExtensionString, "2D Significance of impact parameter 3rd trk",
163  50, lowerIPSBound, upperIPSBound, "b", dir, mcPlots_, igetter_) ;
164  effPurFromHistos[3] = new EffPurFromHistos (tkcntHistosSig2D[2],dir,mcPlots_, ibook,
166  endEffPur_);
167 
168  for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute(ibook);
169 }
FlavourHistograms< double > * tkcntHistosSig2D[5]
const std::string theExtensionString
FlavourHistograms< double > * tkcntHistosSig3D[5]
dbl *** dir
Definition: mlp_gen.cc:35
EffPurFromHistos * effPurFromHistos[4]
void TrackCountingTagPlotter::psPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 171 of file TrackCountingTagPlotter.cc.

References svgfig::canvas(), EffPurFromHistos::discriminatorCutEfficScan(), EffPurFromHistos::discriminatorNoCutEffic(), effPurFromHistos, gen::n, EffPurFromHistos::plot(), FlavourHistograms< T >::plot(), setTDRStyle(), AlCaHLTBitMon_QueryRunRegistry::string, BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, and willFinalize_.

172 {
173  const std::string cName("TrackCountingPlots"+ theExtensionString);
174  setTDRStyle()->cd();
175  TCanvas canvas(cName.c_str(), cName.c_str(), 600, 900);
176  canvas.UseCurrentStyle();
177  if (willFinalize_) {
178  for(int n=0; n != 2; ++n) {
179  canvas.Print((name + cName + ".ps").c_str());
180  canvas.Clear();
181  canvas.Divide(2,3);
182  canvas.cd(1);
184  canvas.cd(2);
186  canvas.cd(3);
187  effPurFromHistos[0+n]->plot();
188  canvas.cd(4);
190  canvas.cd(5);
192  canvas.cd(6);
193  effPurFromHistos[1+n]->plot();
194  }
195  return;
196  }
197 
198  canvas.Clear();
199  canvas.Divide(2,3);
200  canvas.Print((name + cName + ".ps[").c_str());
201 
202  canvas.cd(1);
203  trkNbr3D->plot();
204  canvas.cd(2);
205  tkcntHistosSig3D[4]->plot();
206  for(int n=0; n < 4; n++) {
207  canvas.cd(3+n);
208  tkcntHistosSig3D[n]->plot();
209  }
210 
211  canvas.Print((name + cName + ".ps").c_str());
212  canvas.Clear();
213  canvas.Divide(2,3);
214 
215  canvas.cd(1);
216  trkNbr2D->plot();
217  canvas.cd(2);
218  tkcntHistosSig2D[4]->plot();
219  for(int n=0; n != 4; ++n) {
220  canvas.cd(3+n);
221  tkcntHistosSig2D[n]->plot();
222  }
223 
224  canvas.Print((name + cName + ".ps").c_str());
225  canvas.Print((name + cName + ".ps]").c_str());
226 }
FlavourHistograms< int > * trkNbr3D
void plot(TPad *theCanvas=0)
FlavourHistograms< double > * tkcntHistosSig2D[5]
FlavourHistograms< int > * trkNbr2D
const std::string theExtensionString
def canvas
Definition: svgfig.py:481
FlavourHistograms< double > * discriminatorCutEfficScan() const
void plot(TPad *theCanvas=0)
FlavourHistograms< double > * discriminatorNoCutEffic() const
FlavourHistograms< double > * tkcntHistosSig3D[5]
void setTDRStyle()
Definition: plotscripts.py:87
EffPurFromHistos * effPurFromHistos[4]

Member Data Documentation

EffPurFromHistos* TrackCountingTagPlotter::effPurFromHistos[4]
private

Definition at line 44 of file TrackCountingTagPlotter.h.

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

double TrackCountingTagPlotter::endEffPur_
private

Definition at line 35 of file TrackCountingTagPlotter.h.

Referenced by finalize().

double TrackCountingTagPlotter::lowerIPSBound
private

Definition at line 42 of file TrackCountingTagPlotter.h.

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

unsigned int TrackCountingTagPlotter::mcPlots_
private

Definition at line 32 of file TrackCountingTagPlotter.h.

Referenced by finalize().

int TrackCountingTagPlotter::nBinEffPur_
private

Definition at line 33 of file TrackCountingTagPlotter.h.

Referenced by finalize().

double TrackCountingTagPlotter::startEffPur_
private

Definition at line 34 of file TrackCountingTagPlotter.h.

Referenced by finalize().

FlavourHistograms<double>* TrackCountingTagPlotter::tkcntHistosSig2D[5]
private
FlavourHistograms<double>* TrackCountingTagPlotter::tkcntHistosSig3D[5]
private
FlavourHistograms<int> * TrackCountingTagPlotter::trkNbr2D
private
FlavourHistograms<int>* TrackCountingTagPlotter::trkNbr3D
private
double TrackCountingTagPlotter::upperIPSBound
private

Definition at line 42 of file TrackCountingTagPlotter.h.

Referenced by finalize(), and TrackCountingTagPlotter().

bool TrackCountingTagPlotter::willFinalize_
private