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 unsigned int& 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_ );
57 effVersusDiscr_d = discrCutEfficScan->
histo_d ();
58 effVersusDiscr_u = discrCutEfficScan->
histo_u ();
59 effVersusDiscr_s = discrCutEfficScan->
histo_s ();
60 effVersusDiscr_g = discrCutEfficScan->
histo_g ();
61 effVersusDiscr_dus = discrCutEfficScan->
histo_dus ();
68 effVersusDiscr_dus = 0;
70 effVersusDiscr_c = discrCutEfficScan->
histo_c ();
71 effVersusDiscr_b = discrCutEfficScan->
histo_b ();
72 effVersusDiscr_ni = discrCutEfficScan->
histo_ni ();
73 effVersusDiscr_dusg = discrCutEfficScan->
histo_dusg();
77 effVersusDiscr_d->SetXTitle (
"Discriminant" );
78 effVersusDiscr_d->GetXaxis()->SetTitleOffset ( 0.75 );
79 effVersusDiscr_u->SetXTitle (
"Discriminant" );
80 effVersusDiscr_u->GetXaxis()->SetTitleOffset ( 0.75 );
81 effVersusDiscr_s->SetXTitle (
"Discriminant" );
82 effVersusDiscr_s->GetXaxis()->SetTitleOffset ( 0.75 );
83 effVersusDiscr_g->SetXTitle (
"Discriminant" );
84 effVersusDiscr_g->GetXaxis()->SetTitleOffset ( 0.75 );
85 effVersusDiscr_dus->SetXTitle (
"Discriminant" );
86 effVersusDiscr_dus->GetXaxis()->SetTitleOffset ( 0.75 );
88 effVersusDiscr_c->SetXTitle (
"Discriminant" );
89 effVersusDiscr_c->GetXaxis()->SetTitleOffset ( 0.75 );
90 effVersusDiscr_b->SetXTitle (
"Discriminant" );
91 effVersusDiscr_b->GetXaxis()->SetTitleOffset ( 0.75 );
92 effVersusDiscr_ni->SetXTitle (
"Discriminant" );
93 effVersusDiscr_ni->GetXaxis()->SetTitleOffset ( 0.75 );
94 effVersusDiscr_dusg->SetXTitle (
"Discriminant" );
95 effVersusDiscr_dusg->GetXaxis()->SetTitleOffset ( 0.75 );
100 effVersusDiscr_s = 0;
101 effVersusDiscr_c = 0;
102 effVersusDiscr_b = 0;
103 effVersusDiscr_g = 0;
104 effVersusDiscr_ni = 0;
105 effVersusDiscr_dus = 0;
106 effVersusDiscr_dusg = 0;
113 vector<TH1F*> discrNoCutHistos = discrNoCutEffic->getHistoVector();
116 vector<TH1F*> discrCutHistos = discrCutEfficScan->
getHistoVector();
118 const int& dimHistos = discrCfHistos.size();
124 const int& nBins = dDiscriminatorFC->
nBins();
127 for (
int iFlav = 0; iFlav < dimHistos; iFlav++ ) {
128 if (discrCfHistos[iFlav] == 0)
continue;
129 discrNoCutHistos[iFlav]->SetXTitle (
"Discriminant" );
130 discrNoCutHistos[iFlav]->GetXaxis()->SetTitleOffset ( 0.75 );
134 const double& nJetsFlav = discrCfHistos[iFlav]->GetEntries ();
135 double sum = discrCfHistos[iFlav]->GetBinContent( nBins+1 );
137 for (
int iDiscr = nBins; iDiscr > 0 ; --iDiscr ) {
139 discrNoCutHistos[iFlav]->SetBinContent ( iDiscr, nJetsFlav );
140 discrNoCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(nJetsFlav) );
141 sum += discrCfHistos[iFlav]->GetBinContent( iDiscr );
142 discrCutHistos[iFlav]->SetBinContent ( iDiscr, sum );
143 discrCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(sum) );
149 discrCutEfficScan->
divide ( *discrNoCutEffic );
189 (
"Flavour misidentification vs. b-tagging efficiency " +
histoExtension).c_str());
191 tc.Print((name +
"FlavEffVsBEff" +
histoExtension + ext).c_str());
198 bool btppColour =
true;
206 gPad->UseCurrentStyle();
207 gPad->SetFillColor ( 0 );
209 gPad->SetGridx ( 1 );
210 gPad->SetGridy ( 1 );
223 float mSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
348 ( (nBins_d == nBins_u &&
349 nBins_d == nBins_s &&
350 nBins_d == nBins_c &&
351 nBins_d == nBins_b &&
352 nBins_d == nBins_g &&
353 nBins_d == nBins_ni &&
354 nBins_d == nBins_dus &&
355 nBins_d == nBins_dusg)||
356 (nBins_c == nBins_b &&
357 nBins_c == nBins_dusg &&
358 nBins_c == nBins_ni) );
362 <<
"Input histograms do not all have the same number of bins!\n";
385 ( (sBin_d == sBin_u &&
391 sBin_d == sBin_dus &&
392 sBin_d == sBin_dusg)||
394 sBin_c == sBin_dusg &&
395 sBin_c == sBin_ni) );
399 <<
"EffPurFromHistos::check() : Input histograms do not all have the same start bin!\n";
422 ( (eBin_d == eBin_u &&
428 eBin_d == eBin_dus &&
429 eBin_d == eBin_dusg)||
431 eBin_c == eBin_dusg &&
432 eBin_c == eBin_ni) );
436 <<
"EffPurFromHistos::check() : Input histograms do not all have the same end bin!\n";
533 const int&
nBinB = EffFlavVsBEff->
getTH1F()->GetNbinsX();
535 for (
int iBinB = 1; iBinB <=
nBinB; iBinB++ ) {
537 const float& effBBinWidth = EffFlavVsBEff->
getTH1F()->GetBinWidth ( iBinB );
538 const float& effBMid = EffFlavVsBEff->
getTH1F()->GetBinCenter ( iBinB );
539 const float& effBLeft = effBMid - 0.5*effBBinWidth;
540 const float& effBRight = effBMid + 0.5*effBBinWidth;
543 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)
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 unsigned int &mc, int nBin=100, double startO=0.005, double endO=1.005)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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
volatile std::atomic< bool > shutdown_flag false
bool fromDiscriminatorDistr
void psPlot(const std::string &name)
TH1F * effVersusDiscr_dus
TH1F * histo_dusg() const
MonitorElement * EffFlavVsBEff_dus