g4tools  5.4.0
Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
tools::histo::b2< TC, TO, TN, TW, TH > Class Template Referenceabstract
Inheritance diagram for tools::histo::b2< TC, TO, TN, TW, TH >:
Inheritance graph
[legend]
Collaboration diagram for tools::histo::b2< TC, TO, TN, TW, TH >:
Collaboration graph
[legend]

Public Types

typedef base_histo< TC, TO, TN, TW, TH > base_histo_t
 
typedef parent::axis_t axis_t
 
typedef parent::bn_t bn_t
 
- Public Types inherited from tools::histo::base_histo< TC, TO, TN, TW, TH >
typedef histo_data< TC, TO, TN, TW > hd_t
 
typedef axis< TC, TO > axis_t
 
typedef axis_t::bn_t bn_t
 
typedef unsigned int dim_t
 
typedef TC coordinate_t
 
typedef TO offset_t
 
typedef TN num_entries_t
 
typedef TW weight_t
 
typedef TH height_t
 
typedef std::map< std::string, std::string > annotations_t
 

Public Member Functions

virtual TH bin_error (int, int) const =0
 
TC mean_x () const
 
TC mean_y () const
 
TC rms_x () const
 
TC rms_y () const
 
int coord_to_index_x (TC aCoord) const
 
int coord_to_index_y (TC aCoord) const
 
TN bin_entries (int aI, int aJ) const
 
TW bin_Sw (int aI, int aJ) const
 
TW bin_Sw2 (int aI, int aJ) const
 
TC bin_Sxw (int aI, int aJ) const
 
TC bin_Sx2w (int aI, int aJ) const
 
TC bin_Syw (int aI, int aJ) const
 
TC bin_Sy2w (int aI, int aJ) const
 
TH bin_height (int aI, int aJ) const
 
TC bin_center_x (int aI) const
 
TC bin_center_y (int aJ) const
 
TC bin_mean_x (int aI, int aJ) const
 
TC bin_mean_y (int aI, int aJ) const
 
TC bin_rms_x (int aI, int aJ) const
 
TC bin_rms_y (int aI, int aJ) const
 
const axis_taxis_x () const
 
const axis_taxis_y () const
 
axis_taxis_x ()
 
axis_taxis_y ()
 
TN bin_entries_x (int aI) const
 
TW bin_height_x (int aI) const
 
TN bin_entries_y (int aJ) const
 
TW bin_height_y (int aJ) const
 
TC Sxyw () const
 
void hprint (std::ostream &a_out)
 
bool configure (bn_t aXnumber, TC aXmin, TC aXmax, bn_t aYnumber, TC aYmin, TC aYmax)
 
bool configure (const std::vector< TC > &a_edges_x, const std::vector< TC > &a_edges_y)
 
- Public Member Functions inherited from tools::histo::base_histo< TC, TO, TN, TW, TH >
const hd_tdac () const
 
bool equals (const base_histo &a_from, const TW &a_prec, TW(*a_fabs)(TW)) const
 
const std::string & title () const
 
bool set_title (const std::string &a_title)
 
dim_t dimension () const
 
dim_t number_of_planes () const
 
TN entries () const
 
TN all_entries () const
 
TN extra_entries () const
 
TW equivalent_bin_entries () const
 
TH sum_bin_heights () const
 
TH sum_all_bin_heights () const
 
TH sum_extra_bin_heights () const
 
TH min_bin_height () const
 
TH max_bin_height () const
 
bool min_bin_height_with_entries (TH &a_value) const
 
bool max_bin_height_with_entries (TH &a_value) const
 
bool has_entries_per_bin () const
 
bool get_ith_axis_Sxw (dim_t a_axis, TC &a_value) const
 
bool get_ith_axis_Sx2w (dim_t a_axis, TC &a_value) const
 
TW get_in_range_Sw () const
 
TW get_in_range_Sw2 () const
 
void get_Sw_Sw2 (TW &a_sw, TW &a_sw2) const
 
void get_all_Sw_Sw2 (TW &a_sw, TW &a_sw2) const
 
const std::vector< TN > & bins_entries () const
 
const std::vector< TW > & bins_sum_w () const
 
const std::vector< TW > & bins_sum_w2 () const
 
const std::vector< std::vector< TC > > & bins_sum_xw () const
 
const std::vector< std::vector< TC > > & bins_sum_x2w () const
 
const std::vector< TC > & in_range_planes_xyw () const
 
const axis_tget_axis (int a_index) const
 
offset_t get_bins () const
 
const std::string & get_title () const
 
dim_t get_dimension () const
 
bool is_valid () const
 
const annotations_tannotations () const
 
annotations_t annotations ()
 
void add_annotation (const std::string &a_key, const std::string &a_value)
 
bool annotation (const std::string &a_key, std::string &a_value) const
 
void set_annotations (const annotations_t &a_annotations)
 
void hprint_annotations (std::ostream &a_out)
 

Protected Types

enum  { AxisX =0, AxisY =1 }
 
- Protected Types inherited from tools::histo::base_histo< TC, TO, TN, TW, TH >
enum  { AxisX =0, AxisY =1, AxisZ =2 }
 
- Protected Types inherited from tools::histo::histo_data< TC, TO, TN, TW >
typedef axis< TC, TO > axis_t
 
typedef unsigned int dim_t
 
typedef std::map< std::string, std::string > annotations_t
 

Protected Member Functions

 b2 (const std::string &a_title, bn_t aXnumber, TC aXmin, TC aXmax, bn_t aYnumber, TC aYmin, TC aYmax)
 
 b2 (const std::string &a_title, const std::vector< TC > &a_edges_x, const std::vector< TC > &a_edges_y)
 
virtual ~b2 ()
 
 b2 (const b2 &a_from)
 
b2operator= (const b2 &a_from)
 
bool _find_offset (int aI, int aJ, TO &a_offset) const
 
- Protected Member Functions inherited from tools::histo::base_histo< TC, TO, TN, TW, TH >
virtual TH get_bin_height (TO) const =0
 
void base_from_data (const hd_t &a_from)
 
hd_t base_get_data () const
 
 base_histo ()
 
virtual ~base_histo ()
 
 base_histo (const base_histo &a_from)
 
base_histooperator= (const base_histo &a_from)
 
bool configure (dim_t a_dim, const std::vector< bn_t > &aNumbers, const std::vector< TC > &aMins, const std::vector< TC > &aMaxs)
 
bool configure (dim_t a_dim, const std::vector< std::vector< TC > > &a_edges)
 
void base_reset ()
 
void base_allocate ()
 
bool is_compatible (const base_histo &a_histo)
 
void base_add (const base_histo &a_histo)
 
void base_subtract (const base_histo &a_histo)
 
bool base_multiply (const base_histo &a_histo)
 
bool base_divide (const base_histo &a_histo)
 
bool base_multiply (TW a_factor)
 
bool get_ith_axis_mean (dim_t a_axis, TC &a_value) const
 
bool get_ith_axis_rms (dim_t a_axis, TC &a_value) const
 
TN get_bin_entries (const std::vector< int > &aIs) const
 
- Protected Member Functions inherited from tools::histo::histo_data< TC, TO, TN, TW >
void reset_fast_getters ()
 
 histo_data ()
 
 histo_data (const histo_data &a_from)
 
histo_dataoperator= (const histo_data &a_from)
 
virtual ~histo_data ()
 
void update_fast_getters ()
 
bool equals (const histo_data &a_from, const TW &a_prec, TW(*a_fabs)(TW)) const
 
bool equals_TH (const histo_data &a_from, const TW &a_prec, TW(*a_fabs)(TW), bool a_cmp_bin_Sw2) const
 

Additional Inherited Members

- Protected Attributes inherited from tools::histo::histo_data< TC, TO, TN, TW >
std::string m_title
 
dim_t m_dimension
 
TO m_bin_number
 
std::vector< TN > m_bin_entries
 
std::vector< TW > m_bin_Sw
 
std::vector< TW > m_bin_Sw2
 
std::vector< std::vector< TC > > m_bin_Sxw
 
std::vector< std::vector< TC > > m_bin_Sx2w
 
std::vector< axis_tm_axes
 
std::vector< TC > m_in_range_plane_Sxyw
 
std::map< std::string, std::string > m_annotations
 
TN m_all_entries
 
TN m_in_range_entries
 
TW m_in_range_Sw
 
TW m_in_range_Sw2
 
std::vector< TC > m_in_range_Sxw
 
std::vector< TC > m_in_range_Sx2w
 

Detailed Description

template<class TC, class TO, class TN, class TW, class TH>
class tools::histo::b2< TC, TO, TN, TW, TH >

Definition at line 15 of file b2.

Member Typedef Documentation

◆ axis_t

template<class TC , class TO , class TN , class TW , class TH >
typedef parent::axis_t tools::histo::b2< TC, TO, TN, TW, TH >::axis_t

Definition at line 21 of file b2.

◆ base_histo_t

template<class TC , class TO , class TN , class TW , class TH >
typedef base_histo<TC,TO,TN,TW,TH> tools::histo::b2< TC, TO, TN, TW, TH >::base_histo_t

Definition at line 20 of file b2.

◆ bn_t

template<class TC , class TO , class TN , class TW , class TH >
typedef parent::bn_t tools::histo::b2< TC, TO, TN, TW, TH >::bn_t

Definition at line 22 of file b2.

Member Enumeration Documentation

◆ anonymous enum

template<class TC , class TO , class TN , class TW , class TH >
anonymous enum
protected
Enumerator
AxisX 
AxisY 

Definition at line 18 of file b2.

18 {AxisX=0,AxisY=1};

Constructor & Destructor Documentation

◆ b2() [1/3]

template<class TC , class TO , class TN , class TW , class TH >
tools::histo::b2< TC, TO, TN, TW, TH >::b2 ( const std::string &  a_title,
bn_t  aXnumber,
TC  aXmin,
TC  aXmax,
bn_t  aYnumber,
TC  aYmin,
TC  aYmax 
)
inlineprotected

Definition at line 292 of file b2.

292  {
293  parent::m_title = a_title;
294  std::vector<bn_t> nbins;
295  nbins.push_back(aXnumber);
296  nbins.push_back(aYnumber);
297  std::vector<TC> mins;
298  mins.push_back(aXmin);
299  mins.push_back(aYmin);
300  std::vector<TC> maxs;
301  maxs.push_back(aXmax);
302  maxs.push_back(aYmax);
303  parent::configure(2,nbins,mins,maxs);
304  }

◆ b2() [2/3]

template<class TC , class TO , class TN , class TW , class TH >
tools::histo::b2< TC, TO, TN, TW, TH >::b2 ( const std::string &  a_title,
const std::vector< TC > &  a_edges_x,
const std::vector< TC > &  a_edges_y 
)
inlineprotected

Definition at line 306 of file b2.

306  {
307  parent::m_title = a_title;
308  std::vector< std::vector<TC> > edges(2);
309  edges[0] = a_edges_x;
310  edges[1] = a_edges_y;
311  parent::configure(2,edges);
312  }

◆ ~b2()

template<class TC , class TO , class TN , class TW , class TH >
virtual tools::histo::b2< TC, TO, TN, TW, TH >::~b2 ( )
inlineprotectedvirtual

Definition at line 314 of file b2.

314 {}

◆ b2() [3/3]

template<class TC , class TO , class TN , class TW , class TH >
tools::histo::b2< TC, TO, TN, TW, TH >::b2 ( const b2< TC, TO, TN, TW, TH > &  a_from)
inlineprotected

Definition at line 316 of file b2.

316 :parent(a_from) {}

Member Function Documentation

◆ _find_offset()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::b2< TC, TO, TN, TW, TH >::_find_offset ( int  aI,
int  aJ,
TO &  a_offset 
) const
inlineprotected

Definition at line 340 of file b2.

340  {
341  if(parent::m_dimension!=2) {a_offset=0;return false;}
342  bn_t ibin,jbin;
343  if(!parent::m_axes[0].in_range_to_absolute_index(aI,ibin)) {a_offset=0;return false;}
344  if(!parent::m_axes[1].in_range_to_absolute_index(aJ,jbin)) {a_offset=0;return false;}
345  a_offset = ibin + jbin * parent::m_axes[1].m_offset;
346  return true;
347  }

◆ axis_x() [1/2]

template<class TC , class TO , class TN , class TW , class TH >
axis_t& tools::histo::b2< TC, TO, TN, TW, TH >::axis_x ( )
inline

Definition at line 149 of file b2.

149 {return parent::m_axes[0];} //touchy

◆ axis_x() [2/2]

template<class TC , class TO , class TN , class TW , class TH >
const axis_t& tools::histo::b2< TC, TO, TN, TW, TH >::axis_x ( ) const
inline

Definition at line 147 of file b2.

147 {return parent::m_axes[0];}

◆ axis_y() [1/2]

template<class TC , class TO , class TN , class TW , class TH >
axis_t& tools::histo::b2< TC, TO, TN, TW, TH >::axis_y ( )
inline

Definition at line 150 of file b2.

150 {return parent::m_axes[1];} //touchy

◆ axis_y() [2/2]

template<class TC , class TO , class TN , class TW , class TH >
const axis_t& tools::histo::b2< TC, TO, TN, TW, TH >::axis_y ( ) const
inline

Definition at line 148 of file b2.

148 {return parent::m_axes[1];}

◆ bin_center_x()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_center_x ( int  aI) const
inline

Definition at line 101 of file b2.

101  {
102  return parent::m_axes[0].bin_center(aI);
103  }

◆ bin_center_y()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_center_y ( int  aJ) const
inline

Definition at line 104 of file b2.

104  {
105  return parent::m_axes[1].bin_center(aJ);
106  }

◆ bin_entries()

template<class TC , class TO , class TN , class TW , class TH >
TN tools::histo::b2< TC, TO, TN, TW, TH >::bin_entries ( int  aI,
int  aJ 
) const
inline

Definition at line 57 of file b2.

57  {
58  TO offset;
59  if(!_find_offset(aI,aJ,offset)) return 0;
60  return parent::m_bin_entries[offset];
61  }

◆ bin_entries_x()

template<class TC , class TO , class TN , class TW , class TH >
TN tools::histo::b2< TC, TO, TN, TW, TH >::bin_entries_x ( int  aI) const
inline

Definition at line 153 of file b2.

153  {
154  if(!parent::m_dimension) return 0;
155  bn_t ibin;
156  if(!parent::m_axes[0].in_range_to_absolute_index(aI,ibin)) return 0;
157  bn_t ybins = parent::m_axes[1].bins()+2;
158  TO offset;
159  TN _entries = 0;
160  for(bn_t jbin=0;jbin<ybins;jbin++) {
161  offset = ibin + jbin * parent::m_axes[1].m_offset;
162  _entries += parent::m_bin_entries[offset];
163  }
164  return _entries;
165  }

◆ bin_entries_y()

template<class TC , class TO , class TN , class TW , class TH >
TN tools::histo::b2< TC, TO, TN, TW, TH >::bin_entries_y ( int  aJ) const
inline

Definition at line 181 of file b2.

181  {
182  if(!parent::m_dimension) return 0;
183  bn_t jbin;
184  if(!parent::m_axes[1].in_range_to_absolute_index(aJ,jbin)) return 0;
185  bn_t xbins = parent::m_axes[0].bins()+2;
186  TO offset;
187  TN _entries = 0;
188  for(bn_t ibin=0;ibin<xbins;ibin++) {
189  offset = ibin + jbin * parent::m_axes[1].m_offset;
190  _entries += parent::m_bin_entries[offset];
191  }
192  return _entries;
193  }

◆ bin_error()

template<class TC , class TO , class TN , class TW , class TH >
virtual TH tools::histo::b2< TC, TO, TN, TW, TH >::bin_error ( int  ,
int   
) const
pure virtual

◆ bin_height()

template<class TC , class TO , class TN , class TW , class TH >
TH tools::histo::b2< TC, TO, TN, TW, TH >::bin_height ( int  aI,
int  aJ 
) const
inline

Definition at line 95 of file b2.

95  {
96  TO offset;
97  if(!_find_offset(aI,aJ,offset)) return 0;
98  return this->get_bin_height(offset);
99  }

◆ bin_height_x()

template<class TC , class TO , class TN , class TW , class TH >
TW tools::histo::b2< TC, TO, TN, TW, TH >::bin_height_x ( int  aI) const
inline

Definition at line 167 of file b2.

167  {
168  if(!parent::m_dimension) return 0;
169  bn_t ibin;
170  if(!parent::m_axes[0].in_range_to_absolute_index(aI,ibin)) return 0;
171  bn_t ybins = parent::m_axes[1].bins()+2;
172  TO offset;
173  TW sw = 0;
174  for(bn_t jbin=0;jbin<ybins;jbin++) {
175  offset = ibin + jbin * parent::m_axes[1].m_offset;
176  sw += this->get_bin_height(offset);
177  }
178  return sw;
179  }

◆ bin_height_y()

template<class TC , class TO , class TN , class TW , class TH >
TW tools::histo::b2< TC, TO, TN, TW, TH >::bin_height_y ( int  aJ) const
inline

Definition at line 195 of file b2.

195  {
196  if(!parent::m_dimension) return 0;
197  bn_t jbin;
198  if(!parent::m_axes[1].in_range_to_absolute_index(aJ,jbin)) return 0;
199  bn_t xbins = parent::m_axes[0].bins()+2;
200  TO offset;
201  TW sw = 0;
202  for(bn_t ibin=0;ibin<xbins;ibin++) {
203  offset = ibin + jbin * parent::m_axes[1].m_offset;
204  sw += this->get_bin_height(offset);
205  }
206  return sw;
207  }

◆ bin_mean_x()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_mean_x ( int  aI,
int  aJ 
) const
inline

Definition at line 108 of file b2.

108  {
109  TO offset;
110  if(!_find_offset(aI,aJ,offset)) return 0;
111  TW sw = parent::m_bin_Sw[offset];
112  if(sw==0) return 0;
113  return parent::m_bin_Sxw[offset][AxisX]/sw;
114  }

◆ bin_mean_y()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_mean_y ( int  aI,
int  aJ 
) const
inline

Definition at line 116 of file b2.

116  {
117  TO offset;
118  if(!_find_offset(aI,aJ,offset)) return 0;
119  TW sw = parent::m_bin_Sw[offset];
120  if(sw==0) return 0;
121  return parent::m_bin_Sxw[offset][AxisY]/sw;
122  }

◆ bin_rms_x()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_rms_x ( int  aI,
int  aJ 
) const
inline

Definition at line 124 of file b2.

124  {
125  TO offset;
126  if(!_find_offset(aI,aJ,offset)) return 0;
127  TW sw = parent::m_bin_Sw[offset];
128  if(sw==0) return 0;
129  TC sxw = parent::m_bin_Sxw[offset][AxisX];
130  TC sx2w = parent::m_bin_Sx2w[offset][AxisX];
131  TC mean = sxw/sw;
132  return ::sqrt(::fabs((sx2w / sw) - mean * mean));
133  }

◆ bin_rms_y()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_rms_y ( int  aI,
int  aJ 
) const
inline

Definition at line 135 of file b2.

135  {
136  TO offset;
137  if(!_find_offset(aI,aJ,offset)) return 0;
138  TW sw = parent::m_bin_Sw[offset];
139  if(sw==0) return 0;
140  TC sxw = parent::m_bin_Sxw[offset][AxisY];
141  TC sx2w = parent::m_bin_Sx2w[offset][AxisY];
142  TC mean = sxw/sw;
143  return ::sqrt(::fabs((sx2w / sw) - mean * mean));
144  }

◆ bin_Sw()

template<class TC , class TO , class TN , class TW , class TH >
TW tools::histo::b2< TC, TO, TN, TW, TH >::bin_Sw ( int  aI,
int  aJ 
) const
inline

Definition at line 63 of file b2.

63  {
64  TO offset;
65  if(!_find_offset(aI,aJ,offset)) return 0;
66  return parent::m_bin_Sw[offset];
67  }

◆ bin_Sw2()

template<class TC , class TO , class TN , class TW , class TH >
TW tools::histo::b2< TC, TO, TN, TW, TH >::bin_Sw2 ( int  aI,
int  aJ 
) const
inline

Definition at line 69 of file b2.

69  {
70  TO offset;
71  if(!_find_offset(aI,aJ,offset)) return 0;
72  return parent::m_bin_Sw2[offset];
73  }

◆ bin_Sx2w()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_Sx2w ( int  aI,
int  aJ 
) const
inline

Definition at line 79 of file b2.

79  {
80  TO offset;
81  if(!_find_offset(aI,aJ,offset)) return 0;
82  return parent::m_bin_Sx2w[offset][AxisX];
83  }

◆ bin_Sxw()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_Sxw ( int  aI,
int  aJ 
) const
inline

Definition at line 74 of file b2.

74  {
75  TO offset;
76  if(!_find_offset(aI,aJ,offset)) return 0;
77  return parent::m_bin_Sxw[offset][AxisX];
78  }

◆ bin_Sy2w()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_Sy2w ( int  aI,
int  aJ 
) const
inline

Definition at line 89 of file b2.

89  {
90  TO offset;
91  if(!_find_offset(aI,aJ,offset)) return 0;
92  return parent::m_bin_Sx2w[offset][AxisY];
93  }

◆ bin_Syw()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::bin_Syw ( int  aI,
int  aJ 
) const
inline

Definition at line 84 of file b2.

84  {
85  TO offset;
86  if(!_find_offset(aI,aJ,offset)) return 0;
87  return parent::m_bin_Sxw[offset][AxisY];
88  }

◆ configure() [1/2]

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::b2< TC, TO, TN, TW, TH >::configure ( bn_t  aXnumber,
TC  aXmin,
TC  aXmax,
bn_t  aYnumber,
TC  aYmin,
TC  aYmax 
)
inline

Definition at line 319 of file b2.

319  {
320  std::vector<bn_t> nbins;
321  nbins.push_back(aXnumber);
322  nbins.push_back(aYnumber);
323  std::vector<TC> mins;
324  mins.push_back(aXmin);
325  mins.push_back(aYmin);
326  std::vector<TC> maxs;
327  maxs.push_back(aXmax);
328  maxs.push_back(aYmax);
329  return parent::configure(2,nbins,mins,maxs);
330  }

◆ configure() [2/2]

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::b2< TC, TO, TN, TW, TH >::configure ( const std::vector< TC > &  a_edges_x,
const std::vector< TC > &  a_edges_y 
)
inline

Definition at line 332 of file b2.

332  {
333  std::vector< std::vector<TC> > edges(2);
334  edges[0] = a_edges_x;
335  edges[1] = a_edges_y;
336  return parent::configure(2,edges);
337  }

◆ coord_to_index_x()

template<class TC , class TO , class TN , class TW , class TH >
int tools::histo::b2< TC, TO, TN, TW, TH >::coord_to_index_x ( TC  aCoord) const
inline

Definition at line 49 of file b2.

49  {
50  return axis_x().coord_to_index(aCoord);
51  }

◆ coord_to_index_y()

template<class TC , class TO , class TN , class TW , class TH >
int tools::histo::b2< TC, TO, TN, TW, TH >::coord_to_index_y ( TC  aCoord) const
inline

Definition at line 52 of file b2.

52  {
53  return axis_y().coord_to_index(aCoord);
54  }

◆ hprint()

template<class TC , class TO , class TN , class TW , class TH >
void tools::histo::b2< TC, TO, TN, TW, TH >::hprint ( std::ostream &  a_out)
inline

Definition at line 212 of file b2.

212  {
213  // A la HPRINT.
214  a_out << parent::dimension() << parent::title() << std::endl;
215  a_out
216  << " * ENTRIES = " << parent::all_entries() << std::endl;
217 
218  // 6 | 7 | 8
219  // -----------
220  // 3 | 4 | 5
221  // -----------
222  // 0 | 1 | 2
223 
224  TW height_0 = bin_height(axis_t::UNDERFLOW_BIN,
226  TW height_2 = bin_height(axis_t::OVERFLOW_BIN,
228  TW height_6 = bin_height(axis_t::UNDERFLOW_BIN,
230  TW height_8 = bin_height(axis_t::OVERFLOW_BIN,
232 
233  bn_t i,j;
234 
235  TW height_1 = 0;
236  TW height_7 = 0;
237  for(i=0;i<axis_x().bins();i++){
238  height_1 += bin_height(i,axis_t::UNDERFLOW_BIN);
239  height_7 += bin_height(i,axis_t::OVERFLOW_BIN);
240  }
241 
242  TW height_3 = 0;
243  TW height_5 = 0;
244  for(j=0;j<axis_y().bins();j++){
245  height_3 += bin_height(axis_t::UNDERFLOW_BIN,j);
246  height_5 += bin_height(axis_t::OVERFLOW_BIN,j);
247  }
248 
249  TW height_4 = 0;
250  for(i=0;i<axis_x().bins();i++){
251  for(j=0;j<axis_y().bins();j++){
252  height_4 += bin_height(i,j);
253  }
254  }
255 
256  a_out
257  << " " << height_6 << " " << height_7 << " " << height_8 << std::endl;
258  a_out
259  << " " << height_3 << " " << height_4 << " " << height_5 << std::endl;
260  a_out
261  << " " << height_0 << " " << height_1 << " " << height_2 << std::endl;
262 
263  // Some bins :
264  bn_t xbins = axis_x().bins();
265  bn_t ybins = axis_y().bins();
266  a_out
267  << " * ENTRIES[0,0] = "
268  << bin_entries(0,0)
269  << " * HEIGHT[0,0] = "
270  << bin_height(0,0)
271  << " * ERROR[0,0] = "
272  << bin_error(0,0)
273  << std::endl;
274  a_out
275  << " * ENTRIES[N/2,N/2] = "
276  << bin_entries(xbins/2,ybins/2)
277  << " * HEIGHT[N/2,N/2] = "
278  << bin_height(xbins/2,ybins/2)
279  << " * ERROR[N/2,N/2] = "
280  << bin_error(xbins/2,ybins/2)
281  << std::endl;
282  a_out
283  << " * ENTRIES[N-1,N-1] = "
284  << bin_entries(xbins-1,ybins-1)
285  << " * HEIGHT[N-1,N-1] = "
286  << bin_height(xbins-1,ybins-1)
287  << " * ERROR[N-1,N-1] = "
288  << bin_error(xbins-1,ybins-1)
289  << std::endl;
290  }

◆ mean_x()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::mean_x ( ) const
inline

Definition at line 27 of file b2.

27  {
28  if(parent::m_in_range_Sw==0) return 0;
30  }

◆ mean_y()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::mean_y ( ) const
inline

Definition at line 32 of file b2.

32  {
33  if(parent::m_in_range_Sw==0) return 0;
35  }

◆ operator=()

template<class TC , class TO , class TN , class TW , class TH >
b2& tools::histo::b2< TC, TO, TN, TW, TH >::operator= ( const b2< TC, TO, TN, TW, TH > &  a_from)
inlineprotected

Definition at line 317 of file b2.

317 {parent::operator=(a_from);return *this;}

◆ rms_x()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::rms_x ( ) const
inline

Definition at line 37 of file b2.

37  {
38  if(parent::m_in_range_Sw==0) return 0;
40  return ::sqrt(::fabs((parent::m_in_range_Sx2w[0] / parent::m_in_range_Sw) - mean * mean));
41  }

◆ rms_y()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::rms_y ( ) const
inline

Definition at line 43 of file b2.

43  {
44  if(parent::m_in_range_Sw==0) return 0;
46  return ::sqrt(::fabs((parent::m_in_range_Sx2w[1] / parent::m_in_range_Sw) - mean * mean));
47  }

◆ Sxyw()

template<class TC , class TO , class TN , class TW , class TH >
TC tools::histo::b2< TC, TO, TN, TW, TH >::Sxyw ( ) const
inline

Definition at line 209 of file b2.


The documentation for this class was generated from the following file:
tools::histo::axis::coord_to_index
int coord_to_index(TC a_value) const
Definition: axis:97
tools::histo::histo_data::m_bin_Sx2w
std::vector< std::vector< TC > > m_bin_Sx2w
Definition: histo_data:179
tools::histo::histo_data::m_in_range_Sxw
std::vector< TC > m_in_range_Sxw
Definition: histo_data:190
tools::histo::b2::AxisX
@ AxisX
Definition: b2:18
tools::histo::b2::bin_height
TH bin_height(int aI, int aJ) const
Definition: b2:95
tools::histo::histo_data::m_bin_entries
std::vector< TN > m_bin_entries
Definition: histo_data:175
tools::histo::histo_data::m_bin_Sw
std::vector< TW > m_bin_Sw
Definition: histo_data:176
tools::histo::base_histo::get_bin_height
virtual TH get_bin_height(TO) const =0
tools::histo::histo_data::m_in_range_Sx2w
std::vector< TC > m_in_range_Sx2w
Definition: histo_data:191
tools::histo::histo_data::m_title
std::string m_title
Definition: histo_data:171
tools::histo::axis::bins
bn_t bins() const
Definition: axis:28
tools::histo::histo_data::m_bin_Sxw
std::vector< std::vector< TC > > m_bin_Sxw
Definition: histo_data:178
tools::histo::axis::UNDERFLOW_BIN
@ UNDERFLOW_BIN
Definition: axis:23
tools::histo::b2::axis_y
const axis_t & axis_y() const
Definition: b2:148
tools::histo::base_histo::all_entries
TN all_entries() const
Definition: base_histo:95
tools::histo::histo_data::m_axes
std::vector< axis_t > m_axes
Definition: histo_data:181
tools::histo::base_histo::title
const std::string & title() const
Definition: base_histo:87
tools::histo::base_histo::configure
bool configure(dim_t a_dim, const std::vector< bn_t > &aNumbers, const std::vector< TC > &aMins, const std::vector< TC > &aMaxs)
Definition: base_histo:293
tools::histo::b2::bin_entries
TN bin_entries(int aI, int aJ) const
Definition: b2:57
tools::histo::histo_data::m_bin_Sw2
std::vector< TW > m_bin_Sw2
Definition: histo_data:177
tools::histo::histo_data::m_in_range_Sw
TW m_in_range_Sw
Definition: histo_data:188
tools::histo::b2::_find_offset
bool _find_offset(int aI, int aJ, TO &a_offset) const
Definition: b2:340
tools::histo::b2::AxisY
@ AxisY
Definition: b2:18
tools::histo::axis::OVERFLOW_BIN
@ OVERFLOW_BIN
Definition: axis:23
tools::histo::base_histo::operator=
base_histo & operator=(const base_histo &a_from)
Definition: base_histo:76
tools::histo::histo_data::m_in_range_plane_Sxyw
std::vector< TC > m_in_range_plane_Sxyw
Definition: histo_data:183
tools::histo::histo_data::m_dimension
dim_t m_dimension
Definition: histo_data:172
tools::histo::base_histo::dimension
dim_t dimension() const
Definition: base_histo:89
tools::histo::b2::bin_error
virtual TH bin_error(int, int) const =0
tools::histo::b2::axis_x
const axis_t & axis_x() const
Definition: b2:147
tools::histo::b2::bn_t
parent::bn_t bn_t
Definition: b2:22