QwAnalysis
|
#include <QwHistogramHelper.h>
Data Structures | |
class | HistParams |
Histogram parameter class. More... | |
Public Member Functions | |
QwHistogramHelper () | |
virtual | ~QwHistogramHelper () |
void | ProcessOptions (QwOptions &options) |
Process the configuration options. More... | |
void | LoadHistParamsFromFile (const std::string &filename) |
void | LoadTreeParamsFromFile (const std::string &filename) |
void | PrintHistParams () const |
TH1F * | Construct1DHist (const TString &inputfile, const TString &name_title) |
TH2F * | Construct2DHist (const TString &inputfile, const TString &name_title) |
TH1F * | Construct1DHist (const TString &name_title) |
TH2F * | Construct2DHist (const TString &name_title) |
TProfile * | Construct1DProf (const TString &name_title) |
TProfile2D * | Construct2DProf (const TString &name_title) |
TH1F * | Construct1DHist (const std::string &inputfile, const TString &name_title) |
TH2F * | Construct2DHist (const std::string &inputfile, const TString &name_title) |
TProfile * | Construct1DProf (const std::string &inputfile, const TString &name_title) |
TProfile2D * | Construct2DProf (const std::string &inputfile, const TString &name_title) |
Bool_t | MatchDeviceParamsFromList (const std::string &devicename) |
Bool_t | MatchVQWKElementFromList (const std::string &subsystemname, const std::string &moduletype, const std::string &devicename) |
Static Public Member Functions | |
static void | DefineOptions (QwOptions &options) |
Define the configuration options. More... | |
Protected Member Functions | |
TH1F * | Construct1DHist (const HistParams ¶ms) |
TH2F * | Construct2DHist (const HistParams ¶ms) |
TProfile * | Construct1DProf (const HistParams ¶ms) |
TProfile2D * | Construct2DProf (const HistParams ¶ms) |
const HistParams | GetHistParamsFromLine (QwParameterFile &mapstr) |
const HistParams | GetHistParamsFromFile (const std::string &filename, const TString &histname) |
const HistParams | GetHistParamsFromList (const TString &histname) |
Bool_t | DoesMatch (const TString &s, const TRegexp &wildcard) |
Protected Attributes | |
Bool_t | fDEBUG |
Bool_t | fTrimDisable |
Bool_t | fTrimHistoEnable |
Bool_t | fTreeTrimFileLoaded |
std::string | fInputFile |
std::vector< HistParams > | fHistParams |
std::vector< std::pair < TString, TRegexp > > | fTreeParams |
std::vector< TString > | fSubsystemList |
std::vector< std::vector < TString > > | fModuleList |
std::vector< std::vector < std::vector< TString > > > | fVQWKTrimmedList |
Static Protected Attributes | |
static const Double_t | fInvalidNumber = -1.0e7 |
static const TString | fInvalidName = "EmptyEmpty" |
This class exists to encapsulate several helper functions to aid in describing histograms. There will be a global copy defined within the analysis framework.
Definition at line 21 of file QwHistogramHelper.h.
|
inline |
Definition at line 23 of file QwHistogramHelper.h.
References fHistParams.
|
inlinevirtual |
Definition at line 24 of file QwHistogramHelper.h.
|
inline |
Definition at line 37 of file QwHistogramHelper.h.
Referenced by Construct1DHist(), QwRaster::ConstructHistograms(), QwPMT_Channel::ConstructHistograms(), QwSIS3320_Accumulator::ConstructHistograms(), QwSIS3320_Channel::ConstructHistograms(), QwHelicity::ConstructHistograms(), QwScanner::ConstructHistograms(), VQwScaler_Channel::ConstructHistograms(), QwComptonElectronDetector::ConstructHistograms(), and QwVQWK_Channel::ConstructHistograms().
TH1F * QwHistogramHelper::Construct1DHist | ( | const TString & | name_title | ) |
Definition at line 441 of file QwHistogramHelper.cc.
References Construct1DHist(), and GetHistParamsFromList().
TH1F * QwHistogramHelper::Construct1DHist | ( | const std::string & | inputfile, |
const TString & | name_title | ||
) |
Definition at line 473 of file QwHistogramHelper.cc.
References Construct1DHist(), and GetHistParamsFromFile().
|
protected |
Definition at line 497 of file QwHistogramHelper.cc.
References fInvalidName, fTrimHistoEnable, QwHistogramHelper::HistParams::name_title, QwHistogramHelper::HistParams::x_max, QwHistogramHelper::HistParams::x_min, QwHistogramHelper::HistParams::x_nbins, QwHistogramHelper::HistParams::xtitle, and QwHistogramHelper::HistParams::ytitle.
TProfile * QwHistogramHelper::Construct1DProf | ( | const TString & | name_title | ) |
Definition at line 457 of file QwHistogramHelper.cc.
References GetHistParamsFromList().
Referenced by Construct1DProf(), and QwBeamMod::ConstructHistograms().
TProfile * QwHistogramHelper::Construct1DProf | ( | const std::string & | inputfile, |
const TString & | name_title | ||
) |
Definition at line 489 of file QwHistogramHelper.cc.
References Construct1DProf(), and GetHistParamsFromFile().
|
protected |
Definition at line 539 of file QwHistogramHelper.cc.
References fInvalidName, fTrimHistoEnable, QwHistogramHelper::HistParams::name_title, QwHistogramHelper::HistParams::x_max, QwHistogramHelper::HistParams::x_min, QwHistogramHelper::HistParams::x_nbins, QwHistogramHelper::HistParams::xtitle, QwHistogramHelper::HistParams::y_max, QwHistogramHelper::HistParams::y_min, and QwHistogramHelper::HistParams::ytitle.
|
inline |
Definition at line 41 of file QwHistogramHelper.h.
Referenced by Construct2DHist().
TH2F * QwHistogramHelper::Construct2DHist | ( | const TString & | name_title | ) |
Definition at line 433 of file QwHistogramHelper.cc.
References Construct2DHist(), and GetHistParamsFromList().
TH2F * QwHistogramHelper::Construct2DHist | ( | const std::string & | inputfile, |
const TString & | name_title | ||
) |
Definition at line 465 of file QwHistogramHelper.cc.
References Construct2DHist(), and GetHistParamsFromFile().
|
protected |
Definition at line 517 of file QwHistogramHelper.cc.
References fInvalidName, fTrimHistoEnable, QwHistogramHelper::HistParams::name_title, QwHistogramHelper::HistParams::x_max, QwHistogramHelper::HistParams::x_min, QwHistogramHelper::HistParams::x_nbins, QwHistogramHelper::HistParams::xtitle, QwHistogramHelper::HistParams::y_max, QwHistogramHelper::HistParams::y_min, QwHistogramHelper::HistParams::y_nbins, and QwHistogramHelper::HistParams::ytitle.
TProfile2D * QwHistogramHelper::Construct2DProf | ( | const TString & | name_title | ) |
Definition at line 449 of file QwHistogramHelper.cc.
References GetHistParamsFromList().
Referenced by Construct2DProf().
TProfile2D * QwHistogramHelper::Construct2DProf | ( | const std::string & | inputfile, |
const TString & | name_title | ||
) |
Definition at line 481 of file QwHistogramHelper.cc.
References Construct2DProf(), and GetHistParamsFromFile().
|
protected |
Definition at line 560 of file QwHistogramHelper.cc.
References fInvalidName, fTrimHistoEnable, QwHistogramHelper::HistParams::name_title, QwHistogramHelper::HistParams::x_max, QwHistogramHelper::HistParams::x_min, QwHistogramHelper::HistParams::x_nbins, QwHistogramHelper::HistParams::xtitle, QwHistogramHelper::HistParams::y_max, QwHistogramHelper::HistParams::y_min, QwHistogramHelper::HistParams::y_nbins, QwHistogramHelper::HistParams::ytitle, QwHistogramHelper::HistParams::z_max, and QwHistogramHelper::HistParams::z_min.
|
static |
Define the configuration options.
Definition at line 24 of file QwHistogramHelper.cc.
References QwOptions::AddOptions(), and default_bool_value.
Referenced by QwOptions::DefineOptions().
|
protected |
Definition at line 416 of file QwHistogramHelper.cc.
Referenced by GetHistParamsFromFile(), GetHistParamsFromList(), MatchDeviceParamsFromList(), and MatchVQWKElementFromList().
|
protected |
Definition at line 369 of file QwHistogramHelper.cc.
References DoesMatch(), QwLog::endl(), fDEBUG, fInvalidName, fTrimHistoEnable, GetHistParamsFromLine(), QwHistogramHelper::HistParams::name_title, QwError, QwMessage, and QwParameterFile::TrimComment().
Referenced by Construct1DHist(), Construct1DProf(), Construct2DHist(), and Construct2DProf().
|
protected |
Decodes the histogram parameters from the current line of a QwParameter file. If the line cannot be decoded, the name is returned as fInvalidName.
Definition at line 75 of file QwHistogramHelper.cc.
References QwLog::endl(), QwHistogramHelper::HistParams::expression, fInvalidName, fInvalidNumber, QwParameterFile::GetTypedNextToken(), QwHistogramHelper::HistParams::max, QwHistogramHelper::HistParams::min, QwHistogramHelper::HistParams::name_title, QwError, QwHistogramHelper::HistParams::type, QwHistogramHelper::HistParams::x_max, QwHistogramHelper::HistParams::x_min, QwHistogramHelper::HistParams::x_nbins, QwHistogramHelper::HistParams::xtitle, QwHistogramHelper::HistParams::y_max, QwHistogramHelper::HistParams::y_min, QwHistogramHelper::HistParams::y_nbins, and QwHistogramHelper::HistParams::ytitle.
Referenced by GetHistParamsFromFile(), and LoadHistParamsFromFile().
|
protected |
Definition at line 247 of file QwHistogramHelper.cc.
References DoesMatch(), QwLog::endl(), fDEBUG, fHistParams, fInputFile, fInvalidName, fTrimHistoEnable, QwHistogramHelper::HistParams::max, QwHistogramHelper::HistParams::min, QwHistogramHelper::HistParams::name_title, QwHistogramHelper::HistParams::nbins, QwMessage, QwWarning, QwHistogramHelper::HistParams::x_max, QwHistogramHelper::HistParams::x_min, QwHistogramHelper::HistParams::x_nbins, QwHistogramHelper::HistParams::y_max, QwHistogramHelper::HistParams::y_min, and QwHistogramHelper::HistParams::y_nbins.
Referenced by Construct1DHist(), Construct1DProf(), Construct2DHist(), and Construct2DProf().
void QwHistogramHelper::LoadHistParamsFromFile | ( | const std::string & | filename | ) |
Definition at line 133 of file QwHistogramHelper.cc.
References QwLog::endl(), fDEBUG, fHistParams, fInputFile, fInvalidName, fTrimHistoEnable, GetHistParamsFromLine(), QwParameterFile::LineIsEmpty(), QwHistogramHelper::HistParams::name_title, QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().
Referenced by main(), and ProcessOptions().
void QwHistogramHelper::LoadTreeParamsFromFile | ( | const std::string & | filename | ) |
Definition at line 175 of file QwHistogramHelper.cc.
References QwLog::endl(), fDEBUG, fModuleList, fSubsystemList, fTreeParams, fTreeTrimFileLoaded, fTrimDisable, fVQWKTrimmedList, QwParameterFile::GetLine(), QwParameterFile::LineIsEmpty(), QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::ReadNextModule(), QwParameterFile::ReadNextSection(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().
Referenced by ProcessOptions().
Bool_t QwHistogramHelper::MatchDeviceParamsFromList | ( | const std::string & | devicename | ) |
Definition at line 299 of file QwHistogramHelper.cc.
References DoesMatch(), QwLog::endl(), fDEBUG, fTreeParams, fTreeTrimFileLoaded, fTrimDisable, QwMessage, and QwWarning.
Referenced by QwScanner::ConstructBranchAndVector(), VQwScaler_Channel::ConstructBranchAndVector(), and QwVQWK_Channel::ConstructBranchAndVector().
Bool_t QwHistogramHelper::MatchVQWKElementFromList | ( | const std::string & | subsystemname, |
const std::string & | moduletype, | ||
const std::string & | devicename | ||
) |
Definition at line 325 of file QwHistogramHelper.cc.
References DoesMatch(), QwLog::endl(), fDEBUG, fModuleList, fSubsystemList, fTreeTrimFileLoaded, fTrimDisable, fVQWKTrimmedList, QwMessage, and QwWarning.
Referenced by QwVQWK_Channel::ConstructBranchAndVector().
void QwHistogramHelper::PrintHistParams | ( | ) | const |
Definition at line 166 of file QwHistogramHelper.cc.
References QwLog::endl(), fHistParams, and QwMessage.
void QwHistogramHelper::ProcessOptions | ( | QwOptions & | options | ) |
Process the configuration options.
Definition at line 51 of file QwHistogramHelper.cc.
References QwLog::endl(), fTrimDisable, fTrimHistoEnable, QwOptions::GetValue(), QwOptions::HasValue(), LoadHistParamsFromFile(), LoadTreeParamsFromFile(), and QwMessage.
Referenced by main().
|
protected |
Definition at line 144 of file QwHistogramHelper.h.
Referenced by GetHistParamsFromFile(), GetHistParamsFromList(), LoadHistParamsFromFile(), LoadTreeParamsFromFile(), MatchDeviceParamsFromList(), and MatchVQWKElementFromList().
|
protected |
Definition at line 150 of file QwHistogramHelper.h.
Referenced by GetHistParamsFromList(), LoadHistParamsFromFile(), PrintHistParams(), and QwHistogramHelper().
|
protected |
Definition at line 149 of file QwHistogramHelper.h.
Referenced by GetHistParamsFromList(), and LoadHistParamsFromFile().
|
staticprotected |
Definition at line 143 of file QwHistogramHelper.h.
Referenced by Construct1DHist(), Construct1DProf(), Construct2DHist(), Construct2DProf(), GetHistParamsFromFile(), GetHistParamsFromLine(), GetHistParamsFromList(), and LoadHistParamsFromFile().
|
staticprotected |
Definition at line 142 of file QwHistogramHelper.h.
Referenced by GetHistParamsFromLine().
|
protected |
Definition at line 154 of file QwHistogramHelper.h.
Referenced by LoadTreeParamsFromFile(), and MatchVQWKElementFromList().
|
protected |
Definition at line 153 of file QwHistogramHelper.h.
Referenced by LoadTreeParamsFromFile(), and MatchVQWKElementFromList().
|
protected |
Definition at line 151 of file QwHistogramHelper.h.
Referenced by LoadTreeParamsFromFile(), and MatchDeviceParamsFromList().
|
protected |
Definition at line 147 of file QwHistogramHelper.h.
Referenced by LoadTreeParamsFromFile(), MatchDeviceParamsFromList(), and MatchVQWKElementFromList().
|
protected |
Definition at line 145 of file QwHistogramHelper.h.
Referenced by LoadTreeParamsFromFile(), MatchDeviceParamsFromList(), MatchVQWKElementFromList(), and ProcessOptions().
|
protected |
Definition at line 146 of file QwHistogramHelper.h.
Referenced by Construct1DHist(), Construct1DProf(), Construct2DHist(), Construct2DProf(), GetHistParamsFromFile(), GetHistParamsFromList(), LoadHistParamsFromFile(), and ProcessOptions().
|
protected |
Definition at line 155 of file QwHistogramHelper.h.
Referenced by LoadTreeParamsFromFile(), and MatchVQWKElementFromList().