CMS 3D CMS Logo

Classes | Functions
Histograms.h File Reference
#include <cmath>
#include <iostream>
#include <string>
#include <TH1F.h>
#include "DQMServices/Core/interface/ConcurrentMonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.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 (MonitorElement *eff, const MonitorElement *numerator, const MonitorElement *denominator)
 Function to fill an efficiency histograms with binomial errors. More...
 

Function Documentation

void divide ( MonitorElement eff,
const MonitorElement numerator,
const MonitorElement denominator 
)
inline

Function to fill an efficiency histograms with binomial errors.

Definition at line 22 of file Histograms.h.

References stringResolutionProvider_cfi::bin, create_public_pileup_plots::bins, MonitorElement::getTH1(), and mathSSE::sqrt().

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

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 }
TH1 * getTH1() const
T sqrt(T t)
Definition: SSEVec.h:18
bin
set the eta bin as selection string.