![]() |
![]() |
#include <BTagPerformance.h>
Public Member Functions | |
void | Add (double discriminator, int flavor) |
BTagPerformance () | |
void | Eval () |
TArrayD | GetArray (TString option="b") |
double | Getb_all () |
double | Getc_all () |
std::map< int, double > | GetMap (TString option="b") |
int | GetN () |
double | Getudsg_all () |
void | Set (std::string name) |
void | SetMaxDiscriminator (double value) |
void | SetMinDiscriminator (double value) |
void | SetNcuts (int value) |
Private Attributes | |
double | b_all |
std::map< int, double > | b_eff |
std::map< int, double > | b_effErr |
std::map< int, double > | b_tagged |
double | c_all |
std::map< int, double > | c_eff |
std::map< int, double > | c_effErr |
std::map< int, double > | c_tagged |
std::map< int, double > | disc_map |
Double_t * | farray |
double | fdisc |
int | fflavor |
double | fMaxDisc |
double | fMinDisc |
std::string | fname |
int | fNcuts |
double | udsg_all |
std::map< int, double > | udsg_eff |
std::map< int, double > | udsg_effErr |
std::map< int, double > | udsg_tagged |
Analyze ROOT files produced by analyzer and create plots
Definition at line 16 of file BTagPerformance.h.
BTagPerformance::BTagPerformance | ( | ) | [inline] |
Definition at line 19 of file BTagPerformance.h.
{};
void BTagPerformance::Add | ( | double | discriminator, |
int | flavor | ||
) | [inline] |
Definition at line 41 of file BTagPerformance.h.
References b_all, b_tagged, c_all, c_tagged, align_tpl::cut, disc_map, fdisc, fflavor, fMaxDisc, fMinDisc, fNcuts, i, udsg_all, and udsg_tagged.
Referenced by PatBTagAnalyzer::analyze().
{ fdisc = discriminator; fflavor = flavor; double binwidth = (fMaxDisc-fMinDisc)/((double) fNcuts); if (fflavor==5) b_all++; if (fflavor==4) c_all++; if ((fflavor>0 && fflavor<4)||(fflavor==21)) udsg_all++; for( int i=0; i<fNcuts; ++i ) { double cut = i*binwidth + fMinDisc; if (cut > fMaxDisc) cut = fMaxDisc; disc_map[i] = cut; if ( fdisc > cut ) { if ( fflavor==5 ) b_tagged[i]++; if ( fflavor==4 ) c_tagged[i]++; if ((fflavor>0 && fflavor<4)||(fflavor==21)) udsg_tagged[i]++; } } };
void BTagPerformance::Eval | ( | ) | [inline] |
Definition at line 63 of file BTagPerformance.h.
References b_all, b_eff, b_effErr, b_tagged, c_all, c_eff, c_effErr, c_tagged, mathSSE::sqrt(), udsg_all, udsg_eff, udsg_effErr, and udsg_tagged.
Referenced by PatBTagAnalyzer::endJob().
{ double small = 1.e-5; int ip = 0; for(std::map<int,double>::const_iterator im=b_tagged.begin(); im!=b_tagged.end(); ++im) { double eff = (im->second)/((double)b_all); double err = sqrt(eff*(1-eff)/b_all); if ( eff==0 || eff< small ) { eff = small; err=0; } b_eff[ip] = eff; b_effErr[ip] = err; //g1["b"+fname].SetPoint(ip,eff,eff); //h1["b"+fname]->Fill(eff); ip++; } ip=0; for(std::map<int,double>::const_iterator im=c_tagged.begin(); im!=c_tagged.end(); ++im) { double eff = (im->second)/((double)c_all); double err = sqrt(eff*(1-eff)/c_all); if ( eff==0 || eff< small ) { eff = small; err=0; } c_eff[ip] = eff; c_effErr[ip] = err; //g1["c"+fname].SetPoint(ip,b_tagged[ip],eff); //h1["c"+fname]->Fill(eff); ip++; } ip=0; for(std::map<int,double>::const_iterator im=udsg_tagged.begin(); im!=udsg_tagged.end(); ++im) { double eff = (im->second)/((double)udsg_all); double err = sqrt(eff*(1-eff)/udsg_all); if ( eff==0 || eff< small ) { eff = small; err=0; } udsg_eff[ip] = eff; udsg_effErr[ip] = err; //g1["udsg"+fname].SetPoint(ip,b_tagged[ip],eff); //h1["udsg"+fname]->Fill(eff); ip++; } };
TArrayD BTagPerformance::GetArray | ( | TString | option = "b" | ) | [inline] |
Definition at line 115 of file BTagPerformance.h.
References fNcuts, and GetMap().
Referenced by PatBTagAnalyzer::endJob().
double BTagPerformance::Getb_all | ( | ) | [inline] |
double BTagPerformance::Getc_all | ( | ) | [inline] |
std::map< int,double> BTagPerformance::GetMap | ( | TString | option = "b" | ) | [inline] |
Definition at line 104 of file BTagPerformance.h.
References b_eff, b_effErr, c_eff, c_effErr, disc_map, udsg_eff, and udsg_effErr.
Referenced by GetArray().
{ if (option=="b") return b_eff; if (option=="c") return c_eff; if (option=="udsg") return udsg_eff; if (option=="bErr") return b_effErr; if (option=="cErr") return c_effErr; if (option=="udsgErr") return udsg_effErr; if (option=="discriminator") return disc_map; else { assert(false); return disc_map;} };
int BTagPerformance::GetN | ( | ) | [inline] |
Definition at line 126 of file BTagPerformance.h.
References fNcuts.
Referenced by PatBTagAnalyzer::beginJob(), and PatBTagAnalyzer::endJob().
{ return fNcuts; };
double BTagPerformance::Getudsg_all | ( | ) | [inline] |
void BTagPerformance::Set | ( | std::string | name | ) | [inline] |
Definition at line 20 of file BTagPerformance.h.
References b_all, b_tagged, c_all, c_tagged, fname, fNcuts, i, mergeVDriftHistosByStation::name, udsg_all, and udsg_tagged.
Referenced by PatBTagAnalyzer::beginJob().
void BTagPerformance::SetMaxDiscriminator | ( | double | value | ) | [inline] |
Definition at line 32 of file BTagPerformance.h.
References fMaxDisc, and relativeConstraints::value.
Referenced by PatBTagAnalyzer::beginJob().
void BTagPerformance::SetMinDiscriminator | ( | double | value | ) | [inline] |
Definition at line 31 of file BTagPerformance.h.
References fMinDisc, and relativeConstraints::value.
Referenced by PatBTagAnalyzer::beginJob().
void BTagPerformance::SetNcuts | ( | int | value | ) | [inline] |
Definition at line 33 of file BTagPerformance.h.
References b_tagged, c_tagged, fNcuts, i, udsg_tagged, and relativeConstraints::value.
double BTagPerformance::b_all [private] |
Definition at line 153 of file BTagPerformance.h.
Referenced by Add(), Eval(), Getb_all(), and Set().
std::map< int, double > BTagPerformance::b_eff [private] |
Definition at line 142 of file BTagPerformance.h.
std::map< int, double > BTagPerformance::b_effErr [private] |
Definition at line 145 of file BTagPerformance.h.
std::map< int, double > BTagPerformance::b_tagged [private] |
Definition at line 150 of file BTagPerformance.h.
Referenced by Add(), Eval(), Set(), and SetNcuts().
double BTagPerformance::c_all [private] |
Definition at line 154 of file BTagPerformance.h.
Referenced by Add(), Eval(), Getc_all(), and Set().
std::map< int, double > BTagPerformance::c_eff [private] |
Definition at line 143 of file BTagPerformance.h.
std::map< int, double > BTagPerformance::c_effErr [private] |
Definition at line 146 of file BTagPerformance.h.
std::map< int, double > BTagPerformance::c_tagged [private] |
Definition at line 151 of file BTagPerformance.h.
Referenced by Add(), Eval(), Set(), and SetNcuts().
std::map< int, double > BTagPerformance::disc_map [private] |
Definition at line 148 of file BTagPerformance.h.
Double_t* BTagPerformance::farray [private] |
Definition at line 130 of file BTagPerformance.h.
double BTagPerformance::fdisc [private] |
Definition at line 134 of file BTagPerformance.h.
Referenced by Add().
int BTagPerformance::fflavor [private] |
Definition at line 135 of file BTagPerformance.h.
Referenced by Add().
double BTagPerformance::fMaxDisc [private] |
Definition at line 137 of file BTagPerformance.h.
Referenced by Add(), and SetMaxDiscriminator().
double BTagPerformance::fMinDisc [private] |
Definition at line 136 of file BTagPerformance.h.
Referenced by Add(), and SetMinDiscriminator().
std::string BTagPerformance::fname [private] |
Definition at line 139 of file BTagPerformance.h.
Referenced by Set().
int BTagPerformance::fNcuts [private] |
Definition at line 138 of file BTagPerformance.h.
Referenced by Add(), GetArray(), GetN(), Set(), and SetNcuts().
double BTagPerformance::udsg_all [private] |
Definition at line 155 of file BTagPerformance.h.
Referenced by Add(), Eval(), Getudsg_all(), and Set().
std::map< int, double > BTagPerformance::udsg_eff [private] |
Definition at line 144 of file BTagPerformance.h.
std::map< int, double > BTagPerformance::udsg_effErr [private] |
Definition at line 147 of file BTagPerformance.h.
std::map< int, double > BTagPerformance::udsg_tagged [private] |
Definition at line 152 of file BTagPerformance.h.
Referenced by Add(), Eval(), Set(), and SetNcuts().