/* * ray - the modified mkqsort * deep = bin-boff, dword comparsions */ void ray(int *A, int *B, register uchar *boff) { register int *x,*y,*z; while(B-A > INSERT) { int s = median(A[0],A[(B-A)>>1],B[-1],boff); ulong w = p4b(s+boff); x=y=A; z=B; do { ulong q = p4b((s=*y)+boff); //check bound if(q < w || s+boff<=bin-4) { *y++ = *x; *x++ = s; }else if(q > w) { *y = *--z; *z = s; }else y++; }while(y<z); if(A+1 < x) ray(A,x,boff); if(z+1 < B) ray(z,B,boff); A = x; B = z; boff-=4; }//insertion for(x=A+1; x<B; x++) { int s = *(z=x); while(--z>=A && isab(boff+z[0],boff+s)) z[1] = z[0]; z[1] = s; //in place } }
//compare 2 suffixes int isab(register uchar *a,register uchar *b) { int deep = 4+(a>b?b:a)-bin; while(deep>=0) { if(p4b(a) != p4b(b)) break; a-=4; b-=4; deep-=4; } return p4b(a)>p4b(b) || (b<a && b<bin-4); }
int pruebasOficiales() { p1(); p2(); p3(); p4a(); p4b(); p5(); return 0; }
//====================================================== void EvtBcVNpi::decay( EvtParticle *root_particle ) { ++nCall; // cout<<"BcVNpi::decay()"<<endl; root_particle->initializePhaseSpace(getNDaug(),getDaugs()); EvtVector4R p4b(root_particle->mass(), 0., 0., 0.), // Bc momentum p4meson=root_particle->getDaug(0)->getP4(), // J/psi momenta Q=p4b-p4meson; double Q2=Q.mass2(); // check pi-mesons and calculate hadronic current EvtVector4C hardCur; // bool foundHadCurr=false; if( getNDaug() == 2) { hardCur = wcurr->WCurrent( root_particle->getDaug(1)->getP4() ); // foundHadCurr=true; } else if( getNDaug() == 3) { hardCur = wcurr->WCurrent( root_particle->getDaug(1)->getP4() , root_particle->getDaug(2)->getP4() ); // foundHadCurr=true; } else if( getNDaug() == 4) { hardCur = wcurr->WCurrent( root_particle->getDaug(1)->getP4() , root_particle->getDaug(2)->getP4(), root_particle->getDaug(3)->getP4() ); // foundHadCurr=true; } else if( getNDaug() == 6) // Bc -> psi pi+ pi+ pi- pi- pi+ from [Kuhn, Was, hep-ph/0602162 { hardCur = wcurr->WCurrent(root_particle->getDaug(1)->getP4(), root_particle->getDaug(2)->getP4(), root_particle->getDaug(3)->getP4(), root_particle->getDaug(4)->getP4(), root_particle->getDaug(5)->getP4() ); // foundHadCurr=true; } else { report(Severity::Error,"EvtGen") << "Have not yet implemented this final state in BCNPI model" << endl; report(Severity::Error,"EvtGen") << "Ndaug="<<getNDaug() << endl; int id; for ( id=0; id<(getNDaug()-1); id++ ) report(Severity::Error,"EvtGen") << "Daug " << id << " "<<EvtPDL::name(getDaug(id)).c_str() << endl; ::abort(); }; // calculate Bc -> V W form-factors double a1f, a2f, vf, a0f; double m_meson = root_particle->getDaug(0)->mass(); double m_b = root_particle->mass(); ffmodel->getvectorff(root_particle->getId(), root_particle->getDaug(0)->getId(), Q2, m_meson, &a1f, &a2f, &vf, &a0f); double a3f = ((m_b+m_meson)/(2.0*m_meson))*a1f - ((m_b-m_meson)/(2.0*m_meson))*a2f; // calculate Bc -> V W current EvtTensor4C H; H = a1f*(m_b+m_meson)*EvtTensor4C::g(); H.addDirProd((-a2f/(m_b+m_meson))*p4b,p4b+p4meson); H+=EvtComplex(0.0,vf/(m_b+m_meson))*dual(EvtGenFunctions::directProd(p4meson+p4b,p4b-p4meson)); H.addDirProd((a0f-a3f)*2.0*(m_meson/Q2)*p4b,p4b-p4meson); EvtVector4C Heps=H.cont2(hardCur); for(int i=0; i<4; i++) { EvtVector4C eps=root_particle->getDaug(0)->epsParent(i).conj(); // psi-meson polarization vector EvtComplex amp=eps*Heps; vertex(i,amp); }; }
//choose medial of 3 int median(int a,int b,int c,uchar bof[]) { uint qa = p4b(a+bof), qb = p4b(b+bof), qc = p4b(c+bof); if(qa > qb) return (qa<qc ? a : (qb>qc?b:c)); else return (qb<qc ? b : (qa>qc?a:c)); }