MINT2
BaseGenerator.h
Go to the documentation of this file.
1 #ifndef BASE_GENERATOR_HH
2 #define BASE_GENERATOR_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:59 GMT
5 
6 #include "Mint/IEventGenerator.h"
7 #include "Mint/IDalitzEvent.h"
9 
12 
13 #include "Mint/DalitzEventList.h"
15 
16 #include "Mint/FitAmpSum.h"
17 #include "Mint/DalitzBWBoxSet.h"
18 
19 #include "Mint/IReturnReal.h"
20 
21 #include "Mint/counted_ptr.h"
22 
23 #include "TRandom.h"
24 
25 #include <string>
26 
27 class BaseGenerator : virtual public MINT::IEventGenerator<IDalitzEvent> {
28  protected:
29  std::string _fname;
32  bool _noPrintout;
33 
34  bool saveEvents(){return 0 != _evtList;}
35  //virtual MINT::counted_ptr<DalitzEvent> tryDalitzEvent()=0;
36 
37  TRandom* _rnd;
38 
42 
43  TVector3 mothers3Momentum() const;
44 
45  public:
46  BaseGenerator(TRandom* rnd=gRandom);
47  BaseGenerator(const BaseGenerator& other);
48 
54  );
55  void unsetMothers3Momentum();
56  bool mothers3MomentumIsSet() const;
57 
58  void setSaveEvents(const std::string& fname="GeneratorEvents.root"
59  , const std::string& opt="RECREATE");
60  void dontSaveEvents();
61  void setUnweighted(bool uw=true){_unWeighted = uw;}
62  void setWeighted(bool w=true){_unWeighted = ! w;}
63 
64  void FillEventList(DalitzEventList& evtList, int NEvents);
65  void FillEventList(DiskResidentEventList& evtList, int NEvents);
66 
67  // this one below is required by MINT::IEventGenerator<IDalitzEvent>
69 
70  virtual bool exhausted() const{return false;}
71  virtual bool ensureFreshEvents();
72 
73  void noPrintout(){_noPrintout=true;}
74 
75  virtual ~BaseGenerator();
76 };
77 
78 #endif
79 //
MINT::counted_ptr< MINT::IReturnReal > _mums_p
Definition: BaseGenerator.h:39
MINT::counted_ptr< DiskResidentEventList > _evtList
Definition: BaseGenerator.h:31
virtual bool ensureFreshEvents()
virtual ~BaseGenerator()
MINT::counted_ptr< MINT::IReturnReal > _mums_cosTheta
Definition: BaseGenerator.h:40
TRandom * _rnd
Definition: BaseGenerator.h:37
void noPrintout()
Definition: BaseGenerator.h:73
bool saveEvents()
Definition: BaseGenerator.h:34
std::string _fname
Definition: BaseGenerator.h:29
void setSaveEvents(const std::string &fname="GeneratorEvents.root", const std::string &opt="RECREATE")
bool mothers3MomentumIsSet() const
void dontSaveEvents()
void setMothers3Momentum(MINT::counted_ptr< MINT::IReturnReal > p, MINT::counted_ptr< MINT::IReturnReal > cosTheta=(MINT::counted_ptr< MINT::IReturnReal >) 0, MINT::counted_ptr< MINT::IReturnReal > phi=(MINT::counted_ptr< MINT::IReturnReal >) 0)
void setWeighted(bool w=true)
Definition: BaseGenerator.h:62
MINT::counted_ptr< MINT::IReturnReal > _mums_phi
Definition: BaseGenerator.h:41
void unsetMothers3Momentum()
BaseGenerator(TRandom *rnd=gRandom)
virtual bool exhausted() const
Definition: BaseGenerator.h:70
void setUnweighted(bool uw=true)
Definition: BaseGenerator.h:61
TVector3 mothers3Momentum() const
void FillEventList(DalitzEventList &evtList, int NEvents)
virtual MINT::counted_ptr< IDalitzEvent > newEvent()=0