MINT2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DalitzBWBox Class Reference

#include <DalitzBWBox.h>

Public Member Functions

double & height ()
 
const double & height () const
 
 DalitzBWBox (TRandom *rnd=gRandom)
 
 DalitzBWBox (const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *amps=0, TRandom *rnd=gRandom)
 
 DalitzBWBox (const DalitzEventPattern &pat, const MINT::counted_ptr< IGenFct > &fct, MINT::IReturnRealForEvent< IDalitzEvent > *amps=0, TRandom *rnd=gRandom)
 
 DalitzBWBox (const DalitzEventPattern &pat, const std::vector< MINT::counted_ptr< IGenFct > > &limits, MINT::IReturnRealForEvent< IDalitzEvent > *amps=0, TRandom *rnd=gRandom)
 
 DalitzBWBox (const DalitzBWBox &other)
 
virtual ~DalitzBWBox ()
 
DalitzEventPatternpattern ()
 
const DalitzEventPatternpattern () const
 
void setName (const std::string &name)
 
const std::string & name () const
 
const MappedDalitzBWAreaarea () const
 
MappedDalitzBWAreaarea ()
 
double volume () const
 
bool checkIntegration () const
 
double genValue (const DalitzEvent &evt) const
 
void setUnWeightPs (bool doSo=true)
 
bool unWeightPs ()
 
bool setAmps (MINT::IReturnRealForEvent< IDalitzEvent > *amps)
 
bool insideArea (const DalitzEvent &evt) const
 
MINT::counted_ptr< DalitzEventtryEventForOwner ()
 
MINT::counted_ptr< DalitzEventmakeEventForOwner ()
 
MINT::counted_ptr< DalitzEventmakeEventForOwner (int &nTries)
 
bool setRnd (TRandom *rnd=gRandom)
 
void print (std::ostream &os=std::cout) const
 

Private Member Functions

MINT::counted_ptr< DalitzEventtryNewEvent ()
 

Private Attributes

std::string _name
 
MappedDalitzBWArea _area
 
DalitzEventPattern _pat
 
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
 
TRandom * _rnd
 
double _height
 

Detailed Description

Definition at line 22 of file DalitzBWBox.h.

Constructor & Destructor Documentation

◆ DalitzBWBox() [1/5]

DalitzBWBox::DalitzBWBox ( TRandom *  rnd = gRandom)

Definition at line 17 of file DalitzBWBox.cpp.

18  : _name("noName")
19  , _area()
20  , _pat()
21  , _amps(0)
22  , _rnd(rnd)
23  , _height(-1)
24 {}
double _height
Definition: DalitzBWBox.h:31
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBWBox.h:28
std::string _name
Definition: DalitzBWBox.h:23
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27
TRandom * _rnd
Definition: DalitzBWBox.h:30

◆ DalitzBWBox() [2/5]

DalitzBWBox::DalitzBWBox ( const DalitzEventPattern pat,
MINT::IReturnRealForEvent< IDalitzEvent > *  amps = 0,
TRandom *  rnd = gRandom 
)

Definition at line 27 of file DalitzBWBox.cpp.

30  : _name("noName")
31  , _area(pat, rnd)
32  , _pat(pat)
33  , _amps(0)
34  , _rnd(rnd)
35  , _height(1)
36 {
37  setAmps(amps);
38 }
double _height
Definition: DalitzBWBox.h:31
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBWBox.h:28
std::string _name
Definition: DalitzBWBox.h:23
bool setAmps(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
Definition: DalitzBWBox.cpp:78
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27
TRandom * _rnd
Definition: DalitzBWBox.h:30

◆ DalitzBWBox() [3/5]

DalitzBWBox::DalitzBWBox ( const DalitzEventPattern pat,
const MINT::counted_ptr< IGenFct > &  fct,
MINT::IReturnRealForEvent< IDalitzEvent > *  amps = 0,
TRandom *  rnd = gRandom 
)

Definition at line 40 of file DalitzBWBox.cpp.

44  : _name("noName")
45  , _area(pat, pdf, rnd)
46  , _pat(pat)
47  , _amps(0)
48  , _rnd(rnd)
49  , _height(1)
50 {
51  setAmps(amps);
52 }
double _height
Definition: DalitzBWBox.h:31
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBWBox.h:28
std::string _name
Definition: DalitzBWBox.h:23
bool setAmps(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
Definition: DalitzBWBox.cpp:78
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27
TRandom * _rnd
Definition: DalitzBWBox.h:30

◆ DalitzBWBox() [4/5]

DalitzBWBox::DalitzBWBox ( const DalitzEventPattern pat,
const std::vector< MINT::counted_ptr< IGenFct > > &  limits,
MINT::IReturnRealForEvent< IDalitzEvent > *  amps = 0,
TRandom *  rnd = gRandom 
)

Definition at line 54 of file DalitzBWBox.cpp.

58  : _name("noName")
59  , _area(pat, limits, rnd)
60  , _pat(pat)
61  , _amps(0)
62  , _rnd(rnd)
63  , _height(-1)
64 {
65  setAmps(amps);
66 }
double _height
Definition: DalitzBWBox.h:31
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBWBox.h:28
std::string _name
Definition: DalitzBWBox.h:23
bool setAmps(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
Definition: DalitzBWBox.cpp:78
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27
TRandom * _rnd
Definition: DalitzBWBox.h:30

◆ DalitzBWBox() [5/5]

DalitzBWBox::DalitzBWBox ( const DalitzBWBox other)

Definition at line 68 of file DalitzBWBox.cpp.

69  : _name(other._name)
70  , _area(other._area)
71  , _pat(other._pat)
72  , _amps(other._amps)
73  , _rnd(other._rnd)
74  , _height(other._height)
75 {
76 }
double _height
Definition: DalitzBWBox.h:31
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBWBox.h:28
std::string _name
Definition: DalitzBWBox.h:23
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27
TRandom * _rnd
Definition: DalitzBWBox.h:30

◆ ~DalitzBWBox()

DalitzBWBox::~DalitzBWBox ( )
virtual

Definition at line 84 of file DalitzBWBox.cpp.

84  {
85 }

Member Function Documentation

◆ area() [1/2]

const MappedDalitzBWArea& DalitzBWBox::area ( ) const
inline

Definition at line 65 of file DalitzBWBox.h.

65 {return _area;}
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25

◆ area() [2/2]

MappedDalitzBWArea& DalitzBWBox::area ( )
inline

Definition at line 66 of file DalitzBWBox.h.

66 {return _area;}
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25

◆ checkIntegration()

bool DalitzBWBox::checkIntegration ( ) const
inline

Definition at line 70 of file DalitzBWBox.h.

70  {
71  return _area.checkIntegration();}
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25
bool checkIntegration() const

◆ genValue()

double DalitzBWBox::genValue ( const DalitzEvent evt) const

Definition at line 115 of file DalitzBWBox.cpp.

115  {
116  bool dbThis=false;
117  if(dbThis) {
118  cout << "DalitzBWBox::genValue called " << endl;
119  }
120 
121  double returnVal = area().genValue(evt)*height();
122  if(dbThis) {
123  cout << "DalitzBWBox::genValue returning "
124  << area().genValue(evt) << " * " << height()
125  << " = "
126  << returnVal << endl;
127  }
128  return returnVal;
129 }
double & height()
Definition: DalitzBWBox.h:36
const MappedDalitzBWArea & area() const
Definition: DalitzBWBox.h:65
double genValue(const DalitzEvent &evt) const

◆ height() [1/2]

double& DalitzBWBox::height ( )
inline

Definition at line 36 of file DalitzBWBox.h.

36 { return _height;}
double _height
Definition: DalitzBWBox.h:31

◆ height() [2/2]

const double& DalitzBWBox::height ( ) const
inline

Definition at line 37 of file DalitzBWBox.h.

37 { return _height;}
double _height
Definition: DalitzBWBox.h:31

◆ insideArea()

bool DalitzBWBox::insideArea ( const DalitzEvent evt) const

Definition at line 87 of file DalitzBWBox.cpp.

87  {
88  /*
89  cout << "Hello from DalitzBWBox::insideArea()" << endl;
90  cout << " my area is " << _area << endl;
91  cout << ", or the same with (): " << area() << endl;
92  cout << " and the event: " << evt << endl;
93  cout << " Let's check if the event is inside the area: " << endl;
94  */
95  bool inside = area().isInside(evt);
96 
97  /*
98  cout << "Goodbye from DalitzBWBox::insideArea(); returning "
99  << inside << endl;
100  */
101 
102  return inside;
103 }
bool isInside(const DalitzEvent &evt) const
const MappedDalitzBWArea & area() const
Definition: DalitzBWBox.h:65

◆ makeEventForOwner() [1/2]

counted_ptr< DalitzEvent > DalitzBWBox::makeEventForOwner ( )

Definition at line 137 of file DalitzBWBox.cpp.

137  {
138  int nTries;
139  return makeEventForOwner(nTries);
140 }
MINT::counted_ptr< DalitzEvent > makeEventForOwner()

◆ makeEventForOwner() [2/2]

counted_ptr< DalitzEvent > DalitzBWBox::makeEventForOwner ( int &  nTries)

Definition at line 141 of file DalitzBWBox.cpp.

141  {
142  bool dbThis=false;
143 
144  int maxTries = 10000000;
145  for(int i=0; i< maxTries; i++){
147  if(dbThis && 0 != evt) cout << " DalitzBWBox::makeEventForOwner() got event " << evt << endl;
148  if(0 != evt) {
149  if(dbThis) cout << "DalitzBWBox::makeEventForOwner() - made event for value: "
150  << genValue(*evt) << endl;
151  nTries = i+1;
152  return evt;
153  }
154  }
155  cout << "WARINING DalitzBWBox::makeEventForOwner() - no success after " << maxTries
156  << " tries. Returning 0"
157  << endl;
158  nTries = maxTries;
160  return evt;
161 }
double genValue(const DalitzEvent &evt) const
MINT::counted_ptr< DalitzEvent > tryNewEvent()

◆ name()

const std::string& DalitzBWBox::name ( ) const
inline

Definition at line 63 of file DalitzBWBox.h.

63 {return _name;}
std::string _name
Definition: DalitzBWBox.h:23

◆ pattern() [1/2]

DalitzEventPattern& DalitzBWBox::pattern ( )
inline

Definition at line 59 of file DalitzBWBox.h.

59 {return _pat;}
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27

◆ pattern() [2/2]

const DalitzEventPattern& DalitzBWBox::pattern ( ) const
inline

Definition at line 60 of file DalitzBWBox.h.

60 {return _pat;}
DalitzEventPattern _pat
Definition: DalitzBWBox.h:27

◆ print()

void DalitzBWBox::print ( std::ostream &  os = std::cout) const

Definition at line 178 of file DalitzBWBox.cpp.

178  {
179  os << "DalitzBWBox: " << name()
180  << "\n area " << area();
181 }
const std::string & name() const
Definition: DalitzBWBox.h:63
const MappedDalitzBWArea & area() const
Definition: DalitzBWBox.h:65

◆ setAmps()

bool DalitzBWBox::setAmps ( MINT::IReturnRealForEvent< IDalitzEvent > *  amps)

Definition at line 78 of file DalitzBWBox.cpp.

78  {
79  _amps = amps;
80  if(0 == _amps) return false;
81  return true;
82 }
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBWBox.h:28

◆ setName()

void DalitzBWBox::setName ( const std::string &  name)
inline

Definition at line 62 of file DalitzBWBox.h.

62 { _name = name;}
const std::string & name() const
Definition: DalitzBWBox.h:63
std::string _name
Definition: DalitzBWBox.h:23

◆ setRnd()

bool DalitzBWBox::setRnd ( TRandom *  rnd = gRandom)

Definition at line 173 of file DalitzBWBox.cpp.

173  {
174  _rnd = rnd;
175  area().setRnd(_rnd);
176  return true;
177 }
bool setRnd(TRandom *rnd=gRandom)
const MappedDalitzBWArea & area() const
Definition: DalitzBWBox.h:65
TRandom * _rnd
Definition: DalitzBWBox.h:30

◆ setUnWeightPs()

void DalitzBWBox::setUnWeightPs ( bool  doSo = true)
inline

Definition at line 75 of file DalitzBWBox.h.

75 {_area.setUnWeightPs(doSo);}
void setUnWeightPs(bool doSo=true)
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25

◆ tryEventForOwner()

counted_ptr< DalitzEvent > DalitzBWBox::tryEventForOwner ( )

Definition at line 131 of file DalitzBWBox.cpp.

131  {
132 
134  return evt;
135 }
MINT::counted_ptr< DalitzEvent > tryNewEvent()

◆ tryNewEvent()

counted_ptr< DalitzEvent > DalitzBWBox::tryNewEvent ( )
private

Definition at line 163 of file DalitzBWBox.cpp.

163  {
164  bool dbThis=false;
166  if(dbThis && 0 != evt) {
167  cout << " DalitzBWBox::tryNewEvent() got event with weight "
168  << evt->getWeight() << endl;
169  }
170  return evt;
171 }
const MappedDalitzBWArea & area() const
Definition: DalitzBWBox.h:65
MINT::counted_ptr< DalitzEvent > tryEventForOwner()

◆ unWeightPs()

bool DalitzBWBox::unWeightPs ( )
inline

Definition at line 76 of file DalitzBWBox.h.

76 {return _area.unWeightPs();}
MappedDalitzBWArea _area
Definition: DalitzBWBox.h:25

◆ volume()

double DalitzBWBox::volume ( ) const

Definition at line 105 of file DalitzBWBox.cpp.

105  {
106  //return height(); //
107  bool dbThis=false;
108  if(dbThis){
109  cout << " DalitzBWBox::volume() " << name() << ": "
110  << area().integral() << " * " << height() << endl;
111  }
112  return area().integral() * height();
113 }
double & height()
Definition: DalitzBWBox.h:36
double integral() const
const std::string & name() const
Definition: DalitzBWBox.h:63
const MappedDalitzBWArea & area() const
Definition: DalitzBWBox.h:65

Member Data Documentation

◆ _amps

MINT::IReturnRealForEvent<IDalitzEvent>* DalitzBWBox::_amps
private

Definition at line 28 of file DalitzBWBox.h.

◆ _area

MappedDalitzBWArea DalitzBWBox::_area
private

Definition at line 25 of file DalitzBWBox.h.

◆ _height

double DalitzBWBox::_height
private

Definition at line 31 of file DalitzBWBox.h.

◆ _name

std::string DalitzBWBox::_name
private

Definition at line 23 of file DalitzBWBox.h.

◆ _pat

DalitzEventPattern DalitzBWBox::_pat
private

Definition at line 27 of file DalitzBWBox.h.

◆ _rnd

TRandom* DalitzBWBox::_rnd
private

Definition at line 30 of file DalitzBWBox.h.


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