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, TH1F * h_pu,
24 int nBin,
double startO,
double endO) :
26 fromDiscriminatorDistr(
false),
27 histoExtension(ext), effVersusDiscr_d(h_d), effVersusDiscr_u(h_u),
28 effVersusDiscr_s(h_s), effVersusDiscr_c(h_c), effVersusDiscr_b(h_b),
29 effVersusDiscr_g(h_g), effVersusDiscr_ni(h_ni), effVersusDiscr_dus(h_dus),
30 effVersusDiscr_dusg(h_dusg), effVersusDiscr_pu(h_pu),
31 nBinOutput(nBin), startOutput(startO),
32 endOutput(endO), mcPlots_(mc), label_(label)
40 double startO,
double endO) :
41 fromDiscriminatorDistr(
true), nBinOutput(nBin), startOutput(startO), endOutput(endO), mcPlots_(mc), label_(label){
123 vector<TH1F*> discrCutHistos = discrCutEfficScan->
getHistoVector();
125 const int& dimHistos = discrCfHistos.size();
131 const int& nBins = dDiscriminatorFC->
nBins();
134 for (
int iFlav = 0; iFlav < dimHistos; iFlav++ ) {
135 if (discrCfHistos[iFlav] == 0)
continue;
136 discrNoCutHistos[iFlav]->SetXTitle (
"Discriminant" );
137 discrNoCutHistos[iFlav]->GetXaxis()->SetTitleOffset ( 0.75 );
141 const double& nJetsFlav = discrCfHistos[iFlav]->GetEntries ();
142 double sum = discrCfHistos[iFlav]->GetBinContent( nBins+1 );
144 for (
int iDiscr = nBins; iDiscr > 0 ; --iDiscr ) {
146 discrNoCutHistos[iFlav]->SetBinContent ( iDiscr, nJetsFlav );
147 discrNoCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(nJetsFlav) );
148 sum += discrCfHistos[iFlav]->GetBinContent( iDiscr );
149 discrCutHistos[iFlav]->SetBinContent ( iDiscr, sum );
150 discrCutHistos[iFlav]->SetBinError ( iDiscr,
sqrt(sum) );
196 (
"Flavour misidentification vs. b-tagging efficiency " +
histoExtension).c_str());
198 tc.Print((name +
"FlavEffVsBEff" +
histoExtension + ext).c_str());
205 bool btppColour =
true;
213 gPad->UseCurrentStyle();
214 gPad->SetFillColor ( 0 );
216 gPad->SetGridx ( 1 );
217 gPad->SetGridy ( 1 );
230 float mSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
357 ( (nBins_d == nBins_u &&
358 nBins_d == nBins_s &&
359 nBins_d == nBins_c &&
360 nBins_d == nBins_b &&
361 nBins_d == nBins_g &&
362 nBins_d == nBins_ni &&
363 nBins_d == nBins_dus &&
364 nBins_d == nBins_dusg)||
365 (nBins_c == nBins_b &&
366 nBins_c == nBins_dusg &&
367 nBins_c == nBins_ni &&
368 nBins_c == nBins_pu) );
372 <<
"Input histograms do not all have the same number of bins!\n";
396 ( (sBin_d == sBin_u &&
402 sBin_d == sBin_dus &&
403 sBin_d == sBin_dusg)||
405 sBin_c == sBin_dusg &&
407 sBin_c == sBin_pu) );
411 <<
"EffPurFromHistos::check() : Input histograms do not all have the same start bin!\n";
435 ( (eBin_d == eBin_u &&
441 eBin_d == eBin_dus &&
442 eBin_d == eBin_dusg)||
444 eBin_c == eBin_dusg &&
446 eBin_c == eBin_pu) );
450 <<
"EffPurFromHistos::check() : Input histograms do not all have the same end bin!\n";
553 const int&
nBinB = EffFlavVsBEff->
getTH1F()->GetNbinsX();
555 for (
int iBinB = 1; iBinB <=
nBinB; iBinB++ ) {
557 const float& effBBinWidth = EffFlavVsBEff->
getTH1F()->GetBinWidth ( iBinB );
558 const float& effBMid = EffFlavVsBEff->
getTH1F()->GetBinCenter ( iBinB );
559 const float& effBLeft = effBMid - 0.5*effBBinWidth;
560 const float& effBRight = effBMid + 0.5*effBBinWidth;
563 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
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)
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)
TH1F * effVersusDiscr_dus
TH1F * histo_dusg() const
MonitorElement * EffFlavVsBEff_dus