2 #include "TauolaParticlePair.h"
12 TauolaParticlePair::TauolaParticlePair(std::vector<TauolaParticle*> &particle_list){
14 particle_list.pop_back();
15 setBornKinematics(0,0,-1.,0.);
21 m_mother_exists =
false;
22 m_production_particles.push_back(particle);
23 m_final_particles.push_back(particle);
24 initializeDensityMatrix();
33 if(temp_mothers.size()==0){
36 Log::Warning()<<
"WARNING: Could not find taus mother or grandmothers. "
37 <<
"Ignoring spin effects" << std::endl;
39 m_mother_exists =
false;
40 m_production_particles.push_back(particle);
42 initializeDensityMatrix();
48 std::vector<TauolaParticle*> temp_daughters;
49 temp_daughters = temp_mothers.at(0)->getDaughters();
50 if(temp_daughters.size()==0)
51 Log::Fatal(
"WARNING: Something wrong with event structure or there is a bug in the TAUOLA interface.",6);
53 m_production_particles=temp_daughters;
59 for(
signed int i=0; i < (int) m_production_particles.size(); i++)
62 if(m_final_particles.at(0)->getPdgID()*m_production_particles.at(i)->getPdgID()>=0)
continue;
69 for(j=0;j<(int)particle_list.size();j++)
70 if(m_production_particles.at(i)->getBarcode()==particle_list.at(j)->getBarcode())
break;
71 if(j>=(
int)particle_list.size())
continue;
74 m_final_particles.push_back(m_production_particles.at(i)->findLastSelf());
75 particle_list.erase(particle_list.begin()+j);
81 m_final_particles.push_back(m_production_particles.at(i)->findLastSelf());
87 if(temp_mothers.size()==1){
88 m_mother_exists =
true;
89 m_mother = temp_mothers.at(0);
94 m_mother_exists =
false;
95 m_grandmothers = temp_mothers;
96 m_mother = makeTemporaryMother(m_production_particles);
100 initializeDensityMatrix();
113 void TauolaParticlePair::initializeDensityMatrix(){
114 int incoming_pdg_id=0;
115 int outgoing_pdg_id=0;
116 double invariant_mass_squared=-5.0;
120 for(
int x = 0; x < 4; x ++) {
121 for(
int y = 0; y < 4; y ++)
140 if(!m_mother)
return;
149 if(!Tauola::spin_correlation.HIGGS_H)
return;
151 double phi = Tauola::getHiggsScalarPseudoscalarMixingAngle();
154 double beta = sqrt(1-4*mass_ratio*mass_ratio);
155 double denominator = pow(cos(phi)*beta,2)+pow(sin(phi),2);
158 m_R[1][1]= (pow(cos(phi)*beta,2)-pow(sin(phi),2))/denominator;
159 m_R[1][2]= 2*cos(phi)*sin(phi)*beta/denominator;
160 m_R[2][1]= -m_R[1][2];
161 m_R[2][2]= m_R[1][1];
171 if(!Tauola::spin_correlation.Z0)
break;
177 pz = getZPolarization(&incoming_pdg_id, &outgoing_pdg_id, &invariant_mass_squared, &cosTheta);
183 recalculateRij(incoming_pdg_id, outgoing_pdg_id, invariant_mass_squared, cosTheta);
187 if(!Tauola::spin_correlation.GAMMA)
break;
193 pz = getZPolarization(&incoming_pdg_id, &outgoing_pdg_id, &invariant_mass_squared, &cosTheta);
199 recalculateRij(incoming_pdg_id, outgoing_pdg_id, invariant_mass_squared, cosTheta);
204 if(!Tauola::spin_correlation.HIGGS)
break;
213 if(!Tauola::spin_correlation.HIGGS_A)
break;
221 if(!Tauola::spin_correlation.HIGGS_PLUS)
break;
228 if(!Tauola::spin_correlation.HIGGS_MINUS)
break;
235 if(!Tauola::spin_correlation.W_PLUS)
break;
242 if(!Tauola::spin_correlation.W_MINUS)
break;
258 void TauolaParticlePair::setBornKinematics(
int incoming_pdg_id,
int outgoing_pdg_id,
double invariant_mass_squared,
double cosTheta){
259 Tauola::buf_incoming_pdg_id=incoming_pdg_id;
260 Tauola::buf_outgoing_pdg_id=outgoing_pdg_id;
261 Tauola::buf_invariant_mass_squared=invariant_mass_squared;
262 Tauola::buf_cosTheta=cosTheta;
268 double TauolaParticlePair::getZPolarization(
int *incoming_pdg_id,
int *outgoing_pdg_id,
double *invariant_mass_squared,
double *cosTheta){
274 *invariant_mass_squared = pow(m_mother->
getMass(),2);
275 setBornKinematics(*incoming_pdg_id, *outgoing_pdg_id, *invariant_mass_squared, *cosTheta);
280 if(m_grandmothers.size()<2){
281 Log::Warning()<<
"Not enough mothers of Z to "
282 <<
"calculate cos(theta) between "
283 <<
"incoming about outgoing beam"
285 return 1-plzap0_(incoming_pdg_id,outgoing_pdg_id,
286 invariant_mass_squared, cosTheta);
290 Log::Error()<<
"tau+ or tau- not found in Z decay"<< endl;
298 if(m_grandmothers.size()>2 ||
299 (m_grandmothers.at(0)->getDaughters().size()>1 && m_mother_exists==
true) ||
300 m_production_particles.size() > 2){
303 vector<TauolaParticle*> extra_grandmothers;
304 for(
int i=0; i<(int) m_grandmothers.size(); i++){
308 extra_grandmothers.push_back(m_grandmothers.at(i));
313 vector<TauolaParticle*> extra_tau_siblings;
314 vector<TauolaParticle*> temp_production_particles;
315 for(
int i=0; i<(int) m_production_particles.size(); i++){
316 if(m_production_particles.at(i)!=
getTauPlus(m_production_particles)&&
317 m_production_particles.at(i)!=
getTauMinus(m_production_particles))
318 extra_tau_siblings.push_back(m_production_particles.at(i));
322 vector<TauolaParticle*> extra_Z_siblings;
323 for(
int i=0; m_mother_exists && i<(int) m_grandmothers.at(0)->getDaughters().size(); i++){
325 extra_Z_siblings.push_back(m_grandmothers.at(0)->getDaughters().at(i));
330 std::vector<TauolaParticle*> effective_taus;
331 effective_taus.push_back(
getTauPlus(m_production_particles)->clone());
332 effective_taus.push_back(
getTauMinus(m_production_particles)->clone());
337 m_grandmothers.clear();
338 m_grandmothers.push_back(g1);
339 m_grandmothers.push_back(g2);
342 for(
int i=0; i<(int) extra_grandmothers.size(); i++)
343 addToBeam(extra_grandmothers.at(i),&m_grandmothers,0);
346 for(
int i=0; i<(int) extra_Z_siblings.size(); i++)
347 addToBeam(extra_Z_siblings.at(i),0,&m_grandmothers);
350 for(
int i=0; i<(int) extra_tau_siblings.size() ; i++){
352 addToBeam(extra_tau_siblings.at(i),&effective_taus,0);
354 addToBeam(extra_tau_siblings.at(i),&effective_taus,&m_grandmothers);
358 TauolaParticle * temp_mother = makeTemporaryMother(effective_taus);
359 *invariant_mass_squared = pow(temp_mother->getMass(),2);
364 double angle1,angle2,angle3;
365 boostFromLabToTauPairFrame(&angle1, &angle2, &angle3, temp_mother,
366 m_grandmothers, effective_taus);
375 double costheta1=(tM->getPx()*gM->getPx()+tM->getPy()*gM->getPy()+tM->getPz()*gM->getPz())/
376 sqrt(tM->getPx()*tM->getPx()+tM->getPy()*tM->getPy()+tM->getPz()*tM->getPz())/
377 sqrt(gM->getPx()*gM->getPx()+gM->getPy()*gM->getPy()+gM->getPz()*gM->getPz());
381 double costheta2=(tM->getPx()*gM->getPx()+tM->getPy()*gM->getPy()+tM->getPz()*gM->getPz())/
382 sqrt(tM->getPx()*tM->getPx()+tM->getPy()*tM->getPy()+tM->getPz()*tM->getPz())/
383 sqrt(gM->getPx()*gM->getPx()+gM->getPy()*gM->getPy()+gM->getPz()*gM->getPz());
384 double sintheta1 = sqrt(1-costheta1*costheta1);
385 double sintheta2 = sqrt(1-costheta2*costheta2);
386 double avg = (costheta1*sintheta2+costheta2*sintheta1)/(sintheta1+sintheta2);
392 if(abs(*incoming_pdg_id)==21 || abs(*incoming_pdg_id)==22)
398 if( abs(*incoming_pdg_id)> 8 &&
399 abs(*incoming_pdg_id)!=11 &&
400 abs(*incoming_pdg_id)!=13 &&
401 abs(*incoming_pdg_id)!=15 )
403 Log::Error()<<
"Second class disaster: incoming_pdg_id = "<<*incoming_pdg_id<<endl;
410 return 1-plzap0_(incoming_pdg_id,outgoing_pdg_id,
411 invariant_mass_squared, cosTheta);
414 boostFromTauPairToLabFrame(angle1, angle2, angle3, temp_mother,
415 m_grandmothers, effective_taus);
416 setBornKinematics(*incoming_pdg_id, *outgoing_pdg_id, *invariant_mass_squared, *cosTheta);
417 return 1-plzap0_(incoming_pdg_id,outgoing_pdg_id, invariant_mass_squared, cosTheta);
424 double angle1,angle2,angle3;
425 boostFromLabToTauPairFrame(&angle1, &angle2, &angle3,
426 m_mother,m_grandmothers,m_production_particles);
430 double costheta1=(tM->getPx()*gM->getPx()+tM->getPy()*gM->getPy()+tM->getPz()*gM->getPz())/
431 sqrt(tM->getPx()*tM->getPx()+tM->getPy()*tM->getPy()+tM->getPz()*tM->getPz())/
432 sqrt(gM->getPx()*gM->getPx()+gM->getPy()*gM->getPy()+gM->getPz()*gM->getPz());
437 double costheta2=(tM->getPx()*gM->getPx()+tM->getPy()*gM->getPy()+tM->getPz()*gM->getPz())/
438 sqrt(tM->getPx()*tM->getPx()+tM->getPy()*tM->getPy()+tM->getPz()*tM->getPz())/
439 sqrt(gM->getPx()*gM->getPx()+gM->getPy()*gM->getPy()+gM->getPz()*gM->getPz());
441 double sintheta1 = sqrt(1-costheta1*costheta1);
442 double sintheta2 = sqrt(1-costheta2*costheta2);
444 double avg = (costheta1*sintheta2+costheta2*sintheta1)/(sintheta1+sintheta2);
450 boostFromTauPairToLabFrame(angle1, angle2, angle3,
451 m_mother,m_grandmothers,m_production_particles);
453 setBornKinematics(*incoming_pdg_id, *outgoing_pdg_id, *invariant_mass_squared, *cosTheta);
454 return 1-plzap0_(incoming_pdg_id,outgoing_pdg_id, invariant_mass_squared, cosTheta);
464 std::vector<TauolaParticle*> *candidates_same,
465 std::vector<TauolaParticle*> *candidates_opp){
473 double s0 =1.0/getVirtuality(pcle,candidates_same->at(0),
false);
474 double s1 = 1.0/getVirtuality(pcle,candidates_same->at(1),
false);
477 s_beam = candidates_same->at(0);
481 s_beam = candidates_same->at(1);
486 double o0 =1.0/getVirtuality(pcle,candidates_opp->at(0),
true);
487 double o1 = 1.0/getVirtuality(pcle,candidates_opp->at(1),
true);
490 o_beam = candidates_opp->at(0);
494 o_beam = candidates_opp->at(1);
501 int pdg1 = pcle->getPdgID();
502 int pdg2 = s_beam->getPdgID();
503 if(abs(pdg2)==15)
return;
504 if((abs(pdg2)==21 || abs(pdg2)==22) && abs(pdg1)<17 && abs(pdg1)!=10 && abs(pdg1)!=9) s_beam->setPdgID( pdg1);
508 o_beam->subtract(pcle);
509 int pdg1 = pcle->getPdgID();
510 int pdg2 = o_beam->getPdgID();
511 if((abs(pdg2)==21 || abs(pdg2)==22) && abs(pdg1)<17 && abs(pdg1)!=10 && abs(pdg1)!=9) o_beam->setPdgID(-pdg1);
521 if((p1->getPdgID()==TauolaParticle::GLUON&&abs(p2->getPdgID())>10&&abs(p2->getPdgID())<20) ||
522 (p2->getPdgID()==TauolaParticle::GLUON&&abs(p1->getPdgID())>10&&abs(p1->getPdgID())<20))
528 double kp = p1->getE()*p2->getE() - p1->getPx()*p2->getPx()
529 - p1->getPy()*p2->getPy() - p1->getPz()*p2->getPz();
531 kp = kp - p1->getMass()*p1->getMass();
536 abs(p2->getPdgID())==TauolaParticle::CHARM ||
537 abs(p2->getPdgID())==TauolaParticle::TOP)
540 abs(p2->getPdgID())==TauolaParticle::STRANGE ||
541 abs(p2->getPdgID())==TauolaParticle::BOTTOM)
546 abs(p1->getPdgID())==TauolaParticle::CHARM ||
547 abs(p1->getPdgID())==TauolaParticle::TOP)
550 abs(p1->getPdgID())==TauolaParticle::STRANGE ||
551 abs(p1->getPdgID())==TauolaParticle::BOTTOM)
565 double h_tau_minus[4]={2,0,0,0};
566 double h_tau_plus[4]={2,0,0,0};
572 for(
double weight=0; weight < Tauola::randomDouble();){
575 Tauola::redefineTauMinusProperties(tau_minus);
583 Tauola::redefineTauPlusProperties(tau_plus);
594 for(
int i =0; i<4; i++){
595 for(
int j=0; j<4; j++)
596 weight+=m_R[i][j]*h_tau_minus[i]*h_tau_plus[j];
601 wthel[0]=(h_tau_minus[0]+h_tau_minus[3])*(h_tau_plus[0]+h_tau_plus[3])*(m_R[0][0]+m_R[0][3]+m_R[3][0]+m_R[3][3]);
602 wthel[1]=(h_tau_minus[0]+h_tau_minus[3])*(h_tau_plus[0]-h_tau_plus[3])*(m_R[0][0]-m_R[0][3]+m_R[3][0]-m_R[3][3]);
603 wthel[2]=(h_tau_minus[0]-h_tau_minus[3])*(h_tau_plus[0]+h_tau_plus[3])*(m_R[0][0]+m_R[0][3]-m_R[3][0]-m_R[3][3]);
604 wthel[3]=(h_tau_minus[0]-h_tau_minus[3])*(h_tau_plus[0]-h_tau_plus[3])*(m_R[0][0]-m_R[0][3]-m_R[3][0]+m_R[3][3]);
606 double rn=Tauola::randomDouble();
607 if (rn>(wthel[0]+wthel[1]+wthel[2])/(wthel[0]+wthel[1]+wthel[2]+wthel[3])) Tauola::setHelicities(-1,-1);
608 else if (rn>(wthel[0]+wthel[1]) /(wthel[0]+wthel[1]+wthel[2]+wthel[3])) Tauola::setHelicities(-1,+1);
609 else if (rn>(wthel[0]) /(wthel[0]+wthel[1]+wthel[2]+wthel[3])) Tauola::setHelicities( 1,-1);
610 else Tauola::setHelicities( 1, 1);
618 double angle1,angle2,angle3;
622 boostFromLabToTauPairFrame(&angle1, &angle2, &angle3,
623 mum,m_grandmothers,m_final_particles);
632 boostFromTauPairToLabFrame(angle1,angle2,angle3,
633 mum,m_grandmothers,m_final_particles);
652 void TauolaParticlePair::boostFromLabToTauPairFrame(
double * rotation_angle1,
653 double * rotation_angle2,
654 double * rotation_angle3,
656 vector<TauolaParticle *> grandmothers,
657 vector<TauolaParticle *> taus
663 for(
int i=0; i< (int) grandmothers.size(); i++)
664 grandmothers.at(i)->boostToRestFrame(mother);
667 for(
int i=0; i< (int) taus.size(); i++){
668 taus.at(i)->boostToRestFrame(mother);
671 taus.at(i)->boostDaughtersToRestFrame(mother);
689 if(grandmothers.size()<1){
690 *rotation_angle3 = 0;
707 void TauolaParticlePair::boostFromTauPairToLabFrame(
double rotation_angle1,
708 double rotation_angle2,
709 double rotation_angle3,
711 vector<TauolaParticle *> grandmothers,
712 vector<TauolaParticle *> taus){
728 for(
int i=0; i< (int) grandmothers.size(); i++)
729 grandmothers.at(i)->boostFromRestFrame(mother);
732 for(
int i=0; i< (int) taus.size(); i++){
733 taus.at(i)->boostFromRestFrame(mother);
734 taus.at(i)->boostDaughtersFromRestFrame(mother);
738 void TauolaParticlePair::rotateSystem(vector<TauolaParticle *> grandmothers,
739 vector<TauolaParticle *> taus,
740 double theta,
int axis,
int axis2){
741 for(
int i=0; i< (int) grandmothers.size(); i++)
742 grandmothers.at(i)->rotate(axis,theta,axis2);
743 for(
int i=0; i< (int) taus.size(); i++){
744 taus.at(i)->rotate(axis,theta,axis2);
745 taus.at(i)->rotateDaughters(axis,theta,axis2);
754 TauolaParticle * TauolaParticlePair::makeTemporaryMother(vector<TauolaParticle *> taus){
762 bool tau_plus =
false;
763 bool tau_minus =
false;
764 bool tau_neutrino =
false;
765 bool tau_antineutrino =
false;
767 for(
int d=0; d < (int) taus.size(); d++){
770 px+=daughter->getPx();
771 py+=daughter->getPy();
772 pz+=daughter->getPz();
773 switch(daughter->getPdgID()){
784 tau_antineutrino=
true;
788 double m = e*e-px*px-py*py-pz*pz;
798 if(tau_plus&&tau_minus)
802 if(tau_plus&&tau_neutrino)
806 if(tau_minus&&tau_antineutrino)
810 return taus.at(0)->createNewParticle(pdg,2,m,px,py,pz,e);
818 for(
int i=0; i< (int) m_final_particles.size(); i++){
819 if(m_final_particles.at(i)->getBarcode()==particle->
getBarcode())
826 for(
int i=0; i< (int) taus.size(); i++){
834 for(
int i=0; i< (int) taus.size(); i++){
845 for(
int i=0; i< (int) grandmothers.size(); i++){
846 if( (grandmothers.at(i)->getPdgID()<0 && grandmothers.at(i)->getPdgID()>-9) ||
849 if(e<grandmothers.at(i)->getE()){
850 e=grandmothers.at(i)->getE();
857 for(
int i=0; i< (int) grandmothers.size(); i++)
859 if(grandmothers.at(i)->getPdgID()==21 || grandmothers.at(i)->getPdgID()==22)
862 e=grandmothers.at(i)->getE();
867 if(index==-1) index=0;
870 grandmothers.at(index)->print();
874 return grandmothers.at(index);
881 for(
int i=0; i< (int) grandmothers.size(); i++){
882 if( (grandmothers.at(i)->getPdgID()>0 && grandmothers.at(i)->getPdgID()<9) ||
885 if(e<grandmothers.at(i)->getE()){
886 e=grandmothers.at(i)->getE();
893 for(
int i=(
int) grandmothers.size()-1; i>=0 ; i--)
895 if(grandmothers.at(i)->getPdgID()==21||grandmothers.at(i)->getPdgID()==22)
898 e=grandmothers.at(i)->getE();
903 if(index==-1) index=0;
907 return grandmothers.at(index);
915 std::cout <<
"Daughters final:" << std::endl;
916 for(
int i=0; i< (int) m_final_particles.size(); i++)
917 m_final_particles.at(i)->print();
920 std::cout <<
"Daughters at production:" << std::endl;
921 for(
int i=0; i< (int) m_production_particles.size(); i++)
922 m_production_particles.at(i)->print();
925 std::cout <<
"Mother particle: " << std::endl;
929 std::cout <<
"Grandmother particles: " << std::endl;
930 for(
int i=0; i< (int) m_grandmothers.size(); i++)
931 m_grandmothers.at(i)->print();
939 for(
int i=0; i< (int) m_final_particles.size(); i++)
940 m_final_particles.at(i)->checkMomentumConservation();
942 for(
int i=0; i< (int) m_production_particles.size(); i++)
943 m_production_particles.at(i)->checkMomentumConservation();
948 for(
int i=0; i< (int) m_grandmothers.size(); i++)
949 m_grandmothers.at(i)->checkMomentumConservation();
953 void TauolaParticlePair::recalculateRij(
int incoming_pdg_id,
int outgoing_pdg_id,
double invariant_mass_squared,
double cosTheta){
955 if (abs(outgoing_pdg_id)!=15)
957 Log::Warning()<<
"interface was not used for taus pdg id="<<outgoing_pdg_id<<endl;
961 double (*T) [Tauola::NCOS][4][4] = NULL;
962 double (*Tw) [Tauola::NCOS] = NULL;
963 double (*Tw0)[Tauola::NCOS] = NULL;
969 switch(abs(incoming_pdg_id)){
971 if(invariant_mass_squared<Tauola::smaxB && invariant_mass_squared>Tauola::sminB)
973 T = Tauola::table11B;
974 Tw = Tauola::wtable11B;
975 Tw0 = Tauola::w0table11B;
976 smin = Tauola::sminB;
977 smax = Tauola::smaxB;
978 step = (smax-smin)/(Tauola::NS2-1);
980 else if (invariant_mass_squared<Tauola::smaxC && invariant_mass_squared>Tauola::sminC)
982 T = Tauola::table11C;
983 Tw = Tauola::wtable11C;
984 Tw0 = Tauola::w0table11C;
985 smin = Tauola::sminC;
986 smax = Tauola::smaxC;
987 step = (smax-smin)/(Tauola::NS3-1);
991 T = Tauola::table11A;
992 Tw = Tauola::wtable11A;
993 Tw0 = Tauola::w0table11A;
994 smin = Tauola::sminA;
995 smax = Tauola::smaxA;
996 step = (smax-smin)/(Tauola::NS1-1);
1004 if(invariant_mass_squared<Tauola::smaxB && invariant_mass_squared>Tauola::sminB)
1006 T = Tauola::table1B;
1007 Tw = Tauola::wtable1B;
1008 Tw0 = Tauola::w0table1B;
1009 smin = Tauola::sminB;
1010 smax = Tauola::smaxB;
1011 step = (smax-smin)/(Tauola::NS2-1);
1013 else if (invariant_mass_squared<Tauola::smaxC && invariant_mass_squared>Tauola::sminC)
1015 T = Tauola::table1C;
1016 Tw = Tauola::wtable1C;
1017 Tw0 = Tauola::w0table1C;
1018 smin = Tauola::sminC;
1019 smax = Tauola::smaxC;
1020 step = (smax-smin)/(Tauola::NS3-1);
1024 T = Tauola::table1A;
1025 Tw = Tauola::wtable1A;
1026 Tw0 = Tauola::w0table1A;
1027 smin = Tauola::sminA;
1028 smax = Tauola::smaxA;
1029 step = (smax-smin)/(Tauola::NS1-1);
1036 if(invariant_mass_squared<Tauola::smaxB && invariant_mass_squared>Tauola::sminB)
1038 T = Tauola::table2B;
1039 Tw = Tauola::wtable2B;
1040 Tw0 = Tauola::w0table2B;
1041 smin = Tauola::sminB;
1042 smax = Tauola::smaxB;
1043 step = (smax-smin)/(Tauola::NS2-1);
1045 else if (invariant_mass_squared<Tauola::smaxC && invariant_mass_squared>Tauola::sminC)
1047 T = Tauola::table2C;
1048 Tw = Tauola::wtable2C;
1049 Tw0 = Tauola::w0table2C;
1050 smin = Tauola::sminC;
1051 smax = Tauola::smaxC;
1052 step = (smax-smin)/(Tauola::NS3-1);
1056 T = Tauola::table2A;
1057 Tw = Tauola::wtable2A;
1058 Tw0 = Tauola::w0table2A;
1059 smin = Tauola::sminA;
1060 smax = Tauola::smaxA;
1061 step = (smax-smin)/(Tauola::NS1-1);
1066 Log::Warning()<<
"interface was not used for proper beams pdg id="<<incoming_pdg_id<<endl;
1071 if (T[0][0][0][0]<0.5)
return;
1074 if (invariant_mass_squared <= exp(Tauola::sminA)){
1076 double cosf = cosTheta;
1077 double s = invariant_mass_squared;
1078 double sinf = sqrt(1-cosf*cosf);
1079 double MM = sqrt(4e0*mta*mta/s);
1080 double xnorm = 1+cosf*cosf + MM*MM*sinf*sinf;
1083 for (
int i=0;i<4;i++)
1084 for (
int j=0;j<4;j++)
1087 m_R[0][0] = (1+cosf*cosf + MM*MM*sinf*sinf)/xnorm;
1088 m_R[1][1] = (-(1- MM*MM)*sinf*sinf)/xnorm;
1089 m_R[2][2] = ( (1+ MM*MM)*sinf*sinf)/xnorm;
1090 m_R[3][3] = (1+cosf*cosf - MM*MM*sinf*sinf)/xnorm;
1091 m_R[2][3] = (2*MM*sinf*cosf)/xnorm;
1092 m_R[3][2] = (2*MM*sinf*cosf)/xnorm;
1098 if (Tauola::wtable2A[0][0]>0 ) w=Tauola::wtable2A[0][0];
1099 else if(Tauola::wtable1A[0][0]>0 ) w=Tauola::wtable1A[0][0];
1100 else if(Tauola::wtable11A[0][0]>0) w=Tauola::wtable11A[0][0];
1102 if (Tauola::wtable2A[0][0]>0 ) w0=Tauola::w0table2A[0][0];
1103 else if(Tauola::wtable1A[0][0]>0 ) w0=Tauola::w0table1A[0][0];
1104 else if(Tauola::wtable11A[0][0]>0) w0=Tauola::w0table11A[0][0];
1107 Tauola::setEWwt(w,w0);
1113 double remnant = 0.0;
1116 if(T==Tauola::table11A || T==Tauola::table1A || T== Tauola::table2A)
1118 while(log(invariant_mass_squared) > buf){
1122 remnant = (log(invariant_mass_squared)-(buf-step))/step;
1126 while(invariant_mass_squared > buf){
1130 remnant = (invariant_mass_squared-(buf-step))/step;
1135 double remnantc = 0.0;
1138 buf = cmin+1./Tauola::NCOS;
1139 while(cosTheta > buf){
1141 buf+=2./Tauola::NCOS;
1144 remnantc = (cosTheta-(buf-2./Tauola::NCOS))/(2./Tauola::NCOS);
1147 bool isUsingExtrapolation =
false;
1148 if(y >= Tauola::NCOS) { isUsingExtrapolation =
true; y = Tauola::NCOS-1; }
1149 if(y == 0) { isUsingExtrapolation =
true; y = 1; }
1152 double b11,b21,b12,b22;
1154 for (
int i=0; i<4; i++){
1155 for (
int j=0; j<4; j++){
1157 if(isUsingExtrapolation){
1159 b11 = 2*T[x-1][0][i][j] - T[x-1][1][i][j];
1160 b21 = 2*T[x][0][i][j] - T[x][1][i][j];
1161 b12 = T[x-1][0][i][j];
1162 b22 = T[x][0][i][j];
1165 b11 = T[x-1][y][i][j];
1166 b21 = T[x][y][i][j];
1167 b12 = 2*T[x-1][y][i][j] - T[x-1][y-1][i][j];
1168 b22 = 2*T[x][y][i][j] - T[x][y-1][i][j];
1172 b11 = T[x-1][y-1][i][j];
1173 b21 = T[x][y-1][i][j];
1174 b12 = T[x-1][y][i][j];
1175 b22 = T[x][y][i][j];
1177 m_R[i][j] = b11*(1-remnant)*(1-remnantc) + b21*remnant*(1-remnantc)
1178 + b12*(1-remnant)*remnantc + b22*remnant*remnantc;
1185 if(isUsingExtrapolation){
1187 b11 = 2*Tw[x-1][0] - Tw[x-1][1];
1188 b21 = 2*Tw[x][0] - Tw[x][1];
1196 b12 = 2*Tw[x-1][y] - Tw[x-1][y-1];
1197 b22 = 2*Tw[x][y] - Tw[x][y-1];
1208 w = b11*(1-remnant)*(1-remnantc) + b21*remnant*(1-remnantc)
1209 + b12*(1-remnant)*remnantc + b22*remnant*remnantc;
1211 if(isUsingExtrapolation){
1213 b11 = 2*Tw0[x-1][0] - Tw0[x-1][1];
1214 b21 = 2*Tw0[x][0] - Tw0[x][1];
1221 b12 = 2*Tw0[x-1][y] - Tw0[x-1][y-1];
1222 b22 = 2*Tw0[x][y] - Tw0[x][y-1];
1226 b11 = Tw0[x-1][y-1];
1232 w0 = b11*(1-remnant)*(1-remnantc) + b21*remnant*(1-remnantc)
1233 + b12*(1-remnant)*remnantc + b22*remnant*remnantc;
1235 Tauola::setEWwt(w,w0);
static const int TAU_NEUTRINO
static const int ELECTRON
static const int POSITRON
static const int MUON_PLUS
bool contains(TauolaParticle *particle)
TauolaParticle * findLastSelf()
static void AddDecay(int type)
static const int TAU_MINUS
TauolaParticle * getTauMinus(std::vector< TauolaParticle * > particles)
virtual void decayEndgame()
static int getHiggsScalarPseudoscalarPDG()
TauolaParticle * getGrandmotherMinus(std::vector< TauolaParticle * > particles)
static const double * getDecayOnePolarization()
Abstract base class for particle in the event. This class also handles boosting.
static void RedirectOutput(void(*func)(), ostream &where=*out)
static bool isUsingDecayOneBoost()
void addDecayToEventRecord()
static bool isUsingDecayOne()
static const int TAU_PLUS
void checkMomentumConservation()
virtual void checkMomentumConservation()
static void Fatal(string text, unsigned short int code=0)
static const int HIGGS_MINUS
double getPolarimetricX()
TauolaParticle * getGrandmotherPlus(std::vector< TauolaParticle * > particles)
double getRotationAngle(int axis, int second_axis=Z_AXIS)
static const int HIGGS_PLUS
std::vector< TauolaParticle * > findProductionMothers()
virtual int getBarcode()=0
double getPolarimetricY()
TauolaParticle * getTauPlus(std::vector< TauolaParticle * > particles)
static double getTauMass()
static const int TAU_ANTINEUTRINO
static void RevertOutput()
double getPolarimetricZ()
static const int MUON_MINUS