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


C++ Blob::SetId方法代码示例

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


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

示例1: FillBlobs

bool Perturbative_Interface::FillBlobs(ATOOLS::Blob_List *blobs)
{
  if (p_hard==NULL) return false;
  Blob *sblob = new Blob();
  sblob->SetType(btp::Shower);
  sblob->SetStatus(blob_status::needs_showers);
  sblob->SetId();
  sblob->SetPosition(p_hard->Position());
  if (p_shower->On()) {
    if (!p_hd) {
      for (int i(0);i<p_hard->NInP();++i)
	sblob->AddToOutParticles(p_hard->InParticle(i));
      for (size_t j(0);j<blobs->size();++j) {
        Blob *cb((*blobs)[j]);
        if (cb->Has(blob_status::needs_showers))
          for (int i(0);i<cb->NOutP();++i)
            if (cb->OutParticle(i)->DecayBlob()==NULL)
              sblob->AddToInParticles(cb->OutParticle(i));
      }
    }
    else {
      for (int i(0);i<p_hard->NOutP();++i) {
	if (!(p_hard->OutParticle(i)->GetFlow(1)==0 &&
	      p_hard->OutParticle(i)->GetFlow(2)==0))
	  sblob->AddToInParticles(p_hard->OutParticle(i));
      }
    }
  }
  blobs->push_back(sblob);
  p_shower->FillBlobs(blobs); 
  return true;
}
开发者ID:alisw,项目名称:SHERPA,代码行数:32,代码来源:Perturbative_Interface.C

示例2: PerformMixing

ATOOLS::Blob* Mixing_Handler::PerformMixing(Particle* decayer) const
{
  // explicit mixing in event record
  Flavour flav = decayer->Flav();
  string tag = flav.IsAnti() ? flav.Bar().IDName() : flav.IDName();
  if(m_model("Mixing_"+tag,0.0)!=0.0 && decayer->Info()!=char('M')) {
    double t = DetermineMixingTime(decayer,true)/rpa->hBar();
    if(t==0.0) return NULL;
    double factor = decayer->Flav().QOverP2();
    if(decayer->Flav().IsAnti()) factor = 1.0/factor;
    double dG = decayer->Flav().DeltaGamma()*t/4.0;
    double dm = decayer->Flav().DeltaM()*t/2.0;
    Complex i(0.0,1.0);
    double prob_not_mix = sqr(abs(exp(i*dm)*exp(dG)+exp(-i*dm)*exp(-dG)));
    double prob_mix = factor*sqr(abs(exp(i*dm)*exp(dG)-exp(-i*dm)*exp(-dG)));
    if(prob_mix > ran->Get()*(prob_mix+prob_not_mix)) {
      if(decayer->DecayBlob()) {
        decayer->DecayBlob()->RemoveOwnedParticles();
        delete decayer->DecayBlob();
      }
      decayer->SetStatus(part_status::decayed);
      decayer->SetInfo('m');
      Particle* mixed_part = new Particle(0, decayer->Flav().Bar(),
                                          decayer->Momentum(), 'M');
      mixed_part->SetFinalMass(decayer->FinalMass());
      mixed_part->SetStatus(part_status::active);
      mixed_part->SetTime(decayer->Time());
      Blob* mixingblob = new Blob();
      mixingblob->SetType(btp::Hadron_Mixing);
      mixingblob->SetId();
      mixingblob->SetStatus(blob_status::inactive);
      mixingblob->SetTypeSpec("HADRONS");
      mixingblob->AddToInParticles(decayer);
      mixingblob->AddToOutParticles(mixed_part);
      mixingblob->SetPosition(decayer->ProductionBlob()->Position());
      mixingblob->SetStatus(blob_status::needs_hadrondecays);
      return mixingblob;
    }
  }
  return NULL;
}
开发者ID:alisw,项目名称:SHERPA,代码行数:41,代码来源:Mixing_Handler.C

示例3: GenerateSoftEvent

bool Amisic::GenerateSoftEvent(ATOOLS::Blob_List *blobs)
{
  p_softbase->Reset();
  while (true) {
    Blob *newblob = new Blob();
    if (GenerateSoftProcess(newblob)) {
      newblob->SetType(btp::Soft_Collision);
      newblob->SetStatus(blob_status::needs_beams &
			 blob_status::needs_hadronization);
      newblob->SetId();
      blobs->push_back(newblob);
    }
    else {
      delete newblob;
      if (MI_Base::StopGeneration(MI_Base::SoftEvent)) return true;
      msg_Tracking()<<"Amisic::GenerateSoftEvent(): "
		    <<"Cannot create soft underlying event."<<std::endl
		    <<"   Abort attempt."<<std::endl;
      return false;
    }
  } 
  return true;
}
开发者ID:alisw,项目名称:SHERPA,代码行数:23,代码来源:Amisic.C


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