12 #include <Math/VectorUtil.h>
36 template<
typename Obj1,
typename Obj2>
class Di :
public std::pair<Obj1*, Obj2*>,
40 using std::pair<Obj1*, Obj2*>::pair;
41 using std::pair<Obj1*, Obj2*>::first,
42 std::pair<Obj1*, Obj2*>::second;
44 explicit operator bool ()
const {
return first && second; }
46 inline void clear () { first =
nullptr; second =
nullptr; }
61 inline float Ystar (
const Variation& v =
nominal)
const {
return (first->Rapidity(v) - second->Rapidity(v))/2; }
63 inline float Ymax (
const Variation& v =
nominal)
const {
return std::max(first->AbsRap(v), second->AbsRap(v)); }
64 inline float HT (
const Variation& v =
nominal)
const {
return (first->CorrPt(v) + second->CorrPt(v))/2; }
83 template<
typename Obj1,
typename Obj2,
84 class =
typename std::enable_if_t<std::is_base_of_v<Darwin::Physics::AbstractGenericObject, Obj1>>,
85 class = typename std::enable_if_t<std::is_base_of_v<Darwin::Physics::AbstractGenericObject, Obj2>>>
86 inline auto operator+ (Obj1& o1, Obj2& o2)
91 template<
typename Obj1,
typename Obj2>
95 return s <<
'[' << *di.first <<
", " << *di.second <<
"] = " << di.
CorrP4();
97 return s <<
red <<
"invalid system" <<
normal;