Exemplo n.º 1
0
bool FeynHiggsWrapper::SetFeynHiggsPars()
{
    int err;

    /* FeynHiggs debug flag */
    //FHSetDebug(2);
    //FHSetDebug(3);

    Mw_FHinput = mySUSY.Mw_tree(); /* Tree-level W-boson mass */
    //Mw_FHinput = mySUSY.StandardModel::Mw(); /* SM prediction, which should not be used, since mHl cannot be set before calling FeynHiggs. */
    //std::cout << "Mw = " << Mw_FHinput << " used in FeynHiggsWrapper::SetFeynHiggsPars()" << std::endl;

    /* Set the FeynHiggs SM input parameters */
    FHSetSMPara(&err,
                1.0/mySUSY.alphaMz(),
                mySUSY.getAlsMz(), mySUSY.getGF(),
                mySUSY.getLeptons(StandardModel::ELECTRON).getMass(),
                mySUSY.getQuarks(QCD::UP).getMass(),
                mySUSY.getQuarks(QCD::DOWN).getMass(),
                mySUSY.getLeptons(StandardModel::MU).getMass(),
                mySUSY.getQuarks(QCD::CHARM).getMass(),
                mySUSY.getQuarks(QCD::STRANGE).getMass(),
                mySUSY.getLeptons(StandardModel::TAU).getMass(),
                mySUSY.getQuarks(QCD::BOTTOM).getMass(),
                Mw_FHinput, mySUSY.getMz(),
                mySUSY.getLambda(), mySUSY.getA(), mySUSY.getRhob(), mySUSY.getEtab());
    if (err != 0) {
#ifdef FHDEBUG
        std::cout << "FeynHiggsWrapper::SetFeynHiggsPars(): Error has been detected in SetPara.F:"
                  << err << std::endl;
#endif
        return (false);
    }

    /* Parameters for FeynHiggs */
    double Q_S = mySUSY.Q_SUSY;
    gslpp::complex muHFH = mySUSY.muH;
    gslpp::complex M1FH = mySUSY.m1;
    gslpp::complex M2FH = mySUSY.m2;
    gslpp::matrix<gslpp::complex> MsQ2 = mySUSY.msQhat2;
    gslpp::matrix<gslpp::complex> MsU2 = mySUSY.msUhat2;
    gslpp::matrix<gslpp::complex> MsD2 = mySUSY.msDhat2;
    gslpp::matrix<gslpp::complex> MsL2 = mySUSY.msLhat2;
    gslpp::matrix<gslpp::complex> MsE2 = mySUSY.msEhat2;
    gslpp::matrix<gslpp::complex> KU = mySUSY.TUhat.hconjugate() * mySUSY.v2() / sqrt(2.0);
    gslpp::matrix<gslpp::complex> KD = mySUSY.TDhat.hconjugate() * mySUSY.v1() / sqrt(2.0);
    gslpp::matrix<gslpp::complex> KE = mySUSY.TEhat.hconjugate() * mySUSY.v1() / sqrt(2.0);

    /* MFV trilinear couplings */
    gslpp::vector<gslpp::complex> AU(3,0.), AD(3,0.), AE(3,0.);
    for (int i=0; i<3; i++) {
        int p = (int)mySUSY.UP + 2*i;
        AU.assign(i, KU(i,i) / mySUSY.Mq_Q((QCD::quark)p));
        p = (int)mySUSY.DOWN + 2*i;
        AD.assign(i, KD(i,i) / mySUSY.Mq_Q((QCD::quark)p));
        p = (int)mySUSY.ELECTRON + 2*i;
        AE.assign(i, KE(i,i) / mySUSY.Ml_Q((StandardModel::lepton)p));
    }

    /* Check if non-minimal flavor-violating (NMFV) entries exist in the
     * sfermion mass matrices. See also IniFV() in SetFV.F of FeynHiggs. */
    NMFVu = true; NMFVd = true; NMFVe = true;// NMFVnu = true; 
    double TMPu = 0.0, TMPd = 0.0, TMPe = 0.0; //TMPnu = 0.0
    for (int i=0; i<3; i++) {
        for (int j=0; j<3; j++) {
           if (i < j) {
               TMPu += MsQ2(i, j).abs2() + MsU2(i, j).abs2();
               TMPd += MsQ2(i, j).abs2() + MsD2(i, j).abs2();
               //TMPnu += MsL2(i, j).abs2(); /* not used */
               TMPe += MsL2(i, j).abs2() + MsE2(i, j).abs2();
           }
           if (i != j) {
               TMPu += KU(i, j).abs2();
               TMPd += KD(i, j).abs2();
               TMPe += KE(i, j).abs2();
           }
        }
    }
    if (!TMPu) NMFVu = false;
    if (!TMPe) NMFVd = false;
    if (!TMPe) NMFVe = false;

    /* NMFV trilinear couplings. In the case of NMFV, the trilinear couplings
     * AU, AD and AE for FHSetPara() as well as KU, KD and KE for FHSetNMFV()
     * and FHSetLFV() have to be rotated. */
    gslpp::complex muHphase(1.0, - 2.0*muHFH.arg(), true);
    if (NMFVu) AU *= muHphase;
    if (NMFVd) AD *= muHphase;
    if (NMFVe) AE *= muHphase;
    KU *= muHphase;
    KD *= muHphase;
    KE *= muHphase;

    /* NMFV parameters for FeynHiggs */
    gslpp::matrix<gslpp::complex> deltaQLL(3,3,0.);
    gslpp::matrix<gslpp::complex> deltaULR(3,3,0.), deltaURL(3,3,0.), deltaURR(3,3,0.);
    gslpp::matrix<gslpp::complex> deltaDLR(3,3,0.), deltaDRL(3,3,0.), deltaDRR(3,3,0.);
    gslpp::matrix<gslpp::complex> deltaLLL(3,3,0.);
    gslpp::matrix<gslpp::complex> deltaELR(3,3,0.), deltaERL(3,3,0.), deltaERR(3,3,0.);
    for (int i=0; i<3; i++)
        for (int j=0; j<3; j++) {
            deltaQLL.assign(i, j, MsQ2(i,j) / sqrt(MsQ2(i,i).real() * MsQ2(j,j).real()));
            deltaULR.assign(i, j, KU(i,j) / sqrt(MsQ2(i,i).real() * MsU2(j,j).real()));
            deltaURL.assign(i, j, KU(j,i).conjugate() / sqrt(MsU2(i,i).real() * MsQ2(j,j).real()));
            deltaURR.assign(i, j, MsU2(i,j) / sqrt(MsU2(i,i).real() * MsU2(j,j).real()));
            deltaDLR.assign(i, j, KD(i,j) / sqrt(MsQ2(i,i).real() * MsD2(j,j).real()));
            deltaDRL.assign(i, j, KD(j,i).conjugate() / sqrt(MsD2(i,i).real() * MsQ2(j,j).real()));
            deltaDRR.assign(i, j, MsD2(i,j) / sqrt(MsD2(i,i).real() * MsD2(j,j).real()));
            deltaLLL.assign(i, j, MsL2(i,j) / sqrt(MsL2(i,i).real() * MsL2(j,j).real()));
            deltaELR.assign(i, j, KE(i,j) / sqrt(MsL2(i,i).real() * MsE2(j,j).real()));
            deltaERL.assign(i, j, KE(j,i).conjugate() / sqrt(MsE2(i,i).real() * MsL2(j,j).real()));
            deltaERR.assign(i, j, MsE2(i,j) / sqrt(MsE2(i,i).real() * MsE2(j,j).real()));
        }

    /* Set the FeynHiggs parameters, where the GUT relation is used for M1=0. */
    FHSetPara(&err,
              mySUSY.mut/mySUSY.quarks[QCD::TOP].getMass(),
              mySUSY.mtpole, mySUSY.tanb,
              mySUSY.mHptree,  // as now used, "mHptree" is a name for MA0. We shall be using mA instead of mHptree
	      -1, // this is now not used, the mHptree 
              //
              sqrt(MsL2(2,2).real()), sqrt(MsE2(2,2).real()),
              sqrt(MsQ2(2,2).real()), sqrt(MsU2(2,2).real()),
              sqrt(MsD2(2,2).real()),
              sqrt(MsL2(1,1).real()), sqrt(MsE2(1,1).real()),
              sqrt(MsQ2(1,1).real()), sqrt(MsU2(1,1).real()),
              sqrt(MsD2(1,1).real()),
              sqrt(MsL2(0,0).real()), sqrt(MsE2(0,0).real()),
              sqrt(MsQ2(0,0).real()), sqrt(MsU2(0,0).real()),
              sqrt(MsD2(0,0).real()),
              //
              ToComplex2(muHFH.real(), muHFH.imag()),
              //
              ToComplex2(AE(2).real(), AE(2).imag()),
              ToComplex2(AU(2).real(), AU(2).imag()),
              ToComplex2(AD(2).real(), AD(2).imag()),
              ToComplex2(AE(1).real(), AE(1).imag()),
              ToComplex2(AU(1).real(), AU(1).imag()),
              ToComplex2(AD(1).real(), AD(1).imag()),
              ToComplex2(AE(0).real(), AE(0).imag()),
              ToComplex2(AU(0).real(), AU(0).imag()),
              ToComplex2(AD(0).real(), AD(0).imag()),
              //
              ToComplex2(M1FH.real(), M1FH.imag()),
              ToComplex2(M2FH.real(), M2FH.imag()),
              ToComplex2(mySUSY.m3, 0.),
              //
              Q_S, Q_S, Q_S);
    if (err != 0) {
#ifdef FHDEBUG
        std::cout << "FeynHiggsWrapper::SetFeynHiggsPars(): Error has been detected in SetPara.F:"
                  << err << std::endl;
#endif
        return (false);
    }

    /* Set the non-minimal flavor-violating parameters in the squark sector */
    FHSetNMFV(&err,
              // Q_LL
              ToComplex2(deltaQLL(0,1).real(), deltaQLL(0,1).imag()),
              ToComplex2(deltaQLL(1,2).real(), deltaQLL(1,2).imag()),
              ToComplex2(deltaQLL(0,2).real(), deltaQLL(0,2).imag()),
              // U_LR
              ToComplex2(deltaULR(0,1).real(), deltaULR(0,1).imag()),
              ToComplex2(deltaULR(1,2).real(), deltaULR(1,2).imag()),
              ToComplex2(deltaULR(0,2).real(), deltaULR(0,2).imag()),
              // U_RL
              ToComplex2(deltaURL(0,1).real(), deltaURL(0,1).imag()),
              ToComplex2(deltaURL(1,2).real(), deltaURL(1,2).imag()),
              ToComplex2(deltaURL(0,2).real(), deltaURL(0,2).imag()),
              // U_RR
              ToComplex2(deltaURR(0,1).real(), deltaURR(0,1).imag()),
              ToComplex2(deltaURR(1,2).real(), deltaURR(1,2).imag()),
              ToComplex2(deltaURR(0,2).real(), deltaURR(0,2).imag()),
              // D_LR
              ToComplex2(deltaDLR(0,1).real(), deltaDLR(0,1).imag()),
              ToComplex2(deltaDLR(1,2).real(), deltaDLR(1,2).imag()),
              ToComplex2(deltaDLR(0,2).real(), deltaDLR(0,2).imag()),
              // D_RL
              ToComplex2(deltaDRL(0,1).real(), deltaDRL(0,1).imag()),
              ToComplex2(deltaDRL(1,2).real(), deltaDRL(1,2).imag()),
              ToComplex2(deltaDRL(0,2).real(), deltaDRL(0,2).imag()),
              // D_RR
              ToComplex2(deltaDRR(0,1).real(), deltaDRR(0,1).imag()),
              ToComplex2(deltaDRR(1,2).real(), deltaDRR(1,2).imag()),
              ToComplex2(deltaDRR(0,2).real(), deltaDRR(0,2).imag())
              );
    if (err != 0) {
#ifdef FHDEBUG
        std::cout << "FeynHiggsWrapper::SetFeynHiggsPars(): Error was detected in SetFV.F:"
                  << err << std::endl;
#endif
        return (false);
    }

    /* Set the non-minimal flavor-violating parameters in the slepton sector,
     * which are not used to compute the sneutrino mass spectrum. */
    FHSetLFV(&err,
              // L_LL
              ToComplex2(deltaLLL(0,1).real(), deltaLLL(0,1).imag()),
              ToComplex2(deltaLLL(1,2).real(), deltaLLL(1,2).imag()),
              ToComplex2(deltaLLL(0,2).real(), deltaLLL(0,2).imag()),
              // E_LR
              ToComplex2(deltaELR(0,1).real(), deltaELR(0,1).imag()),
              ToComplex2(deltaELR(1,2).real(), deltaELR(1,2).imag()),
              ToComplex2(deltaELR(0,2).real(), deltaELR(0,2).imag()),
              // E_RL
              ToComplex2(deltaERL(0,1).real(), deltaERL(0,1).imag()),
              ToComplex2(deltaERL(1,2).real(), deltaERL(1,2).imag()),
              ToComplex2(deltaERL(0,2).real(), deltaERL(0,2).imag()),
              // E_RR
              ToComplex2(deltaERR(0,1).real(), deltaERR(0,1).imag()),
              ToComplex2(deltaERR(1,2).real(), deltaERR(1,2).imag()),
              ToComplex2(deltaERR(0,2).real(), deltaERR(0,2).imag())
              );
    if (err != 0) {
#ifdef FHDEBUG
        std::cout << "FeynHiggsWrapper::SetFeynHiggsPars(): Error was detected in SetFV.F:"
                  << err << std::endl;
#endif
        return (false);
    }

    computeHiggsCouplings = true;
    computeHiggsProd = true;
    computeConstraints = true;
    computeFlavour = true;

    return (true);
}
Exemplo n.º 2
0
// -------------------------------------------------------------------------- //
void Test003(
    void
) {

// ========================================================================== //
// void Test003(                                                              //
//     void)                                                                  //
//                                                                            //
// kd-tree demo.                                                              //
// ========================================================================== //
// INPUT                                                                      //
// ========================================================================== //
// - none                                                                     //
// ========================================================================== //
// OUTPUT                                                                     //
// ========================================================================== //
// - none                                                                     //
// ========================================================================== //

// ========================================================================== //
// VARIABLES DECLARATION                                                      //
// ========================================================================== //

// Local variables
    int                         N = 5120000;
    bitpit::KdTree<2, vector<double> >           KD(N);
    dvector2D                   X(N, dvector1D(2, 0.0));
    dvector1D                   x(2, -0.1);

// Counters
// none

// ========================================================================== //
// OPENING MESSAGE                                                            //
// ========================================================================== //
    {
        // Scope variables ------------------------------------------------------ //
        // none

        // Output message ------------------------------------------------------- //
        cout << "=================== TEST 003: kd-tree =========================" << endl;
    }


// ========================================================================== //
// BUILD KD-TREE                                                              //
// ========================================================================== //
    {

        // Scope variables ------------------------------------------------------ //
        chrono::time_point<chrono::system_clock> start, end;
        int                                      i;
        int                                      elapsed_seconds;


        // Output message ------------------------------------------------------- //
        cout << " - Generating k-d tree by element insertion" << endl;

        // Create vertex list --------------------------------------------------- //
        srand(time(NULL));
        for (i = 0; i < N; i++) {
            X[i][0] = ((double) rand())/((double) RAND_MAX);
            X[i][1] = ((double) rand())/((double) RAND_MAX);
        } //next i

        // Build kd tree -------------------------------------------------------- //
        start = std::chrono::system_clock::now();
        for (i = 0; i < N; i++) {
            KD.insert(&X[i]);
        } //next i
        end = chrono::system_clock::now();
        elapsed_seconds = chrono::duration_cast<chrono::milliseconds>(end-start).count();
        cout << "elapsed time: " << elapsed_seconds << " ms" << endl;

        // output kd-tree ------------------------------------------------------- //
//     for (i = 0; i < KD.n_nodes; i++) {
//         cout << "j: " << i << endl;
//         cout << "target: " << *(KD.nodes[i].object_) << endl;
//         cout << "children: (L) " << KD.nodes[i].lchild_ << " (R) " << KD.nodes[i].rchild_ << endl;
//     } //next i
    }

// ========================================================================== //
// INSERT ELEMENT                                                             //
// ========================================================================== //
    {
        // Scope variables ------------------------------------------------------ //
        // none

        // Output message ------------------------------------------------------- //
        cout << " - Inserting a new element" << endl;

        // Inserting a new element ---------------------------------------------- //
        KD.insert(&x);
        cout << "# of nodes: " << KD.n_nodes << endl;

        // output kd-tree ------------------------------------------------------- //
//     for (i = 0; i < KD.n_nodes; i++) {
//         cout << "j: " << i << endl;
//         cout << "target: " << *(KD.nodes[i].object_) << endl;
//         cout << "children: (L) " << KD.nodes[i].lchild_ << " (R) " << KD.nodes[i].rchild_ << endl;
//     } //next i

    }

// ========================================================================== //
// CHECK FOR EXISTING ELEMENTS                                                //
// ========================================================================== //
    {
        // Scope variables ------------------------------------------------------ //
        int            i;

        // Output message ------------------------------------------------------- //
        cout << " - Checking existing elements" << endl;

        // Create vertex list --------------------------------------------------- //

        // Build kd tree -------------------------------------------------------- //
        for (i = N-1; i >= 0; i--) {
            if( KD.exist(&X[i]) < 0 ) {
                cout << "error: " << i << "  " << X[i] << endl ;
            };
//ht         cout << "elem found: " << KD.exist(&X[i]) << endl;
        } //next i

    }

// ========================================================================== //
// CLOSING MESSAGE                                                            //
// ========================================================================== //
    {
        // Scope variables ------------------------------------------------------ //
        // none

        // Output message ------------------------------------------------------- //
        cout << "===================== TEST 003: done!! =====================" << endl;
    }

    return;
}
Exemplo n.º 3
0
void Player::tick(World* world){
    if (this->noclip){
        this->vel=vector2df();
        if (KD(KM_UP))    this->pos+=vector2df(0,-NOCLIP_SPEED);
        if (KD(KM_DOWN))  this->pos+=vector2df(0, NOCLIP_SPEED);
        if (KD(KM_LEFT))  this->pos+=vector2df(-NOCLIP_SPEED,0);
        if (KD(KM_RIGHT)) this->pos+=vector2df(NOCLIP_SPEED, 0);
    }else{
        bool ongr = BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-3,8))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-2,8))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-1,8))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(0, 8))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(1, 8))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(2, 8))).solid;
        
        bool lsol = BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-7))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-6))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-5))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-4))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-3))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-2))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5,-1))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 0))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 1))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 2))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 3))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 4))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 5))).solid;
        
        bool rsol = BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-7))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-6))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-5))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-4))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-3))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-2))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4,-1))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4, 0))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4, 1))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4, 2))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4, 3))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4, 4))).solid ||
                    BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(4, 5))).solid;
                    
        
        if (ongr) this->vel.X/=FRICTION;
        
        if (ongr && this->vel.Y > 0) this->vel.Y = 0;
        if (!ongr) this->vel.Y += world->gravity;
        
        if (ongr && KD(KM_LEFT) && ! lsol) {
            this->vel.X = -WALK_SPEED;
            if (BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 7))).solid){
                this->pos.Y-=1;
                if (BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(-5, 7))).solid) this->pos.Y-=1;
            }
        }
        if (ongr && KD(KM_RIGHT) && ! rsol) {
            this->vel.X = WALK_SPEED;
            if (BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(5, 7))).solid){
                this->pos.Y-=1;
                if (BLOCK(world->getBlockAt(this->getIPos()+vector2d<s32>(5, 7))).solid) this->pos.Y-=1;
            }
        }
        if (ongr && KD(KM_JUMP)) this->vel.Y = -JUMP_POWER;
        
        if (lsol && this->vel.X < 0) this->vel.X = 0;
        if (rsol && this->vel.X > 0) this->vel.X = 0;
    }
    this->pos+=this->vel;
    
    vector2d<s32> cp = this->getIPos() + ((mpos - position2d<s32>(500,333)) / 4);
    stack<vector2d<s32>> pss;
    switch (this->brush) {
        case BRUSH_PX:
            pss.emplace();
        break;
        
        case BRUSH_CIRCLE:
            for (s32 i = -4; i < 4; i++) for (s32 j = -4; j < 4; j++) if (i*i+j*j<17) pss.emplace(i,j);
        break;
    }
    
    while(!pss.empty()){
        if (EVTRR->LB && world->getBlockAt(pss.top()+cp) != BLOCK_AIR) world->setBlockAt(pss.top()+cp,BLOCK_AIR);
        pss.pop();
    }
}