Jpp test-rotations-old-533-g2bdbdb559
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JPseudoExperiment_t Struct Referenceabstract

Auxiliary interface for pseudo experiment. More...

#include <JPseudoExperiment.hh>

Inheritance diagram for JASTRONOMY::JPseudoExperiment_t:
JASTRONOMY::JExperiment JASTRONOMY::JGen2 JASTRONOMY::JPseudoExperiment

Classes

struct  result_type
 Result of combined pseudo experiment and fit. More...
 
struct  stats_type
 Statistics of pseudo experiment. More...
 

Public Types

typedef JAspera::fit_type fit_type
 fit type
 

Public Member Functions

virtual JAsperagetAspera ()=0
 Get fit method.
 
virtual stats_type run (JAspera &out) const =0
 
result_type operator() ()
 Generate pseudo experiment and fit signal strength.
 
void operator() (std::vector< result_type > &storage)
 Run pseudo experiments using given storage.
 
template<class T , class JValue_t >
void operator() (JValue_t result_type::*pm, std::vector< T > &storage)
 Run pseudo experiments using given storage.
 
template<class T , class JValue_t >
void operator() (JValue_t JAspera::fit_type::*pm, std::vector< T > &storage)
 Run pseudo experiments using given storage.
 

Static Public Member Functions

static bool check (const double s, const double b)
 Check validity of signal and background.
 
static bool check (const TAxis *ha, const TAxis *hb)
 Check histogram bins.
 
static bool check (const TH1 &ha, const TH1 &hb)
 Check histogram bins.
 
static bool check (const TH2 &ha, const TH2 &hb)
 Check histogram bins.
 
static bool check (const TH3 &ha, const TH3 &hb)
 Check histogram bins.
 

Detailed Description

Auxiliary interface for pseudo experiment.

Definition at line 38 of file JPseudoExperiment.hh.

Member Typedef Documentation

◆ fit_type

Member Function Documentation

◆ getAspera()

virtual JAspera & JASTRONOMY::JPseudoExperiment_t::getAspera ( )
pure virtual

Get fit method.

Returns
fit

Implemented in JASTRONOMY::JGen2, and JASTRONOMY::JPseudoExperiment.

◆ run()

virtual stats_type JASTRONOMY::JPseudoExperiment_t::run ( JAspera & out) const
pure virtual

◆ operator()() [1/4]

result_type JASTRONOMY::JPseudoExperiment_t::operator() ( )
inline

Generate pseudo experiment and fit signal strength.

Returns
result

Definition at line 93 of file JPseudoExperiment.hh.

94 {
95 JAspera& aspera = getAspera();
96
97 // reset
98
99 aspera.clear();
100 aspera.setSignal(0.0);
101
102 return { run(aspera), aspera() };
103 }
virtual JAspera & getAspera()=0
Get fit method.
virtual stats_type run(JAspera &out) const =0

◆ operator()() [2/4]

void JASTRONOMY::JPseudoExperiment_t::operator() ( std::vector< result_type > & storage)
inline

Run pseudo experiments using given storage.

Parameters
storagestorage

Definition at line 111 of file JPseudoExperiment.hh.

112 {
113 for (auto& i : storage) {
114 i = (*this)();
115 }
116 }

◆ operator()() [3/4]

template<class T , class JValue_t >
void JASTRONOMY::JPseudoExperiment_t::operator() ( JValue_t result_type::* pm,
std::vector< T > & storage )
inline

Run pseudo experiments using given storage.

Parameters
pmpointer to data member of result
storagestorage

Definition at line 126 of file JPseudoExperiment.hh.

127 {
128 for (auto& i : storage) {
129 i = (*this)().*pm;
130 }
131 }

◆ operator()() [4/4]

template<class T , class JValue_t >
void JASTRONOMY::JPseudoExperiment_t::operator() ( JValue_t JAspera::fit_type::* pm,
std::vector< T > & storage )
inline

Run pseudo experiments using given storage.

Parameters
pmpointer to data member of result
storagestorage

Definition at line 141 of file JPseudoExperiment.hh.

142 {
143 (*this)(static_cast<JValue_t result_type::*>(pm), storage);
144 }

◆ check() [1/5]

static bool JASTRONOMY::JExperiment::check ( const double s,
const double b )
inlinestaticinherited

Check validity of signal and background.

Parameters
ssignal
bbackground
Returns
true if signal and backgroud are valid; else false

Definition at line 34 of file JExperiment.hh.

35 {
36 return (s > 0.0 && b > 0.0);
37 }

◆ check() [2/5]

static bool JASTRONOMY::JExperiment::check ( const TAxis * ha,
const TAxis * hb )
inlinestaticinherited

Check histogram bins.

Parameters
hahistogram axis
hbhistogram axis
Returns
true if same binning; else false

Definition at line 47 of file JExperiment.hh.

48 {
49 return (ha->GetNbins() == hb->GetNbins() &&
50 ha->GetXmin() == hb->GetXmin() &&
51 ha->GetXmax() == hb->GetXmax());
52 }

◆ check() [3/5]

static bool JASTRONOMY::JExperiment::check ( const TH1 & ha,
const TH1 & hb )
inlinestaticinherited

Check histogram bins.

Parameters
hahistogram
hbhistogram
Returns
true if same binning; else false

Definition at line 61 of file JExperiment.hh.

62 {
63 return check(ha.GetXaxis(), hb.GetXaxis());
64 }
static bool check(const double s, const double b)
Check validity of signal and background.

◆ check() [4/5]

static bool JASTRONOMY::JExperiment::check ( const TH2 & ha,
const TH2 & hb )
inlinestaticinherited

Check histogram bins.

Parameters
hahistogram
hbhistogram
Returns
true if same binning; else false

Definition at line 74 of file JExperiment.hh.

75 {
76 return (check(ha.GetXaxis(), hb.GetXaxis()) &&
77 check(ha.GetYaxis(), hb.GetYaxis()));
78 }

◆ check() [5/5]

static bool JASTRONOMY::JExperiment::check ( const TH3 & ha,
const TH3 & hb )
inlinestaticinherited

Check histogram bins.

Parameters
hahistogram
hbhistogram
Returns
true if same binning; else false

Definition at line 88 of file JExperiment.hh.

89 {
90 return (check(ha.GetXaxis(), hb.GetXaxis()) &&
91 check(ha.GetYaxis(), hb.GetYaxis()) &&
92 check(ha.GetZaxis(), hb.GetZaxis()));
93 }

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