16 using namespace RecoBTag;
21 TH1F * h_s, TH1F * h_c, TH1F * h_b, TH1F * h_g, TH1F * h_ni,
22 TH1F * h_dus, TH1F * h_dusg,
const std::string&
label,
const bool& mc,
int nBin,
double startO,
double endO) :
24 fromDiscriminatorDistr(
false),
25 histoExtension(ext), effVersusDiscr_d(h_d), effVersusDiscr_u(h_u),
26 effVersusDiscr_s(h_s), effVersusDiscr_c(h_c), effVersusDiscr_b(h_b),
27 effVersusDiscr_g(h_g), effVersusDiscr_ni(h_ni), effVersusDiscr_dus(h_dus),
28 effVersusDiscr_dusg(h_dusg), nBinOutput(nBin), startOutput(startO),
29 endOutput(endO), mcPlots_(mc), label_(label)
37 double startO,
double endO) :
38 fromDiscriminatorDistr(
true), nBinOutput(nBin), startOutput(startO), endOutput(endO), mcPlots_(mc), label_(label){
43 "totalEntries" + histoExtension,
"Total Entries: " + dDiscriminatorFC->
baseNameDescription(),
45 dDiscriminatorFC->
upperBound(),
false,
true,
false,
"b",
false,
label, mcPlots_ );
50 "effVsDiscrCut" + histoExtension,
"Eff. vs Disc. Cut: " + dDiscriminatorFC->
baseNameDescription(),
52 dDiscriminatorFC->
upperBound(),
false,
true,
false,
"b",
false,
label , mcPlots_ );
56 effVersusDiscr_d = discrCutEfficScan->
histo_d ();
57 effVersusDiscr_u = discrCutEfficScan->
histo_u ();
58 effVersusDiscr_s = discrCutEfficScan->
histo_s ();
59 effVersusDiscr_c = discrCutEfficScan->
histo_c ();
60 effVersusDiscr_b = discrCutEfficScan->
histo_b ();
61 effVersusDiscr_g = discrCutEfficScan->
histo_g ();
62 effVersusDiscr_ni = discrCutEfficScan->
histo_ni ();
63 effVersusDiscr_dus = discrCutEfficScan->
histo_dus ();
64 effVersusDiscr_dusg = discrCutEfficScan->
histo_dusg();
68 effVersusDiscr_d->SetXTitle (
"Discriminant" );
69 effVersusDiscr_d->GetXaxis()->SetTitleOffset ( 0.75 );
70 effVersusDiscr_u->SetXTitle (
"Discriminant" );
71 effVersusDiscr_u->GetXaxis()->SetTitleOffset ( 0.75 );
72 effVersusDiscr_s->SetXTitle (
"Discriminant" );
73 effVersusDiscr_s->GetXaxis()->SetTitleOffset ( 0.75 );
74 effVersusDiscr_c->SetXTitle (
"Discriminant" );
75 effVersusDiscr_c->GetXaxis()->SetTitleOffset ( 0.75 );
76 effVersusDiscr_b->SetXTitle (
"Discriminant" );
77 effVersusDiscr_b->GetXaxis()->SetTitleOffset ( 0.75 );
78 effVersusDiscr_g->SetXTitle (
"Discriminant" );
79 effVersusDiscr_g->GetXaxis()->SetTitleOffset ( 0.75 );
80 effVersusDiscr_ni->SetXTitle (
"Discriminant" );
81 effVersusDiscr_ni->GetXaxis()->SetTitleOffset ( 0.75 );
82 effVersusDiscr_dus->SetXTitle (
"Discriminant" );
83 effVersusDiscr_dus->GetXaxis()->SetTitleOffset ( 0.75 );
84 effVersusDiscr_dusg->SetXTitle (
"Discriminant" );
85 effVersusDiscr_dusg->GetXaxis()->SetTitleOffset ( 0.75 );
93 effVersusDiscr_ni = 0;
94 effVersusDiscr_dus = 0;
95 effVersusDiscr_dusg = 0;
102 vector<TH1F*> discrNoCutHistos = discrNoCutEffic->getHistoVector();
105 vector<TH1F*> discrCutHistos = discrCutEfficScan->
getHistoVector();
107 const int& dimHistos = discrCfHistos.size();
113 const int& nBins = dDiscriminatorFC->
nBins();
116 for (
int iFlav = 0; iFlav < dimHistos; iFlav++ ) {
117 if (discrCfHistos[iFlav] == 0)
continue;
118 discrNoCutHistos[iFlav]->SetXTitle (
"Discriminant" );
119 discrNoCutHistos[iFlav]->GetXaxis()->SetTitleOffset ( 0.75 );
123 const double& nJetsFlav = discrCfHistos[iFlav]->GetEntries ();
124 double sum = discrCfHistos[iFlav]->GetBinContent( nBins+1 );
126 for (
int iDiscr = nBins; iDiscr > 0 ; --iDiscr ) {
128 discrNoCutHistos[iFlav]->SetBinContent ( iDiscr, nJetsFlav );
129 discrNoCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(nJetsFlav) );
130 sum += discrCfHistos[iFlav]->GetBinContent( iDiscr );
131 discrCutHistos[iFlav]->SetBinContent ( iDiscr, sum );
132 discrCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(sum) );
138 discrCutEfficScan->
divide ( *discrNoCutEffic );
178 (
"Flavour misidentification vs. b-tagging efficiency " +
histoExtension).c_str());
180 tc.Print((name +
"FlavEffVsBEff" +
histoExtension + ext).c_str());
187 bool btppColour =
true;
195 gPad->UseCurrentStyle();
196 gPad->SetFillColor ( 0 );
198 gPad->SetGridx ( 1 );
199 gPad->SetGridy ( 1 );
212 float mSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
326 ( nBins_d == nBins_u &&
327 nBins_d == nBins_s &&
328 nBins_d == nBins_c &&
329 nBins_d == nBins_b &&
330 nBins_d == nBins_g &&
331 nBins_d == nBins_ni &&
332 nBins_d == nBins_dus &&
333 nBins_d == nBins_dusg );
337 <<
"Input histograms do not all have the same number of bins!\n";
353 ( sBin_d == sBin_u &&
359 sBin_d == sBin_dus &&
360 sBin_d == sBin_dusg );
364 <<
"EffPurFromHistos::check() : Input histograms do not all have the same start bin!\n";
380 ( eBin_d == eBin_u &&
386 eBin_d == eBin_dus &&
387 eBin_d == eBin_dusg );
391 <<
"EffPurFromHistos::check() : Input histograms do not all have the same end bin!\n";
417 const std::string & hB =
"FlavEffVsBEff_";
477 const int& nBinB = EffFlavVsBEff->
getTH1F()->GetNbinsX();
479 for (
int iBinB = 1; iBinB <= nBinB; iBinB++ ) {
481 const float& effBBinWidth = EffFlavVsBEff->
getTH1F()->GetBinWidth ( iBinB );
482 const float& effBMid = EffFlavVsBEff->
getTH1F()->GetBinCenter ( iBinB );
483 const float& effBLeft = effBMid - 0.5*effBBinWidth;
484 const float& effBRight = effBMid + 0.5*effBBinWidth;
487 const bool& binFound = ( binClosest > 0 ) ;
double lowerBound() const
MonitorElement * EffFlavVsBEff_g
void epsPlot(const std::string &name)
void SetMinimum(const double &min)
MonitorElement * EffFlavVsBEff_dusg
MonitorElement * EffFlavVsBEff_u
int findBinClosestYValue(const TH1F *, const float &yVal, const float &yLow, const float &yHigh)
FlavourHistograms< double > * discrNoCutEffic
std::string baseNameDescription() const
std::vector< TH1F * > getHistoVector() const
void epsPlot(const std::string &name)
virtual MonitorElement * book1D(const std::string &name, const std::string &title, const int &nchX, const double &lowX, const double &highX)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
EffPurFromHistos(const std::string &ext, TH1F *h_d, TH1F *h_u, TH1F *h_s, TH1F *h_c, TH1F *h_b, TH1F *h_g, TH1F *h_ni, TH1F *h_dus, TH1F *h_dusg, const std::string &label, const bool &mc, int nBin=100, double startO=0.005, double endO=1.005)
void plot(TPad *theCanvas=0)
std::string baseNameTitle() const
MonitorElement * EffFlavVsBEff_c
MonitorElement * EffFlavVsBEff_s
TH1F * effVersusDiscr_dusg
FlavourHistograms< double > * discrCutEfficScan
std::string histoExtension
TH1F * getTH1F(void) const
MonitorElement * EffFlavVsBEff_d
void divide(const FlavourHistograms< T > &bHD) const
MonitorElement * EffFlavVsBEff_b
MonitorElement * EffFlavVsBEff_ni
double upperBound() const
bool fromDiscriminatorDistr
void psPlot(const std::string &name)
TH1F * effVersusDiscr_dus
TH1F * histo_dusg() const
MonitorElement * EffFlavVsBEff_dus