Exemplo n.º 1
0
void EvtSVPHelAmp::SVPHel(EvtParticle *parent,EvtAmp& amp,EvtId n_v1,EvtId n_v2,
			  const EvtComplex& hp,const EvtComplex& hm){

  //  Routine to decay a vector into a vector and scalar.  Started
  //  by ryd on Oct 17, 1996.

  // This routine is adopted from EvtSVVHel and since there is
  // a photon that can not have helicity 0 this is put in by 
  // setting the h0 amplitude to 0.
  EvtComplex h0=EvtComplex(0.0,0.0);
    
  int tndaug = 2;
  EvtId tdaug[2];
  tdaug[0] = n_v1;
  tdaug[1] = n_v2;

  parent->initializePhaseSpace(tndaug,tdaug);

  EvtParticle *v1,*v2;
  v1 = parent->getDaug(0);
  v2 = parent->getDaug(1);

  EvtVector4R momv1 = v1->getP4();

  EvtVector3R v1dir(momv1.get(1),momv1.get(2),momv1.get(3));
  v1dir=v1dir/v1dir.d3mag();

  EvtComplex a=-0.5*(hp+hm);
  EvtComplex b=EvtComplex(0.0,0.5)*(hp-hm);
  EvtComplex c=h0+0.5*(hp+hm);

  EvtTensor3C M=a*EvtTensor3C::id()+
    b*EvtGenFunctions::eps(v1dir)+
    c*EvtGenFunctions::directProd(v1dir,v1dir);

  EvtVector3C t0=M.cont1(v1->eps(0).vec().conj());
  EvtVector3C t1=M.cont1(v1->eps(1).vec().conj());
  EvtVector3C t2=M.cont1(v1->eps(2).vec().conj());
   
  EvtVector3C eps0=v2->epsParentPhoton(0).vec().conj();
  EvtVector3C eps1=v2->epsParentPhoton(1).vec().conj();

  amp.vertex(0,0,t0*eps0);
  amp.vertex(0,1,t0*eps1);
  //amp.vertex(0,2,t1*eps0*0.);

  amp.vertex(1,0,t1*eps0);
  amp.vertex(1,1,t1*eps1);
  //amp.vertex(1,2,t1*eps0*0.);

  amp.vertex(2,0,t2*eps0);
  amp.vertex(2,1,t2*eps1);
  //amp.vertex(2,2,t1*eps0*0.);

  return ;

}
Exemplo n.º 2
0
double EvtPropSLPole::calcMaxProb( EvtId parent, EvtId meson,
                                        EvtId lepton, EvtId nudaug,
                     EvtSemiLeptonicFF *FormFactors ) {

  //This routine takes the arguements parent, meson, and lepton
  //number, and a form factor model, and returns a maximum
  //probability for this semileptonic form factor model.  A
  //brute force method is used.  The 2D cos theta lepton and
  //q2 phase space is probed.

  //Start by declaring a particle at rest.

  //It only makes sense to have a scalar parent.  For now.
  //This should be generalized later.

  EvtScalarParticle *scalar_part;
  EvtParticle *root_part;

  scalar_part=new EvtScalarParticle;

  //cludge to avoid generating random numbers!
  scalar_part->noLifeTime();

  EvtVector4R p_init;

  p_init.set(EvtPDL::getMass(parent),0.0,0.0,0.0);
  scalar_part->init(parent,p_init);
  root_part=(EvtParticle *)scalar_part;
//  root_part->set_type(EvtSpinType::SCALAR);
  root_part->setDiagonalSpinDensity();

  EvtParticle *daughter, *lep, *trino;

  EvtAmp amp;

  EvtId listdaug[3];
  listdaug[0] = meson;
  listdaug[1] = lepton;
  listdaug[2] = nudaug;

  amp.init(parent,3,listdaug);

  root_part->makeDaughters(3,listdaug);
  daughter=root_part->getDaug(0);
  lep=root_part->getDaug(1);
  trino=root_part->getDaug(2);

  EvtDecayBase *decayer;
  decayer = EvtDecayTable::getInstance()->getDecayFunc(daughter);
  if ( decayer ) {
    daughter->makeDaughters(decayer->nRealDaughters(),decayer->getDaugs());
    for(int ii=0; ii<decayer->nRealDaughters(); ii++){
      daughter->getDaug(ii)->setMass(EvtPDL::getMeanMass(daughter->getDaug(ii)->getId()));
    }
  }  

  //cludge to avoid generating random numbers!
  daughter->noLifeTime();
  lep->noLifeTime();
  trino->noLifeTime();

  //Initial particle is unpolarized, well it is a scalar so it is
  //trivial
  EvtSpinDensity rho;
  rho.setDiag(root_part->getSpinStates());

  double mass[3];

  double m = root_part->mass();

  EvtVector4R p4meson, p4lepton, p4nu, p4w;
  double q2max;

  double q2, elepton, plepton;
  int i,j;
  double erho,prho,costl;

  double maxfoundprob = 0.0;
  double prob = -10.0;
  int massiter;

  for (massiter=0;massiter<3;massiter++){

    mass[0] = EvtPDL::getMeanMass(meson);
    mass[1] = EvtPDL::getMeanMass(lepton);
    mass[2] = EvtPDL::getMeanMass(nudaug);
    if ( massiter==1 ) {
      mass[0] = EvtPDL::getMinMass(meson);
    }
    if ( massiter==2 ) {
      mass[0] = EvtPDL::getMaxMass(meson);
      if ( (mass[0]+mass[1]+mass[2])>m) mass[0]=m-mass[1]-mass[2]-0.00001;
    }

    q2max = (m-mass[0])*(m-mass[0]);

    //loop over q2

    for (i=0;i<25;i++) {
      q2 = ((i+0.5)*q2max)/25.0;

      erho = ( m*m + mass[0]*mass[0] - q2 )/(2.0*m);

      prho = sqrt(erho*erho-mass[0]*mass[0]);

      p4meson.set(erho,0.0,0.0,-1.0*prho);
      p4w.set(m-erho,0.0,0.0,prho);

      //This is in the W rest frame
      elepton = (q2+mass[1]*mass[1])/(2.0*sqrt(q2));
      plepton = sqrt(elepton*elepton-mass[1]*mass[1]);

      double probctl[3];

      for (j=0;j<3;j++) {

        costl = 0.99*(j - 1.0);

        //These are in the W rest frame. Need to boost out into
        //the B frame.
        p4lepton.set(elepton,0.0,
                  plepton*sqrt(1.0-costl*costl),plepton*costl);
        p4nu.set(plepton,0.0,
                 -1.0*plepton*sqrt(1.0-costl*costl),-1.0*plepton*costl);

        EvtVector4R boost((m-erho),0.0,0.0,1.0*prho);
        p4lepton=boostTo(p4lepton,boost);
        p4nu=boostTo(p4nu,boost);

        //Now initialize the daughters...

        daughter->init(meson,p4meson);
        lep->init(lepton,p4lepton);
        trino->init(nudaug,p4nu);

        calcamp->CalcAmp(root_part,amp,FormFactors);

        EvtPoint1D *point = new EvtPoint1D(mass[0]);

        double meson_BWAmp = calBreitWigner(daughter, *point);

        int list[2];
        list[0]=0; list[1]=0;
        amp.vertex(0,0,amp.getAmp(list)*meson_BWAmp);
        list[0]=0; list[1]=1;
        amp.vertex(0,1,amp.getAmp(list)*meson_BWAmp);

        list[0]=1; list[1]=0;
        amp.vertex(1,0,amp.getAmp(list)*meson_BWAmp);
        list[0]=1; list[1]=1;
        amp.vertex(1,1,amp.getAmp(list)*meson_BWAmp);

        list[0]=2; list[1]=0;
        amp.vertex(2,0,amp.getAmp(list)*meson_BWAmp);
        list[0]=2; list[1]=1;
        amp.vertex(2,1,amp.getAmp(list)*meson_BWAmp);

        //Now find the probability at this q2 and cos theta lepton point
        //and compare to maxfoundprob.

        //Do a little magic to get the probability!!
        prob = rho.normalizedProb(amp.getSpinDensity());

        probctl[j]=prob;
      }

      //probclt contains prob at ctl=-1,0,1.
      //prob=a+b*ctl+c*ctl^2

      double a=probctl[1];
      double b=0.5*(probctl[2]-probctl[0]);
      double c=0.5*(probctl[2]+probctl[0])-probctl[1];

      prob=probctl[0];
      if (probctl[1]>prob) prob=probctl[1];
      if (probctl[2]>prob) prob=probctl[2];

      if (fabs(c)>1e-20){
        double ctlx=-0.5*b/c;
        if (fabs(ctlx)<1.0){
          double probtmp=a+b*ctlx+c*ctlx*ctlx;
          if (probtmp>prob) prob=probtmp;
        }

      }

      //EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "prob,probctl:"<<prob<<" "
      //                            << probctl[0]<<" "
      //                            << probctl[1]<<" "
      //                            << probctl[2]<<endl;

      if ( prob > maxfoundprob ) {
        maxfoundprob = prob;
      }

    }
    if ( EvtPDL::getWidth(meson) <= 0.0 ) {
      //if the particle is narrow dont bother with changing the mass.
      massiter = 4;
    }

  }
  root_part->deleteTree();

  maxfoundprob *=1.1;
  return maxfoundprob;

}
void EvtSemiLeptonicScalarAmp::CalcAmp( EvtParticle *parent,
					EvtAmp& amp,
					EvtSemiLeptonicFF *FormFactors ) {

  static EvtId EM=EvtPDL::getId("e-");
  static EvtId MUM=EvtPDL::getId("mu-");
  static EvtId TAUM=EvtPDL::getId("tau-");
  static EvtId EP=EvtPDL::getId("e+");
  static EvtId MUP=EvtPDL::getId("mu+");
  static EvtId TAUP=EvtPDL::getId("tau+");
  
  //Add the lepton and neutrino 4 momenta to find q2

  EvtVector4R q = parent->getDaug(1)->getP4() 
                    + parent->getDaug(2)->getP4();
  double q2 = (q.mass2());

  double fpf,f0f;
  double mesonmass = parent->getDaug(0)->mass();
  double parentmass = parent->mass();

  FormFactors->getscalarff(parent->getId(),
                           parent->getDaug(0)->getId(),
                           q2,
                           mesonmass,
                           &fpf, 
                           &f0f);


  EvtVector4R p4b;
  p4b.set(parent->mass(),0.0,0.0,0.0);
  EvtVector4R p4meson = parent->getDaug(0)->getP4();
  double mdiffoverq2;
  mdiffoverq2 = parentmass*parentmass - mesonmass*mesonmass;
  mdiffoverq2 = mdiffoverq2 / q2;

  EvtVector4C l1,l2;

  EvtId l_num = parent->getDaug(1)->getId();
  EvtVector4C tds;

  if (l_num==EM||l_num==MUM||l_num==TAUM){

    tds = EvtVector4C(fpf*(p4b+p4meson - (mdiffoverq2*(p4b-p4meson)))+
		    + f0f*mdiffoverq2*(p4b-p4meson));

    l1=EvtLeptonVACurrent(parent->getDaug(1)->spParent(0),
                          parent->getDaug(2)->spParentNeutrino());
    l2=EvtLeptonVACurrent(parent->getDaug(1)->spParent(1),
                          parent->getDaug(2)->spParentNeutrino());
  }
  else{
    if (l_num==EP||l_num==MUP||l_num==TAUP){

      tds = EvtVector4C(fpf*(p4b+p4meson - (mdiffoverq2*(p4b-p4meson)))+
		    + f0f*mdiffoverq2*(p4b-p4meson));

      l1=EvtLeptonVACurrent(parent->getDaug(2)->spParentNeutrino(),
			    parent->getDaug(1)->spParent(0));
      l2=EvtLeptonVACurrent(parent->getDaug(2)->spParentNeutrino(),
			    parent->getDaug(1)->spParent(1));
    }
    else{
      EvtGenReport(EVTGEN_ERROR,"EvtGen") << "dfnb89agngri wrong lepton number\n";
    }
  }

  amp.vertex(0,l1*tds);
  amp.vertex(1,l2*tds);

}
Exemplo n.º 4
0
void EvtEvalHelAmp::evalAmp( EvtParticle *p, EvtAmp& amp){

  //find theta and phi of the first daughter
  
  EvtVector4R pB=p->getDaug(0)->getP4();

  double theta=acos(pB.get(3)/pB.d3mag());
  double phi=atan2(pB.get(2),pB.get(1));

  double c=sqrt((_JA2+1)/(4*EvtConst::pi));

  int ia,ib,ic;

  double prob1=0.0;

  for(ia=0;ia<_nA;ia++){
    for(ib=0;ib<_nB;ib++){
      for(ic=0;ic<_nC;ic++){
	_amp[ia][ib][ic]=0.0;
	if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) {
	  double dfun=EvtdFunction::d(_JA2,_lambdaA2[ia],
				      _lambdaB2[ib]-_lambdaC2[ic],theta);

	  _amp[ia][ib][ic]=c*_HBC[ib][ic]*
	    exp(EvtComplex(0.0,phi*0.5*(_lambdaA2[ia]-_lambdaB2[ib]+
	  				_lambdaC2[ic])))*dfun;
	}
	prob1+=real(_amp[ia][ib][ic]*conj(_amp[ia][ib][ic]));
      }
    }
  }

  setUpRotationMatrices(p,theta,phi);

  applyRotationMatrices();

  double prob2=0.0;

  for(ia=0;ia<_nA;ia++){
    for(ib=0;ib<_nB;ib++){
      for(ic=0;ic<_nC;ic++){
	prob2+=real(_amp[ia][ib][ic]*conj(_amp[ia][ib][ic]));
	if (_nA==1){
	  if (_nB==1){
	    if (_nC==1){
	      amp.vertex(_amp[ia][ib][ic]);
	    }
	    else{
	      amp.vertex(ic,_amp[ia][ib][ic]);
	    }
	  }
	  else{
	    if (_nC==1){
	      amp.vertex(ib,_amp[ia][ib][ic]);
	    }
	    else{
	      amp.vertex(ib,ic,_amp[ia][ib][ic]);
	    }
	  }
	}else{
	  if (_nB==1){
	    if (_nC==1){
	      amp.vertex(ia,_amp[ia][ib][ic]);
	    }
	    else{
	      amp.vertex(ia,ic,_amp[ia][ib][ic]);
	    }
	  }
	  else{
	    if (_nC==1){
	      amp.vertex(ia,ib,_amp[ia][ib][ic]);
	    }
	    else{
	      amp.vertex(ia,ib,ic,_amp[ia][ib][ic]);
	    }
	  }
	}
      }
    }
  }

  if (fabs(prob1-prob2)>0.000001*prob1){
    report(Severity::Info,"EvtGen") << "prob1,prob2:"<<prob1<<" "<<prob2<<endl;
    ::abort();
  }
    
  return ;

}
Exemplo n.º 5
0
void EvtB2MuMuMuNuAmp::CalcAmp(EvtParticle *parent, 
                               EvtAmp& amp,
			       EvtbTosllMSFF   *formFactorsms){ 
                            
    
  // Check the charge conservation in the reaction 
  int charge[4];
  charge[0] = (EvtPDL::chg3(parent->getDaug(0)->getId()))/3;
  charge[1] = (EvtPDL::chg3(parent->getDaug(1)->getId()))/3;
  charge[2] = (EvtPDL::chg3(parent->getDaug(2)->getId()))/3;
  charge[3] = (EvtPDL::chg3(parent->getDaug(3)->getId()))/3;
  if(abs(charge[0]+charge[1]+charge[2]+charge[3])!=1){
     EvtGenReport(EVTGEN_ERROR,"EvtGen") 
            << "\n\n The function EvtB2MuMuMuNuAmp::CalcAmp(...)"
            << "\n Error in the daughters charge definition!"
            << "\n charge1 = " << charge[0] 
            << "\t KF code1 = " << EvtPDL::getLundKC(parent->getDaug(0)->getId())
            << "\n charge2 = " << charge[1]
            << "\t KF code2 = " << EvtPDL::getLundKC(parent->getDaug(1)->getId())
            << "\n charge3 = " << charge[2]
            << "\t KF code3 = " << EvtPDL::getLundKC(parent->getDaug(2)->getId())
            << "\n charge4 = " << charge[3]
            << "\t KF code4 = " << EvtPDL::getLundKC(parent->getDaug(3)->getId())
            << "\n number of daughters = " << parent->getNDaug()
            << std::endl;
     ::abort();
  }
  
  
  // Daughter's positions in the matrix element
  int il1, il2, il3, il4;  //   Mu^+(k_1), Mu^-(k_2), \bar Nu_{Mu}(k_3) and Mu^-(k_4)
                           //or Mu^-(k_1), Mu^+(k_2),      Nu_{Mu}(k_3) and Mu^+(k_4)
                           //   This is the "canonical set" for current matrix element.
                           
  il1 = -101; //initialization of the daughter's positions 
  il2 = -102;
  il3 = -103; 
  il4 = -104;                        
  
  // Daughter's positions for the decay 
  //                   B^-(p) -> Mu^+(k_1) Mu^-(k_2) \bar Nu_{Mu}(k_3) Mu^-(k_4).
  if(charge[0]+charge[1]+charge[2]+charge[3] == -1){
     int ll;
     int min_charge, min_charge_il;
     min_charge    = charge[0];
     min_charge_il = 0;
     for(ll = 1; ll < 4; ll++){
        if(min_charge > charge[ll]){ 
               min_charge = charge[ll];
               min_charge_il = ll;
        }              
     }
     il2 = min_charge_il;                        // this is Mu^-(k_2)  
     if(il2 > 2){
       EvtGenReport(EVTGEN_ERROR,"EvtGen") 
            << "\n\n The function EvtB2MuMuMuNuAmp::CalcAmp(...)"
            << "\n Error in the particles distribution!"
            << "\n il2 = "          << il2
            << "\n min_charge = "   << min_charge
            << "\n total charge = -1 = " << (charge[0]+charge[1]+charge[2]+charge[3])
            << std::endl;
       ::abort();
     }       
     for(ll = il2 + 1; ll < 4; ll++){
        if(charge[ll] == -1) il4 = ll;           // this is  Mu^-(k_4)
        }          
     for(ll = 0; ll < 4; ll++){
        if(charge[ll] == +1) il1 = ll;           // this is  Mu^+(k_1)
        }           
     for(ll = 0; ll < 4; ll++){
        if(charge[ll] == 0) il3 = ll;            // this is  \bar Nu_{Mu}(k_3)
        }               
  }

  // Daughter's positions for the decay 
  //                   B^+(p) -> Mu^-(k_1) Mu^+(k_2) Nu_{Mu}(k_3) Mu^+(k_4).
  if(charge[0]+charge[1]+charge[2]+charge[3] == 1){
     int ll;
     int max_charge, max_charge_il;
     max_charge    = charge[0];
     max_charge_il = 0;
     for(ll = 1; ll < 4; ll++){
        if(max_charge < charge[ll]){ 
               max_charge = charge[ll];
               max_charge_il = ll;
        }              
     }
     il2 = max_charge_il;                        // this is Mu^+(k_2)  
     if(il2 > 2){
       EvtGenReport(EVTGEN_ERROR,"EvtGen") 
            << "\n\n The function EvtB2MuMuMuNuAmp::CalcAmp(...)"
            << "\n Error in the particles distribution!"
            << "\n il2 = "          << il2
            << "\n max_charge = "   << max_charge
            << "\n total charge = +1 = " << (charge[0]+charge[1]+charge[2]+charge[3])
            << std::endl;
       ::abort();
     }       
     for(ll = il2 + 1; ll < 4; ll++){
        if(charge[ll] == 1) il4 = ll;            // this is  Mu^+(k_4)
        }          
     for(ll = 0; ll < 4; ll++){
        if(charge[ll] == -1) il1 = ll;           // this is  Mu^-(k_1)
        }           
     for(ll = 0; ll < 4; ll++){
        if(charge[ll] == 0) il3 = ll;            // this is  Nu_{Mu}(k_3)
        }               
  }

  
  if((il1 < 0)||(il2 < 0)|| (il3 < 0) || (il4 < 0)){
     EvtGenReport(EVTGEN_ERROR,"EvtGen") 
            << "\n\n The function EvtB2MuMuMuNuAmp::CalcAmp(...)"
            << "\n ilX < 0 !!!"
            << "\n il1 = " << il1
            << "\t il2 = " << il2
            << "\t il3 = " << il3
            << "\t il4 = " << il4
            << std::endl;
     ::abort();     
  }
  
  // Output for program work check.
  // Need to comment in the final version!
//  EvtGenReport(EVTGEN_ERROR,"EvtGen") 
//            << "\n il1 = " << il1
//            << "\t il2 = " << il2
//            << "\t il3 = " << il3
//            << "\t il4 = " << il4
//            << std::endl;
   //END of the daughter's positions initialization           
            
  
  // Kinematics initialization          
  
  EvtComplex unit1(1.0,0.0); // real unit
  EvtComplex uniti(0.0,1.0); // imaginary unit  

  double M1 = parent->mass();                // B-meson mass, GeV
  double ml = parent->getDaug(il1)->mass();  // mass of muon, GeV
  
  // Id and 4-momentums of the particles
  
  EvtId idparent = parent->getId(); // B-meson Id
  
  EvtVector4R p;                    // B-meson 4-momentum
  p.set(0.0,0.0,0.0,0.0);
  
  
  EvtId id_L1, id_L2, id_L3, id_L4; // leptonic Id
  
  EvtVector4R k_1;  // 4-momentum of mu^+ in the    B^- rest frame; (il1)
  EvtVector4R k_2;  // 4-momentum of mu^- in the    B^- rest frame; (il2) 
  EvtVector4R k_3;  // 4-momentum of \bar nu in the B^- rest frame; (il3)
  EvtVector4R k_4;  // 4-momentum of mu^- in the    B^- rest frame; (il4)

  k_1.set(0.0,0.0,0.0,0.0);
  k_2.set(0.0,0.0,0.0,0.0);
  k_3.set(0.0,0.0,0.0,0.0);
  k_4.set(0.0,0.0,0.0,0.0);

  EvtVector4R q_fierst;     // q = k_1 + k_2 4-momentum in the B-rest frame
  EvtVector4R k_fierst;     // k = k_3 + k_4 4-momentum in the B-rest frame
  double q2_fierst;         // Mandelstam variable s=q^2
  double k2_fierst;         // Mandelstam variable t=k^2

  EvtVector4R q_second;     // q = k_1 + k_4 4-momentum in the B-rest frame
  EvtVector4R k_second;     // k = k_3 + k_2 4-momentum in the B-rest frame
  double q2_second;         // Mandelstam variable s=q^2
  double k2_second;         // Mandelstam variable t=k^2

  p = parent->getP4Restframe();     // B-meson 4-momentum in the B-rest frame

  k_1 = parent->getDaug(il1)->getP4();
  k_2 = parent->getDaug(il2)->getP4();
  k_3 = parent->getDaug(il3)->getP4();
  k_4 = parent->getDaug(il4)->getP4();
  
  q_fierst = k_1 + k_2;
  k_fierst = k_3 + k_4;
  q2_fierst = q_fierst.mass2();
  k2_fierst = k_fierst.mass2(); 
  
  q_second = k_1 + k_4;
  k_second = k_3 + k_2; 
  q2_second = q_second.mass2();
  k2_second = k_second.mass2(); 
  
  
  // For "B^-" - and "B^+" - mesons amplitudeы separately calculations 
  static EvtIdSet bmesons("B-","B_c-");
  static EvtIdSet bbarmesons("B+","B_c+");
  
//  // Information for test of 4-momentum.
//  // Need to comment in the final version!
//  EvtGenReport(EVTGEN_ERROR,"EvtGen") 
//            << "\n 4-momentum initialization  test"
//            << "\n k_1 = " << k_1
//            << "\n k_2 = " << k_2
//            << "\n k_3 = " << k_3
//            << "\n k_4 = " << k_4
//            << "\n q_fierst = " << q_fierst
//            << "\n q_second = " << q_second
//            << "\n k_fierst = " << k_fierst
//            << "\n k_second = " << k_second
//            << std::endl; 

  
  //
  // I. VMD Contribution
  //
  
  double M2[4];   //intermediate vector mesons mass for VMD contribution
  // M2[0] = EvtPDL::getMass(EvtPDL::getId(std::string("rho0")));  // Rho^0
  // M2[1] = EvtPDL::getMass(EvtPDL::getId(std::string("omega"))); // Omega^0
  // M2[2] = M2[0];  // GeV Rho^0
  // M2[3] = M2[1];  // GeV Omega^0
  M2[0] = 0.77526; // GeV Rho^0
  M2[1] = 0.78265; // GeV Omega^0
  M2[2] = M2[0];  // GeV Rho^0
  M2[3] = M2[1];  // GeV Omega^0
  
  double Width2[4]; //intermediate vector mesons width for VMD contribution
  // Width2[0] = EvtPDL::getWidth(EvtPDL::getId(std::string("rho0")));  // Rho^0
  // Width2[1] = EvtPDL::getWidth(EvtPDL::getId(std::string("omega"))); // Omega^0
  // Width2[2] = Width2[0];  // GeV Rho^0
  // Width2[3] = Width2[1];  // GeV Omega^0
  Width2[0] = 0.1491;   // GeV Rho^0
  Width2[1] = 0.00849;  // GeV Omega^0
  Width2[2] = Width2[0];  // GeV Rho^0
  Width2[3] = Width2[1];  // GeV Omega^0
  
  double fV2[4]; //intermediate vector mesons leptonic constant for VMD contribution
                 // see D.Melikhov, N.Nikitin. PRD70, 114028 (2004)
  fV2[0] = 5.04; // GeV Rho^0    
  fV2[1] = 17.1; // GeV Omega^0
  fV2[2] = 5.04; // GeV Rho^0    
  fV2[3] = 17.1; // GeV Omega^0
  
  // For taking the form factors values
  
  // B -> V intermediate vector mesons
  // transition form-factors for VMD contribution
  // 0 -- Rho^0 for k2_fierst
  // 1 -- Omega^0 for k2_fierst
  // 2 -- Rho^0 for k2_second
  // 3 -- Omega^0 for k2_second
  double a1[4],a2[4],a3[4],a0[4],v[4],t1[4],t2[4],t3[4];  
                                         
  
  EvtId B_meson_for_FF     = EvtPDL::getId(std::string("B0"));
  EvtId rho_meson_for_FF   = EvtPDL::getId(std::string("rho0"));
  EvtId omega_meson_for_FF = EvtPDL::getId(std::string("omega"));
  
  formFactorsms->getVectorFF(B_meson_for_FF, rho_meson_for_FF, k2_fierst,
                             a1[0],a2[0],a0[0],v[0],t1[0],t2[0],t3[0]);
                             
  formFactorsms->getVectorFF(B_meson_for_FF, omega_meson_for_FF, k2_fierst,
                             a1[1],a2[1],a0[1],v[1],t1[1],t2[1],t3[1]);
                             
  formFactorsms->getVectorFF(B_meson_for_FF, rho_meson_for_FF, k2_second,
                             a1[2],a2[2],a0[2],v[2],t1[2],t2[2],t3[2]);
                             
  formFactorsms->getVectorFF(B_meson_for_FF, omega_meson_for_FF, k2_second,
                             a1[3],a2[3],a0[3],v[3],t1[3],t2[3],t3[3]);
                                
   int aa;
   for(aa = 0; aa < 4; aa++){
          a3[aa] = ((M1 + M2[aa])*a1[aa] - (M1 - M2[aa])*a2[aa])/(2.0*M2[aa]);
       }                         
  
//  // Information for test of VMD contribution.
//  // Need to comment in the final version!
//  EvtGenReport(EVTGEN_ERROR,"EvtGen") 
//            << "\n VMD Contribution test"
//            << "\n M(Bu) = " << M1 << " GeV;"
//            << "\n M(Rho) = " << M2[0] << " GeV;"
//            << "\t M(Omega) = " << M2[1] << " GeV;"
//            << "\t Gamma(Rho) = " << Width2[0] << " Gev;"
//            << "\t Gamma(Omega) = " << Width2[1] << " Gev."
//            << "\n\n a1[0] = " << a1[0]
//            << "\t  a2[0] = " << a2[0]
//            << "\t  a0[0] = " << a0[0]
//            << "\t  a3[0] = " << a3[0]
//            << "\t   v[0] = " <<  v[0]
//            << "\n\n a1[1] = " << a1[1]
//            << "\t  a2[1] = " << a2[1]
//            << "\t  a0[1] = " << a0[1]
//            << "\t  a3[1] = " << a3[1]
//            << "\t   v[1] = " <<  v[1]
//            << "\n\n a1[2] = " << a1[2]
//            << "\t  a2[2] = " << a2[2]
//            << "\t  a0[2] = " << a0[2]
//            << "\t  a3[2] = " << a3[2]
//            << "\t   v[2] = " <<  v[2]
//            << "\n\n a1[3] = " << a1[3]
//            << "\t  a2[3] = " << a2[3]
//            << "\t  a0[3] = " << a0[3]
//            << "\t  a3[3] = " << a3[3]
//            << "\t   v[3] = " <<  v[3]
//            << std::endl; 
  
  
  
  // Tensor structures for VMD contribution
  EvtTensor4C Tvmd_fierst, Tvmd_second; 
  
  
  //
  // II. Electromagnetic foton emission from B-meson contribution 
  //                     (EM contribution)  
  //
  
  // EM form factors
  // 0 -- u-quark emission for q2_fierst
  // 1 -- b-quark emission for q2_fierst
  // 2 -- u-quark emission for q2_second
  // 3 -- b-quark emission for q2_second
  double v_em[4];
  double MBstar = 5.325; // GeV
  
  v_em[0] = 4.0*MBstar*FF_B2BstarGamma_fromU(q2_fierst)/(3.0*(M1 + MBstar));
  v_em[1] = 2.0*MBstar*FF_B2BstarGamma_fromB(q2_fierst)/(3.0*(M1 + MBstar));
  v_em[2] = 4.0*MBstar*FF_B2BstarGamma_fromU(q2_second)/(3.0*(M1 + MBstar));
  v_em[3] = 2.0*MBstar*FF_B2BstarGamma_fromB(q2_second)/(3.0*(M1 + MBstar));
  
  // Tensor structures for EM contribution
  EvtTensor4C Tem_fierst, Tem_second; 
  
  
  //
  // ***
  //
  
  
  
  // Leptonic currents 
  //   L1 = (\bar mu \gamma^{\mu} (1 - \gamma^5) nu) 
  //                             or (\bar nu \gamma^{\mu} (1 - \gamma^5) mu)
  //   L2 = (\bar mu \gamma^{\nu} mu)
  EvtVector4C L1_fierst, L2_fierst;
  EvtVector4C L1_second, L2_second;

  
  int i1, i2, i3, i4;  // leptonic spin structures counters
  int leptonicspin[4]; // array for the saving of the leptonic spin configuration



  // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  // +                Contribution for B- decay               +
  // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  if (bmesons.contains(idparent)){
  
  Tvmd_fierst = 0.0*EvtTensor4C::g();  
  for(aa = 0; aa < 2; aa++){
      EvtComplex coeff_vmd;
      
      double Re_vmd, Im_vmd, znam_vmd;
      Re_vmd = q2_fierst - M2[aa]*M2[aa];
      Im_vmd = Width2[aa]*M2[aa];
      znam_vmd = fV2[aa]*(Re_vmd*Re_vmd + Im_vmd*Im_vmd);
      coeff_vmd = unit1*Re_vmd/znam_vmd - uniti*Im_vmd/znam_vmd;
      
      double vaa, a2aa, a3aa;
      vaa  = 2.0*v[aa]/(M1 + M2[aa]);
      a2aa = a2[aa]/(M1 + M2[aa]);
      a3aa = 2.0*M2[aa]*(a3[aa] - a0[aa])/k2_fierst;
           
      Tvmd_fierst = Tvmd_fierst 
        +coeff_vmd*(0.0*EvtTensor4C::g()
        -(unit1*vaa*dual(EvtGenFunctions::directProd(p,q_fierst)))
        -uniti*a1[aa]*(M1 + M2[aa])*EvtTensor4C::g()
        +uniti*a2aa*EvtGenFunctions::directProd((p + q_fierst),p)
        +uniti*a3aa*EvtGenFunctions::directProd((p - q_fierst),p));
      }
 
  Tvmd_second = 0.0*EvtTensor4C::g();
  for(aa = 2; aa < 4; aa++){
      EvtComplex coeff_vmd;
      
      double Re_vmd, Im_vmd, znam_vmd;
      Re_vmd = q2_second - M2[aa]*M2[aa];
      Im_vmd = Width2[aa]*M2[aa];
      znam_vmd = fV2[aa]*(Re_vmd*Re_vmd + Im_vmd*Im_vmd);
      coeff_vmd = unit1*Re_vmd/znam_vmd - uniti*Im_vmd/znam_vmd;
      
      double vaa, a2aa, a3aa;
      vaa  = 2.0*v[aa]/(M1 + M2[aa]);
      a2aa = a2[aa]/(M1 + M2[aa]);
      a3aa = 2.0*M2[aa]*(a3[aa] - a0[aa])/k2_second;
      
      Tvmd_second = Tvmd_second  
        +coeff_vmd*(0.0*EvtTensor4C::g()
        -unit1*vaa*dual(EvtGenFunctions::directProd(p,q_second))
        -uniti*a1[aa]*(M1 + M2[aa])*EvtTensor4C::g()
        +uniti*a2aa*EvtGenFunctions::directProd((p + q_second),p)
        +uniti*a3aa*EvtGenFunctions::directProd((p - q_second),p));
      }
      
  Tem_fierst = 0.0*EvtTensor4C::g(); 
  for(aa = 0; aa < 2; aa++){
      double fBstar = 0.2; // GeV
      double coeff;
      coeff = fBstar/(q2_fierst*(k2_fierst - MBstar*MBstar));
      Tem_fierst = Tem_fierst - coeff*v_em[aa]*dual(EvtGenFunctions::directProd(p,k_fierst)); 
     }  
     
  Tem_second = 0.0*EvtTensor4C::g(); 
  for(aa = 2; aa < 4; aa++){
      double fBstar = 0.2; // GeV
      double coeff;
      coeff = fBstar/(q2_fierst*(k2_fierst - MBstar*MBstar));
      Tem_second = Tem_second - coeff*v_em[aa]*dual(EvtGenFunctions::directProd(p,k_second)); 
     }     
      
  // Amplitude calculation
  for(i2=0;i2<2;i2++){
    leptonicspin[0] = i2;
    for(i1=0;i1<2;i1++){
      leptonicspin[1] = i1;
      for(i4=0;i4<2;i4++){
        leptonicspin[2] = i4;
        i3 = 0;                  // neutrino spin structure!
        leptonicspin[3] = i3;
        
        //(\bar mu(k_4) \gamma^{\mu} (1 - \gamma^5) nu(- k_3))
        L1_fierst = EvtLeptonVACurrent(parent->getDaug(il4)->spParent(i4),
                                       parent->getDaug(il3)->spParentNeutrino());
        
        
        //(\bar mu(k_2) \gamma^{\mu} mu(- k_1))
        L2_fierst = EvtLeptonVCurrent(parent->getDaug(il2)->spParent(i2),
                                       parent->getDaug(il1)->spParent(i1));
        
        
        //(\bar mu(k_2) \gamma^{\mu} (1 - \gamma^5) nu(- k_3))
        L1_second = EvtLeptonVACurrent(parent->getDaug(il2)->spParent(i2),
                                       parent->getDaug(il3)->spParentNeutrino());
        
        
        //(\bar mu(k_4) \gamma^{\mu} mu(- k_1))
        L2_second = EvtLeptonVCurrent(parent->getDaug(il4)->spParent(i4),
                                       parent->getDaug(il1)->spParent(i1));
         
        // VMD                               
        EvtVector4C Evmd_fierst, Evmd_second;
        Evmd_fierst=Tvmd_fierst.cont2(L2_fierst);
        Evmd_second=Tvmd_second.cont2(L2_second);
        
        // EM
        EvtVector4C Eem_fierst, Eem_second;
        Eem_fierst=Tem_fierst.cont2(L1_fierst);
        Eem_second=Tem_second.cont2(L1_second);
           
        // Bremsstrahlung   
        EvtComplex Ebrst_fierst, Ebrst_second;
        double fB = 0.20; // GeV leptonic constant of B^{\pm} mesons
        Ebrst_fierst = uniti*fB*L2_fierst*L1_fierst/q2_fierst;
        Ebrst_second = uniti*fB*L2_second*L1_second/q2_second;
        
        amp.vertex(leptonicspin, L1_fierst*Evmd_fierst + L2_fierst*Eem_fierst + Ebrst_fierst 
                               - L1_second*Evmd_second - L2_second*Eem_second - Ebrst_second);
                               
         if(q2_fierst < 4.0*ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }                      
          if(q2_second < 4.0*ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }  
           if(k2_fierst < ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }                      
          if(k2_second < ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }                                                                    
          
        }  // End of the operator "for(i4=0;i4<2;i4++)"
      }    // End of the operator "for(i1=0;i1<2;i1++)"
    }      // End of the operator "for(i2=0;i2<2;i2++)"
      
   }  // End of the operator: "if (bmesons.contains(idparent))"

   
   else { // Start of the operator "else N1" 
  // ++++++++++++++++++++++++++++++++++++++++++++++++++
  // +           Contribution for B+ decay            +
  // ++++++++++++++++++++++++++++++++++++++++++++++++++
  if (bbarmesons.contains(idparent)){
  
  Tvmd_fierst = 0.0*EvtTensor4C::g();  
  for(aa = 0; aa < 2; aa++){
      EvtComplex coeff_vmd;
      
      double Re_vmd, Im_vmd, znam_vmd;
      Re_vmd = q2_fierst - M2[aa]*M2[aa];
      Im_vmd = Width2[aa]*M2[aa];
      znam_vmd = fV2[aa]*(Re_vmd*Re_vmd + Im_vmd*Im_vmd);
      coeff_vmd = unit1*Re_vmd/znam_vmd - uniti*Im_vmd/znam_vmd;
      
      double vaa, a2aa, a3aa;
      vaa  = 2.0*v[aa]/(M1 + M2[aa]);
      a2aa = a2[aa]/(M1 + M2[aa]);
      a3aa = 2.0*M2[aa]*(a3[aa] - a0[aa])/k2_fierst;
            
      Tvmd_fierst = Tvmd_fierst 
        +coeff_vmd*(0.0*EvtTensor4C::g()
        +unit1*vaa*dual(EvtGenFunctions::directProd(p,q_fierst))
        -uniti*a1[aa]*(M1 + M2[aa])*EvtTensor4C::g()
        +uniti*a2aa*EvtGenFunctions::directProd((p + q_fierst),p)
        +uniti*a3aa*EvtGenFunctions::directProd((p - q_fierst),p));
      }
 
  Tvmd_second = 0.0*EvtTensor4C::g();
  for(aa = 2; aa < 4; aa++){
      EvtComplex coeff_vmd;
      
      double Re_vmd, Im_vmd, znam_vmd;
      Re_vmd = q2_second - M2[aa]*M2[aa];
      Im_vmd = Width2[aa]*M2[aa];
      znam_vmd = fV2[aa]*(Re_vmd*Re_vmd + Im_vmd*Im_vmd);
      coeff_vmd = unit1*Re_vmd/znam_vmd - uniti*Im_vmd/znam_vmd;
      
      double vaa, a2aa, a3aa;
      vaa  = 2.0*v[aa]/(M1 + M2[aa]);
      a2aa = a2[aa]/(M1 + M2[aa]);
      a3aa = 2.0*M2[aa]*(a3[aa] - a0[aa])/k2_second;
   
      Tvmd_second = Tvmd_second  
        +coeff_vmd*(0.0*EvtTensor4C::g()
        +unit1*vaa*dual(EvtGenFunctions::directProd(p,q_second))
        -uniti*a1[aa]*(M1 + M2[aa])*EvtTensor4C::g()
        +uniti*a2aa*EvtGenFunctions::directProd((p + q_second),p)
        +uniti*a3aa*EvtGenFunctions::directProd((p - q_second),p));
      }
      
  Tem_fierst = 0.0*EvtTensor4C::g(); 
  for(aa = 0; aa < 2; aa++){
      double fBstar = 0.0 - 0.2; // GeV
      double coeff;
      coeff = fBstar/(q2_fierst*(k2_fierst - MBstar*MBstar));
      Tem_fierst = Tem_fierst + coeff*v_em[aa]*dual(EvtGenFunctions::directProd(p,k_fierst)); 
     }  
     
  Tem_second = 0.0*EvtTensor4C::g(); 
  for(aa = 2; aa < 4; aa++){
      double fBstar = 0.0 - 0.2; // GeV
      double coeff;
      coeff = fBstar/(q2_fierst*(k2_fierst - MBstar*MBstar));
      Tem_second = Tem_second + coeff*v_em[aa]*dual(EvtGenFunctions::directProd(p,k_second)); 
     }        
      
  // Amplitude calculation
  for(i2=0;i2<2;i2++){
    leptonicspin[0] = i2;
    for(i1=0;i1<2;i1++){
      leptonicspin[1] = i1;
      for(i4=0;i4<2;i4++){
        leptonicspin[2] = i4;
        i3 = 0;                  // neutrino spin structure!
        leptonicspin[3] = i3;
        
        //(\bar nu(k_3) \gamma^{\mu} (1 - \gamma^5) mu(- k_4))
        L1_fierst = EvtLeptonVACurrent(parent->getDaug(il3)->spParentNeutrino(),
                                       parent->getDaug(il4)->spParent(i4));
        
        
        //(\bar mu(k_1) \gamma^{\mu} mu(- k_2))
        L2_fierst = EvtLeptonVCurrent(parent->getDaug(il1)->spParent(i1),
                                       parent->getDaug(il2)->spParent(i2));
        
        
        //(\bar nu(k_3) \gamma^{\mu} (1 - \gamma^5) mu(- k_2))
        L1_second = EvtLeptonVACurrent(parent->getDaug(il3)->spParentNeutrino(),
                                       parent->getDaug(il2)->spParent(i2));
        
        
        //(\bar mu(k_1) \gamma^{\mu} mu(- k_4))
        L2_second = EvtLeptonVCurrent(parent->getDaug(il1)->spParent(i1),
                                       parent->getDaug(il4)->spParent(i4));
         
        // VMD        
        EvtVector4C Evmd_fierst, Evmd_second;
        Evmd_fierst=Tvmd_fierst.cont2(L2_fierst);
        Evmd_second=Tvmd_second.cont2(L2_second);
        
        // EM
        EvtVector4C Eem_fierst, Eem_second;
        Eem_fierst=Tem_fierst.cont2(L1_fierst);
        Eem_second=Tem_second.cont2(L1_second);
           
        // Bremsstrahlung                                                               
        EvtComplex Ebrst_fierst, Ebrst_second;
        double fB = 0.20; // GeV leptonic constant of B^{\pm} mesons
        Ebrst_fierst = uniti*fB*L2_fierst*L1_fierst/q2_fierst;
        Ebrst_second = uniti*fB*L2_second*L1_second/q2_second;
        
        
        amp.vertex(leptonicspin, L1_fierst*Evmd_fierst + L2_fierst*Eem_fierst + Ebrst_fierst 
                               - L1_second*Evmd_second - L2_second*Eem_second - Ebrst_second);
                               
         if(q2_fierst < 4.0*ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }                      
          if(q2_second < 4.0*ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }  
           if(k2_fierst < ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }                      
          if(k2_second < ml*ml)
            {
               amp.vertex(leptonicspin, unit1*0.0);
            }                          
          
        }  // End of the operator "for(i4=0;i4<2;i4++)"
      }    // End of the operator "for(i1=0;i1<2;i1++)"
    }      // End of the operator "for(i2=0;i2<2;i2++)"
      
   }  // End of the operator: "if (bbarmesons.contains(idparent))"
   
   else{ // Start of the operator "else N2"
         EvtGenReport(EVTGEN_ERROR,"EvtGen") 
             << "\n\n The function EvtB2MuMuMuNuAmp::CalcAmp(...)"
             << "\n Wrong B-meson number"
             << "\n B-meson KF code = " << EvtPDL::getLundKC(parent->getId())
             << std::endl;
         ::abort();    
   }  // End of the operator "else N2" 

   }  // End of the operator "else N1" 
}