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.

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 }

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

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

mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:475
HLTTauDQMOffline_cfi.numerator
numerator
Definition: HLTTauDQMOffline_cfi.py:179
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:180
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20