当前位置: 首页>>代码示例>>C++>>正文


C++ Flavour::IsOn方法代码示例

本文整理汇总了C++中Flavour::IsOn方法的典型用法代码示例。如果您正苦于以下问题:C++ Flavour::IsOn方法的具体用法?C++ Flavour::IsOn怎么用?C++ Flavour::IsOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Flavour的用法示例。


在下文中一共展示了Flavour::IsOn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MZprime

void SM_U1_B::FillSpectrum(const PDF::ISR_Handler_Map& isr) {
  p_dataread->RereadInFile();
  p_constants->insert(make_pair(string("M_Z'"),    
				p_dataread->GetValue<double>("M_Z'",-1.)));
  p_constants->insert(make_pair(string("g'_1"),    
				p_dataread->GetValue<double>("g'_1",0.)));

  double MZprime(ScalarConstant(string("M_Z'"))),GZprime(0.),inc;
  double g1prime(sqr(ScalarConstant(std::string("g'_1"))));
  FixMix();
  msg_Out()<<"Calculate width for Z' with mass = "<<MZprime<<" GeV.\n";

  for (short int i=1;i<=6;i++) {
    Flavour quark = Flavour((kf_code)(i));
    double  massq = quark.HadMass(); 
    if (!quark.IsOn() || !quark.Strong()) continue;
    if (i%2) {
      if (2.*massq>MZprime) continue;
      GZprime += inc = 
	3.*MZprime*g1prime/(24.*M_PI)*pow(1.-sqr(2.*massq/MZprime),3./2.);
      msg_Out()<<"   Add Z' --> "<<quark<<"+"<<quark.Bar()<<" ("<<i<<"), "
	       <<" add "<<inc<<" GeV.\n";
    }
    else {
      double M2 = MZprime*MZprime, mq2 = massq*massq;
      for (short int j=2;j<=7;j+=2) {
	Flavour anti = Flavour((kf_code)(j)).Bar();
	if (!anti.IsOn() || !anti.Strong()) continue;
	double massa  = anti.HadMass(), ma2 = massa*massa; 
	if (massq+massa>MZprime) continue;
	Complex mix   = ComplexMatrixElement(std::string("UpMix"),i/2-1,j/2-1);
	double absmix = ATOOLS::sqr(mix.real())+ATOOLS::sqr(mix.imag());
	if (ATOOLS::IsZero(absmix)) continue;
	GZprime += inc = 
	  3.*g1prime*absmix/(24.*M_PI*M2)*
	  ((2.*M2-mq2-ma2)/2.-3.*massq*massa-ATOOLS::sqr(ma2-mq2)/(2.*M2)) *
	  sqrt(ATOOLS::sqr(M2-mq2-ma2)-4.*ma2*mq2)/(2.*MZprime);
	msg_Out()<<"   Add Z' --> "<<quark<<"+"<<anti<<" ("<<i<<"), "
		 <<" add "<<inc<<" GeV.\n";
      }
    }
  }

  Flavour flav;
  flav = Flavour(kf_Z0_2);
  flav.SetMass(ScalarConstant(string("M_Z'")));
  flav.SetHadMass(MZprime);
  flav.SetMassOn(true);
  flav.SetWidth(GZprime);

  msg_Out()<<METHOD<<" initializes Z' boson with \n"
	   <<"    mass = "<<MZprime<<" GeV and width = "<<GZprime<<" GeV\n"
	   <<"    for g'_1 = "<<ScalarConstant(std::string("g'_1"))<<".\n";
}
开发者ID:ktf,项目名称:sherpa,代码行数:54,代码来源:SM_U1_B.C

示例2: c_FFV

void Interaction_Model_QCD::c_FFV(std::vector<Single_Vertex>& vertex,int & vanz)
{
  Kabbala kcpl0 = -g3*M_I;
  Kabbala kcpl1 = kcpl0;

  for (short int i=1;i<=(m_extension==2?8:6);i++) {
    Flavour flav = Flavour((kf_code)(i));
    if (flav.Strong() && flav.IsOn() && Flavour(kf_gluon).IsOn()) { 
      vertex[vanz].in[0]         = flav;
      vertex[vanz].in[1]         = Flavour(kf_gluon);
      vertex[vanz].in[2]         = flav;

      vertex[vanz].cpl[0]        = kcpl0;
      vertex[vanz].cpl[1]        = kcpl1;
      vertex[vanz].Str           = (kcpl0*PR+kcpl1*PL).String();      

      
      vertex[vanz].Color.push_back(Color_Function(cf::T,1,2,0,'1','2','0'));     

      vertex[vanz].Lorentz.push_back(LF_Getter::GetObject("Gamma",LF_Key()));     
      vertex[vanz].Lorentz.back()->SetParticleArg(1);     
                  
      vertex[vanz].on            = 1;
      vertex[vanz].oqcd          = 1;
      vertex[vanz].oew           = 0;
      vertex.push_back(Single_Vertex());vanz++;
    } 
  }
}
开发者ID:ktf,项目名称:sherpa,代码行数:29,代码来源:Interaction_Model_QCD.C

示例3: c_FFV

 void Interaction_Model_SM_Zprime::c_FFV(vector<Single_Vertex>& vertex,int& vanz)
 {
   // create the vertices for the standard model
   Interaction_Model_SM::c_FFV(vertex,vanz);
   
   
   // create FFV vertices with Z' if it's on
   kf_code kfZp=32;
   Flavour flZprime(kfZp);
   if (flZprime.IsOn()) {
     
     // parse through all fermions than couple to Z' and create vertices
     int PossibleFermions[12] = {1,2,3,4,5,6,11,12,13,14,15,16};
     for (int i=0; i<12; i++) {
       
       // initialize the currently parsed fermion
       int FermionNumber = PossibleFermions[i];
       Flavour flFermion = Flavour((kf_code)(FermionNumber));
       Kabbala B = Kabbala(string("B_{")+flFermion.TexName()+string("}"),
                           flFermion.BaryonNumber());
       Kabbala L = Kabbala(string("L_{")+ flFermion.TexName()+string("}"),
                           flFermion.LeptonNumber());
       Kabbala Y3R = Kabbala(string("YR_{")+flFermion.TexName()+string("}"),
                             flFermion.IsoWeak());
       
       if (flFermion.IsOn()) {
         // create the vertex for that particular fermion and a Z'.
         // Right-handed neutrinos will not take part in any interaction.
         Kabbala kcpl0;
         if ((FermionNumber==12)||(FermionNumber==14)||(FermionNumber==16))
         {kcpl0 = Kabbala("0.0", 0.);}
         else {kcpl0 = -M_I * g2 * (Y3R * alphaLR + (L-B)/(alphaLR*2));};
         Kabbala kcpl1 = -M_I * g2 * (L-B) / (alphaLR*2);
         
         // set couplings and particle info for current vertex
         vertex[vanz].in[0] = flFermion;
         vertex[vanz].in[1] = flZprime;
         vertex[vanz].in[2] = Flavour((kf_code)(FermionNumber));
         vertex[vanz].cpl[0] = kcpl0;
         vertex[vanz].cpl[1] = kcpl1;
         vertex[vanz].Str = (kcpl0*PR+kcpl1*PL).String(); 
         
         // Color Function for vertex
         
         if (flFermion.Strong()) {
           vertex[vanz].Color.push_back(Color_Function(cf::D));;
           vertex[vanz].Color.back().SetParticleArg(0,2);
           vertex[vanz].Color.back().SetStringArg('0','2');
         } 
         else 
           vertex[vanz].Color.push_back(Color_Function(cf::None));;
         
         // Lorenz function for vertex
         
         vertex[vanz].Lorentz.push_back(LF_Getter::GetObject("Gamma",LF_Key()));
         vertex[vanz].Lorentz.back()->SetParticleArg(1);
         
         vertex[vanz].on     = 1;
         vertex.push_back(Single_Vertex());vanz++; 
       }; 
     };
   };
 }
开发者ID:ktf,项目名称:sherpa,代码行数:63,代码来源:Interaction_Model_SM_Zprime.C


注:本文中的Flavour::IsOn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。