
(* description = "pp -> VV+jets|pp -> llvv+jets|pp -> llvvjj| W+W+ vector boson scattering with different flavour leptonic decays at all orders." *)

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

OpenLoopsModel = "SM_simplified";

(* OnTheFlyMode = 0; *)

(* LO as^2*a^4 + NLO as^3*a^4 contribution *)

(* W+W+ uc channel *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}]},
           SelectInterference -> {eQED -> 8},
           SelectCoupling -> (Exponent[#1, eQED] === 4 &),
           UnitaryGauge -> True];

(* W+W+ uu channel *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}]},
           SelectInterference -> {eQED -> 8},
           SelectCoupling -> (Exponent[#1, eQED] === 4 &),
           UnitaryGauge -> True];


(* LO as^2*a^4 + NLO as^2*a^5 contribution; 1-loop eQED^8 does not contribute *)
(* NOTE: that the LO matrix elements here are inefficient, because both tree orders are calculated. *)

(* W+W+ uc channel *)
(* TODO: There is potential for optimisation here. The following 1-loop diagrams do not contribute:
   (1) as^2*a^2 with one gluon exchanged between the two quark lines, but the other within one quark line,
   (2) as^1*a^3 with gluon exchange within one quark line.
   Note that there is a contribution with two gluons exchaned each within one quark line (or both within the same),
   that gives a non-zero contribution. Hence, the diagram selection is nontrivial. *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}]},
           SelectInterference -> {gQCD -> 4},
           SelectCoupling -> (Exponent[#1, eQED] <= 6 &),
           UnitaryGauge -> False];

(* W+W+ uu channel *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}]},
           SelectInterference -> {gQCD -> 4},
           SelectCoupling -> (Exponent[#1, eQED] <= 6 &),
           UnitaryGauge -> False];

(* LO as^1*a^5; only for uu, because uc vanishes due to colour interference. *)
(* NOTE: Generate this as a separate process, because we don't want to generate NLO to the tiny LO as^2a^5.
         Generated as a real correction. *)
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}]},
        SelectInterference -> {gQCD -> 2},
        UnitaryGauge -> True];

(* LO as^0*a^6 + NLO as^1*a^6 contribution *)

(* W+W+ uc channel; only as^0*a^3 tree is needed, because as^1*a^2 tree interferes to zero with loop *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}]},
           SelectInterference -> {eQED -> 12},
           SelectCoupling -> (Exponent[#1, eQED] === 6 &),
           SelectLoopDiagrams -> SameQuarkLineGluon,
           UnitaryGauge -> True];

(* W+W+ uu channel; as^2*a^2 1-loop does not contribute *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}]},
           SelectInterference -> {eQED -> 12},
           SelectCoupling -> (Exponent[#1, gQCD] <= 2 &),
           UnitaryGauge -> False];
(*
(* W-W- uc channel *)
AddProcess[FeynArtsProcess -> {-F[3,{1}], -F[3,{2}]} -> {-F[1,{1}], F[2,{1}], -F[1,{2}], F[2,{2}], -F[4,{1}], -F[4,{2}]},
           SelectInterference -> {eQED -> 12},
           SelectCoupling -> (Exponent[#1, eQED] === 6 &),
           UnitaryGauge -> False];

(* W-W- uu channel *)
AddProcess[FeynArtsProcess -> {-F[3,{1}], -F[3,{1}]} -> {-F[1,{1}], F[2,{1}], -F[1,{2}], F[2,{2}], -F[4,{1}], -F[4,{1}]},
           SelectInterference -> {eQED -> 12},
           SelectCoupling -> (Exponent[#1, eQED] === 6 &),
           UnitaryGauge -> False];
*)


(* LO as^0*a^6 + NLO as^0*a^7 contribution *)

(* W+W+ uc channel *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}]},
           SelectInterference -> {gQCD -> 0},
           SelectCoupling -> (Exponent[#1, gQCD] === 0 &),
           UnitaryGauge -> False];

(* W+W+ uu channel *)
AddProcess[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}]},
           SelectInterference -> {gQCD -> 0},
           SelectCoupling -> (Exponent[#1, gQCD] === 0 &),
           UnitaryGauge -> False];

(*
(* W-W- uc channel *)
AddProcess[FeynArtsProcess -> {-F[3,{1}], -F[3,{2}]} -> {-F[1,{1}], F[2,{1}], -F[1,{2}], F[2,{2}], -F[4,{1}], -F[4,{2}]},
           SelectInterference -> {gQCD -> 0},
           SelectCoupling -> (Exponent[#1, gQCD] === 0 &),
           UnitaryGauge -> False];

(* W-W- uu channel *)
AddProcess[FeynArtsProcess -> {-F[3,{1}], -F[3,{1}]} -> {-F[1,{1}], F[2,{1}], -F[1,{2}], F[2,{2}], -F[4,{1}], -F[4,{1}]},
           SelectInterference -> {gQCD -> 0},
           SelectCoupling -> (Exponent[#1, gQCD] === 0 &),
           UnitaryGauge -> False];
*)

(* W+W+ real corrections, uc and uu channels *)

(* u c -> ve e+ vm mu+ d s g: as^1*a^6, as^2*a^5, as^3*a^4 *)
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}], V[5]}, SelectInterference -> {eQED -> 12}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 6 &)];
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}], V[5]}, SelectInterference -> {eQED -> 10}, UnitaryGauge -> True];
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}], V[5]}, SelectInterference -> {eQED ->  8}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 4 &)];

(* u c -> ve e+ vm mu+ d s a: as^0*a^7, as^2*a^5; the order as^1*a^6 vanishes due to colour interference *)
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}], V[1]}, SelectInterference -> {eQED -> 14}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 7 &)];
(* AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}], V[1]}, SelectInterference -> {eQED -> 12}, UnitaryGauge -> True]; *)
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{2}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{2}], V[1]}, SelectInterference -> {eQED -> 10}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 5 &)];

(* u u -> ve e+ vm mu+ d d g: as^1*a^6, as^2*a^5, as^3*a^4 *)
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}], V[5]}, SelectInterference -> {eQED -> 12}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 6 &)];
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}], V[5]}, SelectInterference -> {eQED -> 10}, UnitaryGauge -> True];
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}], V[5]}, SelectInterference -> {eQED ->  8}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 4 &)];

(* u u -> ve e+ vm mu+ d d a: as^0*a^7, as^1*a^6, as^2*a^5 *)
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}], V[1]}, SelectInterference -> {eQED -> 14}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 7 &)];
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}], V[1]}, SelectInterference -> {eQED -> 12}, UnitaryGauge -> True];
AddReal[FeynArtsProcess -> {F[3,{1}], F[3,{1}]} -> {F[1,{1}], -F[2,{1}], F[1,{2}], -F[2,{2}], F[4,{1}], F[4,{1}], V[1]}, SelectInterference -> {eQED -> 10}, UnitaryGauge -> True, SelectCoupling -> (Exponent[#1, eQED] === 5 &)];
