A class describing a template.
More...
#include <BCMTFTemplate.h>
A class describing a template.
- Author
- Daniel Kollar
-
Kevin Kröninger
- Version
- 1.1
- Date
- 06.2012 This class describes a template.
Definition at line 32 of file BCMTFTemplate.h.
BCMTFTemplate::BCMTFTemplate |
( |
const char * |
channelname, |
|
|
const char * |
processname |
|
) |
| |
The default constructor.
- Parameters
-
channelname | The name of the channel. |
process | name The name of the process. |
Definition at line 19 of file BCMTFTemplate.cxx.
BCMTFTemplate::~BCMTFTemplate |
( |
) | |
|
TH1D BCMTFTemplate::FluctuateHistogram |
( |
std::string |
options = "GZ" , |
|
|
double |
norm = 1 |
|
) |
| |
Fluctuate the original template histogram by the uncertainty on the bin content.
- Parameters
-
options | A set of options. "P" : use Poisson model, the expectation value parameter is the bin content and also defines the uncertainties. "G" [default] : use a Gaussian mode, the expectation value paramer mu is the bin content, the uncertainty sigma is defined by the uncertainty in the histogram. "Z" [default] : make sure that the bin content is positive. |
norm | The target normalization. |
- Returns
- A histogram with each bin fluctuated by the uncertainty on the bin content.
Definition at line 71 of file BCMTFTemplate.cxx.
79 if (options.find(
"P") < options.size()) {
83 if (options.find(
"G") < options.size()) {
87 if (options.find(
"Z") < options.size()) {
91 if (flag_p && flag_g) {
97 for (
int i = 1; i <=
fNBins; ++i) {
104 n = (double)
fRandom->Poisson(expectation);
109 double dn =
fRandom->Gaus(expectation, error);
114 dn =
fRandom->Gaus(expectation, error);
120 hist_temp.SetBinContent(i, n);
124 double orignorm = hist_temp.Integral();
127 hist_temp.Scale(norm / orignorm);
std::string BCMTFTemplate::GetChannelName |
( |
) | |
|
|
inline |
double BCMTFTemplate::GetEfficiency |
( |
) | |
|
|
inline |
std::vector<TF1 *>* BCMTFTemplate::GetFunctionContainer |
( |
) | |
|
|
inline |
TH1D* BCMTFTemplate::GetHistogram |
( |
) | |
|
|
inline |
int BCMTFTemplate::GetNBins |
( |
) | |
|
|
inline |
double BCMTFTemplate::GetNorm |
( |
) | |
|
|
inline |
double BCMTFTemplate::GetOriginalNorm |
( |
) | |
|
|
inline |
std::string BCMTFTemplate::GetProcessName |
( |
) | |
|
|
inline |
void BCMTFTemplate::SetEfficiency |
( |
double |
eff) | |
|
|
inline |
void BCMTFTemplate::SetFunctionContainer |
( |
std::vector< TF1 * > * |
funccont, |
|
|
int |
nbins |
|
) |
| |
Set a function container funccont The function container nbins The number of bins (and functions)
Definition at line 64 of file BCMTFTemplate.cxx.
void BCMTFTemplate::SetHistogram |
( |
TH1D * |
hist, |
|
|
double |
norm = 1 |
|
) |
| |
Set the histogram.
- Parameters
-
hist | The TH1D histogram. |
norm | The target normalization. |
Definition at line 38 of file BCMTFTemplate.cxx.
void BCMTFTemplate::SetOrignialNormalization |
( |
double |
norm) | |
|
|
inline |
Set the original normalization.
- Parameters
-
Definition at line 126 of file BCMTFTemplate.h.
std::string BCMTFTemplate::fChannelName |
|
private |
double BCMTFTemplate::fEfficiency |
|
private |
std::vector<TF1 *>* BCMTFTemplate::fFunctionContainer |
|
private |
A histogram alternative for templates: a vector of TF1 functions.
Definition at line 148 of file BCMTFTemplate.h.
TH1D* BCMTFTemplate::fHistogram |
|
private |
int BCMTFTemplate::fNBins |
|
private |
double BCMTFTemplate::fNormalization |
|
private |
double BCMTFTemplate::fOriginalNormalization |
|
private |
std::string BCMTFTemplate::fProcessName |
|
private |
TRandom3* BCMTFTemplate::fRandom |
|
private |
The documentation for this class was generated from the following files: