Berkeley Nuclear Data Software
|
#include <STOFFluxAna.h>
Public Member Functions | |
STOFFluxAna () | |
void | setExitTOF (bool a_useExitTOF) |
void | readConfig (std::string a_fileName) |
void | addExpFile (std::string a_fileName) |
this function adds files from experiment More... | |
void | clearExpFiles () |
this function clears the experiment data More... | |
void | addSimFile (std::string a_fileName) |
this function adds files from simulation of the experiment More... | |
void | addExpIncTimeDt (TH1 *a_hist) |
used to pass the incoming time of flight uncertainty hist to the class More... | |
void | addSimEnergyHist (TH1 *a_particleHistory) |
used to add the sim energy histogram to the class More... | |
void | setSimTOFSmearing (double a_exitTOFSmear, double a_incTOFSmear) |
void | setSimTOFSmearing (double a_exitTOFSmear, TH1 *a_incTOFGammaFlashHistogram) |
void | setCutState (std::string a_cutName, bool a_state) |
this sets the cuts for both classes More... | |
void | generateScatterLYCalibrationFiles (std::string a_outDataFileName, std::string a_outSimFileName, std::vector< std::pair< double, double > > a_ranges) |
void | generateTargetLYCalibrationFiles (std::string a_outDataFileName, std::string a_outSimFileName, bool a_incTOF, std::vector< std::pair< double, double > > a_ranges) |
void | setupModelDataComparisonPlotting () |
std::ostream & | printHistNames (std::ostream &a_stream=std::cout) |
TCanvas * | plotComparison (std::string a_histName, int a_binProjection=-1) |
void | setUpEffCalc () |
void | drawProjectionE (int a_binNumber, bool a_newCanvas=false) |
std::vector< double > | getGaussSeedE (int a_proj) |
void | checkGaussGuessE (int a_binNumber, bool a_newCanvas=false) |
void | fitSliceWithGaussE (int a_binNumber, bool a_draw) |
void | fitEfficiencySlices (int a_startBin, int a_stopBin) |
void | calcPeakAreaE (int a_startBin, int a_stopBin) |
TGraph * | plotPeakAreaE (int a_startBin, int a_stopBin) |
void | calcEfficiency (int a_startBin, int a_stopBin) |
basically calcuation of the efficiency needs the transport history More... | |
TGraph * | plotEff (int a_startBin, int a_stopBin) |
void | setUpICalc () |
!!!!!~~~~~~~~~~~~~end largely related to the efficiency caculation More... | |
void | drawProjectionI (int a_binNumber, bool a_newCanvas=false) |
std::vector< double > | getGaussSeedI (int a_proj) |
void | checkGaussGuessI (int a_binNumber, bool a_newCanvas=false) |
void | fitSliceWithGaussI (int a_binNumber, bool a_draw) |
void | fitSlicesI (int a_startBin, int a_stopBin) |
void | calcPeakAreaI (int a_startBin, int a_stopBin) |
TGraph * | plotPeakAreaI (int a_startBin, int a_stopBin) |
void | calcIntensity (int a_startBin, int a_stopBin) |
basically calcuation of the efficiency needs the transport history More... | |
TGraph * | plotI (int a_startBin, int a_stopBin) |
void | setupUncertaintyWeighting () |
!!!!!~~~~~~~~~~~~~end largely related to the intensity caculation More... | |
void | drawBinWeighting (int a_binNumber, bool a_newCanvas=false) |
std::pair< double, double > | getDEWeigthedEfficiency (int a_binNumber, bool a_fluxConsidered=false) |
void | calcFlux (int a_startBin, int a_stopBin) |
void | iterativeFlux (int a_startBin, int a_stopBin, double a_maxDifference=0.01, double a_maxIterations=1000) |
TGraph * | plotFlux () |
TGraph * | plotFluxPerSRmicroC () |
TH1 * | getFluxHistPerSRmicroC () |
std::vector< double > | getGaussSeed (TH1 *a_proj) |
void | checkGaussGuess (TH1 *a_hist, bool a_newCanvas=false) |
TFitResultPtr | fitSliceWithGauss (TH1 *a_hist, bool a_draw, bool a_rangeLimit=false) |
void | calcPeakArea (std::vector< TFitResultPtr > &a_fitResVec, std::vector< TH1 * > &a_sliceVec, std::vector< double > &a_areaVec, std::vector< double > &a_dAreaVec, int a_startBin, int a_stopBin) |
TGraph * | plotResVec (std::vector< double > &a_valVec, std::vector< double > &a_dValVec, int a_startBin, int a_stopBin) |
STOFAna & | getSimAna () |
STOFAna & | getExpAna () |
void | setConfig (STOFConfig a_config) |
STOFConfig | getConfig () |
get config class stored in FluxAna More... | |
void | clearState () |
clears histograms – to be used in-between MC trials More... | |
virtual std::ostream & | printVecsState (std::ostream &a_stream) const |
~STOFFluxAna () | |
Protected Attributes | |
STOFAna | m_simResults |
used to fetch results from the simulation of the experimental setup More... | |
STOFAna | m_expResults |
used to fetch results from the experimental data More... | |
STOFConfig | m_config |
std::map< std::string, TH2 * > | m_simHists |
std::map< std::string, TH2 * > | m_expHists |
std::vector< TH1 * > | m_effProj |
used to store projections of histograms More... | |
std::vector< std::pair< double, double > > | m_projEdges |
used to store the edges of projections More... | |
std::vector< TFitResultPtr > | m_effFitRes |
std::vector< double > | m_effPeakArea |
used a derived result from a fit More... | |
std::vector< double > | m_dEffPeakArea |
used to store the error onthe above value More... | |
std::vector< double > | m_eff |
used to store the efficiency calculation More... | |
std::vector< double > | m_dEff |
uncertainty on the efficiency More... | |
TH1 * | m_transportedNeutrons |
TF1 * | m_sliceFitFunc |
this function is a holder used for various slice fitting the efficiency More... | |
std::vector< TH1 * > | m_IProj |
!!!end eff calculation storage More... | |
std::vector< std::pair< double, double > > | m_IProjEdges |
used to store the edges of projections More... | |
std::vector< TFitResultPtr > | m_IFitRes |
std::vector< double > | m_IPeakArea |
used a derived result from a fit More... | |
std::vector< double > | m_dIPeakArea |
used to store the error onthe above value More... | |
std::vector< double > | m_I |
used to store the efficiency calculation More... | |
std::vector< double > | m_dI |
uncertainty on the efficiency More... | |
std::vector< double > | m_flux |
std::vector< double > | m_dFlux |
std::vector< double > | m_eFlux |
std::vector< double > | m_dEFlux |
std::vector< double > | m_originalFlux |
used to store first calculated flux before iteration More... | |
std::vector< double > | m_originalDFlux |
bool | m_binWeighHistPresent |
std::vector< TH1 * > | m_rEnVTEnProj |
std::vector< double > | m_binEdges |
used to store the edges of the bins generally? More... | |
double | m_charge |
TH1 * | m_incTimeDt |
bool | m_useExitTOF |
changes the loaded data types to be for the exit time of flight More... | |
bool | m_subtract |
this class is intended to manage the final stages of producing a nuetron spectrum from the kinematic neutron spectrometer developed at the 88". I primarily depends on the STOFAna class for histogram generation for data from the experimental configuration and the results of a simulation of the configuration
STOFFluxAna::STOFFluxAna | ( | ) |
default constructor puts the class into a working but not that interesting state
STOFFluxAna::~STOFFluxAna | ( | ) |
void STOFFluxAna::addExpFile | ( | std::string | a_fileName | ) |
this function adds files from experiment
void STOFFluxAna::addExpIncTimeDt | ( | TH1 * | a_hist | ) |
used to pass the incoming time of flight uncertainty hist to the class
void STOFFluxAna::addSimEnergyHist | ( | TH1 * | a_particleHistory | ) |
used to add the sim energy histogram to the class
void STOFFluxAna::addSimFile | ( | std::string | a_fileName | ) |
this function adds files from simulation of the experiment
this function adds files from experiment
void STOFFluxAna::calcEfficiency | ( | int | a_startBin, |
int | a_stopBin | ||
) |
basically calcuation of the efficiency needs the transport history
void STOFFluxAna::calcFlux | ( | int | a_startBin, |
int | a_stopBin | ||
) |
this requires that both intensities and the efficiency has been calculated, and that that neutron energy spreading histogram is present
void STOFFluxAna::calcIntensity | ( | int | a_startBin, |
int | a_stopBin | ||
) |
basically calcuation of the efficiency needs the transport history
void STOFFluxAna::calcPeakArea | ( | std::vector< TFitResultPtr > & | a_fitResVec, |
std::vector< TH1 * > & | a_sliceVec, | ||
std::vector< double > & | a_areaVec, | ||
std::vector< double > & | a_dAreaVec, | ||
int | a_startBin, | ||
int | a_stopBin | ||
) |
uses the results of the above fit to calculate the area ie call the above first
this assumes that there isn't some odd light binning and all bin widths are the same
void STOFFluxAna::calcPeakAreaE | ( | int | a_startBin, |
int | a_stopBin | ||
) |
uses the results of the above fit to calculate the area ie call the above first
void STOFFluxAna::calcPeakAreaI | ( | int | a_startBin, |
int | a_stopBin | ||
) |
uses the results of the above fit to calculate the area ie call the above first
void STOFFluxAna::checkGaussGuess | ( | TH1 * | a_hist, |
bool | a_newCanvas = false |
||
) |
this function gets the gaus seed parameters and plots them with the projecton they were estimate for
void STOFFluxAna::checkGaussGuessE | ( | int | a_binNumber, |
bool | a_newCanvas = false |
||
) |
this function gets the gaus seed parameters and plots them with the projecton they were estimate for
void STOFFluxAna::checkGaussGuessI | ( | int | a_binNumber, |
bool | a_newCanvas = false |
||
) |
this function gets the gaus seed parameters and plots them with the projecton they were estimate for
void STOFFluxAna::clearExpFiles | ( | ) |
this function clears the experiment data
void STOFFluxAna::clearState | ( | ) |
clears histograms – to be used in-between MC trials
void STOFFluxAna::drawBinWeighting | ( | int | a_binNumber, |
bool | a_newCanvas = false |
||
) |
void STOFFluxAna::drawProjectionE | ( | int | a_binNumber, |
bool | a_newCanvas = false |
||
) |
this function will draw a projection of a specified bin number from internal class memory
void STOFFluxAna::drawProjectionI | ( | int | a_binNumber, |
bool | a_newCanvas = false |
||
) |
this function will draw a projection of a specified bin number from internal class memory
void STOFFluxAna::fitEfficiencySlices | ( | int | a_startBin, |
int | a_stopBin | ||
) |
loops over internally stored projections fitting them with gaus and store the fit results
void STOFFluxAna::fitSlicesI | ( | int | a_startBin, |
int | a_stopBin | ||
) |
loops over internally stored projections fitting them with gaus and store the fit results
TFitResultPtr STOFFluxAna::fitSliceWithGauss | ( | TH1 * | a_hist, |
bool | a_draw, | ||
bool | a_rangeLimit = false |
||
) |
this function depends on the class being setup. It attemps to fit an intenally stored slice with a TF1 which the first three parameters should correspond to a normalized gaussian. The fit results will be stored in the class
void STOFFluxAna::fitSliceWithGaussE | ( | int | a_binNumber, |
bool | a_draw | ||
) |
this function depends on the class being setup. It attemps to fit an intenally stored slice with a TF1 which the first three parameters should correspond to a normalized gaussian. The fit results will be stored in the class
void STOFFluxAna::fitSliceWithGaussI | ( | int | a_binNumber, |
bool | a_draw | ||
) |
this function depends on the class being setup. It attemps to fit an intenally stored slice with a TF1 which the first three parameters should correspond to a normalized gaussian. The fit results will be stored in the class
void STOFFluxAna::generateScatterLYCalibrationFiles | ( | std::string | a_outDataFileName, |
std::string | a_outSimFileName, | ||
std::vector< std::pair< double, double > > | a_ranges | ||
) |
this function generates histograms used for calibration of the experimental data to the simulation light axis
'''warning hard coded max eD'''
void STOFFluxAna::generateTargetLYCalibrationFiles | ( | std::string | a_outDataFileName, |
std::string | a_outSimFileName, | ||
bool | a_incTOF, | ||
std::vector< std::pair< double, double > > | a_ranges | ||
) |
this function generates histograms used for calibration of the experimental data to the simulation light axis a_incTOF is set to chose either ranges in incoming TOF (true) or exitTOF (false)
STOFConfig STOFFluxAna::getConfig | ( | ) |
get config class stored in FluxAna
std::pair< double, double > STOFFluxAna::getDEWeigthedEfficiency | ( | int | a_binNumber, |
bool | a_fluxConsidered = false |
||
) |
calculates the average efficiency of a given bin and it's error if a fluxConsidered, using calculated flux in weighting the efficiency
not adding fluxError since it is calculated from previous two error
since the weighting histogram is normalized we have the appropriate efficiency and the variance
STOFAna & STOFFluxAna::getExpAna | ( | ) |
this function allows access to the internal member class managing the simulation results
TH1 * STOFFluxAna::getFluxHistPerSRmicroC | ( | ) |
hard coded target ID
std::vector< double > STOFFluxAna::getGaussSeed | ( | TH1 * | a_hist | ) |
this function looks at the values associated with a projection and attempts to guess the starting paramters for a fit
std::vector< double > STOFFluxAna::getGaussSeedE | ( | int | a_proj | ) |
this function looks at the values associated with a projection and attempts to guess the starting paramters for a fit
std::vector< double > STOFFluxAna::getGaussSeedI | ( | int | a_proj | ) |
this function looks at the values associated with a projection and attempts to guess the starting paramters for a fit
STOFAna & STOFFluxAna::getSimAna | ( | ) |
this function allows access to the internal member class managing the simulation results
void STOFFluxAna::iterativeFlux | ( | int | a_startBin, |
int | a_stopBin, | ||
double | a_maxDifference = 0.01 , |
||
double | a_maxIterations = 1000 |
||
) |
this takes the result from calcFlux to update the distribution of neutron energies contributing to each bin weighted by the measured flux and iterates until convergence
storing original flux for comparisons
TCanvas * STOFFluxAna::plotComparison | ( | std::string | a_histName, |
int | a_binProjection = -1 |
||
) |
plots a comparison of the model and the data for the specified name specifying a bin number other than the default and withtin the range will also plot a projection of both on the same canvas.
TGraph * STOFFluxAna::plotEff | ( | int | a_startBin, |
int | a_stopBin | ||
) |
TGraph * STOFFluxAna::plotFlux | ( | ) |
TGraph * STOFFluxAna::plotFluxPerSRmicroC | ( | ) |
hard coded target ID
TGraph * STOFFluxAna::plotI | ( | int | a_startBin, |
int | a_stopBin | ||
) |
TGraph * STOFFluxAna::plotPeakAreaE | ( | int | a_startBin, |
int | a_stopBin | ||
) |
TGraph * STOFFluxAna::plotPeakAreaI | ( | int | a_startBin, |
int | a_stopBin | ||
) |
TGraph * STOFFluxAna::plotResVec | ( | std::vector< double > & | a_valVec, |
std::vector< double > & | a_dValVec, | ||
int | a_startBin, | ||
int | a_stopBin | ||
) |
std::ostream & STOFFluxAna::printHistNames | ( | std::ostream & | a_stream = std::cout | ) |
|
virtual |
void STOFFluxAna::readConfig | ( | std::string | a_fileName | ) |
this function reads the config file for both the simulation and the experiment accumulator class
void STOFFluxAna::setConfig | ( | STOFConfig | a_config | ) |
this function allows to update the configuration in the Monte Carlo derived class
void STOFFluxAna::setCutState | ( | std::string | a_cutName, |
bool | a_state | ||
) |
this sets the cuts for both classes
void STOFFluxAna::setExitTOF | ( | bool | a_useExitTOF | ) |
this function changes whether the class uses the incoming or exit time of flight to determine the incient neutron energy the default state is setup for incoming time of flight this needs to be called before any of the setup functions
void STOFFluxAna::setSimTOFSmearing | ( | double | a_exitTOFSmear, |
double | a_incTOFSmear | ||
) |
this function turns on time smearing in the simulation using normal distributions with provided 1-sigma values for incTOF and exitTOF
void STOFFluxAna::setSimTOFSmearing | ( | double | a_exitTOFSmear, |
TH1 * | a_incTOFHistogram | ||
) |
this function turns on time smearing in the simulation using a normal distribution with provided 1-sigma values for exitTOF and a histogram for the distribution of the gamma flash for incTOF
void STOFFluxAna::setUpEffCalc | ( | ) |
!!!!!~~~~~~~~~~~~~largely related to the efficiency caculation this function sets up the internal state of the class to consider the efficiency of the detector system using the simulation this includes building the 2D histogram of the observed pulse height of the target
void STOFFluxAna::setUpICalc | ( | ) |
!!!!!~~~~~~~~~~~~~end largely related to the efficiency caculation
!!!!!~~~~~~~~~~~~~largely related to the intesity caculation this function sets up the internal state of the class to consider the efficiency of the detector system using the simulation this includes building the 2D histogram of the observed pulse height of the target
void STOFFluxAna::setupModelDataComparisonPlotting | ( | ) |
this function loads the generated model and data histograms used in the comparison functions
void STOFFluxAna::setupUncertaintyWeighting | ( | ) |
!!!!!~~~~~~~~~~~~~end largely related to the intensity caculation
this vector populates the bin contribution slices and normalizes them if it is called a second time it doesn't recreate the 2d hist and just regenerates the slices it assumes the efficiency has already been calculated
this vector populates the bin contribution slices and normalizes them if it is called a second time it doesn't recreate the 2d hist and just regenerates the slices
|
protected |
used to store the edges of the bins generally?
|
protected |
|
protected |
|
protected |
used to dish information about the experimental configuratoin and calibrations. This config gets modified during the Monte Carlo of systematics
|
protected |
uncertainty on the efficiency
|
protected |
used to store the error onthe above value
|
protected |
|
protected |
|
protected |
uncertainty on the efficiency
|
protected |
used to store the error onthe above value
|
protected |
used to store the efficiency calculation
|
protected |
|
protected |
used a derived result from a fit
|
protected |
used to store projections of histograms
!!!eff calculation storage
|
protected |
|
protected |
used to store references to histograms used in the analysis with name based access
|
protected |
used to fetch results from the experimental data
|
protected |
|
protected |
used to store the efficiency calculation
|
protected |
|
protected |
|
protected |
used a derived result from a fit
|
protected |
!!!end eff calculation storage
!!! intensity calcualtion storage
|
protected |
used to store the edges of projections
|
protected |
|
protected |
used to store first calculated flux before iteration
|
protected |
used to store the edges of projections
|
protected |
|
protected |
used to store references to histograms used in the analysis with name based access
|
protected |
used to fetch results from the simulation of the experimental setup
|
protected |
this function is a holder used for various slice fitting the efficiency
|
protected |
subtracts background by looking at the inverse of the match window
|
protected |
histogram for storing the efficiency this pointed is inteded for storing the particle history of the GEANT particles which contributed to the simulation being analyzed
|
protected |
changes the loaded data types to be for the exit time of flight