All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
ana::Var3DFunc< T > Class Template Reference

Helper for Var3D. More...

Public Member Functions

 Var3DFunc (const _Var< T > &a, const Binning binsa, const _Var< T > &b, const Binning binsb, const _Var< T > &c, const Binning binsc)
 
double operator() (const T *sr) const
 

Protected Attributes

const _Var< T > fA
 
const Binning fBinsA
 
const _Var< T > fB
 
const Binning fBinsB
 
const _Var< T > fC
 
const Binning fBinsC
 

Detailed Description

template<class T>
class ana::Var3DFunc< T >

Helper for Var3D.

Definition at line 62 of file Var.cxx.

Constructor & Destructor Documentation

template<class T >
ana::Var3DFunc< T >::Var3DFunc ( const _Var< T > &  a,
const Binning  binsa,
const _Var< T > &  b,
const Binning  binsb,
const _Var< T > &  c,
const Binning  binsc 
)
inline

Definition at line 65 of file Var.cxx.

68  : fA(a), fBinsA(binsa),
69  fB(b), fBinsB(binsb),
70  fC(c), fBinsC(binsc)
71  {
72  }
const _Var< T > fB
Definition: Var.cxx:101
const Binning fBinsA
Definition: Var.cxx:100
const _Var< T > fC
Definition: Var.cxx:103
process_name gaushit a
const Binning fBinsB
Definition: Var.cxx:102
const _Var< T > fA
Definition: Var.cxx:99
const Binning fBinsC
Definition: Var.cxx:104

Member Function Documentation

template<class T >
double ana::Var3DFunc< T >::operator() ( const T *  sr) const
inline

Calculate current values of the variables in StandardRecord once

Since there are no overflow/underflow bins, check the range

Definition at line 74 of file Var.cxx.

75  {
76  /// Calculate current values of the variables in StandardRecord once
77  const double va = fA(sr);
78  const double vb = fB(sr);
79  const double vc = fC(sr);
80 
81  /// Since there are no overflow/underflow bins, check the range
82  if(va < fBinsA.Min() || vb < fBinsB.Min() || vc < fBinsC.Min()){
83  return -1.0;
84  }
85 
86  if(va > fBinsA.Max() || vb > fBinsB.Max() || vc > fBinsC.Max()){
87  return fBinsA.NBins() * fBinsB.NBins() * fBinsC.NBins();
88  }
89 
90  const int ia = fBinsA.FindBin(va) - 1;
91  const int ib = fBinsB.FindBin(vb) - 1;
92  const int ic = fBinsC.FindBin(vc) - 1;
93  const int i = ia*fBinsB.NBins()*fBinsC.NBins() + ib*fBinsC.NBins() + ic;
94 
95  return i+.5;
96  }
const _Var< T > fB
Definition: Var.cxx:101
const Binning fBinsA
Definition: Var.cxx:100
const _Var< T > fC
Definition: Var.cxx:103
double Min() const
Definition: Binning.h:28
const Binning fBinsB
Definition: Var.cxx:102
int FindBin(float x) const
Definition: Binning.cxx:100
double Max() const
Definition: Binning.h:29
int NBins() const
Definition: Binning.h:27
const _Var< T > fA
Definition: Var.cxx:99
const Binning fBinsC
Definition: Var.cxx:104

Member Data Documentation

template<class T >
const _Var<T> ana::Var3DFunc< T >::fA
protected

Definition at line 99 of file Var.cxx.

template<class T >
const _Var<T> ana::Var3DFunc< T >::fB
protected

Definition at line 101 of file Var.cxx.

template<class T >
const Binning ana::Var3DFunc< T >::fBinsA
protected

Definition at line 100 of file Var.cxx.

template<class T >
const Binning ana::Var3DFunc< T >::fBinsB
protected

Definition at line 102 of file Var.cxx.

template<class T >
const Binning ana::Var3DFunc< T >::fBinsC
protected

Definition at line 104 of file Var.cxx.

template<class T >
const _Var<T> ana::Var3DFunc< T >::fC
protected

Definition at line 103 of file Var.cxx.


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