Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CP9.cpp
Go to the documentation of this file.
1#include <iostream>
2#include <string>
3
4// HYPERISO_MARTY_OPERATOR_NORM_ABI: ew-input-normalization-v1
5// HYPERISO_MARTY_TEMPLATE_ABI: semileptonic-cp9-tree-first-split-regprop-v18
6using namespace csl;
7using namespace mty;
8using namespace std;
9using namespace sm_input;
10
11namespace {
12
13enum class HyperisoMartyC9LinkerSelection {
14 NonPhotonVector,
15 PhotonOnly
16};
17
18HyperisoMartyC9LinkerSelection hyperiso_marty_c9_linker_selection =
19 HyperisoMartyC9LinkerSelection::NonPhotonVector;
20
21void hyperiso_marty_set_c9_linker_selection(HyperisoMartyC9LinkerSelection selection) {
22 hyperiso_marty_c9_linker_selection = selection;
23}
24
25bool hyperiso_marty_tree_level_matching = false;
26
27void hyperiso_marty_set_semileptonic_order(mty::Order order) {
28 hyperiso_marty_tree_level_matching = (order == mty::Order::TreeLevel);
29}
30
31bool hyperiso_marty_is_photon_name(std::string const& name) {
32 return name == "A" || name == "A;\\gamma" || name.find("\\gamma") != std::string::npos;
33}
34
35bool hyperiso_marty_is_scalar_particle(const mty::Particle& particle) {
36 return particle->getSpinDimension() == 1;
37}
38
39bool hyperiso_marty_is_photon_linker_particle(const mty::Particle& particle) {
40 return hyperiso_marty_is_photon_name(std::string(particle->getName()));
41}
42
43bool hyperiso_marty_is_light_up_name(std::string const& name) {
44 // For primed semileptonic charged-Higgs coefficients the SuperIso THDM
45 // matching is already written as the GIM-subtracted top contribution.
46 // MARTY's raw 4-fermion computation keeps u/c charged-Higgs penguins and
47 // boxes separately; after factoring V_tb V_ts^* these pieces carry CKM
48 // phases and do not correspond to the short-distance THDM C'_9 matching
49 // convention. Veto only light up-type loop fermions; do not veto external
50 // leptons ("mu") or BSM particles such as H+.
51 return name == "u" || name == "c"
52 || name.find("u_L") != std::string::npos
53 || name.find("u_R") != std::string::npos
54 || name.find("c_L") != std::string::npos
55 || name.find("c_R") != std::string::npos;
56}
57
58bool hyperiso_marty_has_light_up_loop(mty::FeynmanDiagram const& diag) {
59 for (const auto& particle : diag.getParticles(mty::FeynmanDiagram::DiagramParticleType::Loop)) {
60 if (hyperiso_marty_is_light_up_name(std::string(particle->getName()))) {
61 return true;
62 }
63 }
64 return false;
65}
66
67bool hyperiso_marty_is_forbidden_c9_linker_particle(const mty::Particle& particle) {
68 // Raw photon linkers A -> l+l- carry the regulated propagator used by
69 // MARTY's 4-fermion penguin patch. They are not a finite C9/CP9 matching
70 // coefficient. Finite photon pieces must be supplied analytically or via
71 // WilsonMatchingPatch. This does not veto particles inside loops, only the
72 // linker that MARTY connects to the lepton current.
73 if (hyperiso_marty_is_photon_linker_particle(particle)) {
74 return true;
75 }
76
77 // Neutral scalar/Goldstone linkers can be present as External particles of
78 // the penguin sub-amplitude before MARTY connects the 4-fermion graph. They
79 // should not be projected onto vector C9/CP9; scalar effects belong to CQ*
80 // operators. Again, this does not remove scalar BSM particles in loops or
81 // boxes, only a scalar linker attached to the lepton current.
82 if (hyperiso_marty_is_scalar_particle(particle)) {
83 return true;
84 }
85
86 return false;
87}
88
89template <typename Predicate>
90bool hyperiso_marty_has_linker_matching(mty::FeynmanDiagram const& diag, Predicate predicate) {
91 // In MARTY's 4-fermion coefficient construction, the penguin linker X in
92 // b -> s X is still an External particle when diagram filters are applied.
93 // After connectAmplitudes(), it may appear as a Mediator. Check both;
94 // checking Mediator only misses A/G0 and leaves reg_prop-dependent terms.
95 for (const auto& particle : diag.getParticles(mty::FeynmanDiagram::DiagramParticleType::External)) {
96 if (predicate(particle)) {
97 return true;
98 }
99 }
100 for (const auto& particle : diag.getParticles(mty::FeynmanDiagram::DiagramParticleType::Mediator)) {
101 if (predicate(particle)) {
102 return true;
103 }
104 }
105 return false;
106}
107
108bool hyperiso_marty_has_photon_linker(mty::FeynmanDiagram const& diag) {
109 return hyperiso_marty_has_linker_matching(diag, [](const mty::Particle& particle) {
110 return hyperiso_marty_is_photon_linker_particle(particle);
111 });
112}
113
114bool hyperiso_marty_has_forbidden_c9_linker(mty::FeynmanDiagram const& diag) {
115 return hyperiso_marty_has_linker_matching(diag, [](const mty::Particle& particle) {
116 return hyperiso_marty_is_forbidden_c9_linker_particle(particle);
117 });
118}
119
120bool hyperiso_marty_accept_c9_linker(mty::FeynmanDiagram const& diag) {
121 if (hyperiso_marty_tree_level_matching) {
122 return true;
123 }
124 switch (hyperiso_marty_c9_linker_selection) {
125 case HyperisoMartyC9LinkerSelection::NonPhotonVector:
126 return !hyperiso_marty_has_forbidden_c9_linker(diag);
127 case HyperisoMartyC9LinkerSelection::PhotonOnly:
128 return hyperiso_marty_has_photon_linker(diag);
129 }
130 return !hyperiso_marty_has_forbidden_c9_linker(diag);
131}
132
133// Backward-compatible aliases: older generated caches/templates called these
134// names. Keeping aliases prevents one half-updated template from failing to
135// compile. The semantically precise helper is hyperiso_marty_has_photon_linker.
136bool hyperiso_marty_has_forbidden_c9_penguin_mediator(mty::FeynmanDiagram const& diag) {
137 return hyperiso_marty_has_forbidden_c9_linker(diag);
138}
139
140bool hyperiso_marty_has_photon_mediator(mty::FeynmanDiagram const& diag) {
141 return hyperiso_marty_has_photon_linker(diag);
142}
143
144} // namespace
145
146void defineLibPath(Library &lib) {
147#ifdef MARTY_LIBRARY_PATH
148 lib.addLPath(MARTY_LIBRARY_PATH);
149 lib.addLPath(MARTY_LIBRARY_PATH "/..");
150 lib.addLPath(MARTY_LIBRARY_PATH "/marty");
151 lib.addLPath(MARTY_LIBRARY_PATH "/marty/lha");
152#endif
153#ifdef MARTY_INCLUDE_PATH
154 lib.addIPath(MARTY_INCLUDE_PATH);
155#endif
156}
157
158int calculate_CP9mu(Model &model, gauge::Type gauge) {
159
160 model.getParticle("W")->setGaugeChoice(gauge);
161 model.getParticle("Z")->setGaugeChoice(gauge);
162
163 undefineNumericalValues(); // Allow for HIso to set all the parameters' values
164 mty::option::excludeExternalLegsCorrections = false;
165
166 Expr factorOperator = -4 * GetComplexConjugate(V_ts) * V_tb * G_F * pow_s(e_em / (4 * CSL_PI), 2) / csl::sqrt_s(2);
167 FeynOptions opts;
168 // The photon-penguin part of b -> s l l is not used directly as the final
169 // C9 four-fermion coefficient because it carries MARTY's regulated photon
170 // propagator. In BSM-split mode the same template is evaluated twice:
171 // - NonPhotonVector -> exported as CP9 and evaluated numerically
172 // with reg_prop = 1e-6.
173 // - PhotonOnly -> exported separately as CP9_A and evaluated
174 // numerically with reg_prop = 1.
175 // The numeric wrapper writes CP9 = CP9_non-photon + CP9_A.
176 opts.addFilter([](mty::FeynmanDiagram const& diag) {
177 return hyperiso_marty_accept_c9_linker(diag);
178 });
179 opts.addFilter([](mty::FeynmanDiagram const& diag) {
180 return !hyperiso_marty_has_light_up_loop(diag);
181 });
182 opts.setFermionOrder({1, 0, 2, 3});
183 opts.setWilsonOperatorCoefficient(factorOperator);
184
185 auto wil = model.computeWilsonCoefficients(
186 mty::Order::OneLoop,
187 {Incoming("b"),
188 Outgoing("s"),
189 Outgoing("mu"),
190 Outgoing(AntiPart("mu"))},
191 opts
192 );
193
194 Expr CP9_mu = getWilsonCoefficient(
195 wil,
196 dimension6Operator(model, wil, DiracCoupling::VR, DiracCoupling::V)
197 );
198
199 [[maybe_unused]] int sysres = system("rm -rf libs/C9_SM");
200 mty::Library wilsonLib("CP9_SM", "libs");
201 wilsonLib.cleanExistingSources();
202 wilsonLib.addFunction("CP9", CP9_mu);
203 defineLibPath(wilsonLib);
204 wilsonLib.print();
205
206 return 0;
207}
208
209int main() {
210 SM_Model sm;
211 return calculate_CP9mu(sm, gauge::Type::Feynman);
212}
int calculate_CP9mu(Model &model, gauge::Type gauge)
Definition CP9.cpp:158
void defineLibPath(Library &lib)
Definition CP9.cpp:146
int main()
Definition CP9.cpp:209
Model
RealMatrix diag(const gsl_vector *X)
Builds a diagonal matrix from a GSL vector.
Definition Matrix.cpp:464
Standard Model of particle physics.
Definition sm.h:35
csl::Expr e_em
Definition sm.h:78
csl::Expr G_F
Definition sm.h:84
void undefineNumericalValues()
csl::Expr V_tb
Definition sm.h:244
csl::Expr V_ts
Definition sm.h:306
Definition sm.h:30
Hash specialization for SymbolId<Tag>.
Definition BlockName.h:353