MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SignalGenerator Class Reference

#include <SignalGenerator.h>

Inheritance diagram for SignalGenerator:
BaseGenerator MINT::IEventGenerator< IDalitzEvent > MINT::IEventGenerator< IDalitzEvent >

Public Member Functions

 SignalGenerator (const DalitzEventPattern &pat, TRandom *rnd=gRandom)
 
 SignalGenerator (const DalitzEventPattern &pat, IFastAmplitudeIntegrable *amps, TRandom *rnd=gRandom)
 
 SignalGenerator (const DalitzEventPattern &pat, double rB, double phase, TRandom *rnd=gRandom)
 
virtual ~SignalGenerator ()
 
virtual MINT::counted_ptr< IDalitzEventtryDalitzEvent ()
 
virtual MINT::counted_ptr< IDalitzEventnewDalitzEvent ()
 
virtual MINT::counted_ptr< IDalitzEventnewEvent ()
 
virtual bool exhausted () const
 
virtual bool ensureFreshEvents ()
 
bool am_I_generating_what_I_think_I_am_generating (int Nevents=100000)
 
bool compareGenerationMethodsForFullPDF (int Nevents=100000)
 
- Public Member Functions inherited from BaseGenerator
 BaseGenerator (TRandom *rnd=gRandom)
 
 BaseGenerator (const BaseGenerator &other)
 
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 unsetMothers3Momentum ()
 
bool mothers3MomentumIsSet () const
 
void setSaveEvents (const std::string &fname="GeneratorEvents.root", const std::string &opt="RECREATE")
 
void dontSaveEvents ()
 
void setUnweighted (bool uw=true)
 
void setWeighted (bool w=true)
 
void FillEventList (DalitzEventList &evtList, int NEvents)
 
void FillEventList (DiskResidentEventList &evtList, int NEvents)
 
void noPrintout ()
 
virtual ~BaseGenerator ()
 
- Public Member Functions inherited from MINT::IEventGenerator< IDalitzEvent >
virtual ~IEventGenerator ()
 

Protected Member Functions

bool makeBoxes ()
 
MINT::MinuitParameterSetmyMPS ()
 
- Protected Member Functions inherited from BaseGenerator
bool saveEvents ()
 
TVector3 mothers3Momentum () const
 

Protected Attributes

DalitzEventPattern _pat
 
MINT::MinuitParameterSet _myOwnPSet
 
MINT::counted_ptr< IFastAmplitudeIntegrable_counted_amps
 
IFastAmplitudeIntegrable_amps
 
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
 
- Protected Attributes inherited from BaseGenerator
std::string _fname
 
bool _unWeighted
 
MINT::counted_ptr< DiskResidentEventList_evtList
 
bool _noPrintout
 
TRandom * _rnd
 
MINT::counted_ptr< MINT::IReturnReal_mums_p
 
MINT::counted_ptr< MINT::IReturnReal_mums_cosTheta
 
MINT::counted_ptr< MINT::IReturnReal_mums_phi
 

Detailed Description

Definition at line 25 of file SignalGenerator.h.

Constructor & Destructor Documentation

◆ SignalGenerator() [1/3]

SignalGenerator::SignalGenerator ( const DalitzEventPattern pat,
TRandom *  rnd = gRandom 
)

Definition at line 11 of file SignalGenerator.cpp.

14  : BaseGenerator(rnd)
15  , _pat(pat)
16  , _myOwnPSet()
17  , _counted_amps(new FitAmpSum(pat, myMPS()))
20 {
21  _boxes->setRnd(rnd);
22 }
virtual bool setRnd(TRandom *rnd)=0
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
MINT::MinuitParameterSet _myOwnPSet
MINT::counted_ptr< IFastAmplitudeIntegrable > _counted_amps
DalitzEventPattern _pat
BaseGenerator(TRandom *rnd=gRandom)
IFastAmplitudeIntegrable * _amps
virtual MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > makeEventGenerator(const DalitzEventPattern &pat, TRandom *rnd=gRandom)=0
MINT::MinuitParameterSet * myMPS()
X * get() const
Definition: counted_ptr.h:123

◆ SignalGenerator() [2/3]

SignalGenerator::SignalGenerator ( const DalitzEventPattern pat,
IFastAmplitudeIntegrable amps,
TRandom *  rnd = gRandom 
)

Definition at line 55 of file SignalGenerator.cpp.

58  : BaseGenerator(rnd)
59  , _pat(pat)
60  , _myOwnPSet()
61  , _counted_amps(0)
62  , _amps(amps)
64 {
65  _boxes->setRnd(_rnd);
66 }
virtual bool setRnd(TRandom *rnd)=0
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
TRandom * _rnd
Definition: BaseGenerator.h:37
MINT::MinuitParameterSet _myOwnPSet
MINT::counted_ptr< IFastAmplitudeIntegrable > _counted_amps
DalitzEventPattern _pat
BaseGenerator(TRandom *rnd=gRandom)
IFastAmplitudeIntegrable * _amps
virtual MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > makeEventGenerator(const DalitzEventPattern &pat, TRandom *rnd=gRandom)=0

◆ SignalGenerator() [3/3]

SignalGenerator::SignalGenerator ( const DalitzEventPattern pat,
double  rB,
double  phase,
TRandom *  rnd = gRandom 
)

Definition at line 23 of file SignalGenerator.cpp.

28  : BaseGenerator(rnd)
29  , _pat(pat)
30  , _myOwnPSet()
31  , _counted_amps(0)
32  , _amps(0)
33  , _boxes(0)
34 {
35  DalitzEventPattern cpPat(pat);
36  cpPat[0].antiThis();
37 
38  counted_ptr<FitAmpSum> fs(new FitAmpSum(pat, myMPS()));
39  FitAmpSum cpAmps(pat, myMPS());
40  cpAmps *= polar(rB, phase);
41  fs->add(cpAmps);
44 
45  makeBoxes();
46 
47  /*
48  counted_ptr< IUnweightedEventGenerator<IDalitzEvent> >
49  bpt(fs->makeEventGenerator());
50 
51  _boxes = bpt;
52  _boxes->setRnd(_rnd);
53  */
54 }
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
MINT::MinuitParameterSet _myOwnPSet
MINT::counted_ptr< IFastAmplitudeIntegrable > _counted_amps
DalitzEventPattern _pat
BaseGenerator(TRandom *rnd=gRandom)
IFastAmplitudeIntegrable * _amps
MINT::MinuitParameterSet * myMPS()
X * get() const
Definition: counted_ptr.h:123

◆ ~SignalGenerator()

virtual SignalGenerator::~SignalGenerator ( )
inlinevirtual

Definition at line 56 of file SignalGenerator.h.

56 {}

Member Function Documentation

◆ am_I_generating_what_I_think_I_am_generating()

bool SignalGenerator::am_I_generating_what_I_think_I_am_generating ( int  Nevents = 100000)

Definition at line 134 of file SignalGenerator.cpp.

134  {
135  if(0 == _boxes) return false;
137 
138 }
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
virtual bool am_I_generating_what_I_think_I_am_generating(int)

◆ compareGenerationMethodsForFullPDF()

bool SignalGenerator::compareGenerationMethodsForFullPDF ( int  Nevents = 100000)

Definition at line 139 of file SignalGenerator.cpp.

139  {
140  if(0 == _boxes) return false;
142 }
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes

◆ ensureFreshEvents()

bool SignalGenerator::ensureFreshEvents ( )
virtual

Reimplemented from BaseGenerator.

Definition at line 126 of file SignalGenerator.cpp.

126  {
129 }
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
virtual bool ensureFreshEvents()
virtual bool ensureFreshEvents()=0

◆ exhausted()

virtual bool SignalGenerator::exhausted ( ) const
inlinevirtual

Reimplemented from BaseGenerator.

Definition at line 67 of file SignalGenerator.h.

67 {return false;}

◆ makeBoxes()

bool SignalGenerator::makeBoxes ( )
protected

Definition at line 77 of file SignalGenerator.cpp.

77  {
78  if(0 == _amps) return 0;
81  _boxes = bpt;
82  if(0 == _boxes) return 0;
83  _boxes->setRnd(_rnd);
84  return true;
85 }
virtual bool setRnd(TRandom *rnd)=0
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
TRandom * _rnd
Definition: BaseGenerator.h:37
DalitzEventPattern _pat
IFastAmplitudeIntegrable * _amps
virtual MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > makeEventGenerator(const DalitzEventPattern &pat, TRandom *rnd=gRandom)=0

◆ myMPS()

MINT::MinuitParameterSet * SignalGenerator::myMPS ( )
protected

Definition at line 68 of file SignalGenerator.cpp.

68  {
69  // seems like an unnecessary complication
70  // but it's a "hook" to add the option to pass
71  // other MinuitParameterSets to SignalGenerator
72  // should this become necessary.
73  return & _myOwnPSet;
74 }
MINT::MinuitParameterSet _myOwnPSet

◆ newDalitzEvent()

counted_ptr< IDalitzEvent > SignalGenerator::newDalitzEvent ( )
virtual

Definition at line 109 of file SignalGenerator.cpp.

109  {
110 // bool dbThis=false;
111  counted_ptr<IDalitzEvent> evtPtr(0);
112  int counter(0);
113  int largeNumber(1000000);
114 
115  do{
116  evtPtr = tryDalitzEvent();
117  }while(0 == evtPtr && counter++ < largeNumber);
118  if(saveEvents()) _evtList->Add(evtPtr);
119 /* if(dbThis){
120  cout << "SignalGenerator::newDalitzEvent:"
121  << " just generated this event:\n" << *evtPtr << endl;
122  }*/
123  return evtPtr;
124 }
MINT::counted_ptr< DiskResidentEventList > _evtList
Definition: BaseGenerator.h:31
bool saveEvents()
Definition: BaseGenerator.h:34
virtual bool Add(const DalitzEvent &evt)
virtual MINT::counted_ptr< IDalitzEvent > tryDalitzEvent()

◆ newEvent()

counted_ptr< IDalitzEvent > SignalGenerator::newEvent ( )
virtual

Implements BaseGenerator.

Definition at line 130 of file SignalGenerator.cpp.

130  {
132 }
virtual MINT::counted_ptr< IDalitzEvent > newDalitzEvent()

◆ tryDalitzEvent()

counted_ptr< IDalitzEvent > SignalGenerator::tryDalitzEvent ( )
virtual

Definition at line 87 of file SignalGenerator.cpp.

87  {
88 // bool dbThis=false;
89  if(0 == _boxes) makeBoxes();
90  if(_unWeighted){
92  if(0 != evtPtr) evtPtr->setMothers3Momentum(mothers3Momentum());
93 /* if(dbThis && 0 != evtPtr){
94  cout << "SignalGenerator::tryDalitzEvent(): made un-weighted event "
95  << "with weight " << evtPtr->getWeight() << endl;
96  }*/
97  return evtPtr;
98  }else{
100  if(0 != evtPtr) evtPtr->setMothers3Momentum(mothers3Momentum());
101 // if(dbThis && 0 != evtPtr){
102 // cout << "SignalGenerator::tryDalitzEvent(): made weighted event "
103 // << "with weight " << evtPtr->getWeight() << endl;
104 // }
105  return evtPtr;
106  }
107 }
MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > _boxes
virtual counted_ptr< RETURN_TYPE > newEvent()=0
virtual counted_ptr< RETURN_TYPE > newUnweightedEvent()=0
TVector3 mothers3Momentum() const

Member Data Documentation

◆ _amps

IFastAmplitudeIntegrable* SignalGenerator::_amps
protected

Definition at line 35 of file SignalGenerator.h.

◆ _boxes

MINT::counted_ptr<MINT::IUnweightedEventGenerator<IDalitzEvent> > SignalGenerator::_boxes
protected

Definition at line 36 of file SignalGenerator.h.

◆ _counted_amps

MINT::counted_ptr<IFastAmplitudeIntegrable> SignalGenerator::_counted_amps
protected

Definition at line 34 of file SignalGenerator.h.

◆ _myOwnPSet

MINT::MinuitParameterSet SignalGenerator::_myOwnPSet
protected

Definition at line 30 of file SignalGenerator.h.

◆ _pat

DalitzEventPattern SignalGenerator::_pat
protected

Definition at line 29 of file SignalGenerator.h.


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