MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FlatFct Class Reference

#include <FlatFct.h>

Inheritance diagram for FlatFct:
IGenFct

Public Member Functions

virtual double min () const
 
virtual double max () const
 
 FlatFct (const DalitzCoordinate &c)
 
 FlatFct (const FlatFct &other)
 
virtual void setLimits (double sMin, double sMax)
 
virtual void setBoxLimits (double sMin, double sMax)
 
virtual void resetBoxLimits ()
 
virtual double getSMi () const
 
virtual double getSMa () const
 
virtual double generate (TRandom *rnd=gRandom) const
 
virtual double generateRho (TRandom *rnd=gRandom) const
 
virtual DalitzCoordinate getCoordinate () const
 
virtual void setCoordinate (const DalitzCoordinate &c)
 
virtual double generatingPDFValue (double sij) const
 
virtual double generatingFctValue (double sij) const
 
virtual double transformedFctValue (double sij) const
 
virtual double transformedFctMax () const
 
virtual double integral () const
 
virtual bool flat () const
 
virtual ~FlatFct ()
 
- Public Member Functions inherited from IGenFct
virtual double coordTransformFromS (double s) const
 
virtual double coordTransformToS (double rho) const
 
virtual double getRhoMi () const
 
virtual double getRhoMa () const
 
virtual ~IGenFct ()
 

Protected Member Functions

void redoLimits ()
 

Protected Attributes

DalitzCoordinate _coord
 
double _boxLimit_min
 
double _boxLimit_max
 
double _min
 
double _max
 

Detailed Description

Definition at line 11 of file FlatFct.h.

Constructor & Destructor Documentation

◆ FlatFct() [1/2]

FlatFct::FlatFct ( const DalitzCoordinate c)

Definition at line 7 of file FlatFct.cpp.

8  : _coord(c)
9  , _boxLimit_min(-9998)
10  , _boxLimit_max(-9999)
11  , _min(-9999)
12  , _max(-9999)
13 {}
double _max
Definition: FlatFct.h:15
double _boxLimit_max
Definition: FlatFct.h:14
DalitzCoordinate _coord
Definition: FlatFct.h:13
double _boxLimit_min
Definition: FlatFct.h:14
double _min
Definition: FlatFct.h:15

◆ FlatFct() [2/2]

FlatFct::FlatFct ( const FlatFct other)

Definition at line 15 of file FlatFct.cpp.

16  : IGenFct()
17  , _coord(other._coord)
20  , _min(other._min)
21  , _max(other._max)
22 {}
double _max
Definition: FlatFct.h:15
double _boxLimit_max
Definition: FlatFct.h:14
DalitzCoordinate _coord
Definition: FlatFct.h:13
double _boxLimit_min
Definition: FlatFct.h:14
double _min
Definition: FlatFct.h:15

◆ ~FlatFct()

virtual FlatFct::~FlatFct ( )
inlinevirtual

Definition at line 50 of file FlatFct.h.

50 {};

Member Function Documentation

◆ flat()

virtual bool FlatFct::flat ( ) const
inlinevirtual

Reimplemented from IGenFct.

Definition at line 48 of file FlatFct.h.

48 {return true;}

◆ generate()

double FlatFct::generate ( TRandom *  rnd = gRandom) const
virtual

Implements IGenFct.

Definition at line 90 of file FlatFct.cpp.

90  {
91  double val = min() + rnd->Rndm() * (max() - min());
92  return val;
93 }
virtual double min() const
Definition: FlatFct.cpp:61
virtual double max() const
Definition: FlatFct.cpp:64

◆ generateRho()

double FlatFct::generateRho ( TRandom *  rnd = gRandom) const
virtual

Implements IGenFct.

Definition at line 95 of file FlatFct.cpp.

95  {
96  return generate(rnd);
97 }
virtual double generate(TRandom *rnd=gRandom) const
Definition: FlatFct.cpp:90

◆ generatingFctValue()

double FlatFct::generatingFctValue ( double  sij) const
virtual

Implements IGenFct.

Definition at line 107 of file FlatFct.cpp.

107  {
108  if( sij < min() || sij > max()) return 0;
109  return 1;
110 }
virtual double min() const
Definition: FlatFct.cpp:61
virtual double max() const
Definition: FlatFct.cpp:64

◆ generatingPDFValue()

double FlatFct::generatingPDFValue ( double  sij) const
virtual

Implements IGenFct.

Definition at line 99 of file FlatFct.cpp.

99  {
100  double num = generatingFctValue(sij);
101  if(num <=0) return 0;
102  double norm = integral();
103  if(norm <= 0) return 0;
104  return num/norm;
105 }
virtual double generatingFctValue(double sij) const
Definition: FlatFct.cpp:107
virtual double integral() const
Definition: FlatFct.cpp:120

◆ getCoordinate()

DalitzCoordinate FlatFct::getCoordinate ( ) const
virtual

Implements IGenFct.

Definition at line 124 of file FlatFct.cpp.

124  {
125  return _coord;
126 }
DalitzCoordinate _coord
Definition: FlatFct.h:13

◆ getSMa()

virtual double FlatFct::getSMa ( ) const
inlinevirtual

Implements IGenFct.

Definition at line 34 of file FlatFct.h.

34 {return _coord.max();}
DalitzCoordinate _coord
Definition: FlatFct.h:13
double max() const

◆ getSMi()

virtual double FlatFct::getSMi ( ) const
inlinevirtual

Implements IGenFct.

Definition at line 33 of file FlatFct.h.

33 {return _coord.min();}
double min() const
DalitzCoordinate _coord
Definition: FlatFct.h:13

◆ integral()

double FlatFct::integral ( ) const
virtual

Implements IGenFct.

Definition at line 120 of file FlatFct.cpp.

120  {
121  return (max() - min());
122 }
virtual double min() const
Definition: FlatFct.cpp:61
virtual double max() const
Definition: FlatFct.cpp:64

◆ max()

double FlatFct::max ( ) const
virtual

Definition at line 64 of file FlatFct.cpp.

64  {
65  return _max;
66 }
double _max
Definition: FlatFct.h:15

◆ min()

double FlatFct::min ( ) const
virtual

Definition at line 61 of file FlatFct.cpp.

61  {
62  return _min;
63 }
double _min
Definition: FlatFct.h:15

◆ redoLimits()

void FlatFct::redoLimits ( )
protected

Definition at line 68 of file FlatFct.cpp.

68  {
69  bool dbThis=false;
70  _min= _coord.min();
71  if(dbThis){
72  cout << "_min now " << _min << ", min() " << min() << endl;
73  cout << "boxlimits: " << _boxLimit_min
74  << ", " << _boxLimit_max << endl;
75  }
76  if(_boxLimit_min < _boxLimit_max && _min > _boxLimit_min){
78  }
79  _max= _coord.max();
80  if(_boxLimit_min < _boxLimit_max && _max > _boxLimit_max){
82  }
83  if(dbThis){
84  cout << "and _min now " << _min << endl;
85  cout << "boxlimits: " << _boxLimit_min
86  << ", " << _boxLimit_max << endl;
87  }
88 }
double min() const
double _max
Definition: FlatFct.h:15
double _boxLimit_max
Definition: FlatFct.h:14
DalitzCoordinate _coord
Definition: FlatFct.h:13
double max() const
double _boxLimit_min
Definition: FlatFct.h:14
double _min
Definition: FlatFct.h:15
virtual double min() const
Definition: FlatFct.cpp:61

◆ resetBoxLimits()

void FlatFct::resetBoxLimits ( )
virtual

Definition at line 55 of file FlatFct.cpp.

55  {
56  _boxLimit_min= -9998;
57  _boxLimit_max= -9999;
58  redoLimits();
59 }
double _boxLimit_max
Definition: FlatFct.h:14
double _boxLimit_min
Definition: FlatFct.h:14
void redoLimits()
Definition: FlatFct.cpp:68

◆ setBoxLimits()

void FlatFct::setBoxLimits ( double  sMin,
double  sMax 
)
virtual

Definition at line 48 of file FlatFct.cpp.

48  {
49  bool dbThis=false;
50  if(dbThis) cout << "setBoxLimits(" << sMin << ", " << sMax << ")" << endl;
51  _boxLimit_min=sMin;
52  _boxLimit_max=sMax;
53  redoLimits();
54 }
double _boxLimit_max
Definition: FlatFct.h:14
double _boxLimit_min
Definition: FlatFct.h:14
void redoLimits()
Definition: FlatFct.cpp:68

◆ setCoordinate()

void FlatFct::setCoordinate ( const DalitzCoordinate c)
virtual

Implements IGenFct.

Definition at line 127 of file FlatFct.cpp.

127  {
128  _coord = c;
129 }
DalitzCoordinate _coord
Definition: FlatFct.h:13

◆ setLimits()

void FlatFct::setLimits ( double  sMin,
double  sMax 
)
virtual

Implements IGenFct.

Definition at line 32 of file FlatFct.cpp.

32  {
33  bool dbThis=false;
34  _coord.setMin(sMin);
35  _coord.setMax(sMax);
36  if(dbThis){
37  cout << "set limits " << sMin << ", " << sMax
38  << ". check: " << min() << ", " << max()
39  << endl;
40  }
41  redoLimits();
42  if(dbThis){
43  cout << "set limits " << sMin << ", " << sMax
44  << ". check: 2 " << min() << ", " << max()
45  << endl;
46  }
47 }
void setMax(double max)
DalitzCoordinate _coord
Definition: FlatFct.h:13
void redoLimits()
Definition: FlatFct.cpp:68
virtual double min() const
Definition: FlatFct.cpp:61
void setMin(double min)
virtual double max() const
Definition: FlatFct.cpp:64

◆ transformedFctMax()

double FlatFct::transformedFctMax ( ) const
virtual

Implements IGenFct.

Definition at line 116 of file FlatFct.cpp.

116  {
117  return 1;
118 }

◆ transformedFctValue()

double FlatFct::transformedFctValue ( double  sij) const
virtual

Reimplemented from IGenFct.

Definition at line 111 of file FlatFct.cpp.

111  {
112  if( sij < min() || sij > max()) return 0;
113  return 1;
114 }
virtual double min() const
Definition: FlatFct.cpp:61
virtual double max() const
Definition: FlatFct.cpp:64

Member Data Documentation

◆ _boxLimit_max

double FlatFct::_boxLimit_max
protected

Definition at line 14 of file FlatFct.h.

◆ _boxLimit_min

double FlatFct::_boxLimit_min
protected

Definition at line 14 of file FlatFct.h.

◆ _coord

DalitzCoordinate FlatFct::_coord
protected

Definition at line 13 of file FlatFct.h.

◆ _max

double FlatFct::_max
protected

Definition at line 15 of file FlatFct.h.

◆ _min

double FlatFct::_min
protected

Definition at line 15 of file FlatFct.h.


The documentation for this class was generated from the following files: