evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtMultiChannelParser.hh
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #ifndef EVT_MULTI_CHANNEL_PARSER
22 #define EVT_MULTI_CHANNEL_PARSER
23 
24 #include "EvtGenBase/EvtComplex.hh"
25 
26 #include <string>
27 #include <vector>
28 
29 // Parse decay file tokens from a file or a vector
30 
31 class EvtDecayMode;
32 
33 enum
34 {
38 };
39 
41  public:
42  EvtMultiChannelParser() : _pdfMax( -1. ), _nScan( 0 ), _dm( 0. ) {}
44 
45  static EvtDecayMode getDecayMode( const char* file );
46 
47  void parse( const char* file, const char* model );
48  void parse( const std::vector<std::string>& v );
49 
50  static void parseComplexCoef( size_t& i, const std::vector<std::string>& v,
51  EvtComplex& c, int& format );
52  static double parseRealCoef( int& i, const std::vector<std::string>& v );
53  static bool isKeyword( const std::string& s );
54 
55  inline double pdfMax() const { return _pdfMax; }
56  inline int nScan() const { return _nScan; }
57  inline double dm() const { return _dm; }
58  inline double mixPhase() const { return _mixPhase; }
59  inline double mixAmpli() const { return _mixAmpli; }
60 
61  inline std::vector<std::string> amp( int i ) const { return _amp[i]; }
62  inline std::vector<std::string> ampConj( int i ) const
63  {
64  return _ampConj[i];
65  }
66  inline EvtComplex ampCoef( int i ) const { return _ampCoef[i]; }
67  inline EvtComplex ampConjCoef( int i ) const { return _ampConjCoef[i]; }
68 
69  inline int coefFormat( int i ) const { return _coefFormat[i]; }
70  inline int coefConjFormat( int i ) const { return _coefConjFormat[i]; }
71 
72  inline int getNAmp() const { return _amp.size(); }
73  inline int getNAmpConj() const { return _ampConj.size(); }
74 
75  private:
76  double _pdfMax;
77  int _nScan;
78  double _dm;
79  double _mixPhase;
80  double _mixAmpli;
81 
82  std::vector<std::vector<std::string>> _amp;
83  std::vector<std::vector<std::string>> _ampConj;
84  std::vector<EvtComplex> _ampCoef;
85  std::vector<int> _coefFormat;
86  std::vector<EvtComplex> _ampConjCoef;
87  std::vector<int> _coefConjFormat;
88 };
89 
90 #endif
std::vector< int > _coefFormat
static void parseComplexCoef(size_t &i, const std::vector< std::string > &v, EvtComplex &c, int &format)
static EvtDecayMode getDecayMode(const char *file)
static bool isKeyword(const std::string &s)
void parse(const char *file, const char *model)
std::vector< std::vector< std::string > > _amp
std::vector< EvtComplex > _ampConjCoef
static double parseRealCoef(int &i, const std::vector< std::string > &v)
int coefConjFormat(int i) const
std::vector< std::vector< std::string > > _ampConj
std::vector< int > _coefConjFormat
EvtComplex ampConjCoef(int i) const
std::vector< std::string > amp(int i) const
EvtComplex ampCoef(int i) const
std::vector< std::string > ampConj(int i) const
std::vector< EvtComplex > _ampCoef