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


C++ Process::GetTargetParticle方法代码示例

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


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

示例1: ExtractPhotonEnergyMC

double Propagation::ExtractPhotonEnergyMC(double z, Process &proc) const {
	double esoft = 0;
//double snew = 0;
	double emin = proc.GetMin();
	Particle pi = proc.GetIncidentParticle();
	Particle pb = proc.GetTargetParticle();

	double Epi = pi.GetEnergy();
	double m = pi.GetMass();
	esoft = ShootPhotonEnergyMC(emin / (4.0 * Epi), z);
	//snew = 4 * Epi * esoft + m * m;
	pb.SetEnergy(esoft);
	proc.SetTargetParticle(pb);
	proc.SetCMEnergy();
	return esoft;
}
开发者ID:phyytang,项目名称:CRPropa3,代码行数:16,代码来源:Propagation.cpp

示例2: GetLambdaTab

double Propagation::GetLambdaTab(const Process &proc,
		const Process::Name procName) const {

	double E1 = proc.GetIncidentParticle().GetEnergy();
	double z = proc.GetIncidentParticle().Getz();
	double res = 0;

	double E0taborg = vEtab[0];

	//double dEtab = log10(vEtab[0] / vEtab[1]);
	double evolution = GetEvolution(proc.GetTargetParticle().GetEnergy(), z);
	int i = (int) (log10(E0taborg / (E1 * (1 + z))) / _dEtab);

	if (i < 0) {
		std::cout << "WARNING!! GetLambdaTab in " << procName << " : i= " << i
				<< " <0! E1*(1+z) =   " << E1 << "* (1 + " << z << ") < "
				<< E0taborg << ".. returning lambda[0];" << std::endl;
	}

	else if (i >= 1001) {
		std::cout << "WARNING!! GetLambdaTab in " << procName << " : i>= "
				<< 1001 << " ! E1*(1+z) =   " << E1 << "* (1 + " << z
				<< ") .. returning lambda[nentries];" << std::endl;

	} else {
		if (procName == Process::PP)
			res = vPPle[i];
		else if (procName == Process::DPP)
			res = vDPPle[i];
		else if (procName == Process::ICS)
			res = vICSle[i];
		else if (procName == Process::TPP)
			res = vTPPle[i];
	}

	if (evolution != 0) {
		if (res / evolution < 0)
			std::cerr
					<< "ERROR UNPHYSICAL SOLUTION!! CHECK HERE LAMBDA OR EVOLUTION!!"
					<< std::endl;
		return res / evolution;
	}
	std::cerr << "warning!! evolution ==0 " << std::endl;
	return 0;
}
开发者ID:phyytang,项目名称:CRPropa3,代码行数:45,代码来源:Propagation.cpp


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