32 namespace RestFrames {
35 const std::string& stitle) :
38 m_InvMassDependancy =
true;
43 ContraBoostInvJigsaw::~ContraBoostInvJigsaw() {}
46 return ContraBoostInvJigsaw::m_Empty;
55 TLorentzVector Pvis1 = GetDependancyStates(0).GetFourVector();
56 TLorentzVector Pvis2 = GetDependancyStates(1).GetFourVector();
57 double Mvis1 = std::max(Pvis1.M(), 0.);
58 double Mvis2 = std::max(Pvis2.M(), 0.);
59 double M12 = (Pvis1+Pvis2).M();
61 if(Minv1 < -0.5 && Minv2 < -0.5)
62 return 2.*GetP(M12,Mvis1,Mvis2);
64 Minv1 = std::max(Minv1,0.);
65 Minv2 = std::max(Minv2,0.);
67 double Minvmax = std::max(0.,std::max(Minv1,Minv2));
69 double Mvismin = std::min(Mvis1,Mvis2);
70 double Mvismax = std::max(Mvis1,Mvis2);
72 if(Minv1 < Mvis2 && Minv2 < Mvis1){
73 if(Minvmax <= Mvismin)
74 return sqrt( M12*M12 + 4.*(Minvmax-Mvismin)*(Minvmax+Mvismax) );
78 if(Mvismin <= 0.0 && Minvmax > 0.)
81 return M12*(1.+sqrt(std::max(Minv1*Minv1-Mvis2*Mvis2,
82 Minv2*Minv2-Mvis1*Mvis1))/Mvismin);
87 return SetSpirit(
false);
89 TLorentzVector Pvis1 = GetDependancyStates(0).GetFourVector();
90 TLorentzVector Pvis2 = GetDependancyStates(1).GetFourVector();
94 TVector3 Boost = (Pvis1+Pvis2+INV).BoostVector();
99 double E1 = Pvis1.E();
100 double E2 = Pvis2.E();
101 double m1 = std::max(0.,Pvis1.M());
102 double m2 = std::max(0.,Pvis2.M());
103 TVector3 P1 = Pvis1.Vect();
104 TVector3 P2 = Pvis2.Vect();
108 double Minv = std::max(0.,std::max(Minv1,Minv2));
109 double Mvis = std::min(m1,m2);
114 double MC2 = 2.*(E1*E2 + P1.Dot(P2));
115 double k1 = (m1+m2)*(m1-m2)*(1.-Minv/Mvis) + MC2-2*m1*m2 + (m1+m2)*fabs(m1-m2)*Minv/Mvis;
116 double k2 = -(m1+m2)*(m1-m2)*(1.-Minv/Mvis) + MC2-2*m1*m2 + (m1+m2)*fabs(m1-m2)*Minv/Mvis;
117 double Xbar = sqrt( (k1+k2)*(k1+k2)*(MC2*MC2-4*m1*m1*m2*m2) +
118 16.*Minv*Minv*(k1*k1*m1*m1 + k2*k2*m2*m2 + k1*k2*MC2) );
119 double K = ( fabs(k1*m1*m1-k2*m2*m2) - 0.5*fabs(k2-k1)*MC2 + 0.5*Xbar )/
120 (k1*k1*m1*m1 + k2*k2*m2*m2 + k1*k2*MC2);
126 double sumcE = c1*E1+c2*E2;
128 double N = (sqrt(sumE*sumE-(Pvis1+Pvis2).M2()+INV.M2())+sumE)/sumcE/2.;
133 TLorentzVector INV1,INV2;
134 double Einv1 = (c1-1.)*E1 + c2*E2;
135 double Einv2 = c1*E1 + (c2-1.)*E2;
136 TVector3 Pinv1 = (c1-1.)*P1 - c2*P2;
137 TVector3 Pinv2 = (c2-1.)*P2 - c1*P1;
139 INV1.SetPxPyPzE(Pinv1.X(),Pinv1.Y(),Pinv1.Z(),Einv1);
140 INV2.SetPxPyPzE(Pinv2.X(),Pinv2.Y(),Pinv2.Z(),Einv2);
142 if(Minv1 >= 0. && INV1.M() < Minv1)
143 INV1.SetVectM(Pinv1,Minv1);
144 if(Minv2 >= 0. && INV2.M() < Minv2)
145 INV2.SetVectM(Pinv2,Minv2);
153 return SetSpirit(
true);