13 #include "Math/VectorUtil.h"
32 template<
typename Obj1,
typename Obj2>
struct Di :
public std::pair<Obj1*, Obj2*>,
35 using base = std::pair<Obj1*, Obj2*>;
37 using std::pair<Obj1*, Obj2*>::pair;
38 using std::pair<Obj1*, Obj2*>::first,
39 std::pair<Obj1*, Obj2*>::second;
42 explicit operator bool ()
const {
return first && second; }
44 inline void clear () { first =
nullptr; second =
nullptr; }
47 {
return first->CorrP4(v) + second->CorrP4(v); }
52 {
return CorrP4(v).Rapidity(); }
57 {
return second->CorrP4(v).Eta() - first->CorrP4(v).Eta(); }
59 {
return ROOT::Math::VectorUtil::DeltaPhi(first->CorrP4(v), second->CorrP4(v)); }
61 {
return ROOT::Math::VectorUtil::DeltaR (first->CorrP4(v), second->CorrP4(v)); }
64 {
return (first->Rapidity(v) + second->Rapidity(v))/2; }
66 {
return (first->Rapidity(v) - second->Rapidity(v))/2; }
69 {
return std::max(first->AbsRap(), second->AbsRap()); }
71 {
return (first->CorrPt(v) + second->CorrPt(v))/2; }
74 {
return first->Weight(v) * second->Weight(v); }
92 template<
typename Obj1,
typename Obj2,
93 class =
typename std::enable_if_t<std::is_base_of_v<DAS::AbstractPhysicsObject, Obj1>>,
94 class = typename std::enable_if_t<std::is_base_of_v<DAS::AbstractPhysicsObject, Obj2>>>
95 auto operator+ (Obj1& o1, Obj2& o2)
100 template<
typename Obj1,
typename Obj2>
104 return s <<
'[' << *di.first <<
", " << *di.second <<
"] = " << di.
CorrP4();
106 return s <<
"\x1B[33minvalid system\x1B[0m";
109 #if defined(__ROOTCLING__)
110 #pragma link C++ class DAS::GenDijet::base +;
111 #pragma link C++ class DAS::GenDimuon::base +;
112 #pragma link C++ class DAS::GenZJet::base +;
113 #pragma link C++ class DAS::RecDijet::base +;
114 #pragma link C++ class DAS::RecDimuon::base +;
115 #pragma link C++ class DAS::RecZJet::base +;
117 #pragma link C++ class DAS::GenDijet +;
118 #pragma link C++ class DAS::GenDimuon +;
119 #pragma link C++ class DAS::GenZJet +;
120 #pragma link C++ class DAS::RecDijet +;
121 #pragma link C++ class DAS::RecDimuon +;
122 #pragma link C++ class DAS::RecZJet +;