2 #ifndef FlavourHistograms_H 3 #define FlavourHistograms_H 15 #include "TEfficiency.h" 34 const double& lowerBound_,
35 const double& upperBound_,
38 const unsigned int&
mc,
44 const double& lowerBound_,
45 const double& upperBound_,
46 const bool& statistics_,
48 const bool& plotNormalized_,
51 const unsigned int&
mc,
160 const double& lowerBound_,
161 const double& upperBound_,
164 const unsigned int&
mc,
188 std::cout <<
"FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " <<
thePlotFirst << std::endl;
189 std::cout <<
"FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl;
236 const double& lowerBound_,
237 const double& upperBound_,
238 const bool& statistics_,
239 const bool& plotLog_,
240 const bool& plotNormalized_,
243 const unsigned int&
mc,
267 std::cout <<
"FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " <<
thePlotFirst << std::endl;
268 std::cout <<
"FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl;
372 for (
int i = 0;
i != iMax; ++
i) {
382 const T& theZero =
static_cast<T>(0.0);
412 bool btppColour =
true;
418 gPad->UseCurrentStyle();
431 gPad->SetTitle(
nullptr);
437 const double markerSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
521 histo[0]->
getTH1F()->GetYaxis()->SetTitle(
"Arbitrary Units");
522 histo[0]->
getTH1F()->GetYaxis()->SetTitleOffset(1.25);
524 for (
int i = 0;
i != 4; ++
i) {
525 if (histo[
i] ==
nullptr)
527 histo[
i]->
getTH1F()->SetStats(
false);
528 histo[
i]->
getTH1F()->SetLineStyle(lineStyle[
i]);
529 histo[
i]->
getTH1F()->SetLineWidth(lineWidth);
530 histo[
i]->
getTH1F()->SetLineColor(col[i]);
531 histo[
i]->
getTH1F()->SetMarkerStyle(markerStyle[i]);
532 histo[
i]->
getTH1F()->SetMarkerColor(col[i]);
533 histo[
i]->
getTH1F()->SetMarkerSize(markerSize);
537 if (histo[0]->getTH1F()->GetEntries() != 0) {
538 histo[0]->
getTH1F()->DrawNormalized();
540 histo[0]->
getTH1F()->SetMaximum(1.0);
543 if (histo[1]->getTH1F()->GetEntries() != 0)
544 histo[1]->
getTH1F()->DrawNormalized(
"Same");
545 if (histo[2]->getTH1F()->GetEntries() != 0)
546 histo[2]->
getTH1F()->DrawNormalized(
"Same");
547 if ((histo[3] !=
nullptr) && (histo[3]->getTH1F()->GetEntries() != 0))
548 histo[3]->
getTH1F()->DrawNormalized(
"Same");
550 histo[0]->
getTH1F()->SetMaximum(max * 1.05);
554 histo[1]->
getTH1F()->Draw(
"Same");
555 histo[2]->
getTH1F()->Draw(
"Same");
556 if (histo[3] !=
nullptr)
557 histo[3]->
getTH1F()->Draw(
"Same");
571 double effVal = num / den;
572 double errLo = TEfficiency::ClopperPearson(static_cast<int>(den), static_cast<int>(num), 0.683,
false);
573 double errUp = TEfficiency::ClopperPearson(static_cast<int>(den), static_cast<int>(num), 0.683,
true);
574 return std::max(effVal - errLo, errUp - effVal);
581 double numVal = num->GetBinContent(bin);
582 double denVal = den->GetBinContent(bin);
583 if (denVal > 0 && numVal <= denVal) {
584 effVal = numVal / denVal;
587 num->SetBinContent(bin, effVal);
588 num->SetBinError(bin, errVal);
702 std::vector<TH1F*> histoVector;
double lowerBound() const
MonitorElement * theHisto_g
void plot(TPad *theCanvas=0)
MonitorElement * theHisto_c
void SetMinimum(const double &min)
virtual TH1F * getTH1F() const
MonitorElement * theHisto_u
void fill(const int &flavour, const T &variable) const
MonitorElement * theHisto_all
dqm::legacy::DQMStore DQMStore
std::string baseNameDescription() const
std::vector< TH1F * > getHistoVector() const
void ComputeEfficiency(TH1F *num, TH1F *den, int bin)
void SetMaximum(const double &max)
void epsPlot(const std::string &name)
dqm::legacy::MonitorElement MonitorElement
std::string baseNameTitle() const
MonitorElement * theHisto_pu
void settitle(const char *title)
int * arrayDimension() const
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
double ClopperPearsonUnc(double num, double den)
std::string theBaseNameDescription
virtual ~FlavourHistograms()
MonitorElement * theHisto_b
std::string plotFirst() const
bool plotNormalized() const
virtual MonitorElement * book1D(const std::string &name, const std::string &title, const int &nchX, const double &lowX, const double &highX)
std::string theBaseNameTitle
void fillVariable(const int &flavour, const T &var, const T &w) const
virtual void enableSumw2()
double upperBound() const
MonitorElement * theHisto_s
MonitorElement * get(std::string const &path)
void divide(const FlavourHistograms< T > &bHD)
TH1F * histo_dusg() const
MonitorElement * theHisto_dus
MonitorElement * theHisto_ni
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)