Public Member Functions | Protected Attributes | List of all members
ana::MultiVar2DFunc Class Reference

Public Member Functions

 MultiVar2DFunc (const MultiVar &a, const Binning binsa, const MultiVar &b, const Binning binsb)
 
std::vector< double > operator() (const caf::SRProxy *sr) const
 

Protected Attributes

const MultiVar fA
 
const Binning fBinsA
 
const MultiVar fB
 
const Binning fBinsB
 

Detailed Description

Definition at line 27 of file MultiVar.cxx.

Constructor & Destructor Documentation

ana::MultiVar2DFunc::MultiVar2DFunc ( const MultiVar a,
const Binning  binsa,
const MultiVar b,
const Binning  binsb 
)
inline

Definition at line 30 of file MultiVar.cxx.

32  : fA(a), fBinsA(binsa),
33  fB(b), fBinsB(binsb)
34  {
35  }
const double a
const Binning fBinsA
Definition: MultiVar.cxx:62
const MultiVar fB
Definition: MultiVar.cxx:63
const Binning fBinsB
Definition: MultiVar.cxx:64
const hit & b
Definition: hits.cxx:21
const MultiVar fA
Definition: MultiVar.cxx:61

Member Function Documentation

std::vector<double> ana::MultiVar2DFunc::operator() ( const caf::SRProxy sr) const
inline

Definition at line 37 of file MultiVar.cxx.

References ana::assert(), make_syst_table_plots::h, MECModelEnuComparisons::i, submit_nova_art::va, and APDInfo::vb.

38  {
39  // Calculate current values of the variables in StandardRecord once
40  const std::vector<double> va = fA(sr);
41  const std::vector<double> vb = fB(sr);
42  std::vector<double> res1;
43 
44  assert(va.size() == vb.size());
45  int vector_size = va.size();
46  for(int h = 0; h < vector_size; h++){
47  if(va[h] < fBinsA.Min() || vb[h] < fBinsB.Min())
48  {res1.push_back(-1);}
49  if(va[h] > fBinsA.Max() || vb[h] > fBinsB.Max())
50  {res1.push_back(fBinsA.NBins()*fBinsB.NBins());}
51  // FindBin uses root convention, first bin is bin 1, bin 0 is underflow
52  const int ia = fBinsA.FindBin(va[h]) - 1;
53  const int ib = fBinsB.FindBin(vb[h]) - 1;
54  const int i = ia*fBinsB.NBins()+ib;
55  res1.push_back(i+.5);
56  }
57  return res1;
58  }
int FindBin(double x) const
Definition: Binning.cxx:155
double Min() const
Definition: Binning.h:30
const Binning fBinsA
Definition: MultiVar.cxx:62
double Max() const
Definition: Binning.h:31
const MultiVar fB
Definition: MultiVar.cxx:63
const Binning fBinsB
Definition: MultiVar.cxx:64
int NBins() const
Definition: Binning.h:29
const MultiVar fA
Definition: MultiVar.cxx:61
assert(nhit_max >=nhit_nbins)

Member Data Documentation

const MultiVar ana::MultiVar2DFunc::fA
protected

Definition at line 61 of file MultiVar.cxx.

const MultiVar ana::MultiVar2DFunc::fB
protected

Definition at line 63 of file MultiVar.cxx.

const Binning ana::MultiVar2DFunc::fBinsA
protected

Definition at line 62 of file MultiVar.cxx.

const Binning ana::MultiVar2DFunc::fBinsB
protected

Definition at line 64 of file MultiVar.cxx.


The documentation for this class was generated from the following file: