Esempio n. 1
0
void PhotonDINT1D::process(Candidate *candidate) const {
	if (candidate->current.getId() != 22)
		return;

	// Initialize the spectrum
	Spectrum inputSpectrum;
	NewSpectrum(&inputSpectrum, NUM_MAIN_BINS);

	double criticalEnergy = candidate->current.getEnergy()
			/ (eV * ELECTRON_MASS); // units of dint
	int maxBin = (int) ((log10(criticalEnergy * ELECTRON_MASS) - MAX_ENERGY_EXP)
			* BINS_PER_DECADE + NUM_MAIN_BINS);
	inputSpectrum.spectrum[PHOTON][maxBin] = 1.;

	// Initialize the bField
	dCVector bField;
	New_dCVector(&bField, 1);

	// Initialize output spectrum
	Spectrum outputSpectrum;
	NewSpectrum(&outputSpectrum, NUM_MAIN_BINS);

	double h = H0() * Mpc / 1000;
	double ol =  omegaL();
	double om = omegaM();
	double showerPropDistance = candidate->current.getPosition().getR() / Mpc;
	double z = candidate->getRedshift();
	if (z == 0) {
		//TODO: use z value for distance calculation
	}

	prop_second(showerPropDistance, &bField, &impl->energyGrid,
		    &impl->energyWidth, &inputSpectrum, &outputSpectrum, dataPath,
		    IRFlag, Zmax, RadioFlag, h, om, ol,
		    Cutcascade_Magfield);

#pragma omp critical
	{
		impl->saveSpectrum(&outputSpectrum);
	}

	DeleteSpectrum(&outputSpectrum);
	DeleteSpectrum(&inputSpectrum);
	Delete_dCVector(&bField);

	candidate->setActive(false);
}
Esempio n. 2
0
std::string FutureRedshift::getDescription() const {
	std::stringstream s;
	s << "FutureRedshift: h0 = " << hubbleRate() / 1e5 * Mpc << ", omegaL = "
			<< omegaL() << ", omegaM = " << omegaM();
	return s.str();
}
Esempio n. 3
0
double gz(double z)  /*g(z)*/ 
{
return ((5.0/2.0) * omegaM(z) *pow((pow(omegaM(z),4.0/7.0) - omegaL(z) + (1.0 + omegaM(z) / 2.0) * (1.0 + omegaL(z) / 70.0)),-1.0));
}