MINT2
DalitzBox.h
Go to the documentation of this file.
1 #ifndef DALITZ_BOX_HH
2 #define DALITZ_BOX_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:57 GMT
5 
9 #include "Mint/DalitzEventList.h"
10 
11 #include "Mint/IDalitzEvent.h"
13 
14 #include "Mint/counted_ptr.h"
15 
16 #include "TRandom.h"
17 
18 #include <vector>
19 #include <string>
20 #include <iostream>
21 
22 class DalitzBox{
25 
26  int _number;
27  std::string _name;
28 
29  bool _ready;
30 
32 
35 
36  TRandom* _rnd;
37  double _height;
39 
40  int _nTries;
42  const DalitzBox* _daddy;
43 
45  unsigned int _heightProblems;
46 
48 
49  int makeFlatEventsKeepAll(int N);
50 
51  bool estimateHeight(std::vector<double>& vals);
52  bool estimateHeight_old(std::vector<double>& vals);
53  bool estimateHeightMinuit();
54 
55  bool makeStarterSet();
56  int throwAwayData(const std::vector<double>& vals);
57 
61 
62  double getEventsPdf(DalitzEvent& evt);
63 
64  // void getReady();
65  public:
66  void getReady();
67 
68  void setFlatPhaseSpace(bool flat=true){
69  _flatPhaseSpace = flat;
70  }
71  double amps(IDalitzEvent& ep);
72  double phaseSpace(IDalitzEvent& ep);
73  double ampsWithPhaseSpace(IDalitzEvent& ep);
74 
75  DalitzBox();
76  DalitzBox(const DalitzEventPattern& pat
78  , TRandom* rnd = gRandom
79  );
80 
81  DalitzBox(const DalitzEventPattern& pat
82  , const DalitzCoordinate& limit
84  , TRandom* rnd = gRandom);
85 
86  DalitzBox(const DalitzEventPattern& pat
87  , const std::vector<DalitzCoordinate>& limits
89  , TRandom* rnd = gRandom);
90 
91  DalitzBox(const DalitzBox& other);
92  ~DalitzBox();
93 
94  void setNumber(int num){_number = num;}
95  int number() const{return _number;}
96 
97  void setName(const std::string& name){ _name = name;}
98  const std::string& name() const{return _name;}
99 
100  void setGuessedHeight(double h){_guessedHeight = h;}
101  double guessedHeight() const{return _guessedHeight;}
102 
103  const MappedDalitzArea& area()const{return _area;}
105 
106  double height() const{
107  return _height;
108  }
109  double setHeight(double h){
110  return _height = h;
111  }
113  const DalitzEventList& eventList() const{ return _eventList;}
114 
115  double volume() const;
116 
117  void setDaddy(const DalitzBox* daddy);
119 
120  bool insideArea(const DalitzEvent& evt) const;
121  bool insideDaddysArea(const DalitzEvent& evt) const;
122  bool insideMyOrDaddysArea(const DalitzEvent& evt) const;
123 
125 
127 
130  }
131 
132  std::vector<DalitzBox> split(unsigned int nWays) const;
133  std::vector<DalitzBox> splitIfWiderThan(double maxWidth) const;
134 
135  bool setRnd(TRandom* rnd=gRandom);
136 
137  void print(std::ostream& os = std::cout) const;
138 };
139 
140 std::ostream& operator<<(std::ostream& os, const DalitzBox& box);
141 
142 
143 #endif
144 //
double amps(IDalitzEvent &ep)
Definition: DalitzBox.cpp:268
double _max_s4
Definition: DalitzBox.h:23
int number() const
Definition: DalitzBox.h:95
MappedDalitzArea _area
Definition: DalitzBox.h:31
double ampsWithPhaseSpace(IDalitzEvent &ep)
Definition: DalitzBox.cpp:285
void setFlatPhaseSpace(bool flat=true)
Definition: DalitzBox.h:68
void print(std::ostream &os=std::cout) const
Definition: DalitzBox.cpp:961
std::ostream & operator<<(std::ostream &os, const DalitzBox &box)
void encloseInPhaseSpaceArea()
Definition: DalitzBox.h:128
double setHeight(double h)
Definition: DalitzBox.h:109
bool _flatPhaseSpace
Definition: DalitzBox.h:47
bool estimateHeight(std::vector< double > &vals)
Definition: DalitzBox.cpp:406
void setGuessedHeight(double h)
Definition: DalitzBox.h:100
MINT::counted_ptr< DalitzEvent > tryWeightedEventForOwner()
Definition: DalitzBox.cpp:867
const DalitzBox * _daddy
Definition: DalitzBox.h:42
DalitzEventList _eventList
Definition: DalitzBox.h:38
double phaseSpace(IDalitzEvent &ep)
Definition: DalitzBox.cpp:280
double height() const
Definition: DalitzBox.h:106
bool estimateHeight_old(std::vector< double > &vals)
Definition: DalitzBox.cpp:522
bool insideArea(const DalitzEvent &evt) const
Definition: DalitzBox.cpp:214
bool setRnd(TRandom *rnd=gRandom)
Definition: DalitzBox.cpp:974
double volume() const
Definition: DalitzBox.cpp:788
double _max_s3
Definition: DalitzBox.h:23
bool makeStarterSet()
Definition: DalitzBox.cpp:623
double guessedHeight() const
Definition: DalitzBox.h:101
int _number
Definition: DalitzBox.h:26
const std::string & name() const
Definition: DalitzBox.h:98
double _max_s2
Definition: DalitzBox.h:23
double _maxPhaseSpace
Definition: DalitzBox.h:24
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBox.h:34
const MappedDalitzArea & area() const
Definition: DalitzBox.h:103
double getEventsPdf(DalitzEvent &evt)
Definition: DalitzBox.cpp:830
const DalitzEventList & eventList() const
Definition: DalitzBox.h:113
double _height
Definition: DalitzBox.h:37
int _nTries
Definition: DalitzBox.h:40
double _max_s0
Definition: DalitzBox.h:23
double _max_s1
Definition: DalitzBox.h:23
TRandom * _rnd
Definition: DalitzBox.h:36
std::vector< DalitzBox > splitIfWiderThan(double maxWidth) const
Definition: DalitzBox.cpp:943
std::string _name
Definition: DalitzBox.h:27
void setName(const std::string &name)
Definition: DalitzBox.h:97
int throwAwayData(const std::vector< double > &vals)
Definition: DalitzBox.cpp:727
void encloseInPhaseSpaceArea()
MINT::counted_ptr< DalitzEvent > tryNewEvent()
Definition: DalitzBox.cpp:839
void getReady()
Definition: DalitzBox.cpp:796
int _nEventsForTries
Definition: DalitzBox.h:41
int makeFlatEventsKeepAll(int N)
Definition: DalitzBox.cpp:241
bool _ready
Definition: DalitzBox.h:29
MINT::counted_ptr< DalitzEvent > popEventFromList()
Definition: DalitzBox.cpp:908
unsigned int _heightProblems
Definition: DalitzBox.h:45
bool estimateHeightMinuit()
Definition: DalitzBox.cpp:296
MINT::counted_ptr< DalitzEvent > tryEventForOwner()
Definition: DalitzBox.cpp:817
bool insideMyOrDaddysArea(const DalitzEvent &evt) const
Definition: DalitzBox.cpp:237
std::vector< DalitzBox > split(unsigned int nWays) const
Definition: DalitzBox.cpp:917
MINT::counted_ptr< DalitzEvent > tryEventFromList()
Definition: DalitzBox.cpp:894
DalitzEventList & eventList()
Definition: DalitzBox.h:112
MappedDalitzArea & area()
Definition: DalitzBox.h:104
bool setAmps(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
Definition: DalitzBox.cpp:198
void setDaddy(const DalitzBox *daddy)
Definition: DalitzBox.cpp:209
void setNumber(int num)
Definition: DalitzBox.h:94
double _guessedHeight
Definition: DalitzBox.h:44
DalitzEventPattern _pat
Definition: DalitzBox.h:33
bool insideDaddysArea(const DalitzEvent &evt) const
Definition: DalitzBox.cpp:232