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"
#include "DQMServices/Core/interface/ConcurrentMonitorElement.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 23 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().

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