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::NormalizedPrimitive Struct Reference

#include <ROC.h>

Public Member Functions

void Initialize (const std::string &name, float cut_low, float cut_high, unsigned n_bin)
 
void FillNeutrino (bool is_signal, float value)
 
void FillNeverNeutrino (bool is_signal)
 
void FillAlwaysNeutrino (bool is_signal)
 
void FillCosmic (bool is_signal, float value)
 
void FillNeverCosmic (bool is_signal)
 
void FillAlwaysCosmic (bool is_signal)
 
void Normalize (float scale_neutrino, float scale_cosmic)
 
void Write () const
 
float BestCut () const
 
float Signal (unsigned bin) const
 
float Background (unsigned bin) const
 
float NSignal () const
 
float NBackground () const
 
unsigned NCutVals () const
 
float GetCutVal (unsigned bin) const
 

Public Attributes

Primitive fNeutrino
 
Primitive fCosmic
 
std::string name
 

Detailed Description

Definition at line 50 of file ROC.h.

Member Function Documentation

float ana::SBNOsc::ROC::NormalizedPrimitive::Background ( unsigned  bin) const

Definition at line 121 of file ROC.cc.

121  {
122  return fNeutrino.background->GetBinContent(bin) + fCosmic.background->GetBinContent(bin);
123 }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
float ana::SBNOsc::ROC::NormalizedPrimitive::BestCut ( ) const

Definition at line 141 of file ROC.cc.

141  {
142  float max_significance = 0.;
143  float best_cut = 0.;
144  for (unsigned bin = 1; bin <= NCutVals(); bin++) {
145  float sig = Signal(bin);
146  float bkg = Background(bin);
147  float this_significance = 0.;
148  if (sig + bkg > 1.e-4) {
149  this_significance = sig / sqrt(sig + bkg);
150  }
151  if (this_significance > max_significance) {
152  max_significance = this_significance;
153  best_cut = GetCutVal(bin);
154  }
155  }
156  return best_cut;
157 }
float Signal(unsigned bin) const
Definition: ROC.cc:117
float Background(unsigned bin) const
Definition: ROC.cc:121
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
float GetCutVal(unsigned bin) const
Definition: ROC.cc:129
do i e
unsigned NCutVals() const
Definition: ROC.cc:125
void ana::SBNOsc::ROC::NormalizedPrimitive::FillAlwaysCosmic ( bool  is_signal)
inline

Definition at line 62 of file ROC.h.

62 {fCosmic.FillAlways(is_signal);}
void FillAlways(bool is_signal)
Definition: ROC.cc:100
void ana::SBNOsc::ROC::NormalizedPrimitive::FillAlwaysNeutrino ( bool  is_signal)
inline

Definition at line 58 of file ROC.h.

58 {fNeutrino.FillAlways(is_signal);}
void FillAlways(bool is_signal)
Definition: ROC.cc:100
void ana::SBNOsc::ROC::NormalizedPrimitive::FillCosmic ( bool  is_signal,
float  value 
)
inline

Definition at line 60 of file ROC.h.

60 {fCosmic.Fill(is_signal, value);}
void Fill(bool is_signal, float value)
Definition: ROC.cc:79
temporary value
void ana::SBNOsc::ROC::NormalizedPrimitive::FillNeutrino ( bool  is_signal,
float  value 
)
inline

Definition at line 56 of file ROC.h.

56 {fNeutrino.Fill(is_signal, value);}
void Fill(bool is_signal, float value)
Definition: ROC.cc:79
temporary value
void ana::SBNOsc::ROC::NormalizedPrimitive::FillNeverCosmic ( bool  is_signal)
inline

Definition at line 61 of file ROC.h.

61 {fCosmic.FillNever(is_signal);}
void FillNever(bool is_signal)
Definition: ROC.cc:90
void ana::SBNOsc::ROC::NormalizedPrimitive::FillNeverNeutrino ( bool  is_signal)
inline

Definition at line 57 of file ROC.h.

57 {fNeutrino.FillNever(is_signal);}
void FillNever(bool is_signal)
Definition: ROC.cc:90
float ana::SBNOsc::ROC::NormalizedPrimitive::GetCutVal ( unsigned  bin) const

Definition at line 129 of file ROC.cc.

129  {
130  return fNeutrino.signal->GetBinCenter(bin);
131 }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
void ana::SBNOsc::ROC::NormalizedPrimitive::Initialize ( const std::string &  name,
float  cut_low,
float  cut_high,
unsigned  n_bin 
)

Definition at line 65 of file ROC.cc.

65  {
66  fNeutrino.Initialize(this_name + "neutrino_", cut_low, cut_high, n_bin);
67  fCosmic.Initialize(this_name + "cosmic_", cut_low, cut_high, n_bin);
68  name = this_name;
69 }
void Initialize(const std::string &name, float cut_low, float cut_high, unsigned n_bin)
Definition: ROC.cc:71
float ana::SBNOsc::ROC::NormalizedPrimitive::NBackground ( ) const

Definition at line 137 of file ROC.cc.

unsigned ana::SBNOsc::ROC::NormalizedPrimitive::NCutVals ( ) const

Definition at line 125 of file ROC.cc.

125  {
126  return fNeutrino.signal->GetNbinsX();
127 }
void ana::SBNOsc::ROC::NormalizedPrimitive::Normalize ( float  scale_neutrino,
float  scale_cosmic 
)

Definition at line 112 of file ROC.cc.

112  {
113  fNeutrino.Scale(scale_neutrino);
114  fCosmic.Scale(scale_cosmic);
115 }
void Scale(float scale)
Definition: ROC.cc:105
float ana::SBNOsc::ROC::NormalizedPrimitive::NSignal ( ) const

Definition at line 133 of file ROC.cc.

133  {
135 }
float ana::SBNOsc::ROC::NormalizedPrimitive::Signal ( unsigned  bin) const

Definition at line 117 of file ROC.cc.

117  {
118  return fNeutrino.signal->GetBinContent(bin) + fCosmic.signal->GetBinContent(bin);
119 }
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
void ana::SBNOsc::ROC::NormalizedPrimitive::Write ( ) const

Definition at line 159 of file ROC.cc.

159  {
160  std::vector<float> eff;
161  std::vector<float> rejection;
162  for (unsigned bin = 1; bin <= NCutVals(); bin++) {
163  float this_eff = Signal(bin) / NSignal();
164  float this_rej = 1 - Background(bin) / NBackground();
165  eff.push_back(this_eff);
166  rejection.push_back(this_rej);
167  }
168  TGraph *ROC = new TGraph(NCutVals(), &eff[0], &rejection[0]);
169  ROC->SetTitle(name.c_str());
170  ROC->SetName(name.c_str());
171  ROC->Write();
172 
173  delete ROC;
174 }
float Signal(unsigned bin) const
Definition: ROC.cc:117
float Background(unsigned bin) const
Definition: ROC.cc:121
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
unsigned NCutVals() const
Definition: ROC.cc:125

Member Data Documentation

Primitive ana::SBNOsc::ROC::NormalizedPrimitive::fCosmic

Definition at line 52 of file ROC.h.

Primitive ana::SBNOsc::ROC::NormalizedPrimitive::fNeutrino

Definition at line 51 of file ROC.h.

std::string ana::SBNOsc::ROC::NormalizedPrimitive::name

Definition at line 53 of file ROC.h.


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