Berkeley Nuclear Data Software
|
#include <STOFPostProcessing.h>
Public Member Functions | |
STOFPostProcessing () | |
defualt constructor puts the class into an empty but working state More... | |
STOFPostProcessing (std::string a_writeMode) | |
allows setting the file type see base class constructor of same signature More... | |
void | loadConfig (std::string a_jsonConfigName) |
void | genTimeDiffMultiPMTTarg (std::string a_outFile) |
void | genAmpCalibHists (std::string a_outFile) |
void | genPSDCalibHists (std::string a_outFile) |
void | genCoinTimingCalibrationHists (std::string a_outFile, bool a_targDTCut=false) |
void | genIncTimingCalibrationHists (std::string a_outFile) |
void | reduceToSTOFEvents (std::string a_outfile="stofEvents.root") |
int | buildCoincidences (double a_coinWindow, int a_minMult=2) |
int | addCoinsFromFile (std::string a_fileName, double a_coinWindow, int a_minMult=2) |
void | checkPSDCuts (int a_ch, string a_cutFile) |
check PSD cuts and compare number of events of each type More... | |
TGraph * | investigateCoincidenceWindow (int a_startWindow, int a_stopWindow, int a_step) |
void | setRunStart (double a_runStart) |
Public Member Functions inherited from CompassPostProcBase | |
CompassPostProcBase () | |
default contstructor put the class into a commonly working state More... | |
CompassPostProcBase (std::string a_writeMode) | |
virtual int | addFile (string a_filename) |
overloading defaul file loader to manage complex association of branches More... | |
virtual int | addCoinsFromFile (string a_fileName, double a_coinWindow) |
void | setFileMode (bool a_hasWFs) |
used to set whether the file is list mode or mixed mode. More... | |
int | buildTimeSortedVector (int a_startEvent=0, int a_numToRead=-1) |
used to read tree contents into memory and ensure they are time sorted More... | |
virtual int | buildCoincidences (double a_coinWindow) |
TH1 * | buildDtHist (int a_ch1, int a_ch2, double a_maxT, int a_maxMultiplicity=2, bool enforceOrder=true) |
void | buildClycTree (int a_ch1, int a_ch2, double a_maxT, int a_maxMultiplicity=2, bool enforceOrder=true, int psdType=1, double a_slope=243, double a_offset=-2.3) |
void | buildTrigDTTree (int a_trigChannel, std::string a_fileName) |
TH1 * | buildDtVEHist (int a_ch1, int a_ch2, double a_maxT, int a_maxMultiplicity=2, bool enforceOrder=false, int a_EchOrder=0) |
TH1 * | buildInterEventTime (int a_ch, double a_maxT) |
TH1 * | buildCountRateHist (int a_ch, int a_maxCountRate) |
TH1 * | buildDtTrigVEHist (int a_evCh, int a_trigCh, double a_maxT) |
TH2 * | buildWallTimeVEnergy (int a_ch) |
TH2 * | buildPSDPlot (int a_ch) |
std::vector< compassCoin > | getCoins () |
void | writeCoinsToDisk (std::string a_outFileName="coinFile.root") |
void | investigateCoins () |
std::ostream & | printEvent (int a_eventID, std::ostream &a_stream=std::cout) |
std::ostream & | printTimeSort (std::ostream &a_stream=std::cout, int a_num=-1) |
void | readCutFile (std::string a_fileName) |
void | clearData () |
clears sorted vector, coincidences and loaded file More... | |
Public Member Functions inherited from PostProcBase< compassEvStrct > | |
PostProcBase () | |
defualt constructor puts class into a working state More... | |
virtual int | addFilesFromDirectory (string a_dir, string a_ext) |
virtual int | loadEvent (int a_eventNumber) |
loads a specified event into memory More... | |
virtual int | fileNotLoaded () |
tests if a file is loaded and prinst a message if not More... | |
virtual int | clearFileState () |
virtual std::ostream & | printState (std::ostream &a_stream=std::cout) |
virtual | ~PostProcBase () |
TChain * | getTrees () |
danger danger, use this if you know what you are doing. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CompassPostProcBase | |
void | setTreeName () |
sets the default tree name More... | |
void | setBranchName () |
not used but implementation is required. More... | |
Protected Attributes inherited from CompassPostProcBase | |
TArrayS * | m_evArrayPtr |
bool | m_hasWFs |
used to signal whether the file is list or has wf's More... | |
std::vector< compassEvStrct > | m_sortVector |
stores a time sorted vector More... | |
std::vector< compassCoin > | m_coins |
used to store compass coincidences More... | |
CutManager | m_cuts |
cut manager More... | |
bool | m_cutFileLoaded |
bool for cutmanager status More... | |
Protected Attributes inherited from PostProcBase< compassEvStrct > | |
TChain * | m_trees |
for associating the trees from files More... | |
string | m_treeName |
for storing the name of the tree More... | |
string | m_branchName |
for storing the name of the branch More... | |
compassEvStrct * | m_currentEvent |
for storing the current event More... | |
vector< string > | m_loadedFiles |
for storing a list of loaded files More... | |
bool | m_hasFile |
flag for wheter a file has been loaded More... | |
this class is intended to store analysis routines used for turning experimental data from the Scattered Time Of Flight detector into neutron spectra the routines in this class assume that the data has been taken in pulse amplitude mode. all routines require that you load a config file so that the output of them can be
STOFPostProcessing::STOFPostProcessing | ( | ) |
defualt constructor puts the class into an empty but working state
STOFPostProcessing::STOFPostProcessing | ( | std::string | a_writeMode | ) |
allows setting the file type see base class constructor of same signature
int STOFPostProcessing::addCoinsFromFile | ( | std::string | a_fileName, |
double | a_coinWindow, | ||
int | a_minMult = 2 |
||
) |
this function add the coincidences from a file or a globbed group of files and then clears everything except the coincidences from memory which should make working with multiple files a little less memory intensive coin window is in ns
this function add the coincidences from a file or a globbed group of files and then clears everything except the coincidences from memory which should make working with multiple files a little less memory intensive
int STOFPostProcessing::buildCoincidences | ( | double | a_coinWindow, |
int | a_minMult = 2 |
||
) |
this function overloads the base class coincidence builder to independently manage the rf channel for when finishing the coincidence. It ignores the rf channel when building the coincidence, then finds the nearest rf event to associate with the coincidence. You can specify a minimum multiplicity to enable target singles counting as coincidences. specifying a min multiplicty of 3 will ensure both target channels and a scatter cell are in coincidenced within the specified window. this does not currently included an explicit test if the channels present actuall make a full set, just that there is three. the time scale of the coincidence has also been changed to ns.
loop over sorted events
associate the closest rf to event time from the array
a_coinWindow | coincidence window in ns |
void STOFPostProcessing::checkPSDCuts | ( | int | a_ch, |
string | a_cutFile | ||
) |
check PSD cuts and compare number of events of each type
void STOFPostProcessing::genAmpCalibHists | ( | std::string | a_outFile | ) |
this function generates amplitude calibration spectra for all the detectors if Dual PMT's are used spectra will be produced for both of the independent readouts. This routine generically assumes you have loaded a file containing calibration data
build a hist
build a hist
build a hist
build a hist
void STOFPostProcessing::genCoinTimingCalibrationHists | ( | std::string | a_outFile, |
bool | a_targDTCut = false |
||
) |
this function generates timing calibration plots building coincidences between each scatter cell and all target cells
this function generates timing calibration Hists building coincidences between each scatter cell and all target cells
void STOFPostProcessing::genIncTimingCalibrationHists | ( | std::string | a_outFile | ) |
this function generates timing calibration plots building coincidences between each target cell and the cyclotron RF.
this function generates timing calibration Hists building coincidences between each target cell and the cyclotron RF.
get the target configuration for histogram building and event testing
need to ensure that all channels of the multipmt target are present
void STOFPostProcessing::genPSDCalibHists | ( | std::string | a_outFile | ) |
this function is used to generate PSDHistograms and dump them to a file for developing PSD cuts for the data sets. This generically assumes that you have loaded a file with a mixed gamma and neutron field
build a hist
build a hist
build a hist
build a hist
void STOFPostProcessing::genTimeDiffMultiPMTTarg | ( | std::string | a_outFile | ) |
this function generates a time difference hist between PMT's coupled to a single cell to allow for the determination of the time offset and a width. It requires that the timeBaseID is set in the config file
build a hist for single time differences
1000.;
TGraph * STOFPostProcessing::investigateCoincidenceWindow | ( | int | a_startWindow, |
int | a_stopWindow, | ||
int | a_step | ||
) |
this function requires that your config file is complete with calibrations and cuts. It should realistically only be run with one or two files loaded it iteratively builds coincidences from the loaded files with different coincidence windows and test how many events pass the cut creating a resultant TGraph. All windows sizes are in ns !!!!!! match window test is currently hardcoded to test if the energy match is within 25% !!!!!!!
this function requires that your config file is complete with calibrations and cuts. It should realistically only be run with one or two files loaded it iteratively builds coincidences from the loaded files with different coincidence windows and test how many events pass the cut creating a resultant TGraph. All windows sizes are in ns
this tries to turn the coincidence information from coinEv into an STOFEvent, if it is succesful the then the cuts are tested
!!!!!!!!!!!!!!!!hard coded target ID !!!!!!!!!!!!!!!!!!!!!!!!!!
void STOFPostProcessing::loadConfig | ( | std::string | a_jsonConfigName | ) |
this function reads a specified configuration file for the experiment and stores it in the internal class member variable
void STOFPostProcessing::reduceToSTOFEvents | ( | std::string | a_outfile = "stofEvents.root" | ) |
this function requires that all calibrations are present in the config file. It loops over all events in the coincidence vector and calculates all possible quantities for an event in the system producing a tree with STOFEvent structs stored
loop over events and calculate quantities
this tries to turn the coincidence information from coinEv into an STOFEvent, if it is succesful the tree is filled, if not, the bad event counter is incremented.
void STOFPostProcessing::setRunStart | ( | double | a_runStart | ) |
this function is used when working with multiple runs to keep track of a wall clock time to allow for time dependent calibrations