-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creates a macro that computes the N_gamma for each pressure steps #86
Conversation
… TRestAxionSolarQCDFlux
…or N_gamma for vacuum and for each of the pressure steps from TRestAxionField::GetMassDensityScanning
for more information, see https://pre-commit.ci
Co-authored-by: Javier Galan <javier.galan@unizar.es>
Co-authored-by: Javier Galan <javier.galan@unizar.es>
Co-authored-by: Javier Galan <javier.galan@unizar.es>
Co-authored-by: Javier Galan <javier.galan@unizar.es>
for more information, see https://pre-commit.ci
macros/REST_Axion_PlotNgamma.C
Outdated
TRestAxionSolarQCDFlux* sFlux = new TRestAxionSolarQCDFlux("fluxes.rml", "Gianotti"); | ||
sFlux->Initialize(); | ||
TH1F* spec1 = sFlux->GetEnergySpectrum(); | ||
spec1->Rebin(20000 / n_ma); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you rebin the spectrum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could simply multiply spec1
bins by the results of the axion-photon probability at each energy.
TH1D *convoluted = spec1->Clone();
for( int n = 0; n < spec1->GetNbinsX(); n++ )
{
double en = convoluted->GetBinCenter(n+1);
// Get probability for `en` --> Paxion
convoluted->SetBinContent(n+1, convoluted->GetBinContent(n+1) * Paxion );
}
// Then calculate the integral of convoluted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s great, I’ll change that as soon as I can. I had to rebin the spectrum because I was using this method of storing the Probabilty values in a histogram, and then multiply, then, both histograms needs to be the same size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but you can just compute the probability for the binning given in the energy spectrum, as in the example I give previously.
macros/REST_Axion_PlotNgamma.C
Outdated
|
||
// Create a vector for saving the integrals that corresponds to the Number of photones | ||
|
||
double energy_step = (E_a_max - E_a_min) / n_ma; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The energy step could be the binning of spec1
.
macros/REST_Axion_PlotNgamma.C
Outdated
TH1F* ng = new TH1F(); | ||
*ng = (*spec1) * (*vac); | ||
double integral = ng->Integral(ng->FindBin(0), ng->FindBin(20)); | ||
n_photons[i] = integral * 0.2 * 0.8 * 14 * 60 * 60; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give variable names to the numbers so that we know what they are.
…he definition of the factors that multiply the integral and redefine the pressure step as the bin size of the solar spectra
for more information, see https://pre-commit.ci
I close this PR since changes have been already included in the in #88. In any case we should move towards a future |
Creates a macro called
REST_Axion_PlotNgamma.C
that computes the number of photons vs axion mass for vacuum and for each of the pressure steps thatTRestAxionField::GetMassDensityScanning
computes.