All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
ana::SBNOsc::ROC::Primitive Struct Reference

#include <ROC.h>

Public Member Functions

void Initialize (const std::string &name, float cut_low, float cut_high, unsigned n_bin)
 
void Fill (bool is_signal, float value)
 
void FillNever (bool is_signal)
 
void FillAlways (bool is_signal)
 
void Scale (float scale)
 
 ~Primitive ()
 

Public Attributes

std::string name
 
TH1D * signal
 
unsigned n_signal
 
TH1D * background
 
unsigned n_background
 

Detailed Description

Primitive used to make ROC plots

Definition at line 35 of file ROC.h.

Constructor & Destructor Documentation

ana::SBNOsc::ROC::Primitive::~Primitive ( )

Definition at line 176 of file ROC.cc.

176  {
177  delete signal;
178  delete background;
179 }

Member Function Documentation

void ana::SBNOsc::ROC::Primitive::Fill ( bool  is_signal,
float  value 
)

Definition at line 79 of file ROC.cc.

79  {
80  TH1D *hist = is_signal ? signal : background;
81  unsigned bin = 1;
82  while (bin <= hist->GetNbinsX() && value > hist->GetXaxis()->GetBinCenter(bin)) {
83  hist->Fill(hist->GetXaxis()->GetBinCenter(bin));
84  bin += 1;
85  }
86  n_signal += is_signal;
87  n_background += !is_signal;
88 }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
temporary value
unsigned n_background
Definition: ROC.h:47
void ana::SBNOsc::ROC::Primitive::FillAlways ( bool  is_signal)

Definition at line 100 of file ROC.cc.

100  {
101  n_signal += is_signal;
102  n_background += !is_signal;
103 }
unsigned n_background
Definition: ROC.h:47
void ana::SBNOsc::ROC::Primitive::FillNever ( bool  is_signal)

Definition at line 90 of file ROC.cc.

90  {
91  TH1D *hist = is_signal ? signal : background;
92  unsigned bin = 1;
93  for (unsigned bin = 1; bin <= hist->GetNbinsX(); bin++) {
94  hist->Fill(hist->GetXaxis()->GetBinCenter(bin));
95  }
96  n_signal += is_signal;
97  n_background += !is_signal;
98 }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
unsigned n_background
Definition: ROC.h:47
void ana::SBNOsc::ROC::Primitive::Initialize ( const std::string &  name,
float  cut_low,
float  cut_high,
unsigned  n_bin 
)

Definition at line 71 of file ROC.cc.

71  {
72  signal = new TH1D((this_name + "signal").c_str(), this_name.c_str(), n_bin, cut_low, cut_high);
73  background = new TH1D((this_name + "background").c_str(), this_name.c_str(), n_bin, cut_low, cut_high);
74  n_signal = 0;
75  n_background = 0;
76  name = this_name;
77 }
std::string name
Definition: ROC.h:43
unsigned n_background
Definition: ROC.h:47
void ana::SBNOsc::ROC::Primitive::Scale ( float  scale)

Definition at line 105 of file ROC.cc.

105  {
106  signal->Scale(scale);
107  background->Scale(scale);
108  n_signal *= scale;
109  n_background *= scale;
110 }
unsigned n_background
Definition: ROC.h:47

Member Data Documentation

TH1D* ana::SBNOsc::ROC::Primitive::background

Definition at line 46 of file ROC.h.

unsigned ana::SBNOsc::ROC::Primitive::n_background

Definition at line 47 of file ROC.h.

unsigned ana::SBNOsc::ROC::Primitive::n_signal

Definition at line 45 of file ROC.h.

std::string ana::SBNOsc::ROC::Primitive::name

Definition at line 43 of file ROC.h.

TH1D* ana::SBNOsc::ROC::Primitive::signal

Definition at line 44 of file ROC.h.


The documentation for this struct was generated from the following files: