
(* description = "pp -> VV+jets|pp -> VV+jets|pp -> llA|Off-shell Z/A/W boson and on-shell photon production with leptonic decays (l+l-/nn/l+n/l-n) at NLO EW." *)

SetParameters = JoinOptions[{ME -> 0}];


qed1 = {
  InsertFieldsOptions -> {Restrictions -> {ExcludeParticles -> {V[3],U[3],S[3]}, NoQuarkMixing}},
  SelectLoopDiagrams -> ( Not[ContainsFermionLoop[##] && NLegsOnLoop[2][##]] && ParticlesInLoop[V[1]][##]  &),
  QED -> 1,
  SetParameters -> JoinOptions[{ME -> ME, MM -> MM}]
  };

qed2 = {
  InsertFieldsOptions -> {Restrictions -> {ExcludeParticles -> {V[2|3],U,S}, NoQuarkMixing}},
  SelectLoopDiagrams -> ( Not[ContainsFermionLoop[##] && NLegsOnLoop[2][##]] && ParticlesInLoop[V[1]][##]  &),
  QED -> 2,
  SetParameters -> JoinOptions[{ME -> ME, MM -> MM}]
};



(* O(a^3) + O(a^4) *)

SelectInterference = {gQCD -> 0};

(* l+l- *)

(* eexuuxa *) AddProcess[FeynArtsProcess -> {-F[3,{1}], F[3,{1}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False];
(* eexddxa *) AddProcess[FeynArtsProcess -> {-F[4,{1}], F[4,{1}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False];
(* eexbbxa *) AddProcess[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False];
(* eexaaa *) AddProcess[FeynArtsProcess -> {V[1], V[1]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False];

(* eexuuxa *) AddProcess[FeynArtsProcess -> {-F[3,{1}], F[3,{1}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];
(* eexddxa *) AddProcess[FeynArtsProcess -> {-F[4,{1}], F[4,{1}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];
(* eexbbxa *) AddProcess[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];
(* eexaaa *) AddProcess[FeynArtsProcess -> {V[1], V[1]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];

(* eexuuxa *) AddProcess[FeynArtsProcess -> {-F[3,{1}], F[3,{1}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed2];
(* eexddxa *) AddProcess[FeynArtsProcess -> {-F[4,{1}], F[4,{1}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed2];
(* eexbbxa *) AddProcess[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed2];
(* eexaaa *) AddProcess[FeynArtsProcess -> {V[1], V[1]} -> {F[2,{1}], -F[2,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed2];

(* eexddxaa *)  AddReal[FeynArtsProcess -> {F[4,{1}], -F[4,{1}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}];
(* eexuuxaa *)  AddReal[FeynArtsProcess -> {F[3,{1}], -F[3,{1}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}];
(* eexbbxaa *)  AddReal[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}];
(* eexaaaa *)  AddReal[FeynArtsProcess -> {V[1], V[1]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}];

(* eexddxaa *)  AddReal[FeynArtsProcess -> {F[4,{1}], -F[4,{1}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed1];
(* eexuuxaa *)  AddReal[FeynArtsProcess -> {F[3,{1}], -F[3,{1}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed1];
(* eexbbxaa *)  AddReal[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed1];
(* eexaaaa *)  AddReal[FeynArtsProcess -> {V[1], V[1]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed1];

(* eexddxaa *)  AddReal[FeynArtsProcess -> {F[4,{1}], -F[4,{1}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed2];
(* eexuuxaa *)  AddReal[FeynArtsProcess -> {F[3,{1}], -F[3,{1}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed2];
(* eexbbxaa *)  AddReal[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed2];
(* eexaaaa *)  AddReal[FeynArtsProcess -> {V[1], V[1]} -> {F[2,{1}], -F[2,{1}], V[1], V[1]}, Sequence @@ qed2];


(* nn *)

(* nenexuuxa *) AddProcess[FeynArtsProcess -> {-F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False];
(* nenexddxa *) AddProcess[FeynArtsProcess -> {-F[4,{1}], F[4,{1}]} -> {F[1,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False];
(* nenexbbxa *) AddProcess[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[1,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False];

(* nenexuuxa *) AddProcess[FeynArtsProcess -> {-F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];
(* nenexddxa *) AddProcess[FeynArtsProcess -> {-F[4,{1}], F[4,{1}]} -> {F[1,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];
(* nenexbbxa *) AddProcess[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[1,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False, Sequence @@ qed1];


(* nenexddxaa *)  AddReal[FeynArtsProcess -> {F[4,{1}], -F[4,{1}]} -> {F[1,{1}], -F[1,{1}], V[1], V[1]}];
(* nenexuuxaa *)  AddReal[FeynArtsProcess -> {F[3,{1}], -F[3,{1}]} -> {F[1,{1}], -F[1,{1}], V[1], V[1]}];
(* nenexbbxaa *)  AddReal[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[1,{1}], -F[1,{1}], V[1], V[1]}];

(* nenexddxaa *)  AddReal[FeynArtsProcess -> {F[4,{1}], -F[4,{1}]} -> {F[1,{1}], -F[1,{1}], V[1], V[1]}, Sequence @@ qed1];
(* nenexuuxaa *)  AddReal[FeynArtsProcess -> {F[3,{1}], -F[3,{1}]} -> {F[1,{1}], -F[1,{1}], V[1], V[1]}, Sequence @@ qed1];
(* nenexbbxaa *)  AddReal[FeynArtsProcess -> {F[4,{3}], -F[4,{3}]} -> {F[1,{1}], -F[1,{1}], V[1], V[1]}, Sequence @@ qed1];


(* ln *)

(* nexeudx *) AddProcess[FeynArtsProcess -> {F[3,{1}], -F[4,{1}]} -> {-F[2,{1}], F[1,{1}], V[1]}, UnitaryGauge -> False];
(* neexuxd *) AddProcess[FeynArtsProcess -> {-F[3,{1}], F[4,{1}]} -> {F[2,{1}], -F[1,{1}], V[1]}, UnitaryGauge -> False];

(* nexeudxa *) AddReal[FeynArtsProcess -> {F[3,{1}], -F[4,{1}]} -> {-F[2,{1}], F[1,{1}], V[1], V[1]}];
(* neexuxda *) AddReal[FeynArtsProcess -> {-F[3,{1}], F[4,{1}]} -> {F[2,{1}], -F[1,{1}], V[1], V[1]}];



