Berkeley Nuclear Data Software
|
#include <GenEfficiencyAnalysis.h>
Public Member Functions | |
GenEfficiencyAnalysis () | |
GenEfficiencyAnalysis (string a_configFileName) | |
void | setRNGSeed (int a_seed) |
void | addConfigFile (string a_configFileName) |
loads in a config file More... | |
void | setPSDThreshold (double a_PSDThreshold) |
changes the PSD threshold for accumulating sim data More... | |
void | loadSimulationEvents (string a_simFileName, int a_numEvents) |
loads simulation, needs total number of events simulated More... | |
void | addLYCovarianceData (string a_fileName) |
void | generateResampledConfig () |
void | processSimData (bool a_useExpTimeRes=false, double a_enThreshold=-1, double a_timeResolution=1., bool a_useLYResolution=true, bool a_resampleLYCalib=false) |
void | loadSinglesData (string a_singlesFileName, double a_countingTime, double a_minTime=0) |
loads hists from GENESISPostProcessing::accumulateSinglesQuantities() More... | |
void | loadCoincidenceData (string a_coinFileName, double a_countingTime, double a_minTime=0) |
loads hists from GenCoinAnalysis::buildOutgoingTOFHist() More... | |
void | loadExpGammaGammaData (string a_ggFileName) |
loads gamma-gamma experimental data and prepares slices of TOF in light More... | |
int | loadCoincidenceTreeData (string a_coinFileName, double a_countingTime) |
load experimental n/g scint-scint coincidence tree More... | |
void | prepareCoinTreeData () |
make the experimental tof vs light histograms More... | |
TH2F * | getExpTOFLightHist (int a_detID) |
get tof vs light hist for given detector More... | |
TH2F * | getTotalCoinHist (int a_detID, string a_histNameRoot) |
sums up histograms from each loaded coincidence data file More... | |
double | calcAverageGammaEff (int a_detID, double a_minEnergyBin=1, double a_maxEnergyBin=-1) |
correction for coin data by spectrum-average LaBr efficiency More... | |
vector< double > | plotTOFCf252Comparison (int a_detNum, bool a_normalize=false) |
plot sim and exp TOF plots More... | |
vector< TH2F * > | plotEDepCf252Comparison (int a_detNum) |
returns vector of 2D hists - {sim, experiment} More... | |
void | calcMeanTOF (int a_meanSigma=0) |
map< double, double > | respKDE1DInt (double a_mean, double a_sig, double a_nbins, double a_max) |
void | calcCompEff () |
vector< double > | plotSliceEDep (vector< TH2F * > a_hists, int a_bin, bool a_normalize=false) |
takes output of plotEDepCf252Comparison {sim, exp} and plots time-slices More... | |
void | plotSinglesComparison () |
TCanvas * | plotCumulativeEDepSlice (vector< TH2F * > a_hists, int a_detNum) |
TCanvas * | plotCumulativeEDepSlice (int a_detNum) |
same as above but compares across chunks of experimental data More... | |
void | plotCumulativeEDepSliceAllDet (int a_simExp) |
vector< double > | plotPISingles (int a_detNum, bool a_draw=false) |
map< int, std::pair< double, double > > | plotSinglesComparison (int a_xAxisType) |
void | plotChi2SliceEDep (vector< TH2F * > a_hists, int a_detNum) |
void | plotExpSinglesEff (int a_xAxisType) |
map< double, std::pair< double, double > > | plotRelativeEnergyEff (int a_detNum, double a_enThreshold=.2, bool a_drawSim=true, std::pair< double, double > a_singlesEffs={1., 1.}) |
TH1F * | interpolateCf252Spectrum (vector< double > a_binEdges, vector< double > a_flux, double a_numNeutrons, bool a_draw=false) |
get Cf252 spectrum interpolated for correct TOF bins More... | |
double | calcWattIntegral (double a_lowerE, double a_upperE) |
TH2F * | getSimHist (int a_detNum) |
returns simulation histogram: tof vs light More... | |
map< double, std::pair< double, double > > | calcUniformEfficiency (int a_detNum, double a_lowEnergy, double a_upperEnergy) |
TH2F * | buildResponseFunction (int a_detNum) |
return neutron energy vs light 2d histogram – built in processSimData More... | |
Public Attributes | |
map< int, Eigen::MatrixXf > | m_respFuncs |
class to analyze Cf-252 Efficiency data and facilitate comparisons with processed GEANT4 data J. Gordon 2020 fully refactored
GenEfficiencyAnalysis::GenEfficiencyAnalysis | ( | ) |
GenEfficiencyAnalysis::GenEfficiencyAnalysis | ( | string | a_configFileName | ) |
void GenEfficiencyAnalysis::addConfigFile | ( | string | a_configFileName | ) |
loads in a config file
void GenEfficiencyAnalysis::addLYCovarianceData | ( | string | a_fileName | ) |
modifies the stored GenesisConfig load in file with detector ID and covariances
TH2F * GenEfficiencyAnalysis::buildResponseFunction | ( | int | a_detNum | ) |
return neutron energy vs light 2d histogram – built in processSimData
double GenEfficiencyAnalysis::calcAverageGammaEff | ( | int | a_detID, |
double | a_minEnergyBin = 1 , |
||
double | a_maxEnergyBin = -1 |
||
) |
correction for coin data by spectrum-average LaBr efficiency
hard-coded GEANT4-determined LaBr efficiency, strictly valid >590 keV
from iron-target calibration
void GenEfficiencyAnalysis::calcCompEff | ( | ) |
compute integrated efficiency for simulation and experiment using coincidence data (integrated over LY and a TOF range)
void GenEfficiencyAnalysis::calcMeanTOF | ( | int | a_meanSigma = 0 | ) |
compute mean TOF of all detectors for sim and exp a_meanSigma = 0 : computes mean TOF a_meanSigma = 1 : computes TOF std. dev
map< double, std::pair< double, double > > GenEfficiencyAnalysis::calcUniformEfficiency | ( | int | a_detNum, |
double | a_lowEnergy, | ||
double | a_upperEnergy | ||
) |
calculate efficiency from a simulation with a uniform spectrum between lower and upper energies returns <low edge energy, <efficiency, error>>
double GenEfficiencyAnalysis::calcWattIntegral | ( | double | a_lowerE, |
double | a_upperE | ||
) |
calculates the number of neutron in given energy range from Cf252 spectrum using fits from Mannhart uses Monte-carlo integration (closed form would be better) spectrum is normalized to 1
void GenEfficiencyAnalysis::generateResampledConfig | ( | ) |
TH2F * GenEfficiencyAnalysis::getExpTOFLightHist | ( | int | a_detID | ) |
get tof vs light hist for given detector
TH2F * GenEfficiencyAnalysis::getSimHist | ( | int | a_detNum | ) |
returns simulation histogram: tof vs light
TH2F * GenEfficiencyAnalysis::getTotalCoinHist | ( | int | a_detID, |
string | a_histNameRoot | ||
) |
sums up histograms from each loaded coincidence data file
TH1F * GenEfficiencyAnalysis::interpolateCf252Spectrum | ( | vector< double > | a_binEdges, |
vector< double > | a_flux, | ||
double | a_numNeutrons, | ||
bool | a_draw = false |
||
) |
get Cf252 spectrum interpolated for correct TOF bins
void GenEfficiencyAnalysis::loadCoincidenceData | ( | string | a_coinFileName, |
double | a_countingTime, | ||
double | a_minTime = 0 |
||
) |
loads hists from GenCoinAnalysis::buildOutgoingTOFHist()
int GenEfficiencyAnalysis::loadCoincidenceTreeData | ( | string | a_coinFileName, |
double | a_countingTime | ||
) |
load experimental n/g scint-scint coincidence tree
void GenEfficiencyAnalysis::loadExpGammaGammaData | ( | string | a_ggFileName | ) |
loads gamma-gamma experimental data and prepares slices of TOF in light
void GenEfficiencyAnalysis::loadSimulationEvents | ( | string | a_simFileName, |
int | a_numEvents | ||
) |
loads simulation, needs total number of events simulated
void GenEfficiencyAnalysis::loadSinglesData | ( | string | a_singlesFileName, |
double | a_countingTime, | ||
double | a_minTime = 0 |
||
) |
loads hists from GENESISPostProcessing::accumulateSinglesQuantities()
void GenEfficiencyAnalysis::plotChi2SliceEDep | ( | vector< TH2F * > | a_hists, |
int | a_detNum | ||
) |
compute Chi2/NDF between sim/exp for all eDep slices in TOF from 1% to 95% of exp eDep CDF
TCanvas * GenEfficiencyAnalysis::plotCumulativeEDepSlice | ( | int | a_detNum | ) |
same as above but compares across chunks of experimental data
TCanvas * GenEfficiencyAnalysis::plotCumulativeEDepSlice | ( | vector< TH2F * > | a_hists, |
int | a_detNum | ||
) |
compute LY CDF and plot the LY at the 95% of the CDF compares sim and experiment - {sim, experiment}
void GenEfficiencyAnalysis::plotCumulativeEDepSliceAllDet | ( | int | a_simExp | ) |
simExp = 0 – simulations simExp > 0 – exp coins (index in m_coinFilesNames + 1)
vector< TH2F * > GenEfficiencyAnalysis::plotEDepCf252Comparison | ( | int | a_detNum | ) |
returns vector of 2D hists - {sim, experiment}
void GenEfficiencyAnalysis::plotExpSinglesEff | ( | int | a_xAxisType | ) |
vector< double > GenEfficiencyAnalysis::plotPISingles | ( | int | a_detNum, |
bool | a_draw = false |
||
) |
plot simulated and experimental pulse integral spectra singles data with resolution on sim data
map< double, std::pair< double, double > > GenEfficiencyAnalysis::plotRelativeEnergyEff | ( | int | a_detNum, |
double | a_enThreshold = .2 , |
||
bool | a_drawSim = true , |
||
std::pair< double, double > | a_singlesEffs = {1.,1.} |
||
) |
uses known Cf252 spectrum to calculate neutron eff vs. energy from TOF returns {energy, efficiency, lower energy bin edge, upper bin edge, sigma_eff} a_singlesEff is from plotSinglesComparison -> spectra are normalized to the singles efficiency (or 1.)
ener_sig[i]);
void GenEfficiencyAnalysis::plotSinglesComparison | ( | ) |
copmute integrated efficiency for simulation and experiment using singles epxeriment data (integrated only over LY)
map< int, std::pair< double, double > > GenEfficiencyAnalysis::plotSinglesComparison | ( | int | a_xAxisType | ) |
singles efficiency integrated from [1,3.5] MeV using plotPISingles xAxisType = 0 – detID xAxisType = 1 – polar angle xAxisType = 2 – distance returns detID : experiment Efficiency, GEANT4 efficiency
vector< double > GenEfficiencyAnalysis::plotSliceEDep | ( | vector< TH2F * > | a_hists, |
int | a_bin, | ||
bool | a_normalize = false |
||
) |
takes output of plotEDepCf252Comparison {sim, exp} and plots time-slices
vector< double > GenEfficiencyAnalysis::plotTOFCf252Comparison | ( | int | a_detNum, |
bool | a_normalize = false |
||
) |
plot sim and exp TOF plots
void GenEfficiencyAnalysis::prepareCoinTreeData | ( | ) |
make the experimental tof vs light histograms
void GenEfficiencyAnalysis::processSimData | ( | bool | a_useExpTimeRes = false , |
double | a_enThreshold = -1 , |
||
double | a_timeResolution = 1. , |
||
bool | a_useLYResolution = true , |
||
bool | a_resampleLYCalib = false |
||
) |
prepares simulated data into 2D tof vs light histograms for each detector uses energy threshold from config by default does tof-broadening by sample experimental gamma/gamma distributions if no experimental g/g time available, broadens with 1 ns sigma gaussian
make the histograms - TOF vs Light
det ID : {maxLight, encut, minlight, dist, gtime}
reform the config file then do the rest
call to some function to change the LY resolution and gain
get calibration infor
for sampling new sim lights
for light broadening
for tof broadening
find if experimental gamma/gamma distribution has been added
get new sim light from resolution
fill hists
get light dependent gamma-gamma time distribution
get new sim time
map< double, double > GenEfficiencyAnalysis::respKDE1DInt | ( | double | a_mean, |
double | a_sig, | ||
double | a_nbins, | ||
double | a_max | ||
) |
does 1D KDE re-sampling for simulation data a_nbins and a_max set the bin width of the data
void GenEfficiencyAnalysis::setPSDThreshold | ( | double | a_PSDThreshold | ) |
changes the PSD threshold for accumulating sim data
void GenEfficiencyAnalysis::setRNGSeed | ( | int | a_seed | ) |
sets seed for random number generator for light yield resampling constructors set seed to 0 by default
map<int, Eigen::MatrixXf> GenEfficiencyAnalysis::m_respFuncs |