EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
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
25
26#include <string>
27#include <vector>
28
29// Parse decay file tokens from a file or a vector
30
31class EvtDecayMode;
32
33enum
34{
38};
39
41 public:
42 EvtMultiChannelParser() : m_pdfMax( -1. ), m_nScan( 0 ), m_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 m_pdfMax; }
56 inline int nScan() const { return m_nScan; }
57 inline double dm() const { return m_dm; }
58 inline double mixPhase() const { return m_mixPhase; }
59 inline double mixAmpli() const { return m_mixAmpli; }
60
61 inline std::vector<std::string> amp( int i ) const { return m_amp[i]; }
62 inline std::vector<std::string> ampConj( int i ) const
63 {
64 return m_ampConj[i];
65 }
66 inline EvtComplex ampCoef( int i ) const { return m_ampCoef[i]; }
67 inline EvtComplex ampConjCoef( int i ) const { return m_ampConjCoef[i]; }
68
69 inline int coefFormat( int i ) const { return m_coefFormat[i]; }
70 inline int coefConjFormat( int i ) const { return m_coefConjFormat[i]; }
71
72 inline int getNAmp() const { return m_amp.size(); }
73 inline int getNAmpConj() const { return m_ampConj.size(); }
74
75 private:
76 double m_pdfMax;
78 double m_dm;
79 double m_mixPhase;
80 double m_mixAmpli;
81
82 std::vector<std::vector<std::string>> m_amp;
83 std::vector<std::vector<std::string>> m_ampConj;
84 std::vector<EvtComplex> m_ampCoef;
85 std::vector<int> m_coefFormat;
86 std::vector<EvtComplex> m_ampConjCoef;
87 std::vector<int> m_coefConjFormat;
88};
89
90#endif
std::vector< std::vector< std::string > > m_amp
static EvtDecayMode getDecayMode(const char *file)
std::vector< EvtComplex > m_ampConjCoef
std::vector< std::vector< std::string > > m_ampConj
std::vector< int > m_coefFormat
std::vector< EvtComplex > m_ampCoef
void parse(const char *file, const char *model)
std::vector< int > m_coefConjFormat
static bool isKeyword(const std::string &s)
std::vector< std::string > ampConj(int i) const
static void parseComplexCoef(size_t &i, const std::vector< std::string > &v, EvtComplex &c, int &format)
EvtComplex ampConjCoef(int i) const
std::vector< std::string > amp(int i) const
EvtComplex ampCoef(int i) const
static double parseRealCoef(int &i, const std::vector< std::string > &v)