Berkeley Nuclear Data Software
|
#include <GammaProductionAna.h>
Public Member Functions | |
GammaProductionAna () | |
default constructor More... | |
GammaProductionAna (int a_ZID, int a_AID, string a_talysPath) | |
void | setupTALYSUtils (int a_ZID, int a_AID, string a_talysPath) |
if default constuctor was used, this sets up the TALYS interface More... | |
void | setTalysPath (std::string a_path) |
path to directory where talys will be run More... | |
TH2F * | buildFluxMatrix (std::string a_stofFluxFileName, double a_minEnergy, double a_maxEnergy, double a_flightPath, double a_timeResolution, double a_RFPeriod, double a_timeBinWidth=-1) |
void | addFluxMatrix (FluxAna a_fluxAna) |
void | readGammaEffParams (std::string a_effParamFile, std::string a_fitType="Debertin", bool a_readEffCovMat=false) |
void | readEGammaLevels (std::string a_lvlFile) |
void | loadExpTOFvsEGamma (vector< std::string > a_expFiles) |
void | loadExpTOFvsEGamma (std::string a_expFile) |
void | addTree (std::string a_expTree) |
void | addTreeBKG (std::string a_expTree) |
void | buildHists (vector< int > a_cloverList, bool a_saveFile, string a_outFileName) |
void | buildHistsBKG (vector< int > a_cloverList, bool a_saveFile, string a_outFileName) |
void | loadExpBKGData (vector< std::string > a_expFile) |
stored in m_tofEgammaBKG More... | |
void | loadExpBKGData (std::string a_expFile) |
void | setBackgroundScalar (double a_scalar) |
normalization for background subtraction More... | |
void | addEXFORCrossSection (std::string a_fileName, double a_gammaEnergy, bool a_draw=false, std::string a_dataSetName="") |
void | setVerbosity (int a_verbosity) |
void | setTotalCharge (double a_charge) |
total charge from BCM [uC] More... | |
void | setTargetRhoR (double a_rhoR) |
void | setTargetSolidAngle (double a_solidAngle) |
sr More... | |
void | setDetSolidAngle (double a_solidAngle) |
void | setRFPeriod (double a_RFPeriod) |
[ns] More... | |
void | setTimeResolution (double a_timeResolution) |
sigma [ns] More... | |
void | setFlightPath (double a_flightPath) |
neutron beam flight path [m] More... | |
vector< double > | calcGammaEff (int a_detID, int a_elementID, double a_energy) |
vector< Eigen::MatrixXf > | getFluxMatrix (double a_minEnergy) |
calculates gamma ray uncertainties More... | |
vector< Eigen::MatrixXf > | getFluxMatrix (double a_gammaEnergy, double a_thresholdAdder) |
TALYSUtils * | getTALYSUtils () |
TH2F * | getFluxHist () |
PeakInfo | getPeakArea (double a_tof, double a_tofWidth, int a_detID, int a_elementID, double a_energy, bool a_draw=0, bool a_fitBkg=1, bool a_drawBkg=0, bool a_saveFit=1) |
void | setNewPeakFit (double a_gammaEnergy, int a_detID, int a_elementID, int a_tof, PeakInfo a_peakInfo) |
replace a peak fit with a new one More... | |
void | writePeakFits (double a_gammaEnergy, int a_detID, int a_elementID) |
void | readPeakFits (double a_gammaEnergy, int a_detID, int a_elementID) |
map< double, std::pair< double, double > > | getTotExpYield (double a_gammaEnergy, int a_detID, int a_elementID, double a_tofWidth=-1, bool a_draw=true, int a_plotType=0) |
Eigen::VectorXf | calculateYieldUnc (Eigen::MatrixXf a_fluxUncMat, Eigen::VectorXf a_crossSection) |
Eigen::VectorXf | calculateYieldUnc (vector< Eigen::MatrixXf > a_fluxMats, Eigen::VectorXf a_crossSectionUnc, Eigen::VectorXf a_crossSection) |
Eigen::VectorXf | convolveXSec (double a_gammaEnergy, int a_detID, int a_elementID, bool a_calcUnc=false, bool a_useEXFOR=false, double a_thresholdAdder=0.) |
double | plotComp (double a_gammaEnergy, int a_detID, int a_elementID, bool a_useEXFOR=false, double a_normalize=1, bool a_drawEnAxis=true, bool a_draw=true) |
double | plotRatio (double a_energy1, double a_energy2, int a_detID, int a_elementID, bool a_useEXFOR=false, bool a_drawEnAxis=true, bool a_draw=true) |
ratio of gamma 1 over gamma 2 More... | |
void | compDetectorElements (double a_gammaEnergy, int a_detID1, int a_elementID1, int a_detID2, int a_elementID2) |
vector< DataValuePair > | calcUnwrappedXSec (double a_gammaEnergy, int a_detID, int a_elementID, double a_thresholdAdder=0., double a_normalize=0, bool a_draw=true) |
vector< DataValuePair > | calcUnwrappedXSec (map< double, std::pair< double, double >> a_expYields, double a_gammaEnergy, double a_threshold, bool a_normalize=0, bool a_draw=true) |
vector< DataValuePair > | calcUnwrappedXSec (string a_expYields, double a_gammaEnergy, double a_threshold, bool a_normalize=0, bool a_draw=true) |
void | testUnwrapping (double a_gammaEnergy, int a_detID, int a_elementID) |
void | noExpUnwrapTest (double a_gammaEnergy, int a_detID=0, int a_elementID=2, double a_alpha=1.) |
void | plotSVD () |
plot the flux matrix reconstructed from its SVD More... | |
double | testForwardModel (double a_gammaEnergy, int a_detID, int a_elementID, double a_smoothness=1.e-2, bool a_draw=true, bool a_useEXFOR=false) |
double | forwardModelFit (const double *a_params) |
fit function for above More... | |
void | setupTALYSParams (std::string a_paramFile) |
void | talysForwardModel (vector< double > a_gammaEnergy, int a_detID, int a_elementID, bool a_scale=false, bool a_runECIS=true) |
Chi-2 minimization on a set of TALYS parameters. More... | |
double | talysModelFit (const double *a_params) |
vector< std::pair< double, double > > | scanTALYSParameter (int a_parameterNum, vector< double > a_gammaEnergy, bool a_runECIS=true, int a_detID=1, int a_elementID=2) |
vector< std::pair< double, double > > | scanTALYSParameter (std::string a_paramName, vector< double > a_gammaEnergy, bool a_runECIS=true, int a_detID=1, int a_elementID=2) |
void | setSaveTALYSFits (bool a_saveFits) |
save plots of GENESIS data vs TALYS generated by minimizer More... | |
vector< double > | getEnergySpecLowerBinEdges () |
returns m_energ0BinEdges More... | |
Eigen::VectorXf | getEXFORCrossSection (double a_gammaEnergy, bool a_calcUnc=false, double a_thresholdAdder=0) |
void | writeNonWrappedXSec (double a_gammaE, int a_detID, int a_elemID) |
map< int, PeakInfo > | getPeakFits (double a_gammaE, int a_detID, int a_elemID) |
vector< double > | calcNonWrappedEners (vector< double > a_cumulativeCounts, vector< double > a_eners) |
vector< double > | getEnergyPoints (double a_gammaEnergy, int a_coinGammaID=0) |
int | setupTALYSMinimizer (vector< double > a_gammaEnergy, int a_detID, int a_elementID) |
Public Attributes | |
SpectrumAnalysis | m_specAna |
refit peaks from getPeakArea More... | |
TH1F * | m_lastHist |
std::map< string, int > | m_talysParams |
map< int, map< int, TH2F * > > | m_tofEgamma |
bool | m_saveFits |
bool | m_ratio |
vector< Eigen::MatrixXf > | m_currFluxMat |
vector< Eigen::MatrixXf > | m_currFluxUncMat |
vector< Eigen::VectorXf > | m_currData |
vector< Eigen::VectorXf > | m_currDataUnc |
std::pair< int,int > | m_currDetElemID |
vector< double > | m_tempGammaEnergy |
ROOT::Math::Minimizer * | m_minimum |
double | m_smoothness |
TChain * | m_trees |
std::vector< string > | m_loadedTrees |
bool | m_hasFile |
NSDPhysicsEvents::CloverEvent * | m_currentEvent |
TChain * | m_treesBKG |
std::vector< string > | m_loadedTreesBKG |
bool | m_hasFileBKG |
NSDPhysicsEvents::CloverEvent * | m_currentEventBKG |
GammaProductionAna::GammaProductionAna | ( | ) |
default constructor
GammaProductionAna::GammaProductionAna | ( | int | a_ZID, |
int | a_AID, | ||
string | a_talysPath | ||
) |
constructor with isotope information for TALYS interfacing e.g. GammaProductionAna a1(26,56,"talysOutput/") for Fe-56 data with TALYS to be run in the directory called "talysOutput"
void GammaProductionAna::addEXFORCrossSection | ( | std::string | a_fileName, |
double | a_gammaEnergy, | ||
bool | a_draw = false , |
||
std::string | a_dataSetName = "" |
||
) |
load in previously measured cross sections from e.g. EXFOR format EN-MIN|EN-MAX|TOF-MIN|TOF-MAX|DATA|ERR, space delimited energy in keV, data in barns puts cross-section into energy binning defined by buildFluxMatrix, stores in m_exforData EN-MIN < EN-MAX
void GammaProductionAna::addFluxMatrix | ( | FluxAna | a_fluxAna | ) |
void GammaProductionAna::addTree | ( | std::string | a_expTree | ) |
void GammaProductionAna::addTreeBKG | ( | std::string | a_expTree | ) |
TH2F * GammaProductionAna::buildFluxMatrix | ( | std::string | a_stofFluxFileName, |
double | a_minEnergy, | ||
double | a_maxEnergy, | ||
double | a_flightPath, | ||
double | a_timeResolution, | ||
double | a_RFPeriod, | ||
double | a_timeBinWidth = -1 |
||
) |
analytical generation of flux matrix from an sTOF file file structure: CSV-style: lower bin energy [MeV] | flux [n/sr/uC/MeV] | flux uncertainty last row: upper bin energy of last bin | 0 | 0 returns/stores 2D-histogram of flux matrix sets m_timeResolution = a_timeResolution sets m_RFPeriod = a_RFPeriod sets m_flightPath = a_flightPath to use FluxMatrixAna, set a_timeBinWidth to the width of your TOF bins
bw_0*bw_0;
bw_0*bw_0;
void GammaProductionAna::buildHists | ( | vector< int > | a_cloverList, |
bool | a_saveFile, | ||
string | a_outFileName | ||
) |
void GammaProductionAna::buildHistsBKG | ( | vector< int > | a_cloverList, |
bool | a_saveFile, | ||
string | a_outFileName | ||
) |
vector< double > GammaProductionAna::calcGammaEff | ( | int | a_detID, |
int | a_elementID, | ||
double | a_energy | ||
) |
calculates gamma ray efficiency elem[0] = efficiency elem[1] = uncertainty (default = 0)
vector< double > GammaProductionAna::calcNonWrappedEners | ( | vector< double > | a_cumulativeCounts, |
vector< double > | a_eners | ||
) |
Eigen::VectorXf GammaProductionAna::calculateYieldUnc | ( | Eigen::MatrixXf | a_fluxUncMat, |
Eigen::VectorXf | a_crossSection | ||
) |
uses a matrix of flux uncertainties to estimate uncertainties in yield calculated from EXFOR/TALYS
Eigen::VectorXf GammaProductionAna::calculateYieldUnc | ( | vector< Eigen::MatrixXf > | a_fluxMats, |
Eigen::VectorXf | a_crossSectionUnc, | ||
Eigen::VectorXf | a_crossSection | ||
) |
vector< DataValuePair > GammaProductionAna::calcUnwrappedXSec | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
double | a_thresholdAdder = 0. , |
||
double | a_normalize = 0 , |
||
bool | a_draw = true |
||
) |
given a minimum neutron energy, finds TOF bins where amount of overlap < 5% i.e. one wrap contributes >=95% neutrons in that TOF bin and calculates cross section for those bins minimum neutron energy = reaction threshold + a_thresholdAdder i.e. reaction threshold = 1 MeV, thresholdAddder = 1 MeV minimum incident neutron energy = 2 MeV looks for reaction threshold in m_eGammaLevels - if not present then minimum incident neutron energy = a_thresholdAdder if a_draw=false, doesn't look for TALYS and EXFOR data to plot
vector<DataValuePair> GammaProductionAna::calcUnwrappedXSec | ( | map< double, std::pair< double, double >> | a_expYields, |
double | a_gammaEnergy, | ||
double | a_threshold, | ||
bool | a_normalize = 0 , |
||
bool | a_draw = true |
||
) |
same as above but takes in external gamma-ray production data instead of pulling from internal data data should be corrected for gamma efficiency, current, solid angle, areal density threshold is abosolute threshold (i.e. reaction threshold + additional) if a_draw=false, doesn't look for TALYS and EXFOR data to plot
vector< DataValuePair > GammaProductionAna::calcUnwrappedXSec | ( | string | a_expYields, |
double | a_gammaEnergy, | ||
double | a_threshold, | ||
bool | a_normalize = 0 , |
||
bool | a_draw = true |
||
) |
void GammaProductionAna::compDetectorElements | ( | double | a_gammaEnergy, |
int | a_detID1, | ||
int | a_elementID1, | ||
int | a_detID2, | ||
int | a_elementID2 | ||
) |
ratio of one detector element to another needs detector efficiency, m_timeResolution
Eigen::VectorXf GammaProductionAna::convolveXSec | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
bool | a_calcUnc = false , |
||
bool | a_useEXFOR = false , |
||
double | a_thresholdAdder = 0. |
||
) |
uses STOF matrix and TALYS cross section to predict yield vs. time since last rf threshold adder is added to reaction threshold i.e. if threshold adder = 1 [MeV] and reaction threshold is at 2 MeV, the lowest energy neutron included will be 3 MeV
double GammaProductionAna::forwardModelFit | ( | const double * | a_params | ) |
fit function for above
vector< double > GammaProductionAna::getEnergyPoints | ( | double | a_gammaEnergy, |
int | a_coinGammaID = 0 |
||
) |
vector< double > GammaProductionAna::getEnergySpecLowerBinEdges | ( | ) |
returns m_energ0BinEdges
Eigen::VectorXf GammaProductionAna::getEXFORCrossSection | ( | double | a_gammaEnergy, |
bool | a_calcUnc = false , |
||
double | a_thresholdAdder = 0 |
||
) |
TH2F * GammaProductionAna::getFluxHist | ( | ) |
vector< Eigen::MatrixXf > GammaProductionAna::getFluxMatrix | ( | double | a_gammaEnergy, |
double | a_thresholdAdder | ||
) |
returns flux matrix beginning at threshold for reaction producing a_gammaEnergy gamma ray + a_threshold adder
vector< Eigen::MatrixXf > GammaProductionAna::getFluxMatrix | ( | double | a_minEnergy | ) |
calculates gamma ray uncertainties
returns flux matrix beginning at a_minEnergy [MeV]
PeakInfo GammaProductionAna::getPeakArea | ( | double | a_tof, |
double | a_tofWidth, | ||
int | a_detID, | ||
int | a_elementID, | ||
double | a_energy, | ||
bool | a_draw = 0 , |
||
bool | a_fitBkg = 1 , |
||
bool | a_drawBkg = 0 , |
||
bool | a_saveFit = 1 |
||
) |
calculates photo-peak area at given time since last rf + tof width fits gaussian, can draw fit stores fit in m_peakFits a_drawBkg draws the un-background subtracted and background spectra together assigns histogram that was fit to m_lastHist
map< int, PeakInfo > GammaProductionAna::getPeakFits | ( | double | a_gammaE, |
int | a_detID, | ||
int | a_elemID | ||
) |
TALYSUtils * GammaProductionAna::getTALYSUtils | ( | ) |
map< double, std::pair< double, double > > GammaProductionAna::getTotExpYield | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
double | a_tofWidth = -1 , |
||
bool | a_draw = true , |
||
int | a_plotType = 0 |
||
) |
goes through whole cyclotron period and gets gamma-ray yield vs. time since last rf outputs map of TOF:{yield, unc. on yield} uses fit in m_peakFits if available if a_tofWidth<0, sets automatically to a_tofWidth = m_timeResolution
void GammaProductionAna::loadExpBKGData | ( | std::string | a_expFile | ) |
void GammaProductionAna::loadExpBKGData | ( | vector< std::string > | a_expFile | ) |
stored in m_tofEgammaBKG
void GammaProductionAna::loadExpTOFvsEGamma | ( | std::string | a_expFile | ) |
void GammaProductionAna::loadExpTOFvsEGamma | ( | vector< std::string > | a_expFiles | ) |
output from GenesisAnalysis::buildTOFHists() add multiple files together stored in m_tofEgamma, m_tofEgamma0
void GammaProductionAna::noExpUnwrapTest | ( | double | a_gammaEnergy, |
int | a_detID = 0 , |
||
int | a_elementID = 2 , |
||
double | a_alpha = 1. |
||
) |
same as above but without GENESIS data - really to test the method
double GammaProductionAna::plotComp | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
bool | a_useEXFOR = false , |
||
double | a_normalize = 1 , |
||
bool | a_drawEnAxis = true , |
||
bool | a_draw = true |
||
) |
plots observed vs calculated yield vs. time since last rf set a_normalize = -1 to normalize curves to area otherwise TALYS/exfor cross sections are scaled by a_normalize value
double GammaProductionAna::plotRatio | ( | double | a_energy1, |
double | a_energy2, | ||
int | a_detID, | ||
int | a_elementID, | ||
bool | a_useEXFOR = false , |
||
bool | a_drawEnAxis = true , |
||
bool | a_draw = true |
||
) |
ratio of gamma 1 over gamma 2
void GammaProductionAna::plotSVD | ( | ) |
plot the flux matrix reconstructed from its SVD
void GammaProductionAna::readEGammaLevels | ( | std::string | a_lvlFile | ) |
talys gamma-ray production files indexed by initial level -> final reads in space-separated table: energy | initial level (e.g. 01) | final (e.g. 00) | energy threshold [MeV] stores in m_eGammaLevels
void GammaProductionAna::readGammaEffParams | ( | std::string | a_effParamFile, |
std::string | a_fitType = "Debertin" , |
||
bool | a_readEffCovMat = false |
||
) |
reads in space delimited file: cl ID | leaf id | p0 | p1 | p2 | p3 | p4 for debertin fit function [see z. kis NIMA (1998)] https://doi.org/10.1016/S0168-9002(98)00778-5 stores in m_effParams For Lin fit (300-9700 keV), the file needs one more column for the 6th param: cl ID | leaf id | p0 | p1 | p2 | p3 | p4 |p5
void GammaProductionAna::readPeakFits | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID | ||
) |
vector< std::pair< double, double > > GammaProductionAna::scanTALYSParameter | ( | int | a_parameterNum, |
vector< double > | a_gammaEnergy, | ||
bool | a_runECIS = true , |
||
int | a_detID = 1 , |
||
int | a_elementID = 2 |
||
) |
scans a single parameter while keeping all other constant produces plot of chi2 vs parameter
vector< std::pair< double, double > > GammaProductionAna::scanTALYSParameter | ( | std::string | a_paramName, |
vector< double > | a_gammaEnergy, | ||
bool | a_runECIS = true , |
||
int | a_detID = 1 , |
||
int | a_elementID = 2 |
||
) |
void GammaProductionAna::setBackgroundScalar | ( | double | a_scalar | ) |
normalization for background subtraction
void GammaProductionAna::setDetSolidAngle | ( | double | a_solidAngle | ) |
void GammaProductionAna::setFlightPath | ( | double | a_flightPath | ) |
neutron beam flight path [m]
void GammaProductionAna::setNewPeakFit | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
int | a_tof, | ||
PeakInfo | a_peakInfo | ||
) |
replace a peak fit with a new one
void GammaProductionAna::setRFPeriod | ( | double | a_RFPeriod | ) |
[ns]
void GammaProductionAna::setSaveTALYSFits | ( | bool | a_saveFits | ) |
save plots of GENESIS data vs TALYS generated by minimizer
void GammaProductionAna::setTalysPath | ( | std::string | a_path | ) |
path to directory where talys will be run
void GammaProductionAna::setTargetSolidAngle | ( | double | a_solidAngle | ) |
sr
void GammaProductionAna::setTimeResolution | ( | double | a_timeResolution | ) |
sigma [ns]
void GammaProductionAna::setTotalCharge | ( | double | a_charge | ) |
total charge from BCM [uC]
int GammaProductionAna::setupTALYSMinimizer | ( | vector< double > | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID | ||
) |
void GammaProductionAna::setupTALYSParams | ( | std::string | a_paramFile | ) |
passes json file name to m_talysUtil to setup parameters for minimization
void GammaProductionAna::setupTALYSUtils | ( | int | a_ZID, |
int | a_AID, | ||
string | a_talysPath | ||
) |
if default constuctor was used, this sets up the TALYS interface
void GammaProductionAna::setVerbosity | ( | int | a_verbosity | ) |
set print level for all functions 0 - no printing 1 - some (default) 2 - a lot
void GammaProductionAna::talysForwardModel | ( | vector< double > | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
bool | a_scale = false , |
||
bool | a_runECIS = true |
||
) |
Chi-2 minimization on a set of TALYS parameters.
double GammaProductionAna::talysModelFit | ( | const double * | a_params | ) |
(nDOF-iP);
double GammaProductionAna::testForwardModel | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID, | ||
double | a_smoothness = 1.e-2 , |
||
bool | a_draw = true , |
||
bool | a_useEXFOR = false |
||
) |
attempt to extract cross section from GENESIS data by Chi-2 minimization on the cross section i.e. directly fitting the cross section at each energy
void GammaProductionAna::testUnwrapping | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID | ||
) |
attempt to extract cross-section via pseudo-inversion of flux matrix plots cross section from GENESIS data, TALYS cross-section that has been wrapped then unwrapped, and raw TALYS cross-section
void GammaProductionAna::writeNonWrappedXSec | ( | double | a_gammaE, |
int | a_detID, | ||
int | a_elemID | ||
) |
void GammaProductionAna::writePeakFits | ( | double | a_gammaEnergy, |
int | a_detID, | ||
int | a_elementID | ||
) |
write m_peakFits to a file energy, clover id, leaf id, tof, peakFit
vector<Eigen::VectorXf> GammaProductionAna::m_currData |
vector<Eigen::VectorXf> GammaProductionAna::m_currDataUnc |
std::pair<int ,int> GammaProductionAna::m_currDetElemID |
NSDPhysicsEvents::CloverEvent* GammaProductionAna::m_currentEvent |
NSDPhysicsEvents::CloverEvent* GammaProductionAna::m_currentEventBKG |
vector<Eigen::MatrixXf> GammaProductionAna::m_currFluxMat |
vector<Eigen::MatrixXf> GammaProductionAna::m_currFluxUncMat |
bool GammaProductionAna::m_hasFile |
bool GammaProductionAna::m_hasFileBKG |
TH1F* GammaProductionAna::m_lastHist |
std::vector<string> GammaProductionAna::m_loadedTrees |
std::vector<string> GammaProductionAna::m_loadedTreesBKG |
ROOT::Math::Minimizer* GammaProductionAna::m_minimum |
bool GammaProductionAna::m_ratio |
bool GammaProductionAna::m_saveFits |
double GammaProductionAna::m_smoothness |
SpectrumAnalysis GammaProductionAna::m_specAna |
refit peaks from getPeakArea
std::map<string, int> GammaProductionAna::m_talysParams |
vector<double> GammaProductionAna::m_tempGammaEnergy |
map<int,map<int,TH2F*> > GammaProductionAna::m_tofEgamma |
TChain* GammaProductionAna::m_trees |
TChain* GammaProductionAna::m_treesBKG |