9using namespace sm_input;
13enum class HyperisoMartyC9LinkerSelection {
18HyperisoMartyC9LinkerSelection hyperiso_marty_c9_linker_selection =
19 HyperisoMartyC9LinkerSelection::NonPhotonVector;
21void hyperiso_marty_set_c9_linker_selection(HyperisoMartyC9LinkerSelection selection) {
22 hyperiso_marty_c9_linker_selection = selection;
25bool hyperiso_marty_tree_level_matching =
false;
27void hyperiso_marty_set_semileptonic_order(mty::Order order) {
28 hyperiso_marty_tree_level_matching = (order == mty::Order::TreeLevel);
31bool hyperiso_marty_is_photon_name(std::string
const& name) {
32 return name ==
"A" ||
name ==
"A;\\gamma" ||
name.find(
"\\gamma") != std::string::npos;
35bool hyperiso_marty_is_scalar_particle(
const mty::Particle& particle) {
36 return particle->getSpinDimension() == 1;
39bool hyperiso_marty_is_photon_linker_particle(
const mty::Particle& particle) {
40 return hyperiso_marty_is_photon_name(std::string(particle->getName()));
43bool hyperiso_marty_is_light_up_name(std::string
const& name) {
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;
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()))) {
67bool hyperiso_marty_is_forbidden_c9_linker_particle(
const mty::Particle& particle) {
73 if (hyperiso_marty_is_photon_linker_particle(particle)) {
82 if (hyperiso_marty_is_scalar_particle(particle)) {
89template <
typename Predicate>
90bool hyperiso_marty_has_linker_matching(mty::FeynmanDiagram
const&
diag, Predicate predicate) {
95 for (
const auto& particle :
diag.getParticles(
mty::FeynmanDiagram::DiagramParticleType::External)) {
96 if (predicate(particle)) {
100 for (
const auto& particle :
diag.getParticles(
mty::FeynmanDiagram::DiagramParticleType::Mediator)) {
101 if (predicate(particle)) {
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);
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);
120bool hyperiso_marty_accept_c9_linker(mty::FeynmanDiagram
const&
diag) {
121 if (hyperiso_marty_tree_level_matching) {
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);
130 return !hyperiso_marty_has_forbidden_c9_linker(
diag);
136bool hyperiso_marty_has_forbidden_c9_penguin_mediator(mty::FeynmanDiagram
const&
diag) {
137 return hyperiso_marty_has_forbidden_c9_linker(
diag);
140bool hyperiso_marty_has_photon_mediator(mty::FeynmanDiagram
const&
diag) {
141 return hyperiso_marty_has_photon_linker(
diag);
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");
153#ifdef MARTY_INCLUDE_PATH
154 lib.addIPath(MARTY_INCLUDE_PATH);
160 model.getParticle(
"W")->setGaugeChoice(gauge);
161 model.getParticle(
"Z")->setGaugeChoice(gauge);
164 mty::option::excludeExternalLegsCorrections =
false;
166 Expr factorOperator = -4 * GetComplexConjugate(
V_ts) *
V_tb *
G_F * pow_s(
e_em / (4 * CSL_PI), 2) / csl::sqrt_s(2);
176 opts.addFilter([](mty::FeynmanDiagram
const&
diag) {
177 return hyperiso_marty_accept_c9_linker(
diag);
179 opts.addFilter([](mty::FeynmanDiagram
const&
diag) {
180 return !hyperiso_marty_has_light_up_loop(
diag);
182 opts.setFermionOrder({1, 0, 2, 3});
183 opts.setWilsonOperatorCoefficient(factorOperator);
185 auto wil = model.computeWilsonCoefficients(
190 Outgoing(AntiPart(
"mu"))},
194 Expr CP9_mu = getWilsonCoefficient(
196 dimension6Operator(model, wil, DiracCoupling::VR, DiracCoupling::V)
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);
int calculate_CP9mu(Model &model, gauge::Type gauge)
void defineLibPath(Library &lib)
RealMatrix diag(const gsl_vector *X)
Builds a diagonal matrix from a GSL vector.
Standard Model of particle physics.
Hash specialization for SymbolId<Tag>.