00001 #include "DQMOffline/RecoB/interface/EffPurFromHistos.h"
00002 #include "DQMOffline/RecoB/interface/Tools.h"
00003 #include "FWCore/Utilities/interface/Exception.h"
00004 #include "TStyle.h"
00005 #include "TCanvas.h"
00006
00007 #include <iostream>
00008 #include <math.h>
00009
00010 #include "DQMServices/Core/interface/DQMStore.h"
00011 #include "DQMServices/Core/interface/MonitorElement.h"
00012 #include "FWCore/ServiceRegistry/interface/Service.h"
00013
00014
00015 using namespace std;
00016 using namespace RecoBTag;
00017
00018
00019
00020 EffPurFromHistos::EffPurFromHistos ( const std::string & ext, TH1F * h_d, TH1F * h_u,
00021 TH1F * h_s, TH1F * h_c, TH1F * h_b, TH1F * h_g, TH1F * h_ni,
00022 TH1F * h_dus, TH1F * h_dusg, const std::string& label, const unsigned int& mc, int nBin, double startO, double endO) :
00023
00024 fromDiscriminatorDistr(false),
00025 histoExtension(ext), effVersusDiscr_d(h_d), effVersusDiscr_u(h_u),
00026 effVersusDiscr_s(h_s), effVersusDiscr_c(h_c), effVersusDiscr_b(h_b),
00027 effVersusDiscr_g(h_g), effVersusDiscr_ni(h_ni), effVersusDiscr_dus(h_dus),
00028 effVersusDiscr_dusg(h_dusg), nBinOutput(nBin), startOutput(startO),
00029 endOutput(endO), mcPlots_(mc), label_(label)
00030 {
00031
00032 check();
00033 }
00034
00035 EffPurFromHistos::EffPurFromHistos
00036 (const FlavourHistograms<double> * dDiscriminatorFC, const std::string& label, const unsigned int& mc, int nBin,
00037 double startO, double endO) :
00038 fromDiscriminatorDistr(true), nBinOutput(nBin), startOutput(startO), endOutput(endO), mcPlots_(mc), label_(label){
00039 histoExtension = "_"+dDiscriminatorFC->baseNameTitle();
00040
00041
00042 discrNoCutEffic = new FlavourHistograms<double> (
00043 "totalEntries" + histoExtension, "Total Entries: " + dDiscriminatorFC->baseNameDescription(),
00044 dDiscriminatorFC->nBins(), dDiscriminatorFC->lowerBound(),
00045 dDiscriminatorFC->upperBound(), false, true, false, "b", false, label, mcPlots_ );
00046
00047
00048
00049 discrCutEfficScan = new FlavourHistograms<double> (
00050 "effVsDiscrCut" + histoExtension, "Eff. vs Disc. Cut: " + dDiscriminatorFC->baseNameDescription(),
00051 dDiscriminatorFC->nBins(), dDiscriminatorFC->lowerBound(),
00052 dDiscriminatorFC->upperBound(), false, true, false, "b", false, label , mcPlots_ );
00053 discrCutEfficScan->SetMinimum(1E-4);
00054 if (mcPlots_){
00055
00056 if(mcPlots_>2){
00057 effVersusDiscr_d = discrCutEfficScan->histo_d ();
00058 effVersusDiscr_u = discrCutEfficScan->histo_u ();
00059 effVersusDiscr_s = discrCutEfficScan->histo_s ();
00060 effVersusDiscr_g = discrCutEfficScan->histo_g ();
00061 effVersusDiscr_dus = discrCutEfficScan->histo_dus ();
00062 }
00063 else{
00064 effVersusDiscr_d = 0;
00065 effVersusDiscr_u = 0;
00066 effVersusDiscr_s = 0;
00067 effVersusDiscr_g = 0;
00068 effVersusDiscr_dus = 0;
00069 }
00070 effVersusDiscr_c = discrCutEfficScan->histo_c ();
00071 effVersusDiscr_b = discrCutEfficScan->histo_b ();
00072 effVersusDiscr_ni = discrCutEfficScan->histo_ni ();
00073 effVersusDiscr_dusg = discrCutEfficScan->histo_dusg();
00074
00075
00076 if(mcPlots_>2){
00077 effVersusDiscr_d->SetXTitle ( "Discriminant" );
00078 effVersusDiscr_d->GetXaxis()->SetTitleOffset ( 0.75 );
00079 effVersusDiscr_u->SetXTitle ( "Discriminant" );
00080 effVersusDiscr_u->GetXaxis()->SetTitleOffset ( 0.75 );
00081 effVersusDiscr_s->SetXTitle ( "Discriminant" );
00082 effVersusDiscr_s->GetXaxis()->SetTitleOffset ( 0.75 );
00083 effVersusDiscr_g->SetXTitle ( "Discriminant" );
00084 effVersusDiscr_g->GetXaxis()->SetTitleOffset ( 0.75 );
00085 effVersusDiscr_dus->SetXTitle ( "Discriminant" );
00086 effVersusDiscr_dus->GetXaxis()->SetTitleOffset ( 0.75 );
00087 }
00088 effVersusDiscr_c->SetXTitle ( "Discriminant" );
00089 effVersusDiscr_c->GetXaxis()->SetTitleOffset ( 0.75 );
00090 effVersusDiscr_b->SetXTitle ( "Discriminant" );
00091 effVersusDiscr_b->GetXaxis()->SetTitleOffset ( 0.75 );
00092 effVersusDiscr_ni->SetXTitle ( "Discriminant" );
00093 effVersusDiscr_ni->GetXaxis()->SetTitleOffset ( 0.75 );
00094 effVersusDiscr_dusg->SetXTitle ( "Discriminant" );
00095 effVersusDiscr_dusg->GetXaxis()->SetTitleOffset ( 0.75 );
00096 }
00097 else{
00098 effVersusDiscr_d = 0;
00099 effVersusDiscr_u = 0;
00100 effVersusDiscr_s = 0;
00101 effVersusDiscr_c = 0;
00102 effVersusDiscr_b = 0;
00103 effVersusDiscr_g = 0;
00104 effVersusDiscr_ni = 0;
00105 effVersusDiscr_dus = 0;
00106 effVersusDiscr_dusg = 0;
00107 }
00108
00109
00110 vector<TH1F*> discrCfHistos = dDiscriminatorFC->getHistoVector();
00111
00112
00113 vector<TH1F*> discrNoCutHistos = discrNoCutEffic->getHistoVector();
00114
00115
00116 vector<TH1F*> discrCutHistos = discrCutEfficScan->getHistoVector();
00117
00118 const int& dimHistos = discrCfHistos.size();
00119
00120
00121
00122
00123
00124 const int& nBins = dDiscriminatorFC->nBins();
00125
00126
00127 for ( int iFlav = 0; iFlav < dimHistos; iFlav++ ) {
00128 if (discrCfHistos[iFlav] == 0) continue;
00129 discrNoCutHistos[iFlav]->SetXTitle ( "Discriminant" );
00130 discrNoCutHistos[iFlav]->GetXaxis()->SetTitleOffset ( 0.75 );
00131
00132
00133
00134 const double& nJetsFlav = discrCfHistos[iFlav]->GetEntries ();
00135 double sum = discrCfHistos[iFlav]->GetBinContent( nBins+1 );
00136
00137 for ( int iDiscr = nBins; iDiscr > 0 ; --iDiscr ) {
00138
00139 discrNoCutHistos[iFlav]->SetBinContent ( iDiscr, nJetsFlav );
00140 discrNoCutHistos[iFlav]->SetBinError ( iDiscr, sqrt(nJetsFlav) );
00141 sum += discrCfHistos[iFlav]->GetBinContent( iDiscr );
00142 discrCutHistos[iFlav]->SetBinContent ( iDiscr, sum );
00143 discrCutHistos[iFlav]->SetBinError ( iDiscr, sqrt(sum) );
00144 }
00145 }
00146
00147
00148
00149 discrCutEfficScan->divide ( *discrNoCutEffic );
00150 }
00151
00152
00153 EffPurFromHistos::~EffPurFromHistos () {
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 }
00168
00169
00170
00171
00172 void EffPurFromHistos::epsPlot(const std::string & name)
00173 {
00174 if ( fromDiscriminatorDistr) {
00175 discrNoCutEffic->epsPlot(name);
00176 discrCutEfficScan->epsPlot(name);
00177 }
00178 plot(name, ".eps");
00179 }
00180
00181 void EffPurFromHistos::psPlot(const std::string & name)
00182 {
00183 plot(name, ".ps");
00184 }
00185
00186 void EffPurFromHistos::plot(const std::string & name, const std::string & ext)
00187 {
00188 TCanvas tc (("FlavEffVsBEff" +histoExtension).c_str() ,
00189 ("Flavour misidentification vs. b-tagging efficiency " + histoExtension).c_str());
00190 plot(&tc);
00191 tc.Print((name + "FlavEffVsBEff" + histoExtension + ext).c_str());
00192 }
00193
00194 void EffPurFromHistos::plot (TPad * plotCanvas ) {
00195
00196
00197 bool btppNI = false;
00198 bool btppColour = true;
00199
00200
00201 setTDRStyle()->cd();
00202
00203 if (plotCanvas)
00204 plotCanvas->cd();
00205
00206 gPad->UseCurrentStyle();
00207 gPad->SetFillColor ( 0 );
00208 gPad->SetLogy ( 1 );
00209 gPad->SetGridx ( 1 );
00210 gPad->SetGridy ( 1 );
00211
00212 int col_c ;
00213 int col_g ;
00214 int col_dus;
00215 int col_ni ;
00216
00217 int mStyle_c ;
00218 int mStyle_g ;
00219 int mStyle_dus;
00220 int mStyle_ni ;
00221
00222
00223 float mSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
00224
00225 if ( btppColour ) {
00226 col_c = 6;
00227 col_g = 3;
00228 col_dus = 4;
00229 col_ni = 5;
00230 mStyle_c = 20;
00231 mStyle_g = 20;
00232 mStyle_dus = 20;
00233 mStyle_ni = 20;
00234 }
00235 else {
00236 col_c = 1;
00237 col_g = 1;
00238 col_dus = 1;
00239 col_ni = 1;
00240 mStyle_c = 22;
00241 mStyle_g = 29;
00242 mStyle_dus = 20;
00243 mStyle_ni = 27;
00244 }
00245
00246
00247
00248 if(mcPlots_>2){
00249 EffFlavVsBEff_dus ->getTH1F()->GetXaxis()->SetTitle ( "b-jet efficiency" );
00250 EffFlavVsBEff_dus ->getTH1F()->GetYaxis()->SetTitle ( "non b-jet efficiency" );
00251 EffFlavVsBEff_dus ->getTH1F()->GetYaxis()->SetTitleOffset ( 0.25 );
00252 EffFlavVsBEff_dus ->getTH1F()->SetMaximum ( 1.1 );
00253 EffFlavVsBEff_dus ->getTH1F()->SetMinimum ( 1.e-5 );
00254 EffFlavVsBEff_dus ->getTH1F()->SetMarkerColor ( col_dus );
00255 EffFlavVsBEff_dus ->getTH1F()->SetLineColor ( col_dus );
00256 EffFlavVsBEff_dus ->getTH1F()->SetMarkerSize ( mSize );
00257 EffFlavVsBEff_dus ->getTH1F()->SetMarkerStyle ( mStyle_dus );
00258 EffFlavVsBEff_dus ->getTH1F()->SetStats ( false );
00259 EffFlavVsBEff_dus ->getTH1F()->Draw("pe");
00260
00261 EffFlavVsBEff_g ->getTH1F()->SetMarkerColor ( col_g );
00262 EffFlavVsBEff_g ->getTH1F()->SetLineColor ( col_g );
00263 EffFlavVsBEff_g ->getTH1F()->SetMarkerSize ( mSize );
00264 EffFlavVsBEff_g ->getTH1F()->SetMarkerStyle ( mStyle_g );
00265 EffFlavVsBEff_g ->getTH1F()->SetStats ( false );
00266 EffFlavVsBEff_g ->getTH1F()->Draw("peSame");
00267 }
00268 EffFlavVsBEff_c ->getTH1F()->SetMarkerColor ( col_c );
00269 EffFlavVsBEff_c ->getTH1F()->SetLineColor ( col_c );
00270 EffFlavVsBEff_c ->getTH1F()->SetMarkerSize ( mSize );
00271 EffFlavVsBEff_c ->getTH1F()->SetMarkerStyle ( mStyle_c );
00272 EffFlavVsBEff_c ->getTH1F()->SetStats ( false );
00273 EffFlavVsBEff_c ->getTH1F()->Draw("peSame");
00274
00275 if(mcPlots_>2){
00276 EffFlavVsBEff_d ->getTH1F()-> SetMinimum(0.01);
00277 EffFlavVsBEff_u ->getTH1F()-> SetMinimum(0.01);
00278 EffFlavVsBEff_s ->getTH1F()-> SetMinimum(0.01);
00279 EffFlavVsBEff_g ->getTH1F()-> SetMinimum(0.01);
00280 EffFlavVsBEff_dus ->getTH1F()-> SetMinimum(0.01);
00281 }
00282 EffFlavVsBEff_c ->getTH1F()-> SetMinimum(0.01);
00283 EffFlavVsBEff_b ->getTH1F()-> SetMinimum(0.01);
00284 EffFlavVsBEff_ni ->getTH1F()-> SetMinimum(0.01);
00285 EffFlavVsBEff_dusg ->getTH1F()-> SetMinimum(0.01);
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 if ( btppNI ) {
00316 EffFlavVsBEff_ni ->getTH1F()->SetMarkerColor ( col_ni );
00317 EffFlavVsBEff_ni ->getTH1F()->SetLineColor ( col_ni );
00318 EffFlavVsBEff_ni ->getTH1F()->SetMarkerSize ( mSize );
00319 EffFlavVsBEff_ni ->getTH1F()->SetMarkerStyle ( mStyle_ni );
00320 EffFlavVsBEff_ni ->getTH1F()->SetStats ( false );
00321 EffFlavVsBEff_ni ->getTH1F()->Draw("peSame");
00322 }
00323
00324 }
00325
00326
00327 void EffPurFromHistos::check () {
00328
00329
00330 int nBins_d = 0;
00331 int nBins_u = 0;
00332 int nBins_s = 0;
00333 int nBins_g = 0;
00334 int nBins_dus = 0;
00335 if(mcPlots_>2){
00336 nBins_d = effVersusDiscr_d -> GetNbinsX();
00337 nBins_u = effVersusDiscr_u -> GetNbinsX();
00338 nBins_s = effVersusDiscr_s -> GetNbinsX();
00339 nBins_g = effVersusDiscr_g -> GetNbinsX();
00340 nBins_dus = effVersusDiscr_dus -> GetNbinsX();
00341 }
00342 const int& nBins_c = effVersusDiscr_c -> GetNbinsX();
00343 const int& nBins_b = effVersusDiscr_b -> GetNbinsX();
00344 const int& nBins_ni = effVersusDiscr_ni -> GetNbinsX();
00345 const int& nBins_dusg = effVersusDiscr_dusg -> GetNbinsX();
00346
00347 const bool& lNBins =
00348 ( (nBins_d == nBins_u &&
00349 nBins_d == nBins_s &&
00350 nBins_d == nBins_c &&
00351 nBins_d == nBins_b &&
00352 nBins_d == nBins_g &&
00353 nBins_d == nBins_ni &&
00354 nBins_d == nBins_dus &&
00355 nBins_d == nBins_dusg)||
00356 (nBins_c == nBins_b &&
00357 nBins_c == nBins_dusg &&
00358 nBins_c == nBins_ni) );
00359
00360 if ( !lNBins ) {
00361 throw cms::Exception("Configuration")
00362 << "Input histograms do not all have the same number of bins!\n";
00363 }
00364
00365
00366
00367 float sBin_d = 0;
00368 float sBin_u = 0;
00369 float sBin_s = 0;
00370 float sBin_g = 0;
00371 float sBin_dus = 0;
00372 if(mcPlots_>2){
00373 sBin_d = effVersusDiscr_d -> GetBinCenter(1);
00374 sBin_u = effVersusDiscr_u -> GetBinCenter(1);
00375 sBin_s = effVersusDiscr_s -> GetBinCenter(1);
00376 sBin_g = effVersusDiscr_g -> GetBinCenter(1);
00377 sBin_dus = effVersusDiscr_dus -> GetBinCenter(1);
00378 }
00379 const float& sBin_c = effVersusDiscr_c -> GetBinCenter(1);
00380 const float& sBin_b = effVersusDiscr_b -> GetBinCenter(1);
00381 const float& sBin_ni = effVersusDiscr_ni -> GetBinCenter(1);
00382 const float& sBin_dusg = effVersusDiscr_dusg -> GetBinCenter(1);
00383
00384 const bool& lSBin =
00385 ( (sBin_d == sBin_u &&
00386 sBin_d == sBin_s &&
00387 sBin_d == sBin_c &&
00388 sBin_d == sBin_b &&
00389 sBin_d == sBin_g &&
00390 sBin_d == sBin_ni &&
00391 sBin_d == sBin_dus &&
00392 sBin_d == sBin_dusg)||
00393 (sBin_c == sBin_b &&
00394 sBin_c == sBin_dusg &&
00395 sBin_c == sBin_ni) );
00396
00397 if ( !lSBin ) {
00398 throw cms::Exception("Configuration")
00399 << "EffPurFromHistos::check() : Input histograms do not all have the same start bin!\n";
00400 }
00401
00402
00403
00404 float eBin_d = 0;
00405 float eBin_u = 0;
00406 float eBin_s = 0;
00407 float eBin_g = 0;
00408 float eBin_dus = 0;
00409 if(mcPlots_>2){
00410 eBin_d = effVersusDiscr_d -> GetBinCenter( nBins_d - 1 );
00411 eBin_u = effVersusDiscr_u -> GetBinCenter( nBins_d - 1 );
00412 eBin_s = effVersusDiscr_s -> GetBinCenter( nBins_d - 1 );
00413 eBin_g = effVersusDiscr_g -> GetBinCenter( nBins_d - 1 );
00414 eBin_dus = effVersusDiscr_dus -> GetBinCenter( nBins_d - 1 );
00415 }
00416 const float& eBin_c = effVersusDiscr_c -> GetBinCenter( nBins_d - 1 );
00417 const float& eBin_b = effVersusDiscr_b -> GetBinCenter( nBins_d - 1 );
00418 const float& eBin_ni = effVersusDiscr_ni -> GetBinCenter( nBins_d - 1 );
00419 const float& eBin_dusg = effVersusDiscr_dusg -> GetBinCenter( nBins_d - 1 );
00420
00421 const bool& lEBin =
00422 ( (eBin_d == eBin_u &&
00423 eBin_d == eBin_s &&
00424 eBin_d == eBin_c &&
00425 eBin_d == eBin_b &&
00426 eBin_d == eBin_g &&
00427 eBin_d == eBin_ni &&
00428 eBin_d == eBin_dus &&
00429 eBin_d == eBin_dusg)||
00430 (eBin_c == eBin_b &&
00431 eBin_c == eBin_dusg &&
00432 eBin_c == eBin_ni) );
00433
00434 if ( !lEBin ) {
00435 throw cms::Exception("Configuration")
00436 << "EffPurFromHistos::check() : Input histograms do not all have the same end bin!\n";
00437 }
00438 }
00439
00440
00441 void EffPurFromHistos::compute ()
00442 {
00443 if (!mcPlots_) {
00444
00445 EffFlavVsBEff_d = 0;
00446 EffFlavVsBEff_u = 0;
00447 EffFlavVsBEff_s = 0;
00448 EffFlavVsBEff_c = 0;
00449 EffFlavVsBEff_b = 0;
00450 EffFlavVsBEff_g = 0;
00451 EffFlavVsBEff_ni = 0;
00452 EffFlavVsBEff_dus = 0;
00453 EffFlavVsBEff_dusg = 0;
00454
00455 return;
00456
00457 }
00458
00459
00460
00461 const std::string & hE = histoExtension;
00462 const std::string & hB = "FlavEffVsBEff_";
00463
00464
00465
00466
00467 HistoProviderDQM prov("Btag",label_);
00468 if(mcPlots_>2){
00469 EffFlavVsBEff_d = (prov.book1D ( hB + "D" + hE , hB + "D" + hE , nBinOutput , startOutput , endOutput ));
00470 EffFlavVsBEff_u = (prov.book1D ( hB + "U" + hE , hB + "U" + hE , nBinOutput , startOutput , endOutput )) ;
00471 EffFlavVsBEff_s = (prov.book1D ( hB + "S" + hE , hB + "S" + hE , nBinOutput , startOutput , endOutput )) ;
00472 EffFlavVsBEff_g = (prov.book1D ( hB + "G" + hE , hB + "G" + hE , nBinOutput , startOutput , endOutput )) ;
00473 EffFlavVsBEff_dus = (prov.book1D ( hB + "DUS" + hE , hB + "DUS" + hE , nBinOutput , startOutput , endOutput )) ;
00474 }
00475 else {
00476 EffFlavVsBEff_d = 0;
00477 EffFlavVsBEff_u = 0;
00478 EffFlavVsBEff_s = 0;
00479 EffFlavVsBEff_g = 0;
00480 EffFlavVsBEff_dus = 0;
00481 }
00482 EffFlavVsBEff_c = (prov.book1D ( hB + "C" + hE , hB + "C" + hE , nBinOutput , startOutput , endOutput )) ;
00483 EffFlavVsBEff_b = (prov.book1D ( hB + "B" + hE , hB + "B" + hE , nBinOutput , startOutput , endOutput )) ;
00484 EffFlavVsBEff_ni = (prov.book1D ( hB + "NI" + hE , hB + "NI" + hE , nBinOutput , startOutput , endOutput )) ;
00485 EffFlavVsBEff_dusg = (prov.book1D ( hB + "DUSG" + hE , hB + "DUSG" + hE , nBinOutput , startOutput , endOutput )) ;
00486
00487 if(mcPlots_>2){
00488 EffFlavVsBEff_d->getTH1F()->SetXTitle ( "b-jet efficiency" );
00489 EffFlavVsBEff_d->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00490 EffFlavVsBEff_d->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00491 EffFlavVsBEff_d->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00492 EffFlavVsBEff_u->getTH1F()->SetXTitle ( "b-jet efficiency" );
00493 EffFlavVsBEff_u->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00494 EffFlavVsBEff_u->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00495 EffFlavVsBEff_u->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00496 EffFlavVsBEff_s->getTH1F()->SetXTitle ( "b-jet efficiency" );
00497 EffFlavVsBEff_s->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00498 EffFlavVsBEff_s->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00499 EffFlavVsBEff_s->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00500 EffFlavVsBEff_g->getTH1F()->SetXTitle ( "b-jet efficiency" );
00501 EffFlavVsBEff_g->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00502 EffFlavVsBEff_g->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00503 EffFlavVsBEff_g->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00504 EffFlavVsBEff_dus->getTH1F()->SetXTitle ( "b-jet efficiency" );
00505 EffFlavVsBEff_dus->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00506 EffFlavVsBEff_dus->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00507 EffFlavVsBEff_dus->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00508 }
00509 EffFlavVsBEff_c->getTH1F()->SetXTitle ( "b-jet efficiency" );
00510 EffFlavVsBEff_c->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00511 EffFlavVsBEff_c->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00512 EffFlavVsBEff_c->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00513 EffFlavVsBEff_b->getTH1F()->SetXTitle ( "b-jet efficiency" );
00514 EffFlavVsBEff_b->getTH1F()->SetYTitle ( "b-jet efficiency" );
00515 EffFlavVsBEff_b->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00516 EffFlavVsBEff_b->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00517 EffFlavVsBEff_ni->getTH1F()->SetXTitle ( "b-jet efficiency" );
00518 EffFlavVsBEff_ni->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00519 EffFlavVsBEff_ni->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00520 EffFlavVsBEff_ni->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00521 EffFlavVsBEff_dusg->getTH1F()->SetXTitle ( "b-jet efficiency" );
00522 EffFlavVsBEff_dusg->getTH1F()->SetYTitle ( "non b-jet efficiency" );
00523 EffFlavVsBEff_dusg->getTH1F()->GetXaxis()->SetTitleOffset ( 0.75 );
00524 EffFlavVsBEff_dusg->getTH1F()->GetYaxis()->SetTitleOffset ( 0.75 );
00525
00526
00527
00528
00529
00530
00531 MonitorElement * EffFlavVsBEff = EffFlavVsBEff_b;
00532
00533 const int& nBinB = EffFlavVsBEff->getTH1F()->GetNbinsX();
00534
00535 for ( int iBinB = 1; iBinB <= nBinB; iBinB++ ) {
00536
00537 const float& effBBinWidth = EffFlavVsBEff->getTH1F()->GetBinWidth ( iBinB );
00538 const float& effBMid = EffFlavVsBEff->getTH1F()->GetBinCenter ( iBinB );
00539 const float& effBLeft = effBMid - 0.5*effBBinWidth;
00540 const float& effBRight = effBMid + 0.5*effBBinWidth;
00541
00542 const int& binClosest = findBinClosestYValue ( effVersusDiscr_b , effBMid , effBLeft , effBRight );
00543 const bool& binFound = ( binClosest > 0 ) ;
00544
00545 if ( binFound ) {
00546
00547 if(mcPlots_>2){
00548 EffFlavVsBEff_d -> Fill ( effBMid , effVersusDiscr_d ->GetBinContent ( binClosest ) );
00549 EffFlavVsBEff_u -> Fill ( effBMid , effVersusDiscr_u ->GetBinContent ( binClosest ) );
00550 EffFlavVsBEff_s -> Fill ( effBMid , effVersusDiscr_s ->GetBinContent ( binClosest ) );
00551 EffFlavVsBEff_g -> Fill ( effBMid , effVersusDiscr_g ->GetBinContent ( binClosest ) );
00552 EffFlavVsBEff_dus -> Fill ( effBMid , effVersusDiscr_dus ->GetBinContent ( binClosest ) );
00553 }
00554 EffFlavVsBEff_c -> Fill ( effBMid , effVersusDiscr_c ->GetBinContent ( binClosest ) );
00555 EffFlavVsBEff_b -> Fill ( effBMid , effVersusDiscr_b ->GetBinContent ( binClosest ) );
00556 EffFlavVsBEff_ni -> Fill ( effBMid , effVersusDiscr_ni ->GetBinContent ( binClosest ) );
00557 EffFlavVsBEff_dusg -> Fill ( effBMid , effVersusDiscr_dusg->GetBinContent ( binClosest ) );
00558
00559 if(mcPlots_>2){
00560 EffFlavVsBEff_d ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_d ->GetBinError ( binClosest ) );
00561 EffFlavVsBEff_u ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_u ->GetBinError ( binClosest ) );
00562 EffFlavVsBEff_s ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_s ->GetBinError ( binClosest ) );
00563 EffFlavVsBEff_g ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_g ->GetBinError ( binClosest ) );
00564 EffFlavVsBEff_dus->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_dus ->GetBinError ( binClosest ) );
00565 }
00566 EffFlavVsBEff_c ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_c ->GetBinError ( binClosest ) );
00567 EffFlavVsBEff_b ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_b ->GetBinError ( binClosest ) );
00568 EffFlavVsBEff_ni ->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_ni ->GetBinError ( binClosest ) );
00569 EffFlavVsBEff_dusg->getTH1F() -> SetBinError ( iBinB , effVersusDiscr_dusg->GetBinError ( binClosest ) );
00570 }
00571 else {
00572
00573 }
00574
00575 }
00576
00577 }
00578
00579
00580 #include <typeinfo>
00581