48 if(0 == _exampleDecayD){
52 a1.
addDgtr(211, 113)->addDgtr(211, -211);
53 _exampleDecayD->addDgtr(-211);
54 _exampleDecayD->addDgtr(&a1);
56 return *_exampleDecayD;
59 return getExampleDecay();
63 if(0 == _exampleDecay){
65 _exampleDecay->addDgtr(888310)->addDgtr(211, -211);
66 _exampleDecay->addDgtr(321, -321);
68 return *_exampleDecay;
71 return getExampleDecay();
75 if(0 == _exampleDecay){
77 _exampleDecay->addDgtr(9010221)->addDgtr(211, -211);
78 _exampleDecay->addDgtr(9010221)->addDgtr(211, -211);
80 return *_exampleDecay;
83 return getExampleDecay();
87 if(0 == _exampleDecay){
89 _exampleDecay->addDgtr(-211, 100211)->addDgtr(211, 9000221)->addDgtr(-211,211);
91 return *_exampleDecay;
94 return getExampleDecay();
114 if(0==_exampleDecay){
119 _exampleDecay->addDgtr(-211, 100211)->addDgtr(211, 113)->addDgtr(-211,211);
121 return *_exampleDecay;
125 return getExampleDecay();
130 if(fsPS.size() < 4) fsPS.reserve(4);
131 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
136 if(0==P || 0==fsPS[0]){
137 cout <<
"ERROR in SF_DtoPP0_PtoVP1_VtoP2P3::parseTree" 138 <<
" Didn't find P or P1 " << P.
get() <<
", " << fsPS[0].get() << endl;
142 for(
int i=0; i< P->nDgtr(); i++){
147 if(0==V || 0==fsPS[1]){
148 cout <<
"ERROR in SF_DtoPP0_PtoVP1_VtoP2P3::parseTree" 149 <<
" Didn't find V or P2 " << V.
get() <<
", " << fsPS[1].get() << endl;
154 cout <<
"ERROR in SF_DtoAP0_AtoVP1_VtoP2P3::parseTree" 155 <<
" V should have 2 daughters, but it says it has " 160 fsPS[2] = V->getDgtrTreePtr(0);
161 fsPS[3] = V->getDgtrTreePtr(1);
172 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
173 TLorentzVector pV = p(2, evt) + p(3, evt);
174 TLorentzVector qV = p(2, evt) - p(3, evt);
176 double MassV = mRes(V, evt);
178 if (_useZemachTensors) {
179 double MP = mRes(P, evt);
180 TLorentzVector pP= pV + p(1, evt);
181 TLorentzVector qP= pV - p(1, evt);
185 return (LP.Dot(LV))/(
GeV*
GeV);
188 return (p(1, evt).Dot(qV)
189 - p(1, evt).Dot(pV) * pV.Dot(qV) / (MassV*MassV))
196 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
197 os <<
"---------------------------------------------------------" 198 <<
"\n spin factor SF_DtoPP0_PtoVP1_VtoP2P3 " 199 <<
"\n (p(1).Dot(qV) -p(1).Dot(pV) * pV.Dot(qV) / (MassV*MassV)) / (GeV*GeV)" 200 <<
"\n with pV = p(2) + p(3); qV = p(2) - p(3)" 201 <<
"\n parsed tree " << theDecay().oneLiner()
202 <<
"\n like this:" << endl;
203 this->printParsing(os);
209 if(0==_exampleDecay){
214 _exampleDecay->addDgtr(-321, 10323)->addDgtr(321, 113)->addDgtr(211,-211);
216 return *_exampleDecay;
220 return getExampleDecay();
227 bool debugThis=
false;
229 if(fsPS.size() < 4) fsPS.reserve(4);
230 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
232 theDecay(pat).getDgtrTreePtr(i);
235 else if(dgtr->
getVal().
SVPAT() ==
"P") fsPS[0] = dgtr;
237 if(0==A || 0==fsPS[0]){
238 cout <<
"ERROR in SF_DtoAP0_AtoVP1_VtoP2P3::parseTree" 239 <<
" Didn't find A or P1 " << A.
get() <<
", " << fsPS[0].get() << endl;
243 for(
int i=0; i< A->nDgtr(); i++){
246 else if(dgtr->
getVal().
SVPAT() ==
"P") fsPS[1] = dgtr;
248 if(0==V || 0==fsPS[1]){
249 cout <<
"ERROR in SF_DtoAP0_AtoVP1_VtoP2P3::parseTree" 250 <<
" Didn't find V or P2 " << V.
get() <<
", " << fsPS[1].get() << endl;
255 cout <<
"ERROR in SF_DtoAP0_AtoVP1_VtoP2P3::parseTree" 256 <<
" V should have 2 daughters, but it says it has " 261 fsPS[2] = V->getDgtrTreePtr(0);
262 fsPS[3] = V->getDgtrTreePtr(1);
267 cout <<
"parsed Tree: V:\n" 272 for(
int i=0; i<4; i++){
273 cout <<
"fsPS[" << i <<
"]\n" 283 bool debugThis =
false;
285 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
287 TLorentzVector pV = p(2, evt) + p(3, evt);
288 TLorentzVector qV = p(2, evt) - p(3, evt);
289 TLorentzVector pA = p(1, evt) + p(2, evt) + p(3, evt);
290 TLorentzVector p0 = p(0, evt);
291 TLorentzVector pD = p(0, evt) + pA ;
292 TLorentzVector qD = pA - p(0, evt) ;
294 double MA = mRes(A, evt);
295 double MassV = mRes(V, evt);
298 for(
int i=0; i<4; i++){
299 cout <<
" numbered by SF: p(" << i <<
") " << p(i, evt) << endl;
301 for(
int i=0; i<4; i++){
302 cout <<
" numbered 'normally' p(" << i <<
") " 303 << p(i, evt) << endl;
305 cout <<
"got pV " << pV << endl;
308 if(_useZemachTensors){
313 TLorentzVector tmp= PA.
Dot(LV);
314 return (LB.Dot(tmp))/(
GeV*
GeV);
319 return (p(0, evt).Dot(qV)
320 - p0.Dot(pA) * pA.Dot(qV) / (MA*MA)
321 - p0.Dot(pV) * pV.Dot(qV) / (MassV*MassV)
322 + p0.Dot(pA) * pA.Dot(pV) * pV.Dot(qV) / (MA*MA * MassV*MassV)
330 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
331 os <<
"spin factor SF_DtoAP0_AtoVP1_VtoP2P3" 332 <<
"\n\t (p(0).Dot(qV)" 333 <<
"\n\t - p(0).Dot(pA) * pA.Dot(qV) / (MA*MA)" 334 <<
"\n\t - p(0).Dot(pV) * pV.Dot(qV) / (MassV*MassV)" 335 <<
"\n\t + p(0).Dot(pA) * pA.Dot(pV) * pV.Dot(qV) / (MA*MA * MassV*MassV)" 338 <<
"\n\t with qV = p(2) - p(3) and pA = p(1) + p(2) + p(3)" 339 <<
"\n\t parsed tree " << theDecay().oneLiner()
340 <<
"\n like this:" << endl;
341 this->printParsing(os);
346 if(0==_exampleDecay){
351 _exampleDecay->addDgtr(-321, 10323)->addDgtr(211, 10311)->addDgtr(321,-211);
353 return *_exampleDecay;
357 return getExampleDecay();
362 if(fsPS.size() < 4) fsPS.reserve(4);
363 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
365 theDecay(pat).getDgtrTreePtr(i);
370 if(0==A || 0==fsPS[0]){
371 cout <<
"ERROR in SF_DtoAP0_AtoSP1_StoP2P3::parseTree" 372 <<
" Didn't find A or P1 " << A.
get() <<
", " << fsPS[0].get() << endl;
376 for(
int i=0; i< A->nDgtr(); i++){
381 if(0==S || 0==fsPS[1]){
382 cout <<
"ERROR in SF_DtoAP0_AtoSP1_StoP2P3::parseTree" 383 <<
" Didn't find S or P2 " << S.
get() <<
", " << fsPS[1].get() << endl;
388 cout <<
"ERROR in SF_DtoAP0_AtoSP1_StoP2P3::parseTree" 389 <<
" S should have 2 daughters, but it says it has " 394 fsPS[2] = S->getDgtrTreePtr(0);
395 fsPS[3] = S->getDgtrTreePtr(1);
404 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
406 TLorentzVector p0(p(0, evt)), p1(p(1, evt)), p2(p(2, evt)), p3(p(3, evt));
407 TLorentzVector pV = p2+p3;
409 TLorentzVector pA = p1 + p2 + p3;
410 TLorentzVector qA = (p2 + p3) - p1;
412 TLorentzVector pD = pA + p0;
413 TLorentzVector qD = pA - p0;
415 double MA = mRes(A, evt);
417 if(_useZemachTensors){
420 return (LD.Dot(LA))/(
GeV*
GeV);
425 - p0.Dot(pA) * pA.Dot(qA) / (MA*MA)
433 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
434 os <<
"spin factor SF_DtoAP0_AtoSP1_StoP2P3" 435 <<
"\n\t ( p(0).Dot(qA) - p(0).Dot(pA) * pA.Dot(qA) / (MA*MA) ) / (GeV*GeV)" 436 <<
"\n\t with pV = p(2) + p(3), pA = p(1) + p(2) + p(3), qA = (p(2) + p(3)) - p(1)" 437 <<
"\n\t parsed tree " << theDecay().oneLiner()
438 <<
"\n like this:" << endl;
439 this->printParsing(os);
444 if(0==_exampleDecayS){
449 _exampleDecayS->addDgtr( 313)->addDgtr( 321, -211);
450 _exampleDecayS->addDgtr(-313)->addDgtr(-321, 211);
452 return *_exampleDecayS;
456 if(0==_exampleDecayP){
461 _exampleDecayP->addDgtr( 313)->addDgtr( 321, -211);
462 _exampleDecayP->addDgtr(-313)->addDgtr(-321, 211);
464 _exampleDecayP->getVal().setL(1);
466 return *_exampleDecayP;
470 if(0==_exampleDecayD){
475 _exampleDecayD->addDgtr( 313)->addDgtr( 321, -211);
476 _exampleDecayD->addDgtr(-313)->addDgtr(-321, 211);
478 _exampleDecayD->getVal().setL(2);
480 return *_exampleDecayD;
484 return getExampleDecay();
487 return getExampleDecay();
491 return getExampleDecay();
496 if(fsPS.size() < 4) fsPS.reserve(4);
497 if(theDecay(pat).nDgtr() != 2){
498 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_BASE::parseTree" 499 <<
" expected exactly 2 daughers of D, have " 500 << theDecay(pat).nDgtr();
503 V1 = theDecay(pat).getDgtrTreePtr(0);
504 V2 = theDecay(pat).getDgtrTreePtr(1);
507 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_BASE::parseTree" 508 <<
" Didn't find V1 or V2 " << V1.get() <<
", " << V2.get() << endl;
511 if(V1->nDgtr() != 2){
512 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_BASE::parseTree" 513 <<
" V1 should have 2 daughters, but it says it has " 514 << V1->nDgtr() <<
"." 518 fsPS[0] = V1->getDgtrTreePtr(0);
519 fsPS[1] = V1->getDgtrTreePtr(1);
522 if(V2->nDgtr() != 2){
523 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_BASE::parseTree" 524 <<
" V2 should have 2 daughters, but it says it has " 525 << V2->nDgtr() <<
"." 529 fsPS[2] = V2->getDgtrTreePtr(0);
530 fsPS[3] = V2->getDgtrTreePtr(1);
539 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ){
543 TLorentzVector pV1 = p(0, evt) + p(1, evt);
544 TLorentzVector qV1 = p(0, evt) - p(1, evt);
545 TLorentzVector pV2 = p(2, evt) + p(3, evt);
546 TLorentzVector qV2 = p(2, evt) - p(3, evt);
548 double MV1 = mRes(V1, evt);
549 double MV2 = mRes(V2, evt);
552 double returnVal= (qV1.Dot(qV2)
553 - qV1.Dot(pV1) * pV1.Dot(qV2) / (MV1*MV1)
554 - qV1.Dot(pV2) * pV2.Dot(qV2) / (MV2*MV2)
555 + qV1.Dot(pV1) * pV1.Dot(pV2) * pV2.Dot(qV2)
556 / (MV1*MV1 * MV2*MV2)
566 cout <<
"SF_DtoV1V2_V1toP0P1_V1toP2P3_S compare: " << zResult <<
" / " 567 << returnVal <<
" = " << zResult/returnVal << endl;
575 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
576 os <<
"spin factor SF_DtoV1V2_V1toP0P1_V1toP2P3_S" 577 <<
"\n\t ( qV1.Dot(qV2)" 578 <<
"\n\t - qV1.Dot(pV1) * pV1.Dot(qV2) / (MV1*MV1)" 579 <<
"\n\t - qV1.Dot(pV2) * pV2.Dot(qV2) / (MV2*MV2)" 580 <<
"\n\t + qV1.Dot(pV1) * pV1.Dot(pV2) * pV2.Dot(qV2) " 581 <<
"\n\t / (MV1*MV1 * MV2*MV2)" 584 <<
"\n\t with pV1 = p(0) + p(1), qV1 = p(0) - p(1), pV2 = p(2) + p(3), qV2 = p(2) - p(3)" 585 <<
"\n\t parsed tree " << theDecay().oneLiner()
586 <<
"\n like this:" << endl;
587 this->printParsing(os);
594 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
596 TLorentzVector pV1 = p(0, evt) + p(1, evt);
597 TLorentzVector qV1 = p(0, evt) - p(1, evt);
598 TLorentzVector pV2 = p(2, evt) + p(3, evt);
599 TLorentzVector qV2 = p(2, evt) - p(3, evt);
601 TLorentzVector pD = pV1 + pV2;
602 TLorentzVector qD = pV1 - pV2;
604 if (_useZemachTensors) {
605 double MV1 = mRes(V1, evt);
606 double MV2 = mRes(V2, evt);
613 cout <<
LeviCivita(pD,LD,LV1).Dot(LV2) << endl;
614 cout <<
LeviCivita(pD,LD,LV1,LV2) << endl << endl;
650 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
651 os <<
"spin factor SF_DtoV1V2_V1toP0P1_V1toP2P3_P" 652 <<
"\n\t LeviCivita(pD, qD, qV1, qV2)" 653 <<
"\n\t with pV1 = p(0) + p(1), qV1 = p(0) - p(1), pV2 = p(2) + p(3), qV2 = p(2) - p(3)" 654 <<
"\n\t parsed tree " << theDecay().oneLiner()
655 <<
"\n like this:" << endl;
656 this->printParsing(os);
664 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
666 TLorentzVector pV1 = p(0, evt) + p(1, evt);
667 TLorentzVector qV1 = p(0, evt) - p(1, evt);
668 TLorentzVector pV2 = p(2, evt) + p(3, evt);
669 TLorentzVector qV2 = p(2, evt) - p(3, evt);
671 double MV1 = mRes(V1, evt);
672 double MV2 = mRes(V2, evt);
675 if (_useZemachTensors) {
676 TLorentzVector pD = pV1 + pV2;
677 TLorentzVector qD = pV1 - pV2;
688 ( qV1.Dot(pV2) - qV1.Dot(pV1) * pV1.Dot(pV2)/(MV1*MV1)
690 qV2.Dot(pV1) - qV2.Dot(pV2) * pV2.Dot(pV1)/(MV2*MV2)
696 TLorentzVector pD = -(pV1 + pV2);
697 TLorentzVector qD = pV1 - pV2;
708 double z2Result = tV1.Dot(pV2) * tV2.Dot(pV1)/(
GeV*
GeV*
GeV*
GeV);
710 cout <<
"SF_DtoV1V2_V1toP0P1_V1toP2P3_D compare: 1/n " << z1Result <<
" / " 711 << returnVal <<
" = " << z1Result/returnVal << endl;
712 cout <<
" .... and compare: 2/n " << z2Result <<
" / " 713 << returnVal <<
" = " << z2Result/returnVal << endl;
714 cout <<
" .... and compare: 2/1 " << z2Result <<
" / " 715 << z1Result <<
" = " << z2Result/z1Result << endl;
716 cout <<
" .... and compare: 3/n " << z3Result <<
" / " 717 << returnVal <<
" = " << z3Result/returnVal << endl;
718 cout <<
" .... and compare: 3/1 " << z3Result <<
" / " 719 << z1Result <<
" = " << z3Result/z1Result << endl;
728 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
729 os <<
"spin factor SF_DtoV1V2_V1toP0P1_V1toP2P3_D" 730 <<
"\n\t ( qV1.Dot(pV2) - qV1.Dot(pV1) * pV1.Dot(pV2)/(MV1*MV1)" 732 <<
"\n\t qV2.Dot(pV1) - qV2.Dot(pV2) * pV2.Dot(pV1)/(MV2*MV2)" 734 <<
"\n\t / (GeV*GeV*GeV*GeV)" 735 <<
"\n\t with pV1 = p(0) + p(1), qV1 = p(0) - p(1), pV2 = p(2) + p(3), qV2 = p(2) - p(3)" 736 <<
"\n\t parsed tree " << theDecay().oneLiner()
737 <<
"\n like this:" << endl;
738 this->printParsing(os);
744 if(0==_exampleDecay){
749 _exampleDecay->addDgtr(-321, 321);
750 _exampleDecay->addDgtr( 113)->addDgtr( 211, -211);
752 return *_exampleDecay;
756 return getExampleDecay();
761 if(fsPS.size() < 4) fsPS.reserve(4);
763 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
767 fsPS[P_index++] = dgtr;
771 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_S_nonResV1::parseTree" 772 <<
" Didn't find V " << V2.
get() << endl;
775 if(P_index != 2 || 0==(fsPS[0]) || 0==(fsPS[1]) ){
776 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_S_nonResV1::parseTree" 777 <<
" Didn't find P1, P2 " << endl;
780 if(V2->nDgtr() != 2){
781 cout <<
"ERROR in SF_DtoV1V2_V1toP0P1_V1toP2P3_S_nonResV1::parseTree" 782 <<
" V should have 2 daughters, but it says it has " 783 << V2->
nDgtr() <<
"." 787 fsPS[2] = V2->getDgtrTreePtr(0);
788 fsPS[3] = V2->getDgtrTreePtr(1);
796 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
798 TLorentzVector pV1 = p(0, evt) + p(1, evt);
799 TLorentzVector qV1 = p(0, evt) - p(1, evt);
800 TLorentzVector pV2 = p(2, evt) + p(3, evt);
801 TLorentzVector qV2 = p(2, evt) - p(3, evt);
803 double MV1 = pV1.M();
804 double MV2 = mRes(V2, evt);
807 - qV1.Dot(pV1) * pV1.Dot(qV2) / (MV1*MV1)
808 - qV1.Dot(pV2) * pV2.Dot(qV2) / (MV2*MV2)
809 + qV1.Dot(pV1) * pV1.Dot(pV2) * pV2.Dot(qV2)
810 / (MV1*MV1 * MV2*MV2)
818 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
819 os <<
"spin factor SF_DtoV1V2_V1toP0P1_V1toP2P3_S_nonResV1" 820 <<
" - I recommend not to use this, use nonRes particles insted " 821 <<
" anyway, this is what I do:" 822 <<
"\n\t (qV1.Dot(qV2)" 823 <<
"\n\t - qV1.Dot(pV1) * pV1.Dot(qV2) / (MV1*MV1)" 824 <<
"\n\t - qV1.Dot(pV2) * pV2.Dot(qV2) / (MV2*MV2)" 825 <<
"\n\t + qV1.Dot(pV1) * pV1.Dot(pV2) * pV2.Dot(qV2) " 826 <<
"\n\t / (MV1*MV1 * MV2*MV2)" 829 <<
"\n\t with: pV1 = p(0) + p(1), qV1 = p(0) - p(1), pV2 = p(2) + p(3) qV2 = p(2) - p(3);" 830 <<
"\n\t parsed tree " << theDecay().oneLiner()
831 <<
"\n like this:" << endl;
832 this->printParsing(os);
837 if(0==_exampleDecay){
842 _exampleDecay->addDgtr( 333)->addDgtr( 321, -321);
843 _exampleDecay->addDgtr(9010221)->addDgtr(-211, 211);
845 return *_exampleDecay;
849 return getExampleDecay();
854 if(fsPS.size() < 4) fsPS.reserve(4);
855 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
861 cout <<
"ERROR in SF_DtoVS_VtoP0P1_StoP2P3::parseTree" 862 <<
" Didn't find V or S " << V.
get() <<
", " << S.get() << endl;
866 cout <<
"ERROR in SF_DtoVS_VtoP0P1_StoP2P3::parseTree" 867 <<
" V should have 2 daughters, but it says it has " 872 fsPS[0] = V->getDgtrTreePtr(0);
873 fsPS[1] = V->getDgtrTreePtr(1);
877 cout <<
"ERROR in SF_DtoVS_VtoP0P1_StoP2P3::parseTree" 878 <<
" S should have 2 daughters, but it says it has " 883 fsPS[2] = S->getDgtrTreePtr(0);
884 fsPS[3] = S->getDgtrTreePtr(1);
892 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
894 TLorentzVector pS = p(2, evt) + p(3, evt);
895 TLorentzVector pV = p(0, evt) + p(1, evt);
896 TLorentzVector qV = p(0, evt) - p(1, evt);
898 double MassV = mRes(V, evt);
900 if(_useZemachTensors){
901 TLorentzVector pD= pV + pS;
902 TLorentzVector qD= pV - pS;
905 return (LD.Dot(LV))/(
GeV*
GeV);
909 - pS.Dot(pV) * pV.Dot(qV) / (MassV*MassV)
916 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
917 os <<
"spin factor SF_DtoVS_VtoP0P1_StoP2P3" 918 <<
"\n\t ( pS.Dot(qV) - pS.Dot(pV) * pV.Dot(qV) / (MassV*MassV) ) / (GeV*GeV)" 919 <<
"\n\t with: pS = p(2) + p(3), pV = p(0) + p(1), qV = p(0) - p(1)" 920 <<
"\n\t parsed tree " << theDecay().oneLiner()
921 <<
"\n like this:" << endl;
922 this->printParsing(os);
927 if(0==_exampleDecay){
932 _exampleDecay->addDgtr( 321, -321);
933 _exampleDecay->addDgtr(9010221)->addDgtr(-211, 211);
935 return *_exampleDecay;
939 return getExampleDecay();
944 if(fsPS.size() < 4) fsPS.reserve(4);
946 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
950 fsPS[P_index++] = dgtr;
954 cout <<
"ERROR in SF_DtoVS_VtoP0P1_StoP2P3_nonResV::parseTree" 955 <<
" Didn't find S " << S.
get() << endl;
958 if(P_index != 2 || 0==(fsPS[0]) || 0==(fsPS[1]) ){
959 cout <<
"ERROR in SF_DtoVS_VtoP0P1_StoP2P3_nonResV::parseTree" 960 <<
" Didn't find P1, P2 " << endl;
964 cout <<
"ERROR in SF_DtoVS_VtoP0P1_StoP2P3_nonResV::parseTree" 965 <<
" S should have 2 daughters, but it says it has " 970 fsPS[2] = S->getDgtrTreePtr(0);
971 fsPS[3] = S->getDgtrTreePtr(1);
979 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
981 TLorentzVector pS = p(2, evt) + p(3, evt);
982 TLorentzVector pV = p(0, evt) + p(1, evt);
983 TLorentzVector qV = p(0, evt) - p(1, evt);
985 double MassV = pV.M();
988 - pS.Dot(pV) * pV.Dot(qV) / (MassV*MassV)
995 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
996 os <<
"spin factor SF_DtoVS_VtoP0P1_StoP2P3_nonResV" 997 <<
" - recommend not to use this, use nonRes particles instead" 998 <<
"\n anyway, I return:" 999 <<
"\n\t (pS.Dot(qV) - pS.Dot(pV) * pV.Dot(qV) / (MassV*MassV) ) / (GeV*GeV)" 1000 <<
"\n\t with: pS = p(2) + p(3), pV = p(0) + p(1), qV = p(0) - p(1)" 1001 <<
"\n\t parsed tree " << theDecay().oneLiner()
1002 <<
"\n like this:" << endl;
1003 this->printParsing(os);
1009 if(0==_exampleDecay){
1014 _exampleDecay->addDgtr(310, 223)->addDgtr(111, 113)->addDgtr(211, -211);
1016 return *_exampleDecay;
1019 return getExampleDecay();
1025 if(fsPS.size() < 4) fsPS.reserve(4);
1026 for(
int i=0; i< theDecay(pat).nDgtr(); i++){
1031 if(0==V1 || 0==fsPS[0]){
1032 cout <<
"ERROR in SF_DtoV1P0_V1toV2P1_V2toP2P3::parseTree" 1033 <<
" Didn't find V1 or P0 " << V1.
get() <<
", " << fsPS[0].get() << endl;
1037 for(
int i=0; i< V1->nDgtr(); i++){
1042 if(0==V2 || 0==fsPS[1]){
1043 cout <<
"ERROR in SF_DtoV1P0_V1toV2P1_V2toP2P3::parseTree" 1044 <<
" Didn't find V2 or P1 " << V2.
get() <<
", " << fsPS[1].get() << endl;
1048 if(V2->nDgtr() != 2){
1049 cout <<
"ERROR in SF_DtoV1P0_V1toV2P1_V2toP2P3::parseTree" 1050 <<
" V should have 2 daughters, but it says it has " 1051 << V2->
nDgtr() <<
"." 1055 fsPS[2] = V2->getDgtrTreePtr(0);
1056 fsPS[3] = V2->getDgtrTreePtr(1);
1064 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
1066 TLorentzVector pV1 = p(1, evt) + p(2, evt) + p(3, evt);
1067 TLorentzVector pV2 = p(2, evt) + p(3, evt);
1068 TLorentzVector pP1 = p(0, evt);
1070 TLorentzVector qV1 = (p(2, evt) + p(3, evt)) - p(1, evt);
1071 TLorentzVector qV2 = p(2, evt) - p(3, evt);
1075 if (_useZemachTensors) {
1076 double MV1 = mRes(V1, evt);
1077 double MV2 = mRes(V2, evt);
1079 TLorentzVector pD = pV1 + p(0, evt);
1080 TLorentzVector qD = pV1 - p(0, evt);
1087 TLorentzVector tmp = PV1.
Dot(LD);
1089 return LeviCivita(pV1,LV1,LV2).Dot(tmp)/units;
1098 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
1099 os <<
"spin factor SF_DtoV1P0_V1toV2P1_V2toP2P3" 1100 <<
"\n\t return: LeviCivita(pV1, qV1, pP1, qV2)/ / GeV^4" 1101 <<
"\n\t with pV1 = p(1) + p(2) + p(3), pP1 = p(0)" 1102 <<
"\n\t and qV1 = (p(2) + p(3)) - p(1), qV2 = p(2) - p(3)" 1103 <<
"\n\t parsed tree " << theDecay().oneLiner()
1104 <<
"\n like this:" << endl;
1105 this->printParsing(os);
1118 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) ) parseTree(evt.
eventPattern());
1120 TLorentzVector pV = p(2, evt) + p(3, evt);
1121 TLorentzVector qV = p(2, evt) - p(3, evt);
1123 TLorentzVector pA = p(1, evt) + p(2, evt) + p(3, evt);
1124 TLorentzVector qA = p(1, evt) - (p(2, evt) + p(3, evt));
1126 TLorentzVector pD = p(0, evt) + pA;
1127 TLorentzVector qD = pA - p(0, evt);
1129 double MA = mRes(A, evt);
1130 double MV = mRes(V, evt);
1137 if(_useZemachTensors){
1141 TLorentzVector tmp= LA.
Contract(LV);
1147 return (LD.Dot(tmp))/units;
1150 return p(0, evt).Dot(tA) * tV.Dot(pA) / units;
1155 if(! ( fsPS[0] && fsPS[1] && fsPS[2] && fsPS[3]) )
return;
1156 os <<
"spin factor SF_DtoAP0_AtoVP1Dwavve_VtoP2P3" 1157 <<
" with\t pV = p(2) + p(3), qV = p(2) - p(3) " 1158 <<
"\n\t and pA = p(1) + p(2) + p(3), qA = p(1) - (p(2) + p(3));" 1159 <<
"\n\t evaluates as:" 1160 <<
"\n\t ZTspin1 tA(qA, pA, MA);" 1161 <<
"\n\t ZTspin1 tV(qV, pV, MV);" 1162 <<
"\n\t p(0).Dot(tA) * tV.Dot(pA) / (GeV*GeV*GeV*GeV);" 1163 <<
"\n\t parsed tree " << theDecay().oneLiner()
1164 <<
"\n like this:" << endl;
1165 this->printParsing(os);
double Contract_2(const SymmLorentzMatrix &M)
virtual const DecayTree & exampleDecay()
virtual bool parseTree(const DalitzEventPattern &pat)
virtual double getVal(IDalitzEvent &evt)
virtual void printYourself(std::ostream &os=std::cout) const
static DecayTree * _exampleDecay
MINT::counted_ptr< DDTree< ValueType > > addDgtr(const DDTree< ValueType > *treePtr)
virtual const DecayTree & exampleDecay()
virtual const DecayTree & exampleDecay()
static DecayTree * _exampleDecay
virtual void printYourself(std::ostream &os=std::cout) const
virtual void printYourself(std::ostream &os=std::cout) const
static const DecayTree & getExampleDecay()
virtual const DecayTree & exampleDecay()
static DecayTree * _exampleDecayD
virtual bool parseTree(const DalitzEventPattern &pat)
virtual double getVal(IDalitzEvent &evt)
virtual const DecayTree & exampleDecay()
std::string SVPAT() const
TLorentzVector Dot(const TLorentzVector &rhs) const
static DecayTree * _exampleDecay
static DecayTree * _exampleDecayS
virtual void printYourself(std::ostream &os=std::cout) const
virtual const DecayTree & exampleDecay()
virtual const DecayTree & exampleDecay()
virtual double getVal(IDalitzEvent &evt)
virtual bool parseTree(const DalitzEventPattern &pat)
virtual bool parseTree(const DalitzEventPattern &pat)
virtual const DecayTree & exampleDecay()
virtual bool parseTree(const DalitzEventPattern &pat)
const ValueType & getVal() const
virtual void printYourself(std::ostream &os=std::cout) const
virtual const DecayTree & exampleDecay()
static DecayTree * _exampleDecay
static const DecayTree & getExampleDecay()
bool isFinalState() const
static const DecayTree & getExampleDecay()
virtual const DecayTree & exampleDecay()
static DecayTree * _exampleDecay
static const DecayTree & getExampleDecay()
virtual double getVal(IDalitzEvent &evt)
virtual double getVal(IDalitzEvent &evt)
double Contract(const TLorentzVector &rhs) const
virtual const DecayTree & exampleDecay()
static const DecayTree & getExampleDecay()
static DecayTree * _exampleDecay
virtual bool parseTree(const DalitzEventPattern &pat)
virtual const DecayTree & exampleDecay()
virtual const DecayTree & exampleDecay()
virtual void printYourself(std::ostream &os=std::cout) const
virtual bool parseTree(const DalitzEventPattern &pat)
static const DecayTree & getExampleDecay()
virtual double getVal(IDalitzEvent &evt)
virtual const DalitzEventPattern & eventPattern() const =0
virtual void printYourself(std::ostream &os=std::cout) const
static DecayTree * _exampleDecay
virtual bool parseTree(const DalitzEventPattern &pat)
virtual double getVal(IDalitzEvent &evt)
static DecayTree * _exampleDecay
static const DecayTree & getExampleDecay()
double LeviCivita(const TLorentzVector &p0, const TLorentzVector &p1, const TLorentzVector &p2, const TLorentzVector &p3)
static const DecayTree & getExampleDecay()
static const DecayTree & getExampleDecay()
virtual void printYourself(std::ostream &os=std::cout) const
static DecayTree * _exampleDecay
virtual void printYourself(std::ostream &os=std::cout) const
static DecayTree * _exampleDecay
static const DecayTree & getExampleDecay()
DDTree< DecayTreeItem > DecayTree
virtual double getVal(IDalitzEvent &evt)
virtual double getVal(IDalitzEvent &evt)
virtual const DecayTree & exampleDecay()
virtual void printYourself(std::ostream &os=std::cout) const
static const DecayTree & getExampleDecay()
static const DecayTree & getExampleDecay()
virtual double getVal(IDalitzEvent &evt)
virtual double getVal(IDalitzEvent &evt)
static DecayTree * _exampleDecayP
static const DecayTree & getExampleDecay()
virtual void printYourself(std::ostream &os=std::cout) const
static const DecayTree & getExampleDecay()
static DecayTree * _exampleDecayD
TLorentzVector Contract(const TLorentzVector &vec)