Skip to content
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

Closed
wants to merge 12 commits into from

Conversation

francandon
Copy link
Contributor

@francandon francandon commented Feb 15, 2024

francandon Medium: 160 Powered by Pull Request Badge

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 that TRestAxionField::GetMassDensityScanning computes.
image

francandon and others added 2 commits February 20, 2024 18:36
…or N_gamma for vacuum and for each of the pressure steps from TRestAxionField::GetMassDensityScanning
@francandon francandon changed the title Updates TRestAxionSolarQCDFlux documentation Creates a macro that computes the N_gamma for each pressure steps Feb 20, 2024
francandon and others added 5 commits February 21, 2024 04:40
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>
TRestAxionSolarQCDFlux* sFlux = new TRestAxionSolarQCDFlux("fluxes.rml", "Gianotti");
sFlux->Initialize();
TH1F* spec1 = sFlux->GetEnergySpectrum();
spec1->Rebin(20000 / n_ma);
Copy link
Member

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?

Copy link
Member

@jgalan jgalan Feb 21, 2024

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

Copy link
Contributor Author

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.

Copy link
Member

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.


// 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;
Copy link
Member

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.

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;
Copy link
Member

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.

francandon and others added 3 commits February 23, 2024 12:23
…he definition of the factors that multiply the integral and redefine the pressure step as the bin size of the solar spectra
@jgalan jgalan closed this Mar 13, 2024
@jgalan
Copy link
Member

jgalan commented Mar 13, 2024

I close this PR since changes have been already included in the in #88. In any case we should move towards a future TRestAxionPlotResonances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants