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

#include <AmpInitialiser.h>

Public Member Functions

 AmpInitialiser ()
 
 AmpInitialiser (const std::string &StandardisedDecayTreeName, const std::string &lopt="", const std::string &namePrefix="", const std::string &linshapePrefix="", const std::vector< double > &numOpts=std::vector< double >(), bool autoSwap=true, int index=-1)
 
 AmpInitialiser (const DecayTree &dt_in, char SPD_in='?', const std::string &lopt="", const std::string &namePrefix="", const std::string &linshapePrefix="", const std::vector< double > &numOpts=std::vector< double >(), bool autoSwap=true, int index=-1)
 
 AmpInitialiser (const DecayTree &dt_in, const std::string &lopt, const std::string &namePrefix="", const std::string &linshapePrefix="", const std::vector< double > &numOpts=std::vector< double >(), bool autoSwap=true, int index=-1)
 
 AmpInitialiser (const AmpInitialiser &other, const std::string &addedPrefix="", const std::string &addedLineshapePrefix="")
 
AmpInitialiseroperator= (const AmpInitialiser &rhs)
 
const DecayTreetree () const
 
DalitzEventPattern getEventPattern () const
 
void setTree (const DecayTree &dt_in)
 
char SPD () const
 
void setSPD (char SPD_in)
 
const std::string & lopt () const
 
void setLopt (const std::string &lopt_in)
 
void addLopt (const std::string &lopt_in)
 
void setNumOpts (const std::vector< double > &numOpts_in=std::vector< double >())
 
void setNumOpts (double n1)
 
void setNumOpts (double n1, double n2)
 
void setNumOpts (double n1, double n2, double n3)
 
const std::vector< double > & numOpts () const
 
bool autoSwap () const
 
bool setAutoSwap (bool autoSwap_in=true)
 
const std::string & prefix () const
 
void addPrefix (const std::string &namePrefix)
 
const std::string & lsPrefix () const
 
void addLsPrefix (const std::string &linshapePrefix)
 
int index () const
 
void setIndex (int index)
 
std::string indexString () const
 
std::string uniqueName () const
 
std::string name () const
 
 ~AmpInitialiser ()
 

Private Attributes

DecayTree _dt
 
char _SPD
 
bool _valid
 
std::string _prefix
 
std::string _lsPrefix
 
std::string _lopt
 
std::vector< double > _numOpts
 
bool _autoSwap
 
int _index
 

Detailed Description

Definition at line 10 of file AmpInitialiser.h.

Constructor & Destructor Documentation

◆ AmpInitialiser() [1/5]

AmpInitialiser::AmpInitialiser ( )

Definition at line 14 of file AmpInitialiser.cpp.

15  : _SPD('?')
16  , _valid(false)
17  , _lopt("")
18  , _numOpts()
19  , _autoSwap(true)
20  , _index(-1)
21 {}
std::string _lopt
std::vector< double > _numOpts

◆ AmpInitialiser() [2/5]

AmpInitialiser::AmpInitialiser ( const std::string &  StandardisedDecayTreeName,
const std::string &  lopt = "",
const std::string &  namePrefix = "",
const std::string &  linshapePrefix = "",
const std::vector< double > &  numOpts = std::vector<double>(),
bool  autoSwap = true,
int  index = -1 
)

Definition at line 22 of file AmpInitialiser.cpp.

30  : _valid(false)
31  , _prefix(namePrefix)
32  , _lsPrefix(lineshapePrefix)
33  , _lopt(lopt_in)
34  , _numOpts(numOpts_in)
35  , _autoSwap(autoSwap_in)
36  , _index(index_in)
37 {
38  setSPD('?');
40  if(! ndl){
41  cout << "ERROR in constructor of AmpInitialiser from string: "
42  << StandardisedDecayTreeName << endl;
43  cout << "Can't find NamedDecayTreeList!" << endl;
44  }else{
45  bool success=false;
46  (*this) = ndl->find(StandardisedDecayTreeName, success);
47  if(! success){
48  cout << "ERROR in constructor of AmpInitialiser from string: "
49  << StandardisedDecayTreeName << endl;
50  cout << "Can't find this decay in List" << endl;
51  }
52  }
53 }
const AmpInitialiser & find(const std::string &name, bool &successFlag) const
std::string _lsPrefix
void setSPD(char SPD_in)
static NamedDecayTreeList * getMe(const std::string &printopt="printNever")
std::string _lopt
std::string _prefix
std::vector< double > _numOpts

◆ AmpInitialiser() [3/5]

AmpInitialiser::AmpInitialiser ( const DecayTree dt_in,
char  SPD_in = '?',
const std::string &  lopt = "",
const std::string &  namePrefix = "",
const std::string &  linshapePrefix = "",
const std::vector< double > &  numOpts = std::vector<double>(),
bool  autoSwap = true,
int  index = -1 
)

Definition at line 54 of file AmpInitialiser.cpp.

63  : _prefix(namePrefix)
64  , _lsPrefix(lineshapePrefix)
65  , _lopt(lopt_in)
66  , _numOpts(numOpts_in)
67  , _autoSwap(autoSwap_in)
68  , _index(index_in)
69 {
70  setTree(dt_in);
71  setSPD(SPD_in);
72 }
std::string _lsPrefix
void setSPD(char SPD_in)
void setTree(const DecayTree &dt_in)
std::string _lopt
std::string _prefix
std::vector< double > _numOpts

◆ AmpInitialiser() [4/5]

AmpInitialiser::AmpInitialiser ( const DecayTree dt_in,
const std::string &  lopt,
const std::string &  namePrefix = "",
const std::string &  linshapePrefix = "",
const std::vector< double > &  numOpts = std::vector<double>(),
bool  autoSwap = true,
int  index = -1 
)

Definition at line 73 of file AmpInitialiser.cpp.

81  : _prefix(namePrefix)
82  , _lsPrefix(lineshapePrefix)
83  , _lopt(lopt_in)
84  , _numOpts(numOpts_in)
85  , _autoSwap(autoSwap_in)
86  , _index(index_in)
87 {
88  setTree(dt_in);
89  setSPD('?');
90 }
std::string _lsPrefix
void setSPD(char SPD_in)
void setTree(const DecayTree &dt_in)
std::string _lopt
std::string _prefix
std::vector< double > _numOpts

◆ AmpInitialiser() [5/5]

AmpInitialiser::AmpInitialiser ( const AmpInitialiser other,
const std::string &  addedPrefix = "",
const std::string &  addedLineshapePrefix = "" 
)

Definition at line 92 of file AmpInitialiser.cpp.

93  : _SPD(other._SPD)
94  , _valid(other._valid)
95  , _prefix(addedPrefix + other._prefix)
96  , _lsPrefix(addedLineshapePrefix + other._lsPrefix)
97  , _lopt(other._lopt)
98  , _numOpts(other._numOpts)
99  , _autoSwap(other._autoSwap)
100  , _index(other._index)
101 {
102  setTree(other._dt);
103 }
std::string _lsPrefix
void setTree(const DecayTree &dt_in)
std::string _lopt
std::string _prefix
std::vector< double > _numOpts

◆ ~AmpInitialiser()

AmpInitialiser::~AmpInitialiser ( )
inline

Definition at line 96 of file AmpInitialiser.h.

96  {
97  }

Member Function Documentation

◆ addLopt()

void AmpInitialiser::addLopt ( const std::string &  lopt_in)

Definition at line 152 of file AmpInitialiser.cpp.

152  {
153  if(! A_is_in_B(lopt_in, _lopt)){
154  _lopt += lopt_in;
155  }
156 }
bool A_is_in_B(const std::string &a, const std::string &b)
Definition: Utils.cpp:34
std::string _lopt

◆ addLsPrefix()

void AmpInitialiser::addLsPrefix ( const std::string &  linshapePrefix)

Definition at line 211 of file AmpInitialiser.cpp.

211  {
212  _lsPrefix = lineshapePrefix + _lsPrefix;
213 }
std::string _lsPrefix

◆ addPrefix()

void AmpInitialiser::addPrefix ( const std::string &  namePrefix)

Definition at line 204 of file AmpInitialiser.cpp.

204  {
205  _prefix = namePrefix + _prefix;
206 }
std::string _prefix

◆ autoSwap()

bool AmpInitialiser::autoSwap ( ) const

Definition at line 178 of file AmpInitialiser.cpp.

178  {
179  return _autoSwap;
180 }

◆ getEventPattern()

DalitzEventPattern AmpInitialiser::getEventPattern ( ) const

Definition at line 121 of file AmpInitialiser.cpp.

121  {
122  std::vector<const DecayTreeItem*> fs = tree().finalState();
123 
124  std::vector<int> fs_int;
125  fs_int.push_back(tree().getVal().pdg()); // mum;
126  for(unsigned int i=0; i< fs.size(); i++){
127  fs_int.push_back(fs[i]->pdg());
128  }
129  return DalitzEventPattern(fs_int);
130 }
const DecayTree & tree() const
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ index()

int AmpInitialiser::index ( ) const

Definition at line 185 of file AmpInitialiser.cpp.

185  {
186  return _index;
187 }

◆ indexString()

std::string AmpInitialiser::indexString ( ) const

Definition at line 193 of file AmpInitialiser.cpp.

193  {
194  if(index() < 0){
195  return "";
196  }else{
197  return "_" + anythingToString(index());
198  }
199 }
int index() const
std::string anythingToString(const T &anything)
Definition: Utils.h:62

◆ lopt()

const std::string & AmpInitialiser::lopt ( ) const

Definition at line 146 of file AmpInitialiser.cpp.

146  {
147  return _lopt;
148 }
std::string _lopt

◆ lsPrefix()

const std::string & AmpInitialiser::lsPrefix ( ) const

Definition at line 208 of file AmpInitialiser.cpp.

208  {
209  return _lsPrefix;
210 }
std::string _lsPrefix

◆ name()

std::string AmpInitialiser::name ( ) const

Definition at line 224 of file AmpInitialiser.cpp.

224  {
225  return uniqueName();
226 }
std::string uniqueName() const

◆ numOpts()

const std::vector< double > & AmpInitialiser::numOpts ( ) const

Definition at line 174 of file AmpInitialiser.cpp.

174  {
175  return _numOpts;
176 }
std::vector< double > _numOpts

◆ operator=()

AmpInitialiser & AmpInitialiser::operator= ( const AmpInitialiser rhs)

Definition at line 104 of file AmpInitialiser.cpp.

104  {
105  setTree(rhs._dt);
106  _SPD = rhs._SPD;
107  _valid = rhs._valid;
108  _prefix = rhs._prefix;
109  _lsPrefix = rhs._lsPrefix;
110  _lopt = rhs._lopt;
111  _numOpts = rhs._numOpts;
112  _autoSwap = rhs._autoSwap;
113  _index = rhs._index;
114  return *this;
115 }
std::string _lsPrefix
void setTree(const DecayTree &dt_in)
std::string _lopt
std::string _prefix
std::vector< double > _numOpts

◆ prefix()

const std::string & AmpInitialiser::prefix ( ) const

Definition at line 201 of file AmpInitialiser.cpp.

201  {
202  return _prefix;
203 }
std::string _prefix

◆ setAutoSwap()

bool AmpInitialiser::setAutoSwap ( bool  autoSwap_in = true)

Definition at line 181 of file AmpInitialiser.cpp.

181  {
182  return _autoSwap=autoSwap_in;
183 }

◆ setIndex()

void AmpInitialiser::setIndex ( int  index)

Definition at line 189 of file AmpInitialiser.cpp.

189  {
190  _index = index_in;
191 }

◆ setLopt()

void AmpInitialiser::setLopt ( const std::string &  lopt_in)

Definition at line 149 of file AmpInitialiser.cpp.

149  {
150  _lopt = lopt_in;
151 }
std::string _lopt

◆ setNumOpts() [1/4]

void AmpInitialiser::setNumOpts ( const std::vector< double > &  numOpts_in = std::vector<double>())

Definition at line 158 of file AmpInitialiser.cpp.

158  {
159  _numOpts = numOpts_in;
160 }
std::vector< double > _numOpts

◆ setNumOpts() [2/4]

void AmpInitialiser::setNumOpts ( double  n1)

Definition at line 162 of file AmpInitialiser.cpp.

162  {
163  _numOpts.push_back(n1);
164 }
std::vector< double > _numOpts

◆ setNumOpts() [3/4]

void AmpInitialiser::setNumOpts ( double  n1,
double  n2 
)

Definition at line 165 of file AmpInitialiser.cpp.

165  {
166  _numOpts.push_back(n1); _numOpts.push_back(n2);
167 }
std::vector< double > _numOpts

◆ setNumOpts() [4/4]

void AmpInitialiser::setNumOpts ( double  n1,
double  n2,
double  n3 
)

Definition at line 169 of file AmpInitialiser.cpp.

169  {
170  _numOpts.push_back(n1); _numOpts.push_back(n2); _numOpts.push_back(n3);
171 }
std::vector< double > _numOpts

◆ setSPD()

void AmpInitialiser::setSPD ( char  SPD_in)

Definition at line 142 of file AmpInitialiser.cpp.

142  {
143  _SPD = SPD_in;
144 }

◆ setTree()

void AmpInitialiser::setTree ( const DecayTree dt_in)

Definition at line 132 of file AmpInitialiser.cpp.

132  {
133  _dt = dt_in;
134  standardSort(_dt);
135  // sorting makes the name derived
136  // from tree unique.
137  _valid=true;
138 }
bool standardSort(DecayTree &A)

◆ SPD()

char AmpInitialiser::SPD ( ) const

Definition at line 139 of file AmpInitialiser.cpp.

139  {
140  return _SPD;
141 }

◆ tree()

const DecayTree & AmpInitialiser::tree ( ) const

Definition at line 117 of file AmpInitialiser.cpp.

117  {
118  return _dt;
119 }

◆ uniqueName()

std::string AmpInitialiser::uniqueName ( ) const

Definition at line 215 of file AmpInitialiser.cpp.

215  {
216  if(_valid){
217  std::string s = prefix() + _lopt + _dt.oneLiner() + indexString();
218  // if(_SPD != '?') s = s + "_" + _SPD;
219  return s;
220  }else{
221  return "Tree not set - so no name";
222  }
223 }
static const double s
std::string indexString() const
std::string _lopt
const std::string & prefix() const
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375

Member Data Documentation

◆ _autoSwap

bool AmpInitialiser::_autoSwap
private

Definition at line 26 of file AmpInitialiser.h.

◆ _dt

DecayTree AmpInitialiser::_dt
private

Definition at line 11 of file AmpInitialiser.h.

◆ _index

int AmpInitialiser::_index
private

Definition at line 27 of file AmpInitialiser.h.

◆ _lopt

std::string AmpInitialiser::_lopt
private

Definition at line 17 of file AmpInitialiser.h.

◆ _lsPrefix

std::string AmpInitialiser::_lsPrefix
private

Definition at line 15 of file AmpInitialiser.h.

◆ _numOpts

std::vector<double> AmpInitialiser::_numOpts
private

Definition at line 24 of file AmpInitialiser.h.

◆ _prefix

std::string AmpInitialiser::_prefix
private

Definition at line 14 of file AmpInitialiser.h.

◆ _SPD

char AmpInitialiser::_SPD
private

Definition at line 12 of file AmpInitialiser.h.

◆ _valid

bool AmpInitialiser::_valid
private

Definition at line 13 of file AmpInitialiser.h.


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