MINT2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MakePreIntegratedAmplitudes Class Reference

#include <MakePreIntegratedAmplitudes.h>

Public Member Functions

 MakePreIntegratedAmplitudes (const DalitzEventPattern &pat, const std::string &opt, double prec, const std::string &integEventsFname="", const std::string &fnamePrefix="", const std::string &generateEventsIfNeeded="DoGenerate", TRandom *rnd=gRandom)
 
const std::string & fname () const
 
const std::string & eventsFname () const
 
std::string defaultEventsFname () const
 
bool doit ()
 

Private Member Functions

const std::string & makeFname (const std::string &prefix)
 
const std::string & makeEventsFname ()
 
bool includeCPCon () const
 

Private Attributes

DalitzEventPattern _pat
 
std::string _opt
 
double _prec
 
std::string _fname
 
std::string _eventsFname
 
bool _generateEventsIfNeeded
 
TRandom * _rnd
 

Detailed Description

Definition at line 8 of file MakePreIntegratedAmplitudes.h.

Constructor & Destructor Documentation

◆ MakePreIntegratedAmplitudes()

MakePreIntegratedAmplitudes::MakePreIntegratedAmplitudes ( const DalitzEventPattern pat,
const std::string &  opt,
double  prec,
const std::string &  integEventsFname = "",
const std::string &  fnamePrefix = "",
const std::string &  generateEventsIfNeeded = "DoGenerate",
TRandom *  rnd = gRandom 
)

Definition at line 15 of file MakePreIntegratedAmplitudes.cpp.

23  : _pat(pat)
24  , _opt(opt)
25  , _prec(prec)
26  , _fname("noName")
27  , _eventsFname(integEventsFname)
28  , _generateEventsIfNeeded("DoGenerate" == generateEventsIfNeeded)
29  , _rnd(rnd)
30 {
31  makeFname(fnamePrefix);
32  if("" == _eventsFname) makeEventsFname();
33 }
const std::string & makeFname(const std::string &prefix)

Member Function Documentation

◆ defaultEventsFname()

std::string MakePreIntegratedAmplitudes::defaultEventsFname ( ) const

Definition at line 67 of file MakePreIntegratedAmplitudes.cpp.

67  {
68  return "IntegEvents" + _fname + ".root";
69 }

◆ doit()

bool MakePreIntegratedAmplitudes::doit ( )

Definition at line 75 of file MakePreIntegratedAmplitudes.cpp.

75  {
76 
77  FitAmpSum fitAmps(_pat, "", _opt);
78  if(includeCPCon()){
79  DalitzEventPattern antiPat = _pat;
80  antiPat[0].antiThis();
81  FitAmpSum antiFa(antiPat, _opt);
82  fitAmps.add(antiFa);
83  }
84  fitAmps.setAllAmpsTo(std::complex<double>(1,0));
85 
86  counted_ptr<SignalGenerator> genSgPtr(0);
88  cout << "MakePreIntegratedAmplitudes::doit()"
89  << " will generate events if I don't find enough in file "
90  << eventsFname()
91  << " to reach precision " << _prec
92  << endl;
94  genSgPtr = ptr;
95  }else{
96  cout << "MakePreIntegratedAmplitudes::doit()"
97  << " will NOT generate my own events "
98  << " even if I don't find enough in file "
99  << eventsFname()
100  << " to reach precision " << _prec
101  << endl;
102  }
103  FromFileGenerator ffg(eventsFname(), genSgPtr.get());
104  FastAmplitudeIntegrator integ(_pat, &fitAmps, &ffg, _rnd, _prec);
105  integ.save(fname());
106 
107  cout << "Saved integration result for " << _pat
108  << " in this file: "
109  << fname()
110  << endl;
111  return true;
112 }
const std::string & fname() const
const std::string & eventsFname() const

◆ eventsFname()

const std::string& MakePreIntegratedAmplitudes::eventsFname ( ) const
inline

Definition at line 31 of file MakePreIntegratedAmplitudes.h.

◆ fname()

const std::string& MakePreIntegratedAmplitudes::fname ( ) const
inline

Definition at line 30 of file MakePreIntegratedAmplitudes.h.

◆ includeCPCon()

bool MakePreIntegratedAmplitudes::includeCPCon ( ) const
private

Definition at line 70 of file MakePreIntegratedAmplitudes.cpp.

70  {
71  // return false; // for now.
72  return (_pat[0].props()->charge() == "0" && _pat[0].hasDistinctAnti());
73 }

◆ makeEventsFname()

const std::string & MakePreIntegratedAmplitudes::makeEventsFname ( )
private

Definition at line 62 of file MakePreIntegratedAmplitudes.cpp.

◆ makeFname()

const std::string & MakePreIntegratedAmplitudes::makeFname ( const std::string &  prefix)
private

Definition at line 37 of file MakePreIntegratedAmplitudes.cpp.

37  {
38 
39  if(_pat.empty()){
40  _fname = prefix + "noPattern";
41  return _fname;
42  }
43  std::string name = _pat[0].name();
44  if(includeCPCon()){
45  DecayTreeItem antiMum = _pat[0];
46  antiMum.antiThis();
47  name += "_" + antiMum.name();
48  }
49  name += "_to_";
50  if(_pat.size() < 2){
51  _fname = prefix + name;
52  return _fname;
53  }
54  for(unsigned int i=1; i < _pat.size(); i++){
55  name += _pat[i].name();
56  }
57  _fname = prefix + name;
58  return _fname;
59 }
std::string name() const
unsigned int size() const
std::string name() const

Member Data Documentation

◆ _eventsFname

std::string MakePreIntegratedAmplitudes::_eventsFname
private

Definition at line 13 of file MakePreIntegratedAmplitudes.h.

◆ _fname

std::string MakePreIntegratedAmplitudes::_fname
private

Definition at line 12 of file MakePreIntegratedAmplitudes.h.

◆ _generateEventsIfNeeded

bool MakePreIntegratedAmplitudes::_generateEventsIfNeeded
private

Definition at line 14 of file MakePreIntegratedAmplitudes.h.

◆ _opt

std::string MakePreIntegratedAmplitudes::_opt
private

Definition at line 10 of file MakePreIntegratedAmplitudes.h.

◆ _pat

DalitzEventPattern MakePreIntegratedAmplitudes::_pat
private

Definition at line 9 of file MakePreIntegratedAmplitudes.h.

◆ _prec

double MakePreIntegratedAmplitudes::_prec
private

Definition at line 11 of file MakePreIntegratedAmplitudes.h.

◆ _rnd

TRandom* MakePreIntegratedAmplitudes::_rnd
private

Definition at line 15 of file MakePreIntegratedAmplitudes.h.


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