CMS 3D CMS Logo

Classes | Functions
Histograms.h File Reference
#include <cmath>
#include <iostream>
#include <string>
#include <TH1F.h>
#include "DQMServices/Core/interface/DQMStore.h"

Go to the source code of this file.

Classes

class  HEff1DHit
 A set of histograms fo efficiency computation for 1D RecHits (producer) More...
 
class  HEff1DHitHarvest
 A set of histograms fo efficiency computation for 1D RecHits (harvesting) More...
 
class  HEff2DHit
 
class  HEff2DHitHarvest
 
class  HEff4DHit
 A set of histograms for efficiency 4D RecHits (producer) More...
 
class  HEff4DHitHarvest
 A set of histograms for efficiency 4D RecHits (harvesting) More...
 
class  HRes1DHit
 A set of histograms of residuals and pulls for 1D RecHits. More...
 
class  HRes2DHit
 
class  HRes4DHit
 

Functions

void divide (dqm::legacy::MonitorElement *eff, const dqm::legacy::MonitorElement *numerator, const dqm::legacy::MonitorElement *denominator)
 Function to fill an efficiency histograms with binomial errors. More...
 

Function Documentation

◆ divide()

void divide ( dqm::legacy::MonitorElement eff,
const dqm::legacy::MonitorElement numerator,
const dqm::legacy::MonitorElement denominator 
)
inline

Function to fill an efficiency histograms with binomial errors.

Definition at line 20 of file Histograms.h.

References newFWLiteAna::bin, trigObjTnPSource_cfi::bins, bTagMiniDQMDeepCSV::denominator, submitPVResolutionJobs::err, dqm::legacy::MonitorElement::getTH1(), bTagMiniDQMDeepCSV::numerator, and mathSSE::sqrt().

Referenced by HEff1DHitHarvest::computeEfficiency(), HEff2DHitHarvest::computeEfficiency(), and HEff4DHitHarvest::computeEfficiency().

22  {
23  TH1* effH = eff->getTH1();
24  TH1* numH = numerator->getTH1();
25  TH1* denH = denominator->getTH1();
26  effH->Divide(numH, denH);
27 
28  // Set the error accordingly to binomial statistics
29  int bins = effH->GetNbinsX();
30  for (int bin = 1; bin <= bins; ++bin) {
31  float den = denH->GetBinContent(bin);
32  float eff = effH->GetBinContent(bin);
33  float err = 0;
34  if (den != 0) {
35  err = sqrt(eff * (1 - eff) / den);
36  }
37  effH->SetBinError(bin, err);
38  }
39  return;
40 }
T sqrt(T t)
Definition: SSEVec.h:23
virtual TH1 * getTH1() const