MINT2
DalitzPhaseSpaceBox.cpp
Go to the documentation of this file.
3 
4 #include <iostream>
5 #include <ctime>
6 
7 using namespace std;
8 using namespace MINT;
9 
11  : _name("noName")
12  , _pat()
13  , _rnd(rnd)
14  , _height(1)
15  , _weight(1)
16  , _phaseSpaceIntegral(-1)
17 {}
18 
19 
21  , TRandom* rnd)
22  : _name("noName")
23  , _pat(pat)
24  , _rnd(rnd)
25  , _height(1)
26  , _weight(1)
27  , _phaseSpaceIntegral(-1)
28 {
30 }
31 
33  : _name(other._name)
34  , _pat(other._pat)
35  , _rnd(other._rnd)
36  , _height(other._height)
37  , _weight(other._weight)
38  , _phaseSpaceIntegral(other._phaseSpaceIntegral)
39 {
40 }
41 
43 }
44 
46  _pat = pat;
48 }
51  return _phaseSpaceIntegral;
52 }
54  return _phaseSpaceIntegral;
55 }
58  return _phaseSpaceIntegral;
59 }
60 
62 
63  return (evt.phaseSpace() > 0);
64 }
65 
67  // bool dbThis = false;
68  return phaseSpaceIntegral() * height();
69 }
70 
72  // returns generator value w/o phase space - constant, here.
73  return genValue();
74 }
76  bool dbThis=false;
77  if(dbThis) {
78  cout << "DalitzPhaseSpaceBox::genValue called " << endl;
79  }
80 
81  double returnVal = height() * weight();
82  if(dbThis) {
83  cout << "DalitzPhaseSpaceBox::genValue returning "
84  << weight() << " * " << height()
85  << " = "
86  << returnVal << endl;
87  }
88  return returnVal;
89 }
90 
92 
94  return evt;
95 }
96 
98  // bool dbThis=false;
99  if(_pat.numDaughters() < 2){
100  counted_ptr<DalitzEvent> zero(0);
101  return zero;
102  }
104  evtPtr->setWeight(weight());
105  // above constructor makes a phase space event, weight 1.
106  if(0 != evtPtr && _pat[0] < 0) evtPtr->P_conjugateYourself();
107  // the above ensures that, for the same random seed,
108  // identical but CP conjugate events are generated
109  // for D->f and Dbar->fbar.
110  // Note that this step of the event generation is
111  // completely P-even, and the event generation would
112  // still be correct without this P-conjugation. The
113  // crucial P-senstive step is the reweighting applied
114  // later, which will then take into account the full
115  // amplitude model. The P-conjugation here is just to keep the
116  // random numbers in sync between CP conjugate event generations.
117  return evtPtr;
118 }
119 
121  return makeEventForOwner();
122 }
123 
124 bool DalitzPhaseSpaceBox::setRnd(TRandom* rnd){
125  _rnd = rnd;
126  return true;
127 }
128 void DalitzPhaseSpaceBox::print(std::ostream& os) const{
129  os << "DalitzPhaseSpaceBox: " << name();
130 }
131 
133  cout << "DalitzPhaseSpaceBox: can't check integration, yet - improve me!" << endl;
134  return true;
135 }
136 
137 ostream& operator<<(ostream& os, const DalitzPhaseSpaceBox& box){
138  box.print(os);
139  return os;
140 }
141 //
virtual void setWeight(double w)
void setPattern(const DalitzEventPattern &pat)
MINT::counted_ptr< DalitzEvent > tryNewEvent()
DalitzEventPattern _pat
virtual double phaseSpace() const
virtual void P_conjugateYourself()
MINT::counted_ptr< DalitzEvent > tryEventForOwner()
bool insideArea(const DalitzEvent &evt) const
MINT::counted_ptr< DalitzEvent > makeEventForOwner()
DalitzPhaseSpaceBox(TRandom *rnd=gRandom)
const std::string & name() const
void print(std::ostream &os=std::cout) const
double phaseSpaceIntegral() const
ostream & operator<<(ostream &os, const DalitzPhaseSpaceBox &box)
bool setRnd(TRandom *rnd=gRandom)
double phaseSpaceIntegral_upTo4body(const DalitzEventPattern &pat)