Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
jsonToPhysics.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
22 #ifndef JSONTOPHYSICS_H_INCLUDED
23 #define JSONTOPHYSICS_H_INCLUDED
24 
25 #include <optional>
26 #include <memory>
27 #include "jsonLoader.h"
28 
29 namespace csl {
30  class Expr;
31 }
32 
33 namespace mty {
34 
35 class QuantumNumber;
36 class QuantumFieldParent;
37 class Flavor;
38 class FlavorIrrep;
39 class Gauge;
40 class GaugeIrrep;
41 class Model;
42 
50 class JSONToHEP {
51 
52  public:
53 
54  JSONToHEP() = delete;
55 
56  public:
57 
64  static std::unique_ptr<Model> readModel(std::string const& nameFile);
65 
66  private:
67 
73  static std::unique_ptr<Gauge> readGauge(JSON::Node* tree);
74 
80  static std::unique_ptr<Flavor> readFlavor(JSON::Node* tree);
81 
82  static std::vector<QuantumNumber> readQuantumNumbers(JSON::Node* tree);
83 
90  static csl::Expr readGaugeCoupling(JSON::Node* couplingNode);
91 
100  static std::vector<std::shared_ptr<QuantumFieldParent>>
101  readField(JSON::Node* tree,
102  Gauge* gauge,
103  Flavor* flavor,
104  Model* model,
105  std::vector<QuantumNumber> const& qNumbers);
106 
107  static std::vector<std::pair<std::string, JSON::Node*>>
108  readYukawaNodes(JSON::Node* fields);
109 
110  static csl::Expr interpretYukawaCoupling(Model* model,
111  std::string const& nameScalar,
112  JSON::Node* node);
113 
120  static std::vector<int> stringToDinkinLabels(std::string const& str);
121 
133  static GaugeIrrep readIrrep(JSON::Node* node,
134  Gauge* gauge);
135 
147  static FlavorIrrep readFlavorIrrep(JSON::Node* node,
148  Flavor* flavor);
149 
156  static void readMass(JSON::Node* massNode,
157  QuantumFieldParent* field);
158 };
159 
160 
161 } // End of namespace mty
162 
163 #endif
Definition: gauge.h:36
Namespace of MARTY.
Definition: 2HDM.h:31
Definition: gauge.h:137
Reads a file in .json format containing data of a model and returns the corresponding Model object vi...
Definition: jsonToPhysics.h:50
Inherits from JSON::Object, specialized in JSON Node. A Node owns a vector of Object. The Node&#39;s children can either be Leaf or other Node objects. This allows to store the tree structure of a .json file.
Definition: jsonObject.h:97
Definition: flavor.h:133
Definition: flavor.h:72
Contains all objects in the theory. In particular QuantumField objects, Gauge, Flavor, Particle...
Definition: model.h:68
Base class for parents of QuantumField objects.
Definition: quantumField.h:152