Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JROOT::data_type< T > Struct Template Reference

Template definition of data structure for set of data points. More...

Public Member Functions

void unpack (const TH1 &h1, const range_type &X)
 Unpack 1D-histogram.
 
void unpack (const TH1 &h1, const range_type &X)
 Unpack 1D-histogram.
 
void unpack (const TGraphErrors &g1, const range_type &X)
 Unpack 1D-graph.
 
void unpack (const TH2 &h2, const range_type &X, const range_type &Y)
 Unpack 2D-histogram.
 
void unpack (const TH2 &h2, const range_type &X, const range_type &Y)
 Unpack 2D-histogram.
 
void unpack (const TGraph2DErrors &g2, const range_type &X, const range_type &Y)
 Unpack 2D-graph.
 
void unpack (const TH3 &h3, const range_type &X, const range_type &Y, const range_type &Z)
 Unpack 3D-histogram.
 
void unpack (const TH3 &h3, const range_type &X, const range_type &Y, const range_type &Z)
 Unpack 3D-histogram.
 

Detailed Description

template<class T>
struct JROOT::data_type< T >

Template definition of data structure for set of data points.

Definition at line 392 of file JRootfit.hh.

Member Function Documentation

◆ unpack() [1/8]

void JROOT::data_type< m_1d< m_count > >::unpack ( const TH1 & h1,
const range_type & X )

Unpack 1D-histogram.

Parameters
h1histogram
Xabscissa range

Definition at line 463 of file JRootfit.hh.

465 {
466 for (Int_t ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) {
467
468 const double x = h1.GetXaxis()->GetBinCenter(ix);
469 const size_t count = h1.GetBinContent(ix);
470
471 if (X(x)) {
472 this->push_back(m_1d<m_count>(x, count));
473 }
474 }
475 }

◆ unpack() [2/8]

void JROOT::data_type< m_1d< m_value > >::unpack ( const TH1 & h1,
const range_type & X )

Unpack 1D-histogram.

Parameters
h1histogram
Xabscissa range

Definition at line 485 of file JRootfit.hh.

487 {
488 for (Int_t ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) {
489
490 const double x = h1.GetXaxis()->GetBinCenter(ix);
491 const double value = h1.GetBinContent(ix);
492 const double error = h1.GetBinError (ix);
493
494 if (X(x) && error > 0.0) {
495 this->push_back(m_1d<m_value>(x, m_value(value, error)));
496 }
497 }
498 }

◆ unpack() [3/8]

void JROOT::data_type< m_1d< m_value > >::unpack ( const TGraphErrors & g1,
const range_type & X )

Unpack 1D-graph.

Parameters
g1graph
Xabscissa range

Definition at line 508 of file JRootfit.hh.

510 {
511 for (Int_t i = 0; i != g1.GetN(); ++i) {
512
513 const double x = g1.GetX()[i];
514 const double value = g1.GetY()[i];
515 const double error = g1.GetEY()[i];
516
517 if (X(x) && error > 0.0) {
518 this->push_back(m_1d<m_value>(x, m_value(value, error)));
519 }
520 }
521 }
Double_t g1(const Double_t x)
Function.
Definition JQuantiles.cc:25

◆ unpack() [4/8]

void JROOT::data_type< m_2d< m_count > >::unpack ( const TH2 & h2,
const range_type & X,
const range_type & Y )

Unpack 2D-histogram.

Parameters
h2histogram
Xabscissa range
Yabscissa range

Definition at line 601 of file JRootfit.hh.

604 {
605 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
606 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
607
608 const double x = h2.GetXaxis()->GetBinCenter(ix);
609 const double y = h2.GetYaxis()->GetBinCenter(iy);
610 const size_t count = h2.GetBinContent(ix,iy);
611
612 if (X(x) && Y(y)) {
613 this->push_back(m_2d<m_count>(x, y, count));
614 }
615 }
616 }
617 }

◆ unpack() [5/8]

void JROOT::data_type< m_2d< m_value > >::unpack ( const TH2 & h2,
const range_type & X,
const range_type & Y )

Unpack 2D-histogram.

Parameters
h2histogram
Xabscissa range
Yabscissa range

Definition at line 628 of file JRootfit.hh.

631 {
632 for (Int_t ix = 1; ix <= h2.GetXaxis()->GetNbins(); ++ix) {
633 for (Int_t iy = 1; iy <= h2.GetYaxis()->GetNbins(); ++iy) {
634
635 const double x = h2.GetXaxis()->GetBinCenter(ix);
636 const double y = h2.GetYaxis()->GetBinCenter(iy);
637 const double value = h2.GetBinContent(ix,iy);
638 const double error = h2.GetBinError (ix,iy);
639
640 if (X(x) && Y(y) && error > 0.0) {
641 this->push_back(m_2d<m_value>(x, y, m_value(value, error)));
642 }
643 }
644 }
645 }

◆ unpack() [6/8]

void JROOT::data_type< m_2d< m_value > >::unpack ( const TGraph2DErrors & g2,
const range_type & X,
const range_type & Y )

Unpack 2D-graph.

Parameters
g2graph
Xabscissa range
Yabscissa range

Definition at line 656 of file JRootfit.hh.

659 {
660 for (Int_t i = 0; i != g2.GetN(); ++i) {
661
662 const double x = g2.GetX()[i];
663 const double y = g2.GetY()[i];
664 const double value = g2.GetZ()[i];
665 const double error = g2.GetEZ()[i];
666
667 if (X(x) && Y(y) && error > 0.0) {
668 this->push_back(m_2d<m_value>(x, y, m_value(value, error)));
669 }
670 }
671 }

◆ unpack() [7/8]

void JROOT::data_type< m_3d< m_count > >::unpack ( const TH3 & h3,
const range_type & X,
const range_type & Y,
const range_type & Z )

Unpack 3D-histogram.

Parameters
h3histogram
Xabscissa range
Yabscissa range
Zabscissa range

Definition at line 729 of file JRootfit.hh.

733 {
734 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
735 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
736 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
737
738 const double x = h3.GetXaxis()->GetBinCenter(ix);
739 const double y = h3.GetYaxis()->GetBinCenter(iy);
740 const double z = h3.GetZaxis()->GetBinCenter(iz);
741 const size_t count = h3.GetBinContent(ix,iy,iz);
742
743 if (X(x) && Y(y) && Z(z)) {
744 this->push_back(m_3d<m_count>(x, y, z, count));
745 }
746 }
747 }
748 }
749 }

◆ unpack() [8/8]

void JROOT::data_type< m_3d< m_value > >::unpack ( const TH3 & h3,
const range_type & X,
const range_type & Y,
const range_type & Z )

Unpack 3D-histogram.

Parameters
h3histogram
Xabscissa range
Yabscissa range
Zabscissa range

Definition at line 761 of file JRootfit.hh.

765 {
766 for (Int_t ix = 1; ix <= h3.GetXaxis()->GetNbins(); ++ix) {
767 for (Int_t iy = 1; iy <= h3.GetYaxis()->GetNbins(); ++iy) {
768 for (Int_t iz = 1; iz <= h3.GetZaxis()->GetNbins(); ++iz) {
769
770 const double x = h3.GetXaxis()->GetBinCenter(ix);
771 const double y = h3.GetYaxis()->GetBinCenter(iy);
772 const double z = h3.GetZaxis()->GetBinCenter(iz);
773 const double value = h3.GetBinContent(ix,iy,iz);
774 const double error = h3.GetBinError (ix,iy,iz);
775
776 if (X(x) && Y(y) && Z(z) && error > 0.0) {
777 this->push_back(m_3d<m_value>(x, y, z, m_value(value, error)));
778 }
779 }
780 }
781 }
782 }

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