MINT2
DalitzBoxSet.h
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:17:57 GMT
3 #ifndef DALITZ_BOX_SET
4 #define DALITZ_BOX_SET
5 
6 #include "Mint/DalitzBox.h"
8 #include "Mint/IEventGenerator.h"
9 
10 #include "Mint/counted_ptr.h"
11 
12 #include "TRandom.h"
13 
14 #include <vector>
15 #include <iostream>
16 
18 : public MINT::PolymorphVector<DalitzBox>
19 , virtual public MINT::IEventGenerator<IDalitzEvent>
20 {
21 
22  protected:
23  bool _ready;
26 
27  TRandom* _rnd;
28 
29 
30  double VolumeSum() const;
31  double AreaSum() const;
33  int pickRandomVolume();
34 
35  void setBoxPDFs();
36  void setBoxRnds();
37  void getBoxesReady();
38  virtual void getReady();
39 
40  public:
41  // the next two should be private
42  // public for now for debugging:
43  void makeRelations();
44  void removeDuplicates();
45 
46  void sortYourself();
48 
49  DalitzBoxSet(TRandom* rnd = gRandom);
50  DalitzBoxSet(const DalitzBoxSet& other);
51 
52  void add(const DalitzBox& box);
53  void add(const MINT::PolymorphVector<DalitzBox>& boxes);
54  void add(const DalitzBoxSet& boxes);
56 
57  DalitzBoxSet split(unsigned int nWays)const;
58  DalitzBoxSet splitIfWiderThan(double maxWidth)const;
59 
63  virtual DalitzEvent generateEvent();
64 
66 
67  virtual void print(std::ostream& os=std::cout) const;
68 
69 
70  virtual bool exhausted()const{return false;}
71  bool setRnd(TRandom* rnd);
72  virtual bool ensureFreshEvents();
73  virtual ~DalitzBoxSet(){}
74 };
75 
76 std::ostream& operator<<(std::ostream& os, const DalitzBoxSet& db);
77 
78 #endif
79 //
void makeRelations()
void setPDF(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
MINT::IReturnRealForEvent< IDalitzEvent > * _amps
Definition: DalitzBoxSet.h:25
void getBoxesReady()
void makeVolumeProbIntervals()
DalitzBoxSet split(unsigned int nWays) const
virtual bool exhausted() const
Definition: DalitzBoxSet.h:70
void sortYourself()
virtual MINT::counted_ptr< DalitzEvent > tryEvent()
virtual MINT::counted_ptr< IDalitzEvent > newEvent()
DalitzBoxSet splitIfWiderThan(double maxWidth) const
bool setRnd(TRandom *rnd)
virtual bool ensureFreshEvents()
virtual MINT::counted_ptr< DalitzEvent > generateEventForOwner()
void add(const DalitzBox &box)
double VolumeSum() const
TRandom * _rnd
Definition: DalitzBoxSet.h:27
virtual ~DalitzBoxSet()
Definition: DalitzBoxSet.h:73
virtual void getReady()
void callSortYourselfForDebug()
std::ostream & operator<<(std::ostream &os, const DalitzBoxSet &db)
double AreaSum() const
MINT::PolymorphVector< double > _volumeProbs
Definition: DalitzBoxSet.h:24
int pickRandomVolume()
virtual MINT::counted_ptr< DalitzEvent > tryWeightedEvent()
void removeDuplicates()
DalitzBoxSet(TRandom *rnd=gRandom)
virtual DalitzEvent generateEvent()
virtual void print(std::ostream &os=std::cout) const