-
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
Creation of hidden photon flux code #72
Merged
Merged
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8d7f724
created hidden photon files and started work
tomasoshea f1e5be3
Coded in HP flux calculation
tomasoshea b58c1f2
Changed comments to HP versions
tomasoshea 17ac38f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 76b0c6d
Removed all monochromatic and .flux code
tomasoshea af6550d
Merge branch 'master' of https://github.com/tomasoshea/axionlib
tomasoshea cd4b0e6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 57d7428
Merge branch 'master' into master
jgalan 4d7b548
Inlcuded mass dependence and set chi=1
tomasoshea 712ca97
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 43aee16
Mass set only in loadtables
tomasoshea 8687a30
Merge branch 'master' of https://github.com/tomasoshea/axionlib
tomasoshea d577a5d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ddfcefb
Merge branch 'master' into master
jgalan ac0aa28
created hidden photon plot code
tomasoshea 8a7990f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f81afa5
fixed args error
tomasoshea a81dcb4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] fdedb14
fixing bugs
tomasoshea 98136de
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c0758b2
fixing bugs again
tomasoshea 0a1f729
fixing bugs again
tomasoshea 1b71f05
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3712ce2
fixing bugs pt.4
tomasoshea b261cc0
fixing bugs pt.5
tomasoshea 74e04fb
fixing bugs pt.6
tomasoshea 3871b57
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1abf766
fixed bugs, now compiles
tomasoshea 1885077
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b4984f9
changed how mass is set for hidden photon
tomasoshea 55492be
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build | ||
*.root | ||
**/.DS_Store | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/************************************************************************* | ||
* This file is part of the REST software framework. * | ||
* * | ||
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) * | ||
* For more information see http://gifna.unizar.es/trex * | ||
* * | ||
* REST is free software: you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation, either version 3 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* REST is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have a copy of the GNU General Public License along with * | ||
* REST in $REST_PATH/LICENSE. * | ||
* If not, see http://www.gnu.org/licenses/. * | ||
* For the list of contributors see $REST_PATH/CREDITS. * | ||
*************************************************************************/ | ||
|
||
#ifndef _TRestAxionSolarHiddenPhotonFlux | ||
#define _TRestAxionSolarHiddenPhotonFlux | ||
|
||
#include <TRestAxionSolarFlux.h> | ||
#include <TRestAxionSolarModel.h> | ||
|
||
//! A metadata class to load tabulated solar hidden photon fluxes. Mass and coupling set to 1. | ||
class TRestAxionSolarHiddenPhotonFlux : public TRestAxionSolarFlux { | ||
private: | ||
/// The hidden photon mass used for calculation | ||
double HiddenPhotonMass; | ||
|
||
/// The value of the kinetic mixing parameter used for calculation | ||
double HiddenPhotonKineticMixing; | ||
tomasoshea marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// The filename containing the solar flux table with continuum spectrum | ||
std::string fFluxDataFile = ""; //< | ||
|
||
/// The filename containing the resonance width (wGamma) | ||
std::string fWidthDataFile = ""; //< | ||
|
||
/// The filename containing the plasma freqency (wp) table | ||
std::string fPlasmaFreqDataFile = ""; //< | ||
|
||
/// It will be used when loading `.flux` files to define the input file energy binsize in eV. | ||
Double_t fBinSize = 0; //< | ||
|
||
/// It will be used when loading `.flux` files to define the threshold for peak identification | ||
Double_t fPeakSigma = 0; //< | ||
|
||
/// The tabulated solar flux continuum spectra TH1F(200,0,20)keV in cm-2 s-1 keV-1 versus solar radius | ||
std::vector<TH1F*> fFluxTable; //! | ||
|
||
/// The tabulated resonance width TH1F(200,0,20)keV in eV2 versus solar radius | ||
std::vector<TH1F*> fWidthTable; //! | ||
|
||
/// The solar plasma frequency vector in eV versus solar radius | ||
std::vector<TH1F*> fPlasmaFreqTable; //! | ||
|
||
/// The total solar flux TH1F(200,0,20)keV in cm-2 s-1 keV-1 versus solar radius | ||
std::vector<TH1F*> fFullFluxTable; //! | ||
|
||
/// Accumulative integrated solar flux for each solar ring for continuum spectrum (renormalized to unity) | ||
std::vector<Double_t> fFluxTableIntegrals; //! | ||
|
||
/// A pointer to the continuum spectrum histogram | ||
TH1F* fContinuumHist = nullptr; //! | ||
|
||
/// A pointer to the superposed monochromatic and continuum spectrum histogram | ||
TH1F* fTotalHist = nullptr; //! | ||
|
||
void ReadFluxFile(); | ||
void LoadContinuumFluxTable(); | ||
void LoadMonoChromaticFluxTable(); | ||
void IntegrateSolarFluxes(); | ||
|
||
public: | ||
/// It returns true if continuum flux spectra was loaded | ||
Bool_t isSolarTableLoaded() { return fFluxTable.size() > 0; } | ||
|
||
/// It returns true if width table was loaded | ||
Bool_t isWidthTableLoaded() { return fWGammaTable.size() > 0; } | ||
|
||
/// It returns true if plasma frequency table was loaded | ||
Bool_t isPlasmaFreqLoaded() { return fWpTable.size() > 0; } | ||
|
||
/// It returns the integrated flux at earth in cm-2 s-1 for the given energy range | ||
Double_t IntegrateFluxInRange(TVector2 eRange = TVector2(-1, -1), Double_t mass = 0) override; | ||
|
||
/// It defines how to generate Monte Carlo energy and radius values to reproduce the flux | ||
std::pair<Double_t, Double_t> GetRandomEnergyAndRadius(TVector2 eRange = TVector2(-1, -1), | ||
Double_t mass = 0) override; | ||
|
||
/// It defines how to read the solar tables at the inhereted class | ||
Bool_t LoadTables() override; | ||
|
||
/// It returns the total integrated flux at earth in cm-2 s-1 | ||
Double_t GetTotalFlux(Double_t mass = 0) override { | ||
return fTotalContinuumFlux + fTotalMonochromaticFlux; | ||
} | ||
|
||
/// It returns an energy integrated spectrum in cm-2 s-1 keV-1 | ||
TH1F* GetEnergySpectrum(Double_t m = 0) override { return GetTotalSpectrum(); } | ||
|
||
TH1F* GetContinuumSpectrum(); | ||
TH1F* GetMonochromaticSpectrum(); | ||
TH1F* GetTotalSpectrum(); | ||
|
||
virtual TCanvas* DrawSolarFlux() override; | ||
|
||
/// Tables might be loaded using a solar model description by TRestAxionSolarModel | ||
void InitializeSolarTable(TRestAxionSolarModel* model) { | ||
// TOBE implemented | ||
// This method should initialize the tables fFluxTable and fFluxLines | ||
} | ||
|
||
void ExportTables(Bool_t ascii = false) override; | ||
|
||
void PrintMetadata() override; | ||
|
||
void PrintContinuumSolarTable(); | ||
void PrintIntegratedRingFlux(); | ||
void PrintMonoChromaticFlux(); | ||
|
||
TRestAxionSolarHiddenPhotonFlux(); | ||
TRestAxionSolarHiddenPhotonFlux(const char* cfgFileName, std::string name = ""); | ||
~TRestAxionSolarHiddenPhotonFlux(); | ||
|
||
ClassDefOverride(TRestAxionSolarHiddenPhotonFlux, 1); | ||
}; | ||
#endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we do not need the mass here? It is the method
GetRandomEnergyAndRadius
where we define the mass. There should be something inside that method that gets the probability depending on the mass.Then, inside the processing chain,
TRestAxionGeneratorProcess
will chose a given mass, and it will use that method to get a random particle from the sun, with given energy and position in the sun (for a given mass).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.
I've been looking at it and instead of having the mass as an argument to all the functions that need it, could we not have it as a member of the class? So for example when
GetRandomEnergyAndRadius
is called withdouble_t mass
as an argument we can then setHiddenPhotonMass = mass
? So that since the flux depends on the mass we wouldn't have to supply mass as an argument to every function that deals with the flux.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.
Yes, this is possible.
We just need to make sure then that we have this mass inside
TRestAxionSolarFlux
and not withinTRestAxionQCDSolarFlux
orTRestAxionHiddenPhotonFlux
.So, we define a
TRestAxionSolarFlux::fMass
.Then, inside the
TRestAxionGeneratorProcess
we can callTRestAxionSolarFlux::SetMass(m)
before callingGetRandomEnergyAndRadius
.TRestAxionGeneratorProcess
will only have access to those methods available toTRestAxionSolarFlux
.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.
Then, inside
TRestAxionSolarFlux
we should add: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, then would we remove the
double_t mass
from the other functions and just have them usefMass
? For example inGetTotalFlux(Double_t mass = 0)