A class describing a physics channel.
More...
#include <BCMTFChannel.h>
A class describing a physics channel.
- Author
- Daniel Kollar
-
Kevin Kröninger
- Version
- 1.1
- Date
- 06.2012 This class describes a physics channel.
Definition at line 33 of file BCMTFChannel.h.
BCMTFChannel::BCMTFChannel |
( |
const char * |
name) | |
|
The default constructor.
- Parameters
-
name | The name of the channel. |
Definition at line 25 of file BCMTFChannel.cxx.
BCMTFChannel::~BCMTFChannel |
( |
) | |
|
Add a systematic variation.
- Parameters
-
Definition at line 162 of file BCMTFChannel.h.
void BCMTFChannel::CalculateHistUncertaintyBandPoisson |
( |
) | |
|
Calculate histogram for uncertainty band calculation.
Definition at line 222 of file BCMTFChannel.cxx.
230 for (
int ix = 1; ix <= nbinsx_poisson; ++ix) {
233 for (
int iy = 1; iy <= nbinsy_exp; ++iy) {
238 for (
int iy = 1; iy <= nbinsy_exp; ++iy) {
242 for (
int jbin = 1; jbin <= nbinsy_poisson; ++jbin) {
243 double p = TMath::Poisson(
double(jbin-1), expectation);
244 double bincontent = 0;
TH1D * BCMTFChannel::CalculateUncertaintyBandPoisson |
( |
double |
minimum, |
|
|
double |
maximumm, |
|
|
int |
color |
|
) |
| |
Calculate histogram for uncertainty band calculation and return a TH1D.
- Parameters
-
minimum | The minimum value on the expectation. |
maximum | The maximum value on the expectation. |
color | The color scheme. |
- Returns
- A TH1D histogram.
Definition at line 255 of file BCMTFChannel.cxx.
258 hist->SetMarkerSize(0);
259 hist->SetFillColor(color);
260 hist->SetFillStyle(1001);
266 for (
int ix = 1; ix <= nbinsx_poisson; ++ix) {
269 int limit_max = nbinsx_poisson-1;
272 for (
int jbin = 1; jbin <= nbinsy_poisson; ++jbin) {
277 if (sum_p > maximum && (sum_p - p) < maximum )
284 hist->SetBinContent(ix, 0.5*
double(ylimit_min+ylimit_max));
285 hist->SetBinError(ix, 0.5*
double(ylimit_max-ylimit_min));
bool BCMTFChannel::GetFlagChannelActive |
( |
) | |
|
|
inline |
- Returns
- Flag defining if the channel is active or not.
Definition at line 80 of file BCMTFChannel.h.
TH2D* BCMTFChannel::GetHistUncertaintyBandExpectation |
( |
) | |
|
|
inline |
Return a histogram ued for the calculation of the error band of the expectation.
- Returns
- The histogram.
Definition at line 87 of file BCMTFChannel.h.
TH2D* BCMTFChannel::GetHistUncertaintyBandPoisson |
( |
) | |
|
|
inline |
Return a histogram used for the calculation of the Poisson fluctuations.
- Returns
- The histogram.
Definition at line 93 of file BCMTFChannel.h.
std::string BCMTFChannel::GetName |
( |
) | |
|
|
inline |
double BCMTFChannel::GetRangeYMax |
( |
) | |
|
|
inline |
- Returns
- The maximal y-range for printing.
Definition at line 103 of file BCMTFChannel.h.
double BCMTFChannel::GetRangeYMin |
( |
) | |
|
|
inline |
- Returns
- The minimal y-range for printing.
Definition at line 98 of file BCMTFChannel.h.
Return a systematic variation
- Parameters
-
index | The systematic index. |
- Returns
- The systematic variation.
Definition at line 75 of file BCMTFChannel.h.
Return a template
- Parameters
-
- Returns
- The template.
Definition at line 68 of file BCMTFChannel.h.
void BCMTFChannel::PrintHistCumulativeUncertaintyBandPoisson |
( |
const char * |
filename) | |
|
Print cumulative histogram for uncertainty band calculation.
- Parameters
-
filename | The name of the file. |
Definition at line 292 of file BCMTFChannel.cxx.
295 TCanvas * c1 =
new TCanvas();
303 int nbinsx_poisson = hist.GetNbinsX();
304 int nbinsy_poisson = hist.GetNbinsY();
307 for (
int ix = 1; ix <= nbinsx_poisson; ++ix) {
311 for (
int jbin = 1; jbin <= nbinsy_poisson; ++jbin) {
312 double p = hist.GetBinContent(ix, jbin);
314 hist.SetBinContent(ix, jbin, sum_p);
void BCMTFChannel::PrintHistUncertaintyBandExpectation |
( |
const char * |
filename) | |
|
Print histogram for uncertainty band calculation.
- Parameters
-
filename | The name of the file. |
Definition at line 204 of file BCMTFChannel.cxx.
207 TCanvas * c1 =
new TCanvas();
void BCMTFChannel::PrintHistUncertaintyBandPoisson |
( |
const char * |
filename, |
|
|
const char * |
options = "COLZ" |
|
) |
| |
Print histogram for uncertainty band calculation.
- Parameters
-
filename | The name of the file. |
Definition at line 330 of file BCMTFChannel.cxx.
333 TCanvas * c1 =
new TCanvas();
void BCMTFChannel::PrintTemplate |
( |
int |
index, |
|
|
const char * |
filename |
|
) |
| |
Print a particular template with systematics.
- Parameters
-
index | The template index. |
filename | The name of the file. |
Definition at line 136 of file BCMTFChannel.cxx.
139 TCanvas * c1 =
new TCanvas();
149 if (nsystematics == 0)
152 c1->Print( (std::string(filename)+std::string(
"(")).c_str() );
155 for (
unsigned int isystematic = 0; isystematic < nsystematics; ++isystematic) {
164 TH1D hist = TH1D(*
GetTemplate(index)->GetHistogram());
166 TH1D hist_down(hist);
169 hist.SetFillStyle(0);
170 hist_up.SetFillStyle(0);
171 hist_up.SetLineStyle(2);
172 hist_down.SetFillStyle(0);
173 hist_down.SetLineStyle(3);
179 hist.Scale(efficiency/ hist.Integral());
182 for (
int i = 1; i <= hist.GetNbinsX(); ++i) {
183 hist.SetBinContent(i,
GetTemplate(index)->GetHistogram()->GetBinContent(i));
189 hist_up.Draw(
"HIST");
190 hist.Draw(
"HISTSAME");
191 hist_down.Draw(
"HISTSAME");
193 if (isystematic < nsystematics-1)
196 c1->Print( (std::string(filename)+std::string(
")")).c_str() );
void BCMTFChannel::PrintTemplates |
( |
std::string |
filename) | |
|
Print the templates in this channel.
- Parameters
-
filename | The name of the file. |
Definition at line 56 of file BCMTFChannel.cxx.
59 if ( (filename.find_last_of(
".") != std::string::npos) &&
60 (filename.substr(filename.find_last_of(
".")+1) ==
"pdf") ) {
64 else if ( (filename.find_last_of(
".") != std::string::npos) &&
65 (filename.substr(filename.find_last_of(
".")+1) ==
"ps") ) {
74 TCanvas * c1 =
new TCanvas();
84 for (
int i = 0; i < ntemplates; ++i) {
88 if (first_hist < 0 && temphist)
96 if ( first_hist < 0 ) {
104 for (
int i = 0; i < ntemplates; ++i) {
109 TLatex* l =
new TLatex();
118 if (i == first_hist && (first_hist != last_hist))
119 c1->Print(std::string( filename +
"(").c_str());
120 else if (i == last_hist && (first_hist != last_hist))
121 c1->Print(std::string( filename +
")").c_str());
124 c1->Print(filename.c_str());
void BCMTFChannel::PrintUncertaintyBandPoisson |
( |
const char * |
filename, |
|
|
double |
minimum, |
|
|
double |
maximum, |
|
|
int |
color |
|
) |
| |
Print uncertainty band.
- Parameters
-
filename | The name of the file. |
Definition at line 351 of file BCMTFChannel.cxx.
354 TCanvas * c1 =
new TCanvas();
void BCMTFChannel::SetFlagChannelActive |
( |
bool |
flag) | |
|
|
inline |
Set flag to define if the channel is active or not.
- Parameters
-
Definition at line 138 of file BCMTFChannel.h.
void BCMTFChannel::SetHistUncertaintyBandExpectation |
( |
TH2D * |
hist) | |
|
|
inline |
Set a histogram ued for the calculation of the error band of the expectation.
- Parameters
-
Definition at line 126 of file BCMTFChannel.h.
void BCMTFChannel::SetHistUncertaintyBandPoisson |
( |
TH2D * |
hist) | |
|
|
inline |
Set a histogram used for the calculation of the Poisson fluctuations.
- Parameters
-
Definition at line 132 of file BCMTFChannel.h.
void BCMTFChannel::SetName |
( |
const char * |
name) | |
|
|
inline |
Set the name of the channel.
- Parameters
-
name | The name of the channel. |
Definition at line 113 of file BCMTFChannel.h.
void BCMTFChannel::SetRangeY |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
|
inline |
Set the y-ranges for printing.
- Parameters
-
min | The minimum range. |
max | The maximum range. |
Definition at line 145 of file BCMTFChannel.h.
bool BCMTFChannel::fFlagChannelActive |
|
private |
Flag defining if the channel is active or not.
Definition at line 244 of file BCMTFChannel.h.
TH2D* BCMTFChannel::fHistUncertaintyBandExpectation |
|
private |
A histogram for the calculation of uncertainty bands.
Definition at line 248 of file BCMTFChannel.h.
TH2D* BCMTFChannel::fHistUncertaintyBandPoisson |
|
private |
A histogram for the calculation of uncertainty bands.
Definition at line 252 of file BCMTFChannel.h.
std::string BCMTFChannel::fName |
|
private |
double BCMTFChannel::fRangeYMax |
|
private |
double BCMTFChannel::fRangeYMin |
|
private |
The documentation for this class was generated from the following files: