Exemple #1
0
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;
}
Exemple #2
0
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;
}
Exemple #3
0
double Propagation::ExtractMinDist(Process &proc, int type, double R, double R2,
		std::vector<double> &Etarget) const {

	double min_dist1 = 0;
	double min_dist2 = 0;
	Process proc1(proc);
	Process proc2(proc);
	double tmp_lambda1 = 0;
	double tmp_lambda2 = 0;
	Particle pt;
	pt.SetType(0);
	pt.Setz(proc.GetIncidentParticle().Getz());

	if (type == 22) {
	  if (Etarget[0]) {
		proc1.SetName(Process::PP);
		pt.SetEnergy(Etarget[0]);
		proc1.SetTargetParticle(pt);
		proc1.SetCMEnergy();

		tmp_lambda1 = GetLambdaTab(proc1, Process::PP);

		min_dist1 = -tmp_lambda1 * log(R);
	  }
	  if (Etarget[1]) {
		pt.SetEnergy(Etarget[1]);
		proc2.SetTargetParticle(pt);
		proc2.SetCMEnergy();
		tmp_lambda2 = GetLambdaTab(proc2, Process::DPP);
		min_dist2 = -tmp_lambda2 * log(R2);
	  }
#ifdef DEBUG_ELECA
		std::cerr << "comparing 2 mindists: " << min_dist1 << "("
		<< tmp_lambda1 << ") vs " << min_dist2 << " ( "
		<< tmp_lambda2 << ") " << std::endl;
#endif

		if (min_dist2 < min_dist1) {
			min_dist1 = min_dist2;
			proc.SetName(Process::DPP);
			pt.SetEnergy(Etarget[1]);
			proc.SetTargetParticle(pt);
			proc.SetCMEnergy();
		} else {
			proc.SetName(Process::PP);
			pt.SetEnergy(Etarget[0]);
			proc.SetTargetParticle(pt);
			proc.SetCMEnergy();
		}
	}    //end if type 0
	else if (abs(type) == 11) {

		proc1.SetName(Process::ICS);
		pt.SetEnergy(Etarget[0]);
		proc1.SetTargetParticle(pt);
		tmp_lambda1 = GetLambdaTab(proc1, Process::ICS);
		min_dist1 = -tmp_lambda1 * log(R);

		proc2.SetName(Process::TPP);
		pt.SetEnergy(Etarget[1]);
		proc2.SetTargetParticle(pt);
		tmp_lambda2 = GetLambdaTab(proc2, Process::TPP);
		min_dist2 = -tmp_lambda2 * log(R2);

#ifdef DEBUG_ELECA
		std::cerr << "comparing 2 mindists: " << min_dist1 << "("
		<< tmp_lambda1 << ") vs " << min_dist2 << " ( "
		<< tmp_lambda2 << ") " << std::endl;
#endif

		if (min_dist2 < min_dist1) {
			min_dist1 = min_dist2;
			proc.SetName(Process::TPP);
			pt.SetEnergy(Etarget[1]);
			proc.SetTargetParticle(pt);
			proc.SetCMEnergy();
		} else {
			proc.SetName(Process::ICS);
			pt.SetEnergy(Etarget[0]);
			proc.SetTargetParticle(pt);
			proc.SetCMEnergy();
		}
	}    //else e+/e-
	else
		std::cerr << "something wrong in particle type ( " << type
				<< ". Propagation of photons and e+/e- is the only allowed.)"
				<< std::endl;

	return min_dist1;
}