Berkeley Nuclear Data Software
|
#include <FluxMatrixAna.h>
Public Member Functions | |
FluxAna () | |
Default constructor puts the class into working state. More... | |
void | setRFPeriod (double a_RFPeriod) |
void | setTimeResolution (double a_timeResolution) |
void | setReqTimeBinWidth (double a_reqTimeBinWidth) |
void | setFlightPath (double a_flightPath) |
void | setEMin (double a_eMin) |
void | setEMax (double a_eMax) |
double | getRFPeriod () |
double | getTimeResolution () |
double | getReqTimeBinWidth () |
double | getFlightPath () |
double | getEMin () |
double | getEMax () |
void | readBinWiseFluxCSV (std::string a_fileName) |
void | loadFluxHist (std::string a_fileName, std::string a_histName) |
void | loadFluxHistCovMat (std::string a_fileName, std::string a_histName) |
void | setFlxHist (TH1 *a_fluxHist) |
TH1 * | getFluxHist () |
this returns a clone of the internal flux hist as originally loaded or read More... | |
vector< double > | readDeutronTimeProfile (TH1 *a_rfHist, double a_distToBreakup, double a_distToDet, double a_timeResolution=-1) |
vector< double > | getEnergySpecLowerBinEdges () |
std::vector< double > | buildTimeSinceRFAxis () |
builds the time since RF axis More... | |
void | setTimeSinceRFAxis (std::vector< double > a_binEdges) |
std::vector< double > | buildEnergyAxis () |
std::pair< int, int > | findRFPeriodPlusBinIndex (double a_En) |
TH1 * | generateNew1DFlux () |
creates new 1D flux from covariance matrix More... | |
TH1 * | rebinFluxHist () |
TH1 * | getRebinnedFluxHistPerMeV () |
TH2 * | buildFluxMatrix () |
TH2F * | smearFluxMatrix () |
TH2 * | getSmearFluxMatrix () |
vector< Eigen::MatrixXf > | getFluxMatrix () |
returns the eigen interpretation of the flux and error matrix More... | |
vector< Eigen::MatrixXf > | getSmearedFluxMatrix () |
returns smeared eigen interpretation of the flux and error matrix More... | |
std::vector< double > | getEnBinCenters () |
std::pair< double, double > | getFluxAndError (double a_en) |
std::pair< double, double > | getFluxAndError (double a_lowEn, double a_highEn) |
vector< vector< double > > | getFluxAtTimeSinceRFBin (int a_tofBin) |
~FluxAna () | |
this class is intended to store and share information regarding neutron flux for an experiment in the form of a rank 2 matrix where the collums are energy bins corresponding to the rows, which are TOF bins. This allow for tracking energy degeneracy resulting from frame overlap in a an experiment !!!!!!!!!!!!!!This class isn't currently in the safest state !!!!!!!!!!!!!! !!!!!!!!!!!!!!Many functions need to be called in order etc !!!!!!!!!!!!!!
FluxAna::FluxAna | ( | ) |
Default constructor puts the class into working state.
FluxAna::~FluxAna | ( | ) |
std::vector< double > FluxAna::buildEnergyAxis | ( | ) |
this function builds the energy axis considering the time since RF axis and the min and max energy specified
TH2 * FluxAna::buildFluxMatrix | ( | ) |
constructs the 2D flux matrix with the Y axis in time since RF in ns using the specified bin width and the X axis being the corresponding energy bins aligned with the time since RF axis for the range of energies specified as both a TH2 and Eigen matrix requires a rebinned flux hist,bin width request and energy ranges
std::vector< double > FluxAna::buildTimeSinceRFAxis | ( | ) |
builds the time since RF axis
std::pair< int, int > FluxAna::findRFPeriodPlusBinIndex | ( | double | a_En | ) |
returns a pair corresponding to number of rf periods from zero and the bin within the that rf period in the time since RF axis
TH1 * FluxAna::generateNew1DFlux | ( | ) |
creates new 1D flux from covariance matrix
double FluxAna::getEMax | ( | ) |
double FluxAna::getEMin | ( | ) |
std::vector< double > FluxAna::getEnBinCenters | ( | ) |
vector< double > FluxAna::getEnergySpecLowerBinEdges | ( | ) |
double FluxAna::getFlightPath | ( | ) |
std::pair< double, double > FluxAna::getFluxAndError | ( | double | a_en | ) |
get flux and error from the rebinned histogram this return the counts in the bin that corresponds to the energy specified, ie it is most useful in the case of something like a loop over the centroids
std::pair< double, double > FluxAna::getFluxAndError | ( | double | a_lowEn, |
double | a_highEn | ||
) |
this function returns the number of observed neutrons between the specified energy range
vector< vector< double > > FluxAna::getFluxAtTimeSinceRFBin | ( | int | a_tofBin | ) |
evaluates flux matrix to look return flux from each wrap in a give time since last RF bin for all wraps, returns: {mean energy, lower energy,upper energy,flux, flux unc.}
TH1 * FluxAna::getFluxHist | ( | ) |
this returns a clone of the internal flux hist as originally loaded or read
vector< Eigen::MatrixXf > FluxAna::getFluxMatrix | ( | ) |
returns the eigen interpretation of the flux and error matrix
TH1 * FluxAna::getRebinnedFluxHistPerMeV | ( | ) |
double FluxAna::getReqTimeBinWidth | ( | ) |
double FluxAna::getRFPeriod | ( | ) |
vector< Eigen::MatrixXf > FluxAna::getSmearedFluxMatrix | ( | ) |
returns smeared eigen interpretation of the flux and error matrix
TH2 * FluxAna::getSmearFluxMatrix | ( | ) |
double FluxAna::getTimeResolution | ( | ) |
void FluxAna::loadFluxHist | ( | std::string | a_fileName, |
std::string | a_histName | ||
) |
this loads a flux histogram from a file units need to be per MeV
void FluxAna::loadFluxHistCovMat | ( | std::string | a_fileName, |
std::string | a_histName | ||
) |
void FluxAna::readBinWiseFluxCSV | ( | std::string | a_fileName | ) |
this function reads a file containing bin edges and contents the last line will be the upper edge of the last bin we should prefer TH1 to csv
vector< double > FluxAna::readDeutronTimeProfile | ( | TH1 * | a_rfHist, |
double | a_distToBreakup, | ||
double | a_distToDet, | ||
double | a_timeResolution = -1 |
||
) |
function to help smear flux matrix non-parameterically by gamma-flash a_rfHist --> gamma flash in RF_calib detector a_distToBreakup --> cm distance from scattering target to breakup target a_distToDet --> cm dist from scattering target to RF_calib detector a_timeResolution --> same as above (by default uses m_timeResolution)
calculate where the center of gamma flash should be
will look from gamma flash +/- 75 ns
to estimate background
simultaneously rebinning to match expected time bin structure and setting t=0 as gamma arrival time and subtract background
need to time reverse this
TH1 * FluxAna::rebinFluxHist | ( | ) |
rebin flux histogram into the energy axis with correspondence of the flux matrix !!!!THIS ASSUMES THE SPECIFIED HIST IN IN 1/MEV !!!!!!!!!!! requires you have loaded a flux hist
void FluxAna::setEMax | ( | double | a_eMax | ) |
void FluxAna::setEMin | ( | double | a_eMin | ) |
void FluxAna::setFlightPath | ( | double | a_flightPath | ) |
void FluxAna::setFlxHist | ( | TH1 * | a_fluxHist | ) |
this will set the internal flux hist if you have one externally constructed in memory
void FluxAna::setReqTimeBinWidth | ( | double | a_reqTimeBinWidth | ) |
void FluxAna::setRFPeriod | ( | double | a_RFPeriod | ) |
void FluxAna::setTimeResolution | ( | double | a_timeResolution | ) |
void FluxAna::setTimeSinceRFAxis | ( | std::vector< double > | a_binEdges | ) |
this function takes a vector of doubles to use as the time since rf axis this can lead to undefined behavior and should be relied upon sparingly
TH2F * FluxAna::smearFluxMatrix | ( | ) |
smears flux matrix with m_timeSmearing if no m_timeSmearing, just smears by m_timeResolution gaussian need to call buildFluxMatrix first (assumes m_fluxMat exists);
some code need to figure out how many time bins represents 5 sigma
to ease calculation
loop over the bins that are influenced by the convolution