Jpp
JHistogram1D.hh
Go to the documentation of this file.
1 #ifndef __JHISTOGRAM1D__
2 #define __JHISTOGRAM1D__
3 
4 #include "JTools/JHistogram.hh"
5 #include "JTools/JDistance.hh"
8 #include "JTools/JCollection.hh"
9 #include "JTools/JElement.hh"
10 #include "JMath/JMath.hh"
11 
12 
13 /**
14  * \author mdejong
15  */
16 
17 namespace JTOOLS {}
18 namespace JPP { using namespace JTOOLS; }
19 
20 namespace JTOOLS {
21 
22  using JLANG::JClass;
23 
24 
25  /**
26  * Auxiliary class for merging of fixed number of consecutive bins.
27  */
28  template<class JElement_t>
29  struct JRebin {
30 
31  typedef JElement_t value_type;
32  typedef typename JElement_t::ordinate_type contents_type;
33 
34 
35  /**
36  * Constructor.
37  *
38  * \param n number of bins to merge
39  */
40  JRebin(const int n) :
41  __n(n > 1 ? n : 1),
42  __i(0)
43  {}
44 
45 
46  /**
47  * Test whether bins should be merged.
48  *
49  * \param first first bin
50  * \param second second bin
51  * \return true if bins should be merged; else false
52  */
53  bool operator()(const value_type& first, const value_type& second) const
54  {
55  return (__n != 1 && ++__i%__n != 0);
56  }
57 
58  private:
59  const int __n;
60  mutable int __i;
61  };
62 
63 
64  /**
65  * Auxiliary class for merging of consecutive bins until minimal content is reached.
66  */
67  template<class JElement_t>
68  struct JContent {
69 
70  typedef JElement_t value_type;
71  typedef typename JElement_t::ordinate_type contents_type;
72 
73 
74  /**
75  * Constructor.
76  *
77  * \param y minimal content
78  */
80  __y(y)
81  {}
82 
83 
84  /**
85  * Test whether bins should be merged.
86  *
87  * \param first first bin
88  * \param second second bin
89  * \return true if bins should be merged; else false
90  */
91  bool operator()(const value_type& first, const value_type& second) const
92  {
93  return (first.getY() + second.getY() < __y);
94  }
95 
96  private:
98  };
99 
100 
101 
102  /**
103  * Histogram in 1D.
104  *
105  * This class implements the JHistogram interface.
106  */
107  template<class JElement_t,
108  template<class, class> class JContainer_t,
110  class JHistogram1D :
111  public JContainer_t<JElement_t, JDistance_t>,
112  public JHistogram<typename JElement_t::abscissa_type, typename JElement_t::ordinate_type>,
113  public JMATH::JMath< JHistogram1D<JElement_t, JContainer_t, JDistance_t> >
114  {
115  public:
116 
117  enum { NUMBER_OF_DIMENSIONS = 1 };
118 
119  typedef JContainer_t<JElement_t, JDistance_t> collection_type;
120 
121  typedef typename collection_type::abscissa_type abscissa_type;
122  typedef typename collection_type::ordinate_type ordinate_type;
123  typedef typename collection_type::value_type value_type;
124 
125  typedef typename collection_type::const_iterator const_iterator;
126  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
127  typedef typename collection_type::iterator iterator;
128  typedef typename collection_type::reverse_iterator reverse_iterator;
129 
131 
133 
136 
137 
138  /**
139  * Default constructor.
140  */
142  {}
143 
144 
145  /**
146  * Constructor.
147  *
148  * \param bounds bounds
149  */
151  {
152  this->configure(bounds);
153  }
154 
155 
156  /**
157  * Constructor.
158  *
159  * \param bounds bounds
160  */
162  {
163  this->configure(bounds);
164  }
165 
166 
167  /**
168  * Fill histogram.
169  *
170  * \param pX pointer to abscissa values
171  * \param w weight
172  */
173  virtual void evaluate(const abscissa_type* pX,
175  {
176  this->fill(*pX, w);
177  }
178 
179 
180  /**
181  * Fill histogram.
182  *
183  * \param x abscissa value
184  * \param w weight
185  */
188  {
189  this->integral += w;
190 
191  iterator p = this->lower_bound(x);
192 
193  if (p == this->begin())
194  this->underflow += w;
195  else if (p == this->end())
196  this->overflow += w;
197  else
198  (--p)->getY() += w;
199  }
200 
201 
202  /**
203  * Rebin histogram.
204  *
205  * \param merge rebin evaluator
206  */
207  template<class JRebin_t>
208  void rebin(JRebin_t merge)
209  {
210  if (this->size() > 1u) {
211 
212  iterator out = this->begin();
213 
214  for (const_iterator i = this->begin(); i != this->end(); ) {
215 
216  *out = *i;
217 
218  while (++i != this->end() && merge(*out,*i)) {
219  out->getY() += i->getY();
220  }
221 
222  ++out;
223  }
224 
225  const_reverse_iterator __rbegin(out);
226 
227  if (this->getDistance(__rbegin->getX(), this->rbegin()->getX()) > 0.0) {
228 
229  *out = *(this->rbegin());
230 
231  ++out;
232  }
233 
234  this->resize(std::distance(this->begin(), out));
235  }
236  }
237 
238 
239  /**
240  * Add histogram.
241  *
242  * \param histogram histogram
243  * \return this histogram
244  */
245  JHistogram1D& add(const JHistogram1D& histogram)
246  {
247  collection_type::add(static_cast<const collection_type&>(histogram));
248  histogram_type ::add(static_cast<const histogram_type&> (histogram));
249 
250  return *this;
251  }
252 
253 
254  /**
255  * Subtract histogram.
256  *
257  * \param histogram histogram
258  * \return this histogram
259  */
260  JHistogram1D& sub(const JHistogram1D& histogram)
261  {
262  collection_type::sub(static_cast<const collection_type&>(histogram));
263  histogram_type ::sub(static_cast<const histogram_type&> (histogram));
264 
265  return *this;
266  }
267 
268 
269  /**
270  * Scale contents.
271  *
272  * \param value multiplication factor
273  * \return this histogram
274  */
275  JHistogram1D& mul(const double value)
276  {
277  collection_type::mul(value);
278  histogram_type ::mul(value);
279 
280  return *this;
281  }
282 
283 
284  /**
285  * Scale contents.
286  *
287  * \param value division factor
288  * \return this histogram
289  */
290  JHistogram1D& div(const double value)
291  {
292  collection_type::div(value);
293  histogram_type ::div(value);
294 
295  return *this;
296  }
297 
298 
299  /**
300  * Read histogram from input.
301  *
302  * \param in reader
303  * \param object histogram
304  * \return reader
305  */
306  friend inline JReader& operator>>(JReader& in, JHistogram1D& object)
307  {
308  in >> static_cast<histogram_type&> (object);
309  in >> static_cast<collection_type&>(object);
310 
311  return in;
312  }
313 
314 
315  /**
316  * Write histogram to output.
317  *
318  * \param out writer
319  * \param object histogram
320  * \return writer
321  */
322  friend inline JWriter& operator<<(JWriter& out, const JHistogram1D& object)
323  {
324  out << static_cast<const histogram_type&> (object);
325  out << static_cast<const collection_type&>(object);
326 
327  return out;
328  }
329  };
330 
331 
332  /**
333  * Template specialisation if JHistogram1D class with bin centering.
334  *
335  * This class implements the JHistogram interface.
336  */
337  template<class JAbscissa_t,
338  class JContents_t,
339  template<class, class> class JContainer_t,
340  class JDistance_t>
341  class JHistogram1D<JBin2D<JAbscissa_t, JContents_t>, JContainer_t, JDistance_t> :
342  public JContainer_t<JBin2D<JAbscissa_t, JContents_t>, JDistance_t>,
343  public JHistogram<JAbscissa_t, JContents_t>,
344  public JMATH::JMath< JHistogram1D<JBin2D<JAbscissa_t, JContents_t>, JContainer_t, JDistance_t> >
345  {
346  public:
347 
348  enum { NUMBER_OF_DIMENSIONS = 1 };
349 
351  typedef JContainer_t<element_type, JDistance_t> collection_type;
352 
353  typedef typename collection_type::abscissa_type abscissa_type;
354  typedef typename collection_type::ordinate_type ordinate_type;
355  typedef typename collection_type::value_type value_type;
356 
357  typedef typename collection_type::const_iterator const_iterator;
358  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
359  typedef typename collection_type::iterator iterator;
360  typedef typename collection_type::reverse_iterator reverse_iterator;
361 
363 
365 
368 
369 
370  /**
371  * Default constructor.
372  */
374  {}
375 
376 
377  /**
378  * Constructor.
379  *
380  * \param bounds bounds
381  */
383  {
384  this->set(bounds);
385  }
386 
387 
388  /**
389  * Fill histogram.
390  *
391  * \param pX pointer to abscissa values
392  * \param w weight
393  */
394  virtual void evaluate(const abscissa_type* pX,
396  {
397  this->fill(*pX, w);
398  }
399 
400 
401  /**
402  * Fill histogram.
403  *
404  * \param x abscissa value
405  * \param w weight
406  */
409  {
410  this->integral += w;
411 
412  iterator p = this->lower_bound(x);
413 
414  if (p == this->begin())
415  this->underflow += w;
416  else if (p == this->end())
417  this->overflow += w;
418  else
419  (--p)->fill(x, w);
420  }
421 
422 
423  /**
424  * Rebin histogram.
425  *
426  * \param merge rebin evaluator
427  */
428  template<class JRebin_t>
429  void rebin(JRebin_t merge)
430  {
431  if (this->size() > 1u) {
432 
433  iterator out = this->begin();
434 
435  for (const_iterator i = this->begin(); i != this->end(); ) {
436 
437  *out = *i;
438 
439  while (++i != this->end() && merge(*out,*i)) {
440  out->add(*i);
441  }
442 
443  ++out;
444  }
445 
446  const_reverse_iterator __rbegin(out);
447 
448  if (getDistance(__rbegin->getX(), this->rbegin()->getX()) > 0.0) {
449 
450  *out = *(this->rbegin());
451 
452  ++out;
453  }
454 
455  this->resize(std::distance(this->begin(), out));
456  }
457  }
458 
459 
460  /**
461  * Scale contents.
462  *
463  * \param value multiplication factor
464  */
465  JHistogram1D& mul(const double value)
466  {
467  for (iterator i = this->begin(); i != this->end(); ++i) {
468  i->mul(value);
469  }
470 
471  histogram_type::mul(value);
472 
473  return *this;
474  }
475 
476 
477  /**
478  * Scale contents.
479  *
480  * \param value division factor
481  */
482  JHistogram1D& div(const double value)
483  {
484  for (iterator i = this->begin(); i != this->end(); ++i) {
485  i->div(value);
486  }
487 
488  histogram_type::div(value);
489 
490  return *this;
491  }
492 
493 
494  /**
495  * Read histogram from input.
496  *
497  * \param in reader
498  * \param object histogram
499  * \return reader
500  */
501  friend inline JReader& operator>>(JReader& in, JHistogram1D& object)
502  {
503  in >> static_cast<histogram_type&> (object);
504  in >> static_cast<collection_type&>(object);
505 
506  return in;
507  }
508 
509 
510  /**
511  * Write histogram to output.
512  *
513  * \param out writer
514  * \param object histogram
515  * \return writer
516  */
517  friend inline JWriter& operator<<(JWriter& out, const JHistogram1D& object)
518  {
519  out << static_cast<const histogram_type&> (object);
520  out << static_cast<const collection_type&>(object);
521 
522  return out;
523  }
524 
525  private:
526  /**
527  * Make methods inaccessible.
528  */
529  JHistogram1D& add(const JHistogram1D& histogram); //!< addition not allowed with bin centering
530  JHistogram1D& sub(const JHistogram1D& histogram); //!< subtraction not allowed with bin centering
531  };
532 
533 
534  /**
535  * Conversion of histogram to probability density function (PDF).
536  *
537  * The PDF abscissa and contents are set to the bin center and contents divided the bin width, respectively.
538  *
539  * \param input histogram
540  * \param output mappable collection
541  */
542  template<class JElement_t,
543  template<class, class> class JContainer_t,
544  class JDistance_t>
546  typename JMappable<JElement_t>::map_type& output)
547  {
548  typedef typename JElement_t::abscissa_type abscissa_type;
549  typedef typename JElement_t::ordinate_type ordinate_type;
551 
552  if (input.getSize() > 1) {
553 
554  for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
555 
556  const abscissa_type x = 0.5 * (i->getX() + j->getX());
557  const ordinate_type y = i->getY();
558  const double w = input.getDistance(i->getX(), j->getX());
559 
560  output.put(x, y/w);
561  }
562  }
563  }
564 
565 
566  /**
567  * Conversion of histogram to probability density function (PDF).
568  *
569  * The PDF abscissa and contents are set to the bin center and contents divided the bin width, respectively.
570  *
571  * \param input histogram
572  * \param output mappable collection
573  */
574  template<class JAbscissa_t,
575  class JContents_t,
576  template<class, class> class JContainer_t,
577  class JDistance_t>
578  inline void makePDF(const JHistogram1D<JBin2D<JAbscissa_t, JContents_t>, JContainer_t, JDistance_t>& input,
580  {
581  typedef JAbscissa_t abscissa_type;
582  typedef JContents_t contents_type;
583  typedef typename JHistogram1D<JBin2D<JAbscissa_t, JContents_t>, JContainer_t, JDistance_t>::const_iterator const_iterator;
584 
585  if (input.getSize() > 1) {
586 
587  for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
588 
589  const abscissa_type x = i->getBinCenter();
590  const contents_type y = i->getY();
591  const double w = input.getDistance(i->getX(), j->getX());
592 
593  output.put(x, y/w);
594  }
595  }
596  }
597 
598 
599  /**
600  * Conversion of data points to integral values.
601  *
602  * The integration is based on the sum of bin contents of the input data points.
603  *
604  * \param input histogram
605  * \param output mappable collection
606  * \return integral
607  */
608  template<class JElement_t,
609  template<class, class> class JContainer_t,
610  class JDistance_t>
611  inline typename JElement_t::ordinate_type
613  typename JMappable<JElement_t>::map_type& output)
614  {
615  typedef typename JElement_t::ordinate_type ordinate_type;
617 
618  ordinate_type V(JMATH::zero);
619 
620  if (input.getSize() > 1) {
621 
622  output.put(input.begin()->getX(), V);
623 
624  for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
625 
626  V += i->getY();
627 
628  output.put(j->getX(), V);
629  }
630  }
631 
632  return V;
633  }
634 }
635 
636 #endif
JTOOLS::JHistogram1D::const_iterator
collection_type::const_iterator const_iterator
Definition: JHistogram1D.hh:125
JTOOLS::JHistogram::add
JHistogram & add(const JHistogram &histogram)
Add histogram.
Definition: JHistogram.hh:69
JElement.hh
JTOOLS::JHistogram1D
Histogram in 1D.
Definition: JHistogram1D.hh:110
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::contents_type
histogram_type::contents_type contents_type
Definition: JHistogram1D.hh:364
JAbstractHistogram.hh
JIO::JReader
Interface for binary input.
Definition: JSerialisable.hh:62
JTOOLS::JHistogram1D::JHistogram1D
JHistogram1D(const JAbstractCollection< abscissa_type > &bounds)
Constructor.
Definition: JHistogram1D.hh:161
JTOOLS::JBin2D
2D Binned element.
Definition: JElement.hh:349
JHistogram.hh
JTOOLS::pX
pX
Definition: JPolint.hh:625
JTOOLS::w
data_type w[N+1][M+1]
Definition: JPolint.hh:708
JCollection.hh
JTOOLS::JMappableCollection
Template interface definition for associative collection of elements.
Definition: JMappableCollection.hh:30
JTOOLS::JHistogram1D::operator<<
friend JWriter & operator<<(JWriter &out, const JHistogram1D &object)
Write histogram to output.
Definition: JHistogram1D.hh:322
JTOOLS::JAbstractCollection
Abstract interface for abscissa values of a collection of elements.
Definition: JAbstractCollection.hh:18
JTOOLS::JRebin
Auxiliary class for merging of fixed number of consecutive bins.
Definition: JHistogram1D.hh:29
JTOOLS::JHistogram1D::sub
JHistogram1D & sub(const JHistogram1D &histogram)
Subtract histogram.
Definition: JHistogram1D.hh:260
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::fill
void fill(typename JClass< abscissa_type >::argument_type x, typename JClass< contents_type >::argument_type w)
Fill histogram.
Definition: JHistogram1D.hh:407
JTOOLS::JHistogram::div
JHistogram & div(double value)
Scale histogram.
Definition: JHistogram.hh:117
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::operator<<
friend JWriter & operator<<(JWriter &out, const JHistogram1D &object)
Write histogram to output.
Definition: JHistogram1D.hh:517
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::JRebin
JTOOLS::JRebin< value_type > JRebin
Definition: JHistogram1D.hh:366
JTOOLS::JRebin::JRebin
JRebin(const int n)
Constructor.
Definition: JHistogram1D.hh:40
JTOOLS::JHistogram< JElement_t::abscissa_type, JElement_t::ordinate_type >::overflow
contents_type overflow
Definition: JHistogram.hh:196
JTOOLS::JHistogram1D::JContent
JTOOLS::JContent< value_type > JContent
Definition: JHistogram1D.hh:135
JTOOLS::JHistogram< JElement_t::abscissa_type, JElement_t::ordinate_type >::integral
contents_type integral
Definition: JHistogram.hh:197
JTOOLS::u
double u[N+1]
Definition: JPolint.hh:706
JTOOLS::JHistogram1D::rebin
void rebin(JRebin_t merge)
Rebin histogram.
Definition: JHistogram1D.hh:208
JTOOLS::n
const int n
Definition: JPolint.hh:628
JTOOLS::JRebin::contents_type
JElement_t::ordinate_type contents_type
Definition: JHistogram1D.hh:32
JLANG::JClass::argument_type
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
JTOOLS::JRebin::__i
int __i
Definition: JHistogram1D.hh:60
JTOOLS::JHistogram1D::NUMBER_OF_DIMENSIONS
Definition: JHistogram1D.hh:117
JTOOLS::JHistogram1D::fill
void fill(typename JClass< abscissa_type >::argument_type x, typename JClass< contents_type >::argument_type w)
Fill histogram.
Definition: JHistogram1D.hh:186
JTOOLS::j
int j
Definition: JPolint.hh:634
JLANG::JClass
Template for generic class types.
Definition: JClass.hh:80
distance
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Definition: PhysicsEvent.hh:434
JTOOLS::JMappableCollection::put
void put(typename JClass< key_type > ::argument_type key, typename JClass< mapped_type >::argument_type value)
Put pair-wise element (key,value) into collection.
Definition: JMappableCollection.hh:76
JTOOLS::JHistogram1D::reverse_iterator
collection_type::reverse_iterator reverse_iterator
Definition: JHistogram1D.hh:128
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::mul
JHistogram1D & mul(const double value)
Scale contents.
Definition: JHistogram1D.hh:465
JMATH::JMath
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:26
JTOOLS::JHistogram1D::JHistogram1D
JHistogram1D(const JAbstractHistogram< abscissa_type > &bounds)
Constructor.
Definition: JHistogram1D.hh:150
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::ordinate_type
collection_type::ordinate_type ordinate_type
Definition: JHistogram1D.hh:354
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::const_iterator
collection_type::const_iterator const_iterator
Definition: JHistogram1D.hh:357
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTOOLS::JHistogram1D::mul
JHistogram1D & mul(const double value)
Scale contents.
Definition: JHistogram1D.hh:275
JTOOLS::JHistogram
Template definition of histogram object interface.
Definition: JHistogram.hh:27
JTOOLS::integrate
JElement_t::ordinate_type integrate(const JHistogram1D< JElement_t, JContainer_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
Conversion of data points to integral values.
Definition: JHistogram1D.hh:612
JTOOLS::JHistogram1D::abscissa_type
collection_type::abscissa_type abscissa_type
Definition: JHistogram1D.hh:121
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::operator>>
friend JReader & operator>>(JReader &in, JHistogram1D &object)
Read histogram from input.
Definition: JHistogram1D.hh:501
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::element_type
JBin2D< JAbscissa_t, JContents_t > element_type
Definition: JHistogram1D.hh:350
JIO::JWriter
Interface for binary output.
Definition: JSerialisable.hh:130
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::const_reverse_iterator
collection_type::const_reverse_iterator const_reverse_iterator
Definition: JHistogram1D.hh:358
JTOOLS::JHistogram1D::operator>>
friend JReader & operator>>(JReader &in, JHistogram1D &object)
Read histogram from input.
Definition: JHistogram1D.hh:306
JTOOLS::JHistogram1D::const_reverse_iterator
collection_type::const_reverse_iterator const_reverse_iterator
Definition: JHistogram1D.hh:126
JTOOLS::JContent::operator()
bool operator()(const value_type &first, const value_type &second) const
Test whether bins should be merged.
Definition: JHistogram1D.hh:91
JMATH::getDistance
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
Definition: JMathToolkit.hh:116
JTOOLS::JHistogram::sub
JHistogram & sub(const JHistogram &histogram)
Subtract histogram.
Definition: JHistogram.hh:85
JTOOLS::JContent
Auxiliary class for merging of consecutive bins until minimal content is reached.
Definition: JHistogram1D.hh:68
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::reverse_iterator
collection_type::reverse_iterator reverse_iterator
Definition: JHistogram1D.hh:360
JTOOLS::JContent::JContent
JContent(const contents_type y)
Constructor.
Definition: JHistogram1D.hh:79
JMath.hh
JTOOLS::JHistogram1D::div
JHistogram1D & div(const double value)
Scale contents.
Definition: JHistogram1D.hh:290
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::JContent
JTOOLS::JContent< value_type > JContent
Definition: JHistogram1D.hh:367
JTOOLS::JHistogram1D::contents_type
histogram_type::contents_type contents_type
Definition: JHistogram1D.hh:132
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::collection_type
JContainer_t< element_type, JDistance_t > collection_type
Definition: JHistogram1D.hh:351
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::histogram_type
JHistogram< abscissa_type, ordinate_type > histogram_type
Definition: JHistogram1D.hh:362
JTOOLS::JContent::__y
const contents_type __y
Definition: JHistogram1D.hh:97
JTOOLS::JHistogram::mul
JHistogram & mul(const double value)
Scale histogram.
Definition: JHistogram.hh:101
JTOOLS::JHistogram1D::value_type
collection_type::value_type value_type
Definition: JHistogram1D.hh:123
JTOOLS::JHistogram1D::collection_type
JContainer_t< JElement_t, JDistance_t > collection_type
Definition: JHistogram1D.hh:119
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::iterator
collection_type::iterator iterator
Definition: JHistogram1D.hh:359
JTOOLS::JHistogram1D::iterator
collection_type::iterator iterator
Definition: JHistogram1D.hh:127
JTOOLS::JAbstractHistogram
Simple data structure for histogram binning.
Definition: JAbstractHistogram.hh:24
JTOOLS::JDistance
Template class for distance evaluation.
Definition: JDistance.hh:24
JTOOLS::JRebin::operator()
bool operator()(const value_type &first, const value_type &second) const
Test whether bins should be merged.
Definition: JHistogram1D.hh:53
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::value_type
collection_type::value_type value_type
Definition: JHistogram1D.hh:355
JTOOLS::JHistogram1D::ordinate_type
collection_type::ordinate_type ordinate_type
Definition: JHistogram1D.hh:122
JTOOLS::JHistogram1D::add
JHistogram1D & add(const JHistogram1D &histogram)
Add histogram.
Definition: JHistogram1D.hh:245
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::evaluate
virtual void evaluate(const abscissa_type *pX, typename JClass< contents_type >::argument_type w)
Fill histogram.
Definition: JHistogram1D.hh:394
JTOOLS::JHistogram::contents_type
JContents_t contents_type
Definition: JHistogram.hh:43
JTOOLS::JContent::value_type
JElement_t value_type
Definition: JHistogram1D.hh:70
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::rebin
void rebin(JRebin_t merge)
Rebin histogram.
Definition: JHistogram1D.hh:429
JMATH::zero
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:94
JTOOLS::JContent::contents_type
JElement_t::ordinate_type contents_type
Definition: JHistogram1D.hh:71
JTOOLS::JRebin::value_type
JElement_t value_type
Definition: JHistogram1D.hh:31
JTOOLS::JHistogram< JElement_t::abscissa_type, JElement_t::ordinate_type >::underflow
contents_type underflow
Definition: JHistogram.hh:195
JTOOLS::JRebin::__n
const int __n
Definition: JHistogram1D.hh:59
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JTOOLS::JHistogram::abscissa_type
JAbscissa_t abscissa_type
Definition: JHistogram.hh:42
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::JHistogram1D
JHistogram1D(const JAbstractCollection< abscissa_type > &bounds)
Constructor.
Definition: JHistogram1D.hh:382
JTOOLS::JHistogram1D::JRebin
JTOOLS::JRebin< value_type > JRebin
Definition: JHistogram1D.hh:134
JTOOLS::JHistogram1D::JHistogram1D
JHistogram1D()
Default constructor.
Definition: JHistogram1D.hh:141
JAbstractCollection.hh
JTOOLS::JHistogram1D::evaluate
virtual void evaluate(const abscissa_type *pX, typename JClass< contents_type >::argument_type w)
Fill histogram.
Definition: JHistogram1D.hh:173
JTOOLS::configure
void configure(const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
Configuration of value.
Definition: JToolsToolkit.hh:285
JDistance.hh
JTOOLS::JHistogram1D::histogram_type
JHistogram< abscissa_type, ordinate_type > histogram_type
Definition: JHistogram1D.hh:130
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::abscissa_type
collection_type::abscissa_type abscissa_type
Definition: JHistogram1D.hh:353
JTOOLS::makePDF
void makePDF(const JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t > &input, JMappableCollection< JAbscissa_t, JContents_t > &output)
Conversion of histogram to probability density function (PDF).
Definition: JHistogram1D.hh:578
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::div
JHistogram1D & div(const double value)
Scale contents.
Definition: JHistogram1D.hh:482
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >::JHistogram1D
JHistogram1D()
Default constructor.
Definition: JHistogram1D.hh:373