15 using namespace RecoBTag;
18 TH1F * h_s, TH1F * h_c, TH1F * h_b, TH1F * h_g, TH1F * h_ni,
19 TH1F * h_dus, TH1F * h_dusg, TH1F * h_pu,
21 int nBin,
double startO,
double endO) :
22 fromDiscriminatorDistr(
false),
23 histoExtension(ext), effVersusDiscr_d(h_d), effVersusDiscr_u(h_u),
24 effVersusDiscr_s(h_s), effVersusDiscr_c(h_c), effVersusDiscr_b(h_b),
25 effVersusDiscr_g(h_g), effVersusDiscr_ni(h_ni), effVersusDiscr_dus(h_dus),
26 effVersusDiscr_dusg(h_dusg), effVersusDiscr_pu(h_pu),
27 nBinOutput(nBin), startOutput(startO),
28 endOutput(endO), mcPlots_(mc), label_(label)
36 double startO,
double endO) :
37 fromDiscriminatorDistr(
true), nBinOutput(nBin), startOutput(startO), endOutput(endO), mcPlots_(mc), label_(label){
119 vector<TH1F*> discrCutHistos = discrCutEfficScan->
getHistoVector();
121 const int& dimHistos = discrCfHistos.size();
127 const int& nBins = dDiscriminatorFC->
nBins();
130 for (
int iFlav = 0; iFlav < dimHistos; iFlav++ ) {
131 if (discrCfHistos[iFlav] == 0)
continue;
132 discrNoCutHistos[iFlav]->SetXTitle (
"Discriminant" );
133 discrNoCutHistos[iFlav]->GetXaxis()->SetTitleOffset ( 0.75 );
137 const double& nJetsFlav = discrCfHistos[iFlav]->GetEntries ();
138 double sum = discrCfHistos[iFlav]->GetBinContent( nBins+1 );
140 for (
int iDiscr = nBins; iDiscr > 0 ; --iDiscr ) {
142 discrNoCutHistos[iFlav]->SetBinContent ( iDiscr, nJetsFlav );
143 discrNoCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(nJetsFlav) );
144 sum += discrCfHistos[iFlav]->GetBinContent( iDiscr );
145 discrCutHistos[iFlav]->SetBinContent ( iDiscr, sum );
146 discrCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(sum) );
193 (
"Flavour misidentification vs. b-tagging efficiency " +
histoExtension).c_str());
195 tc.Print((name +
"FlavEffVsBEff" +
histoExtension + ext).c_str());
202 bool btppColour =
true;
210 gPad->UseCurrentStyle();
211 gPad->SetFillColor ( 0 );
213 gPad->SetGridx ( 1 );
214 gPad->SetGridy ( 1 );
227 float mSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
354 ( (nBins_d == nBins_u &&
355 nBins_d == nBins_s &&
356 nBins_d == nBins_c &&
357 nBins_d == nBins_b &&
358 nBins_d == nBins_g &&
359 nBins_d == nBins_ni &&
360 nBins_d == nBins_dus &&
361 nBins_d == nBins_dusg)||
362 (nBins_c == nBins_b &&
363 nBins_c == nBins_dusg &&
364 nBins_c == nBins_ni &&
365 nBins_c == nBins_pu) );
369 <<
"Input histograms do not all have the same number of bins!\n";
393 ( (sBin_d == sBin_u &&
399 sBin_d == sBin_dus &&
400 sBin_d == sBin_dusg)||
402 sBin_c == sBin_dusg &&
404 sBin_c == sBin_pu) );
408 <<
"EffPurFromHistos::check() : Input histograms do not all have the same start bin!\n";
432 ( (eBin_d == eBin_u &&
438 eBin_d == eBin_dus &&
439 eBin_d == eBin_dusg)||
441 eBin_c == eBin_dusg &&
443 eBin_c == eBin_pu) );
447 <<
"EffPurFromHistos::check() : Input histograms do not all have the same end bin!\n";
560 const int&
nBinB = EffFlavVsBEff->
getTH1F()->GetNbinsX();
562 for (
int iBinB = 1; iBinB <=
nBinB; iBinB++ ) {
564 const float& effBBinWidth = EffFlavVsBEff->
getTH1F()->GetBinWidth ( iBinB );
565 const float& effBMid = EffFlavVsBEff->
getTH1F()->GetBinCenter ( iBinB );
566 const float& effBLeft = effBMid - 0.5*effBBinWidth;
567 const float& effBRight = effBMid + 0.5*effBBinWidth;
570 const bool& binFound = ( binClosest > 0 ) ;
double lowerBound() const
MonitorElement * EffFlavVsBEff_g
void epsPlot(const std::string &name)
void SetMinimum(const double &min)
void compute(DQMStore::IBooker &ibook)
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
MonitorElement * EffFlavVsBEff_pu
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)
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
MonitorElement * EffFlavVsBEff_b
MonitorElement * EffFlavVsBEff_ni
void setEfficiencyFlag(void)
double upperBound() const
volatile std::atomic< bool > shutdown_flag false
bool fromDiscriminatorDistr
void psPlot(const std::string &name)
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, TH1F *h_pu, const std::string &label, const unsigned int &mc, int nBin=100, double startO=0.005, double endO=1.005)
void divide(const FlavourHistograms< T > &bHD)
TH1F * effVersusDiscr_dus
TH1F * histo_dusg() const
MonitorElement * EffFlavVsBEff_dus