10 #include "TMatrixDSym.h" 11 #include "TLorentzVector.h" 20 ,
double s23_in,
double s34_in
28 set(t01_in, s12_in, s23_in, s34_in, t40_in
29 , m0_in, m1_in, m2_in, m3_in, m4_in);
39 for(
int i=0; i<5; i++){
41 for(
int j=0; j<5; j++){
42 stij[i][j] = other.
stij[i][j];
43 xij[i][j] = other.
xij[i][j];
103 ,
double s23_in,
double s34_in
126 ,
double s23_in,
double s34_in
135 for(
int i=0; i<5; i++)
m[i]=m_in[i];
141 ,
double s23_in,
double s34_in
153 knowK4=knowK3_12=knows124=knowK3_23=knows14=
false;
154 knowK3_34=knows134=knows13_plus_s24=
false;
155 knows13_minus_s24=knows13=knows24=
false;
156 knowBDet=knowstij=
false;
157 knowDelta4=knowDelta3=knowDelta2=
false;
159 knowp1=knowp2=knowp3=knowp4=knowp0=
false;
171 s12Min = s12Max = -9999;
172 double s23AbsMin = (_d2M + _d3M)*(_d2M + _d3M);
173 double s23AbsMax = (_mumM - _d1M)*(_mumM - _d1M);
175 if(_s23 < 0)
return 0;
176 if(_s23 < s23AbsMin)
return false;
177 if(_s23 > s23AbsMax)
return false;
180 double mumMsq = _mumM * _mumM;
182 if(_s23 > mumMsq)
return false;
184 double m1sq=_d1M*_d1M, m2sq=_d2M*_d2M, m3sq=_d3M*_d3M;
186 double m23 = sqrt(_s23);
187 double E3 = (_s23 - m2sq + m3sq)/(2*m23);
188 if(E3 < _d3M)
return false;
190 double E1 = (mumMsq - _s23 - m1sq)/(2*m23);
191 if(E1 < _d1M)
return false;
193 double E3_E1sq = (E3+E1)*(E3+E1);
194 double p3_23 = sqrt(E3*E3 - m3sq);
195 double p1_23 = sqrt(E1*E1 - m1sq);
196 double P_minSq = (p3_23 - p1_23)*(p3_23 - p1_23);
197 double P_maxSq = (p3_23 + p1_23)*(p3_23 + p1_23);
199 s12Max = E3_E1sq - P_minSq;
200 s12Min = E3_E1sq - P_maxSq;
201 if(
false)cout <<
"s12Max s12Min " 218 if(! knowstij) fill_stij();
223 if(! knowstij) fill_stij();
229 if(! knowstij) fill_stij();
230 m(0,0) = xij[p1][q1];
231 m(0,1) = xij[p1][q2];
232 m(1,0) = xij[p2][q1];
233 m(1,1) = xij[p2][q2];
235 return m.Determinant();
239 ,
int q1,
int q2,
int q3){
241 if(! knowstij) fill_stij();
242 m(0,0) = xij[p1][q1];
243 m(0,1) = xij[p1][q2];
244 m(0,2) = xij[p1][q3];
245 m(1,0) = xij[p2][q1];
246 m(1,1) = xij[p2][q2];
247 m(1,2) = xij[p2][q3];
248 m(2,0) = xij[p3][q1];
249 m(2,1) = xij[p3][q2];
250 m(2,2) = xij[p3][q3];
252 return m.Determinant();
256 ,
int q1,
int q2,
int q3,
int q4){
258 if(! knowstij) fill_stij();
259 m(0,0) = xij[p1][q1];
260 m(0,1) = xij[p1][q2];
261 m(0,2) = xij[p1][q3];
262 m(0,3) = xij[p1][q4];
263 m(1,0) = xij[p2][q1];
264 m(1,1) = xij[p2][q2];
265 m(1,2) = xij[p2][q3];
266 m(1,3) = xij[p2][q4];
267 m(2,0) = xij[p3][q1];
268 m(2,1) = xij[p3][q2];
269 m(2,2) = xij[p3][q3];
270 m(2,3) = xij[p3][q4];
271 m(3,0) = xij[p4][q1];
272 m(3,1) = xij[p4][q2];
273 m(3,2) = xij[p4][q3];
274 m(3,3) = xij[p4][q4];
276 return m.Determinant();
283 return G(p1, p2, p1, p2);
286 return G(p1, p2, p3, p1, p2, p3);
289 return G(p1, p2, p3, p4, p1, p2, p3, p4);
293 if(! knowK4) calcK4();
297 _K4 = m0sq() + 2*(m1sq() + m2sq() + m3sq() + m4sq());
301 if(! knowK3_12) calcK3_12();
307 _K3_12 = m0sq() + m12sq() + m3sq() + m4sq();
311 if(! knows124) calcs124();
315 _s124 = K3_12() - s123() - s34();
320 if(! knowK3_23) calcK3_23();
326 _K3_23 = m0sq() + m1sq() + m23sq() + m4sq();
331 if(! knows14) calcs14();
335 _s14 = K3_23() - s123() - s234();
339 if(! knowK3_34) calcK3_34();
345 _K3_34 = m0sq() + m1sq() + m2sq() + m34sq();
349 if(! knows134) calcs134();
353 _s134 = K3_34() - s12() - s234();
358 if(! knows13_plus_s24) calcs13_plus_s24();
359 return _s13_plus_s24;
363 _s13_plus_s24 = K4() - s12() -s23() - s34() - s14();
364 knows13_plus_s24 =
true;
367 if(! knows13_minus_s24) calcs13_minus_s24();
368 return _s13_minus_s24;
380 _s13_minus_s24 = s123() + s134() - m0sq() - m2sq() - m4sq();
382 knows13_minus_s24 =
true;
385 if(! knows13) calcs13();
389 _s13 = (s13_plus_s24() + s13_minus_s24())/2.0;
393 if(! knows24) calcs24();
397 _s24 = (s13_plus_s24() - s13_minus_s24())/2.0;
402 int a = (i < j ? i: j);
403 int b = (i >= j ? i: j);
404 return sij(10*a + b);
407 std::vector<int> v = v_in;
408 sort(v.begin(), v.end());
411 for(
int i= v.size() -1; i>=0; i--){
412 index += facTen * v[i];
421 v.push_back(i); v.push_back(j); v.push_back(k);
422 sort(v.begin(), v.end());
424 return sij(100*v[0] + 10*v[1] + v[2]);
487 cout <<
"Error from Calculate4BodyProps::sij(" << index <<
")" 488 <<
": Don't understand index " << index << endl;
495 if(! knowBDet) calcBDet();
507 B(1,0)=B(0,1)=m2sq(); B(1,1) = 0;
508 B(2,0)=B(0,2)=s23() ; B(2,1)=B(1,2) = m3sq(); B(2,2)=0;
509 B(3,0)=B(0,3)=t01() ; B(3,1)=B(1,3) = s34() ; B(3,2)=B(2,3)=m4sq(); B(3,3)=0;
510 B(4,0)=B(0,4)=m1sq(); B(4,1)=B(1,4) = s12() ; B(4,2)=B(2,4)=t40() ; B(4,3)=B(3,4)=m0sq(); B(4,4)=0;
511 B(5,0)=B(0,5)=B(5,1)=B(1,5)=B(5,2)=B(2,5)=B(5,3)=B(3,5)=B(5,4)=B(4,5)=1;
514 _BDet = B.Determinant();
524 stij[0][0] = 4*m0sq();
525 stij[0][1] = stij[1][0]=t01();
526 stij[0][4] = stij[4][0]=t40();
527 stij[1][1] = 4*m1sq();
528 stij[1][2] = stij[2][1] = s12();
529 stij[1][3] = stij[3][1] = s13();
530 stij[1][4] = stij[4][1] = s14();
531 stij[2][2] = 4*m2sq();
532 stij[2][3] = stij[3][2] = s23();
533 stij[2][4] = stij[4][2] = s24();
534 stij[3][3] = 4*m3sq();
535 stij[3][4] = stij[4][3] = s34();
536 stij[4][4] = 4*m4sq();
538 for(
int i=0; i<5; i++){
539 for(
int j=0; j<5; j++){
540 xij[i][j] = 0.5*( stij[i][j] -
m[i]*
m[i] -
m[j]*
m[j] );
547 if(! knowDelta4) calcDelta4();
553 return Delta4_without_xij();
558 if(! knowstij)fill_stij();
561 B(1,0)=B(0,1)=xij[2][1]; B(1,1)=xij[2][2];
562 B(2,0)=B(0,2)=xij[3][1]; B(2,1)=B(1,2)=xij[3][2]; B(2,2)=xij[3][3];
563 B(3,0)=B(0,3)=xij[4][1]; B(3,1)=B(1,3)=xij[4][2]; B(3,2)=B(2,3)=xij[4][3]; B(3,3)=xij[4][4];
565 _Delta4 = B.Determinant();
571 if(! knowDelta3) calcDelta3();
576 if(! knowstij)fill_stij();
578 B(1,0)=B(0,1)=xij[2][1]; B(1,1)=xij[2][2];
579 B(2,0)=B(0,2)=xij[3][1]; B(2,1)=B(1,2)=xij[3][2]; B(2,2)=xij[3][3];
580 _Delta3 = B.Determinant();
584 if(! knowDelta2) calcDelta2();
589 if(! knowstij)fill_stij();
591 B(1,0)=B(0,1)=xij[2][1]; B(1,1)=xij[2][2];
592 _Delta2 = B.Determinant();
596 if(! knowstij)fill_stij();
601 double D1=Delta1(), D2=Delta2(), D3=Delta3(), D4=Delta4();
602 if(D1 <=0 || -D2*D3 <=0 || -D4/D3 < 0 || -D1*D2 <=0){
606 double invps2 = -Delta4();
607 if(invps2 <= 0)
return 0;
608 return pi*
pi/(32.0*
m[0]*
m[0]) * 1.0/sqrt(invps2);
612 double D1=Delta1(), D2=Delta2(), D3=Delta3(), D4=Delta4();
613 cout <<
"Calculate4BodyProps::showPhaseSpaceFactorCalculation()" << endl;
614 cout <<
"\n\t D1 " << D1 <<
", D2 " << D2
615 <<
", D3 " << D3 <<
", D4 " << D4 << endl;
616 cout <<
"\n\t D1 <=0 ? " << D1;
617 cout <<
"\n\t -D2*D3 <=0 ? " <<
"- " << D2 <<
" * " << D3
619 cout <<
"\n\t -D4/D3 < 0 ? " <<
"- " << D4 <<
" / " << D3;
620 if(D3 != 0) cout <<
" = " << -D4/D3;
621 cout <<
"\n\t -D1*D2 <=0 ? " <<
"- " << D1 <<
" * " << D2
625 if(D1 <=0 || -D2*D3 <=0 || -D4/D3 < 0 || -D1*D2 <=0){
629 double invps2 = -Delta4();
630 cout <<
"\n\t invps2 = " << invps2 << endl;
631 if(invps2 <= 0)
return 0;
632 double returnVal =
pi*
pi/(32.0*
m[0]*
m[0]) * 1.0/sqrt(invps2);
633 cout <<
"\n\t returning " << returnVal << endl;
641 boundaries3Body(mi, ma
650 boundaries3Body(mi, ma
659 boundaries3Body(mi, ma
669 boundaries3Body(mi, ma
671 , m0(), m1(), sqrt(s23())
679 boundaries3Body(mi, ma
681 , m0(),
m2(), sqrt(s34())
688 if(! knowp1) calcp1();
694 TLorentzVector p(-9999,-9999,-9999,-9999);
697 TLorentzVector p(0, 0, 0, sqrt(D1));
704 if(! knowp2) calcp2();
708 double D1=Delta1(), D2=Delta2();
709 if(D1 <= 0 || -D2/D1 < 0){
710 TLorentzVector p(-9999,-9999,-9999,-9999);
713 TLorentzVector p(0, 0, sqrt(-D2/D1), G(1,2)/sqrt(D1));
719 if(! knowp3) calcp3();
724 double D1=Delta1(), D2=Delta2(), D3=Delta3();
725 if(D1 <= 0 || (- D1 * D2) <= 0 || -D3/D2 < 0 ){
726 if(dbThis) cout <<
"calcp3, failing because " 727 << D1 <<
" <= " << 0 <<
" || " 728 << (- D1 * D2) <<
" <= " << 0
729 <<
" || " << -D3/D2 <<
" < " << 0 <<endl;
730 if(dbThis) cout <<
" Delta3 = " << D3 << endl;
731 TLorentzVector p(-9999,-9999,-9999,-9999);
734 TLorentzVector p( sqrt(-D3/D2)
736 , -G(1,2, 1,3)/sqrt(-D1*D2)
745 if(! knowp4) calcp4();
749 double D1=Delta1(), D2=Delta2(), D3=Delta3(), D4=Delta4();
750 if(D1 <=0 || -D2*D3 <=0 || -D4/D3 < 0 || -D1*D2 <=0){
751 TLorentzVector p(-9999,-9999,-9999,-9999);
754 TLorentzVector p(G(1, 2, 3, 1, 2, 4)/sqrt(-D2*D3)
756 , -G(1, 2, 1, 4)/sqrt(-D1*D2)
765 if(! knowp0) calcp0();
769 double D1=Delta1(), D2=Delta2(), D3=Delta3(), D4=Delta4();
770 if(D1 <=0 || -D2*D3 <=0 || -D4/D3 < 0 || -D1*D2 <=0){
771 TLorentzVector p(-9999,-9999,-9999,-9999);
774 _p0 = p1() + p2() + p3() + p4();
797 TLorentzVector p(-9999,-9999,-9999,-9999);
TLorentzVector pVec(int i)
void set(double t01_in, double s12_in, double s23_in, double s34_in, double t40_in, double m0_in, double m1_in, double m2_in, double m3_in, double m4_in)
bool boundaries3Body(double &s12Min, double &s12Max, double _s23, double _mumM, double _d1M, double _d2M, double _d3M)
void t01MinMax(double &mi, double &ma)
void s23MinMax(double &mi, double &ma)
void setWithSameMass(double t01_in, double s12_in, double s23_in, double s34_in, double t40_in)
double sijk(int i, int j, int k)
void s12MinMax(double &mi, double &ma)
void s34MinMax(double &mi, double &ma)
double showPhaseSpaceFactorCalculation()
double Delta4_without_xij()
double phaseSpaceFactor()
void t40MinMax(double &mi, double &ma)