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

Public Types

typedef histo_data< TC, TO, TN, TW > hd_t
 
typedef parent::bn_t bn_t
 
- Public Types inherited from tools::histo::b3< TC, TO, TN, TW, TH >
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 aI, int aJ, int aK) const
 
bool multiply (TW a_factor)
 
bool scale (TW a_factor)
 
void copy_from_data (const hd_t &a_from)
 
hd_t get_histo_data () const
 
bool reset ()
 
bool fill (TC aX, TC aY, TC aZ, TW aWeight=1)
 
bool set_bin_content (bn_t a_ibin, bn_t a_jbin, bn_t a_kbin, TN a_entries, TW a_Sw, TW a_Sw2, TC a_Sxw, TC a_Sx2w, TC a_Syw, TC a_Sy2w, TC a_Szw, TC a_Sz2w)
 
bool get_bin_content (bn_t a_ibin, bn_t a_jbin, bn_t a_kbin, TN &a_entries, TW &a_Sw, TW &a_Sw2, TC &a_Sxw, TC &a_Sx2w, TC &a_Syw, TC &a_Sy2w, TC &a_Szw, TC &a_Sz2w)
 
bool add (const h3 &a_histo)
 
bool subtract (const h3 &a_histo)
 
bool multiply (const h3 &a_histo)
 
bool divide (const h3 &a_histo)
 
bool equals_TH (const h3 &a_from, const TW &a_prec, TW(*a_fabs)(TW)) const
 
void not_a_profile () const
 
bool Fill (TC aX, TC aY, TC aZ, TW aWeight=1)
 
 h3 (const std::string &a_title, bn_t aXnumber, TC aXmin, TC aXmax, bn_t aYnumber, TC aYmin, TC aYmax, bn_t aZnumber, TC aZmin, TC aZmax)
 
 h3 (const std::string &a_title, const std::vector< TC > &a_edges_x, const std::vector< TC > &a_edges_y, const std::vector< TC > &a_edges_z)
 
virtual ~h3 ()
 
 h3 (const h3 &a_from)
 
h3operator= (const h3 &a_from)
 
- Public Member Functions inherited from tools::histo::b3< TC, TO, TN, TW, TH >
int coord_to_index_x (TC aCoord) const
 
int coord_to_index_y (TC aCoord) const
 
int coord_to_index_z (TC aCoord) const
 
TC mean_x () const
 
TC mean_y () const
 
TC mean_z () const
 
TC rms_x () const
 
TC rms_y () const
 
TC rms_z () const
 
TN bin_entries (int aI, int aJ, int aK) const
 
TH bin_height (int aI, int aJ, int aK) const
 
TC bin_center_x (int aI) const
 
TC bin_center_y (int aJ) const
 
TC bin_center_z (int aK) const
 
TC bin_mean_x (int aI, int aJ, int aK) const
 
TC bin_mean_y (int aI, int aJ, int aK) const
 
TC bin_mean_z (int aI, int aJ, int aK) const
 
TC bin_rms_x (int aI, int aJ, int aK) const
 
TC bin_rms_y (int aI, int aJ, int aK) const
 
TC bin_rms_z (int aI, int aJ, int aK) const
 
const axis_taxis_x () const
 
const axis_taxis_y () const
 
const axis_taxis_z () const
 
axis_taxis_x ()
 
axis_taxis_y ()
 
axis_taxis_z ()
 
TN bin_entries_x (int aI) const
 
TN bin_entries_y (int aJ) const
 
TN bin_entries_z (int aK) const
 
TW bin_height_x (int aI) const
 
TW bin_height_y (int aJ) const
 
TW bin_height_z (int aK) const
 
TC Sxyw () const
 
TC Syzw () const
 
TC Szxw () const
 
void hprint (std::ostream &a_out)
 
 b3 (const std::string &a_title, bn_t aXnumber, TC aXmin, TC aXmax, bn_t aYnumber, TC aYmin, TC aYmax, bn_t aZnumber, TC aZmin, TC aZmax)
 
 b3 (const std::string &a_title, const std::vector< TC > &a_edges_x, const std::vector< TC > &a_edges_y, const std::vector< TC > &a_edges_z)
 
virtual ~b3 ()
 
bool configure (bn_t aXnumber, TC aXmin, TC aXmax, bn_t aYnumber, TC aYmin, TC aYmax, bn_t aZnumber, TC aZmin, TC aZmax)
 
bool configure (const std::vector< TC > &a_edges_x, const std::vector< TC > &a_edges_y, const std::vector< TC > &a_edges_z)
 
- 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 Member Functions

virtual TH get_bin_height (TO a_offset) const
 
- Protected Member Functions inherited from tools::histo::b3< TC, TO, TN, TW, TH >
 b3 (const b3 &a_from)
 
b3operator= (const b3 &a_from)
 
bool _find_offset (int aI, int aJ, int aK, TO &a_offset) const
 
- Protected Member Functions inherited from tools::histo::base_histo< TC, TO, TN, TW, TH >
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 Types inherited from tools::histo::b3< TC, TO, TN, TW, TH >
enum  { AxisX =0, AxisY =1, AxisZ =2 }
 
- 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 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::h3< TC, TO, TN, TW, TH >

Definition at line 13 of file h3.

Member Typedef Documentation

◆ bn_t

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

Definition at line 17 of file h3.

◆ hd_t

template<class TC , class TO , class TN , class TW , class TH >
typedef histo_data<TC,TO,TN,TW> tools::histo::h3< TC, TO, TN, TW, TH >::hd_t

Definition at line 16 of file h3.

Constructor & Destructor Documentation

◆ h3() [1/3]

template<class TC , class TO , class TN , class TW , class TH >
tools::histo::h3< TC, TO, TN, TW, TH >::h3 ( const std::string &  a_title,
bn_t  aXnumber,
TC  aXmin,
TC  aXmax,
bn_t  aYnumber,
TC  aYmin,
TC  aYmax,
bn_t  aZnumber,
TC  aZmin,
TC  aZmax 
)
inline

Definition at line 250 of file h3.

254  :parent(a_title,aXnumber,aXmin,aXmax,
255  aYnumber,aYmin,aYmax,
256  aZnumber,aZmin,aZmax)
257  {}

◆ h3() [2/3]

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

Definition at line 259 of file h3.

263  :parent(a_title,a_edges_x,a_edges_y,a_edges_z)
264  {}

◆ ~h3()

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

Definition at line 266 of file h3.

266 {}

◆ h3() [3/3]

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

Definition at line 268 of file h3.

268 : parent(a_from){}

Member Function Documentation

◆ add()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::add ( const h3< TC, TO, TN, TW, TH > &  a_histo)
inline

Definition at line 215 of file h3.

215  {
216  parent::base_add(a_histo);
217  return true;
218  }

◆ bin_error()

template<class TC , class TO , class TN , class TW , class TH >
virtual TH tools::histo::h3< TC, TO, TN, TW, TH >::bin_error ( int  aI,
int  aJ,
int  aK 
) const
inlinevirtual

Implements tools::histo::b3< TC, TO, TN, TW, TH >.

Definition at line 24 of file h3.

24  {
25  TO offset;
26  if(!parent::_find_offset(aI,aJ,aK,offset)) return 0;
27  return ::sqrt(parent::m_bin_Sw2[offset]);
28  }

◆ copy_from_data()

template<class TC , class TO , class TN , class TW , class TH >
void tools::histo::h3< TC, TO, TN, TW, TH >::copy_from_data ( const hd_t a_from)
inline

Definition at line 34 of file h3.

34 {parent::base_from_data(a_from);}

◆ divide()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::divide ( const h3< TC, TO, TN, TW, TH > &  a_histo)
inline

Definition at line 228 of file h3.

228  {
229  return parent::base_divide(a_histo);
230  }

◆ equals_TH()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::equals_TH ( const h3< TC, TO, TN, TW, TH > &  a_from,
const TW &  a_prec,
TW(*)(TW)  a_fabs 
) const
inline

Definition at line 232 of file h3.

232  {
233  if(!parent::equals_TH(a_from,a_prec,a_fabs,true)) return false;
234  return true;
235  }

◆ fill()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::fill ( TC  aX,
TC  aY,
TC  aZ,
TW  aWeight = 1 
)
inline

Definition at line 42 of file h3.

42  {
43  if(parent::m_dimension!=3) return false;
44 
45  bn_t ibin,jbin,kbin;
46  if(!parent::m_axes[0].coord_to_absolute_index(aX,ibin)) return false;
47  if(!parent::m_axes[1].coord_to_absolute_index(aY,jbin)) return false;
48  if(!parent::m_axes[2].coord_to_absolute_index(aZ,kbin)) return false;
49  TO offset = ibin + jbin * parent::m_axes[1].m_offset + kbin * parent::m_axes[2].m_offset;
50 
51  parent::m_bin_entries[offset]++;
52  parent::m_bin_Sw[offset] += aWeight;
53  parent::m_bin_Sw2[offset] += aWeight * aWeight;
54 
55  TC xw = aX * aWeight;
56  TC x2w = aX * xw;
57  parent::m_bin_Sxw[offset][0] += xw;
58  parent::m_bin_Sx2w[offset][0] += x2w;
59 
60  TC yw = aY * aWeight;
61  TC y2w = aY * yw;
62  parent::m_bin_Sxw[offset][1] += yw;
63  parent::m_bin_Sx2w[offset][1] += y2w;
64 
65  TC zw = aZ * aWeight;
66  TC z2w = aZ * zw;
67  parent::m_bin_Sxw[offset][2] += zw;
68  parent::m_bin_Sx2w[offset][2] += z2w;
69 
70  bool inRange = true;
71  if(ibin==0) inRange = false;
72  else if(ibin==(parent::m_axes[0].m_number_of_bins+1)) inRange = false;
73 
74  if(jbin==0) inRange = false;
75  else if(jbin==(parent::m_axes[1].m_number_of_bins+1)) inRange = false;
76 
77  if(kbin==0) inRange = false;
78  else if(kbin==(parent::m_axes[2].m_number_of_bins+1)) inRange = false;
79 
81  if(inRange) {
82  parent::m_in_range_plane_Sxyw[0] += aX * aY * aWeight;
83  parent::m_in_range_plane_Sxyw[1] += aY * aZ * aWeight;
84  parent::m_in_range_plane_Sxyw[2] += aZ * aX * aWeight;
85 
86  // fast getters :
88  parent::m_in_range_Sw += aWeight;
89  parent::m_in_range_Sw2 += aWeight*aWeight;
90 
91  parent::m_in_range_Sxw[0] += xw;
92  parent::m_in_range_Sx2w[0] += x2w;
93 
94  parent::m_in_range_Sxw[1] += yw;
95  parent::m_in_range_Sx2w[1] += y2w;
96 
97  parent::m_in_range_Sxw[2] += zw;
98  parent::m_in_range_Sx2w[2] += z2w;
99  }
100 
101  return true;
102  }

◆ Fill()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::Fill ( TC  aX,
TC  aY,
TC  aZ,
TW  aWeight = 1 
)
inline

Definition at line 240 of file h3.

240 {return fill(aX,aY,aZ,aWeight);}

◆ get_bin_content()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::get_bin_content ( bn_t  a_ibin,
bn_t  a_jbin,
bn_t  a_kbin,
TN &  a_entries,
TW &  a_Sw,
TW &  a_Sw2,
TC &  a_Sxw,
TC &  a_Sx2w,
TC &  a_Syw,
TC &  a_Sy2w,
TC &  a_Szw,
TC &  a_Sz2w 
)
inline

Definition at line 165 of file h3.

169  {
170  if(parent::m_dimension!=3) {
171  a_entries = 0;a_Sw = 0;a_Sw2 = 0;
172  a_Sxw = 0;a_Sx2w = 0;
173  a_Syw = 0;a_Sy2w = 0;
174  a_Szw = 0;a_Sz2w = 0;
175  return false;
176  }
177  if(a_ibin>(parent::m_axes[0].m_number_of_bins+1)) {
178  a_entries = 0;a_Sw = 0;a_Sw2 = 0;
179  a_Sxw = 0;a_Sx2w = 0;
180  a_Syw = 0;a_Sy2w = 0;
181  a_Szw = 0;a_Sz2w = 0;
182  return false;
183  }
184  if(a_jbin>(parent::m_axes[1].m_number_of_bins+1)) {
185  a_entries = 0;a_Sw = 0;a_Sw2 = 0;
186  a_Sxw = 0;a_Sx2w = 0;
187  a_Syw = 0;a_Sy2w = 0;
188  a_Szw = 0;a_Sz2w = 0;
189  return false;
190  }
191  if(a_kbin>(parent::m_axes[2].m_number_of_bins+1)) {
192  a_entries = 0;a_Sw = 0;a_Sw2 = 0;
193  a_Sxw = 0;a_Sx2w = 0;
194  a_Syw = 0;a_Sy2w = 0;
195  a_Szw = 0;a_Sz2w = 0;
196  return false;
197  }
198 
199  TO offset = a_ibin + a_jbin * parent::m_axes[1].m_offset + a_kbin * parent::m_axes[2].m_offset;
200 
201  a_entries = parent::m_bin_entries[offset];
202  a_Sw = parent::m_bin_Sw[offset];
203  a_Sw2 = parent::m_bin_Sw2[offset];
204 
205  a_Sxw = parent::m_bin_Sxw[offset][0];
206  a_Sx2w = parent::m_bin_Sx2w[offset][0];
207  a_Syw = parent::m_bin_Sxw[offset][1];
208  a_Sy2w = parent::m_bin_Sx2w[offset][1];
209  a_Szw = parent::m_bin_Sxw[offset][2];
210  a_Sz2w = parent::m_bin_Sx2w[offset][2];
211 
212  return true;
213  }

◆ get_bin_height()

template<class TC , class TO , class TN , class TW , class TH >
virtual TH tools::histo::h3< TC, TO, TN, TW, TH >::get_bin_height ( TO  a_offset) const
inlineprotectedvirtual

Implements tools::histo::base_histo< TC, TO, TN, TW, TH >.

Definition at line 19 of file h3.

19  { //TH should be the same as TW
20  return parent::m_bin_Sw[a_offset];
21  }

◆ get_histo_data()

template<class TC , class TO , class TN , class TW , class TH >
hd_t tools::histo::h3< TC, TO, TN, TW, TH >::get_histo_data ( ) const
inline

Definition at line 35 of file h3.

35 {return *this;} //deprecated. Keep it for g4tools.

◆ multiply() [1/2]

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::multiply ( const h3< TC, TO, TN, TW, TH > &  a_histo)
inline

Definition at line 224 of file h3.

224  {
225  return parent::base_multiply(a_histo);
226  }

◆ multiply() [2/2]

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::multiply ( TW  a_factor)
inline

Definition at line 31 of file h3.

31 {return parent::base_multiply(a_factor);}

◆ not_a_profile()

template<class TC , class TO , class TN , class TW , class TH >
void tools::histo::h3< TC, TO, TN, TW, TH >::not_a_profile ( ) const
inline

Definition at line 237 of file h3.

237 {}

◆ operator=()

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

Definition at line 269 of file h3.

269  {
270  parent::operator=(a_from);
271  return *this;
272  }

◆ reset()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::reset ( )
inline

Definition at line 37 of file h3.

37  {
39  return true;
40  }

◆ scale()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::scale ( TW  a_factor)
inline

Definition at line 32 of file h3.

32 {return multiply(a_factor);}

◆ set_bin_content()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::set_bin_content ( bn_t  a_ibin,
bn_t  a_jbin,
bn_t  a_kbin,
TN  a_entries,
TW  a_Sw,
TW  a_Sw2,
TC  a_Sxw,
TC  a_Sx2w,
TC  a_Syw,
TC  a_Sy2w,
TC  a_Szw,
TC  a_Sz2w 
)
inline

Definition at line 104 of file h3.

106  {
107  if(parent::m_dimension!=3) return false;
108  if(a_ibin>(parent::m_axes[0].m_number_of_bins+1)) return false;
109  if(a_jbin>(parent::m_axes[1].m_number_of_bins+1)) return false;
110  if(a_kbin>(parent::m_axes[2].m_number_of_bins+1)) return false;
111 
112  bool inRange = true;
113  if(a_ibin==0) inRange = false;
114  else if(a_ibin==(parent::m_axes[0].m_number_of_bins+1)) inRange = false;
115  if(a_jbin==0) inRange = false;
116  else if(a_jbin==(parent::m_axes[1].m_number_of_bins+1)) inRange = false;
117  if(a_kbin==0) inRange = false;
118  else if(a_kbin==(parent::m_axes[2].m_number_of_bins+1)) inRange = false;
119 
120  TO offset = a_ibin + a_jbin * parent::m_axes[1].m_offset + a_kbin * parent::m_axes[2].m_offset;
121 
123  if(inRange) {
127  parent::m_in_range_Sxw[0] -= parent::m_bin_Sxw[offset][0];
129  parent::m_in_range_Sxw[1] -= parent::m_bin_Sxw[offset][1];
131  parent::m_in_range_Sxw[2] -= parent::m_bin_Sxw[offset][2];
133  }
134 
135  parent::m_bin_entries[offset] = a_entries;
136  parent::m_bin_Sw[offset] = a_Sw;
137  parent::m_bin_Sw2[offset] = a_Sw2;
138 
139  parent::m_bin_Sxw[offset][0] = a_Sxw;
140  parent::m_bin_Sx2w[offset][0] = a_Sx2w;
141  parent::m_bin_Sxw[offset][1] = a_Syw;
142  parent::m_bin_Sx2w[offset][1] = a_Sy2w;
143  parent::m_bin_Sxw[offset][2] = a_Szw;
144  parent::m_bin_Sx2w[offset][2] = a_Sz2w;
145 
146  parent::m_all_entries += a_entries;
147  if(inRange) {
148  //parent::m_in_range_plane_Sxyw[0,1,2] ??? ill-defined.
149 
150  parent::m_in_range_entries += a_entries;
151  parent::m_in_range_Sw += a_Sw;
152  parent::m_in_range_Sw2 += a_Sw2;
153 
154  parent::m_in_range_Sxw[0] += a_Sxw;
155  parent::m_in_range_Sx2w[0] += a_Sx2w;
156  parent::m_in_range_Sxw[1] += a_Syw;
157  parent::m_in_range_Sx2w[1] += a_Sy2w;
158  parent::m_in_range_Sxw[2] += a_Szw;
159  parent::m_in_range_Sx2w[2] += a_Sz2w;
160  }
161 
162  return true;
163  }

◆ subtract()

template<class TC , class TO , class TN , class TW , class TH >
bool tools::histo::h3< TC, TO, TN, TW, TH >::subtract ( const h3< TC, TO, TN, TW, TH > &  a_histo)
inline

Definition at line 219 of file h3.

219  {
220  parent::base_subtract(a_histo);
221  return true;
222  }

The documentation for this class was generated from the following file:
tools::histo::h3::bn_t
parent::bn_t bn_t
Definition: h3:17
tools::histo::histo_data::m_in_range_Sw2
TW m_in_range_Sw2
Definition: histo_data:189
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::histo_data::m_bin_entries
std::vector< TN > m_bin_entries
Definition: histo_data:175
tools::histo::base_histo::base_add
void base_add(const base_histo &a_histo)
Definition: base_histo:476
tools::histo::histo_data::m_bin_Sw
std::vector< TW > m_bin_Sw
Definition: histo_data:176
tools::histo::h3::multiply
bool multiply(TW a_factor)
Definition: h3:31
tools::histo::histo_data::m_in_range_entries
TN m_in_range_entries
Definition: histo_data:187
tools::histo::base_histo::base_subtract
void base_subtract(const base_histo &a_histo)
Definition: base_histo:493
tools::histo::histo_data::m_in_range_Sx2w
std::vector< TC > m_in_range_Sx2w
Definition: histo_data:191
tools::histo::base_histo::base_from_data
void base_from_data(const hd_t &a_from)
Definition: base_histo:47
tools::histo::h3::fill
bool fill(TC aX, TC aY, TC aZ, TW aWeight=1)
Definition: h3:42
tools::histo::histo_data::m_bin_Sxw
std::vector< std::vector< TC > > m_bin_Sxw
Definition: histo_data:178
tools::histo::histo_data::m_axes
std::vector< axis_t > m_axes
Definition: histo_data:181
tools::histo::b3::_find_offset
bool _find_offset(int aI, int aJ, int aK, TO &a_offset) const
Definition: b3:378
tools::histo::base_histo::base_reset
void base_reset()
Definition: base_histo:381
tools::histo::histo_data::m_bin_Sw2
std::vector< TW > m_bin_Sw2
Definition: histo_data:177
tools::histo::histo_data::m_all_entries
TN m_all_entries
Definition: histo_data:186
tools::histo::histo_data::m_in_range_Sw
TW m_in_range_Sw
Definition: histo_data:188
tools::histo::b3::operator=
b3 & operator=(const b3 &a_from)
Definition: b3:347
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::histo_data::equals_TH
bool equals_TH(const histo_data &a_from, const TW &a_prec, TW(*a_fabs)(TW), bool a_cmp_bin_Sw2) const
Definition: histo_data:144
tools::histo::base_histo::base_multiply
bool base_multiply(const base_histo &a_histo)
Definition: base_histo:513
tools::histo::base_histo::base_divide
bool base_divide(const base_histo &a_histo)
Definition: base_histo:547