MINT2
DalitzPdfSaveInteg.cpp
Go to the documentation of this file.
1 
3 
5 #include <string>
6 #include "TRandom.h"
7 #include "TRandom3.h"
8 #include "Mint/SignalGenerator.h"
11 
12 using namespace std;
13 using namespace MINT;
14 
16  , double precision
17  , const std::string& integInputFiles
18  , const std::string& integEvtFile
19  , const std::string& topUpIntegOption
20  , MinuitParameterSet* mps
21  , const std::string& integOutputFile
22  )
23  : DalitzPdfBaseFastInteg(pat, 0, mps, precision)
24  , _localRnd(0)
25  , _sgGen(0)
26  , _fileGen(0)
27  , _integratorEventFile(integEvtFile)
28  , _integratorOutputFile(integOutputFile)
29  {
30  // _pat = pat;
31  setIntegratorFileName(integInputFiles);
32 
33  cout << "pset pointer in DalitzPdfSaveInteg " << mps << endl;
34  cout << "amps pointer in DalitzPdfSaveInteg " << _amps << endl;
35 
36  if("" == integOutputFile) _integratorOutputFile=integInputFiles;
37 
38  // here, SignalGenerator is used by FromFileGenerator, to fill
39  // up missing events in case more are needed than found in the
40  // file. Since we don't know with which random seed the
41  // events in the file were generated, we supply a random
42  // number generator with randomised seed.
43  _localRnd = new TRandom3(time(0));
44  if("topUp" == topUpIntegOption){
45  if(_pat.empty()){
46  cout << "cannot make SignalGenerator, pattern is empty" << endl;
47  cout << "bailing out" << endl;
48  throw "no pattern, no signal generator";
49  }
52  _sgGen->dontSaveEvents();// saving events is done by FromFileGenerator
53  }else{
54  _sgGen = 0;
55  }
58  }
59 
62  , double precision
63  , const std::string& integInputFiles
64  , const std::string& integEvtFile
65  , const std::string& topUpIntegOption
66  , const std::string& integOutputFile
67  )
68  : DalitzPdfBaseFastInteg(pat, 0, amps, precision)
69  , _localRnd(0)
70  , _sgGen(0)
71  , _fileGen(0)
72  , _integratorEventFile(integEvtFile)
73  , _integratorOutputFile(integOutputFile)
74  {
75  //_pat = pat;
76  setIntegratorFileName(integInputFiles);
77 
78  if("" == integOutputFile) _integratorOutputFile=integInputFiles;
79 
80  // here, SignalGenerator is used by FromFileGenerator, to fill
81  // up missing events in case more are needed than found in the
82  // file. Since we don't know with which random seed the
83  // events in the file were generated, we supply a random
84  // number generator with randomised seed.
85  _localRnd = new TRandom3(time(0));
86  if("topUp" == topUpIntegOption){
87  if(0 == _amps){
88  cout << "cannot make SignalGenerator, _amps are empty" << endl;
89  cout << "bailing out" << endl;
90  throw "no amps, no signal generator";
91  }
92  if(_pat.empty()){
93  cout << "cannot make SignalGenerator, pattern is empty" << endl;
94  cout << "bailing out" << endl;
95  throw "no pattern, no signal generator";
96  }
99  _sgGen->dontSaveEvents();// saving events is done by FromFileGenerator
100  }else{
101  _sgGen = 0;
102  }
105  }
106 
107 //IFastAmplitudeIntegrable* DalitzPdfSaveInteg::getAmpSum(){ return _amps;}
108 
111  if(0 != _fileGen) delete _fileGen;
112  if(0 != _sgGen) delete _sgGen;
113  if(0 != _localRnd) delete _localRnd;
114 }
115 //
116 
void setIntegratorFileName(const std::string &commaSeparatedList)
bool saveIntegrator(const std::string &fname) const
std::string _integratorOutputFile
DalitzPdfSaveInteg(const DalitzEventPattern &pat, double precision=1.e-4, const std::string &integInputFiles="Integrator", const std::string &integEvtFile="integEvtFile.root", const std::string &topUpIntegOption="topUp", MINT::MinuitParameterSet *mps=0, const std::string &integOutputFile="")
SignalGenerator * _sgGen
void dontSaveEvents()
void setWeighted(bool w=true)
Definition: BaseGenerator.h:62
IFastAmplitudeIntegrable * _amps
FromFileGenerator * _fileGen
void setEventGenerator(MINT::IEventGenerator< IDalitzEvent > *g)
std::string _integratorEventFile