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) );
192 (
"Flavour misidentification vs. b-tagging efficiency " +
histoExtension).c_str());
194 tc.Print((name +
"FlavEffVsBEff" +
histoExtension + ext).c_str());
201 bool btppColour =
true;
209 gPad->UseCurrentStyle();
210 gPad->SetFillColor ( 0 );
212 gPad->SetGridx ( 1 );
213 gPad->SetGridy ( 1 );
226 float mSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
353 ( (nBins_d == nBins_u &&
354 nBins_d == nBins_s &&
355 nBins_d == nBins_c &&
356 nBins_d == nBins_b &&
357 nBins_d == nBins_g &&
358 nBins_d == nBins_ni &&
359 nBins_d == nBins_dus &&
360 nBins_d == nBins_dusg)||
361 (nBins_c == nBins_b &&
362 nBins_c == nBins_dusg &&
363 nBins_c == nBins_ni &&
364 nBins_c == nBins_pu) );
368 <<
"Input histograms do not all have the same number of bins!\n";
392 ( (sBin_d == sBin_u &&
398 sBin_d == sBin_dus &&
399 sBin_d == sBin_dusg)||
401 sBin_c == sBin_dusg &&
403 sBin_c == sBin_pu) );
407 <<
"EffPurFromHistos::check() : Input histograms do not all have the same start bin!\n";
431 ( (eBin_d == eBin_u &&
437 eBin_d == eBin_dus &&
438 eBin_d == eBin_dusg)||
440 eBin_c == eBin_dusg &&
442 eBin_c == eBin_pu) );
446 <<
"EffPurFromHistos::check() : Input histograms do not all have the same end bin!\n";
549 const int&
nBinB = EffFlavVsBEff->
getTH1F()->GetNbinsX();
551 for (
int iBinB = 1; iBinB <=
nBinB; iBinB++ ) {
553 const float& effBBinWidth = EffFlavVsBEff->
getTH1F()->GetBinWidth ( iBinB );
554 const float& effBMid = EffFlavVsBEff->
getTH1F()->GetBinCenter ( iBinB );
555 const float& effBLeft = effBMid - 0.5*effBBinWidth;
556 const float& effBRight = effBMid + 0.5*effBBinWidth;
559 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