QwAnalysis
|
#include <QwRegression.h>
Public Types | |
enum | EQwRegType { kRegTypeUnknown =0, kRegTypeMps, kRegTypeAsym, kRegTypeDiff } |
Type of regression variable. More... | |
typedef std::vector< std::pair < VQwHardwareChannel *, VQwHardwareChannel * > >::iterator | PairIterator |
typedef std::vector< std::pair < VQwHardwareChannel *, VQwHardwareChannel * > >::const_iterator | PairConstIterator |
Public Member Functions | |
QwRegression (QwOptions &options, QwSubsystemArrayParity &event, QwHelicityPattern &helicitypattern) | |
Constructor with single event and helicity pattern. More... | |
QwRegression (QwOptions &options, QwSubsystemArrayParity &event) | |
Constructor with single event. More... | |
QwRegression (QwOptions &options, QwHelicityPattern &helicitypattern) | |
Constructor with helicity pattern. More... | |
QwRegression (QwOptions &options) | |
Constructor with only options. More... | |
QwRegression (const QwRegression &source) | |
Copy constructor. More... | |
virtual | ~QwRegression () |
Virtual destructor. More... | |
void | ProcessOptions (QwOptions &options) |
Process the configuration options. More... | |
Int_t | LoadChannelMap (const std::string &mapfile) |
Load the channels and sensitivities. More... | |
Int_t | ConnectChannels (QwSubsystemArrayParity &event, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) |
Connect to channels. More... | |
Int_t | ConnectChannels (QwSubsystemArrayParity &event) |
Connect to Channels (event only) More... | |
Int_t | ConnectChannels (QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) |
Connect to Channels (asymmetry/difference only) More... | |
void | LinearRegression (EQwRegType type) |
Linear regression. More... | |
void | AccumulateRunningSum (QwRegression value) |
void | CalculateRunningAverage () |
void | PrintValue () const |
void | FillDB (QwParityDB *db, TString datatype) |
Tree and vector construction and maintenance | |
void | ConstructBranchAndVector (TTree *tree, std::vector< Double_t > &values) |
Construct the tree and vector for this subsystem. More... | |
void | ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values) |
Construct a branch and vector for this subsystem with a prefix. More... | |
void | FillTreeVector (std::vector< Double_t > &values) const |
Fill the vector for this subsystem. More... | |
Static Public Member Functions | |
static void | DefineOptions (QwOptions &options) |
Define the configuration options. More... | |
Protected Member Functions | |
std::pair< EQwRegType, std::string > | ParseRegressionVariable (const std::string &variable) |
Parse regression variable in type and name. More... | |
Protected Attributes | |
bool | fEnableRegression |
Flag to enable regression. More... | |
std::string | fRegressionMapFile |
Regression dependent and independent variable map. More... | |
QwSubsystemArrayParity * | fSubsystemArray |
Single event pointer. More... | |
QwHelicityPattern * | fHelicityPattern |
Helicity pattern pointer. More... | |
UInt_t | fErrorFlag |
std::vector< EQwRegType > | fDependentType |
List of channels to use in the regression. More... | |
std::vector< std::string > | fDependentName |
std::vector< std::vector < EQwRegType > > | fIndependentType |
std::vector< std::vector < std::string > > | fIndependentName |
std::vector< std::vector < Double_t > > | fSensitivity |
std::vector< EQwRegType > | fDependentVarType |
std::vector< std::pair < VQwHardwareChannel *, VQwHardwareChannel * > > | fDependentVar |
std::vector< std::vector < std::pair< Double_t, const VQwHardwareChannel * > > > | fIndependentVar |
Private Member Functions | |
QwRegression () | |
Private default constructor. More... | |
... info to follow ... really, I promise ...
Definition at line 19 of file QwRegression.h.
typedef std::vector< std::pair< VQwHardwareChannel*,VQwHardwareChannel*> >::const_iterator QwRegression::PairConstIterator |
Definition at line 29 of file QwRegression.h.
typedef std::vector< std::pair< VQwHardwareChannel*,VQwHardwareChannel*> >::iterator QwRegression::PairIterator |
Definition at line 28 of file QwRegression.h.
Type of regression variable.
Enumerator | |
---|---|
kRegTypeUnknown | |
kRegTypeMps | |
kRegTypeAsym | |
kRegTypeDiff |
Definition at line 24 of file QwRegression.h.
QwRegression::QwRegression | ( | QwOptions & | options, |
QwSubsystemArrayParity & | event, | ||
QwHelicityPattern & | helicitypattern | ||
) |
Constructor with single event and helicity pattern.
Constructor with single event and helicity pattern
options | Options object |
event | Single event |
helicitypattern | Helicity pattern |
Definition at line 25 of file QwRegression.cc.
References ConnectChannels(), QwHelicityPattern::fAsymmetry, QwHelicityPattern::fDifference, fEnableRegression, fHelicityPattern, fRegressionMapFile, fSubsystemArray, LoadChannelMap(), and ProcessOptions().
QwRegression::QwRegression | ( | QwOptions & | options, |
QwSubsystemArrayParity & | event | ||
) |
Constructor with single event.
Constructor with single event
options | Options object |
event | Single event |
Definition at line 46 of file QwRegression.cc.
References ConnectChannels(), fEnableRegression, fRegressionMapFile, fSubsystemArray, LoadChannelMap(), and ProcessOptions().
QwRegression::QwRegression | ( | QwOptions & | options, |
QwHelicityPattern & | helicitypattern | ||
) |
Constructor with helicity pattern.
Constructor with only helicity pattern
options | Obtions object |
helicitypattern | Helicity Pattern |
Definition at line 62 of file QwRegression.cc.
References ConnectChannels(), QwHelicityPattern::fAsymmetry, QwHelicityPattern::fDifference, fEnableRegression, fHelicityPattern, fRegressionMapFile, LoadChannelMap(), and ProcessOptions().
QwRegression::QwRegression | ( | QwOptions & | options | ) |
Constructor with only options.
Constructor with options
options | Obtions object |
Definition at line 78 of file QwRegression.cc.
References fEnableRegression, fRegressionMapFile, LoadChannelMap(), and ProcessOptions().
QwRegression::QwRegression | ( | const QwRegression & | source | ) |
Copy constructor.
Definition at line 86 of file QwRegression.cc.
References fDependentVar, fDependentVarType, and VQwDataElement::kDerived.
|
virtual |
Virtual destructor.
Destructor.
Definition at line 102 of file QwRegression.cc.
References fDependentVar.
|
inlineprivate |
void QwRegression::AccumulateRunningSum | ( | QwRegression | value | ) |
Definition at line 612 of file QwRegression.cc.
References fDependentVar, and fErrorFlag.
Referenced by QwRegressionSubsystem::AccumulateRunningSum(), and main().
void QwRegression::CalculateRunningAverage | ( | ) |
Definition at line 622 of file QwRegression.cc.
References fDependentVar.
Referenced by QwRegressionSubsystem::CalculateRunningAverage(), and main().
Int_t QwRegression::ConnectChannels | ( | QwSubsystemArrayParity & | event, |
QwSubsystemArrayParity & | asym, | ||
QwSubsystemArrayParity & | diff | ||
) |
Connect to channels.
Connect to the dependent and independent channels
event | Helicity event structure |
asym | Asymmetry event structure |
diff | Difference event structure |
Fill vector of pointers to the relevant data elements
Definition at line 222 of file QwRegression.cc.
References QwLog::endl(), fDependentName, fDependentType, fDependentVar, fDependentVarType, fEnableRegression, fIndependentName, fIndependentType, fIndependentVar, fSensitivity, VQwDataElement::GetElementName(), VQwDataElement::kDerived, kRegTypeAsym, kRegTypeDiff, kRegTypeMps, QwMessage, QwWarning, QwSubsystemArray::ReturnInternalValue(), and VQwDataElement::SetElementName().
Referenced by QwRegression().
Int_t QwRegression::ConnectChannels | ( | QwSubsystemArrayParity & | event | ) |
Connect to Channels (event only)
Connect to the dependent and independent channels
event | Helicity event structure |
Fill vector of pointers to the relevant data elements
Definition at line 432 of file QwRegression.cc.
References QwLog::endl(), fDependentName, fDependentType, fDependentVar, fDependentVarType, fEnableRegression, fIndependentName, fIndependentType, fIndependentVar, fSensitivity, VQwDataElement::GetElementName(), VQwDataElement::kDerived, kRegTypeAsym, kRegTypeDiff, kRegTypeMps, QwMessage, QwWarning, and VQwDataElement::SetElementName().
Int_t QwRegression::ConnectChannels | ( | QwSubsystemArrayParity & | asym, |
QwSubsystemArrayParity & | diff | ||
) |
Connect to Channels (asymmetry/difference only)
Connect to the dependent and independent channels
asym | Asymmetry event structure |
diff | Difference event structure |
Fill vector of pointers to the relevant data elements
Definition at line 328 of file QwRegression.cc.
References QwLog::endl(), fDependentName, fDependentType, fDependentVar, fDependentVarType, fEnableRegression, fIndependentName, fIndependentType, fIndependentVar, fSensitivity, VQwDataElement::GetElementName(), VQwDataElement::kDerived, kRegTypeAsym, kRegTypeDiff, kRegTypeMps, QwMessage, QwWarning, QwSubsystemArray::ReturnInternalValue(), and VQwDataElement::SetElementName().
|
inline |
Construct the tree and vector for this subsystem.
Definition at line 74 of file QwRegression.h.
Referenced by QwRegressionSubsystem::ConstructBranchAndVector().
void QwRegression::ConstructBranchAndVector | ( | TTree * | tree, |
TString & | prefix, | ||
std::vector< Double_t > & | values | ||
) |
Construct a branch and vector for this subsystem with a prefix.
Construct the branch and tree vector
tree | Tree |
prefix | Prefix |
values | Vector of values |
Definition at line 584 of file QwRegression.cc.
References fDependentVar.
|
static |
Define the configuration options.
Defines configuration options using QwOptions functionality.
options | Options object |
Definition at line 514 of file QwRegression.cc.
References QwOptions::AddOptions().
Referenced by DefineOptionsParity().
void QwRegression::FillDB | ( | QwParityDB * | db, |
TString | datatype | ||
) |
Definition at line 640 of file QwRegression.cc.
References QwDatabase::Connect(), QwDBInterface::DetermineMeasurementTypeID(), QwDatabase::Disconnect(), QwLog::endl(), fDependentVar, fEnableRegression, QwParityDB::GetAnalysisID(), QwDBInterface::kQwDBI_BeamTable, QwDBInterface::kQwDBI_LumiTable, QwDBInterface::kQwDBI_MDTable, QwDBInterface::kQwDBI_OtherTable, QwDatabase::Query(), QwDebug, QwError, and QwMessage.
Referenced by main().
void QwRegression::FillTreeVector | ( | std::vector< Double_t > & | values | ) | const |
Fill the vector for this subsystem.
Fill the tree vector
values | Vector of values |
Definition at line 600 of file QwRegression.cc.
References fDependentVar.
Referenced by QwRegressionSubsystem::FillTreeVector().
void QwRegression::LinearRegression | ( | EQwRegType | type | ) |
Linear regression.
Do the linear regression.
Definition at line 536 of file QwRegression.cc.
References QwLog::endl(), fDependentVar, fDependentVarType, fEnableRegression, fErrorFlag, fHelicityPattern, fIndependentVar, fSubsystemArray, QwSubsystemArrayParity::GetEventcutErrorFlag(), QwHelicityPattern::GetEventcutErrorFlag(), QwDebug, and QwError.
Referenced by QwRegressionSubsystem::LinearRegression(), and main().
Int_t QwRegression::LoadChannelMap | ( | const std::string & | mapfile | ) |
Load the channels and sensitivities.
Load the channel map
mapfile | Filename of map file |
Definition at line 152 of file QwRegression.cc.
References QwLog::endl(), fDependentName, fDependentType, fEnableRegression, fIndependentName, fIndependentType, fSensitivity, QwParameterFile::GetNextToken(), QwParameterFile::LineHasSectionHeader(), QwParameterFile::LineIsEmpty(), ParseRegressionVariable(), QwError, QwParameterFile::ReadNextLine(), QwParameterFile::ReadNextSection(), QwParameterFile::TrimComment(), QwParameterFile::TrimSectionHeader(), and QwParameterFile::TrimWhitespace().
Referenced by QwRegression().
|
protected |
Parse regression variable in type and name.
Parse the variable type and name from a section header
variable | String with variable type and name |
Definition at line 120 of file QwRegression.cc.
References kRegTypeAsym, kRegTypeDiff, kRegTypeMps, and kRegTypeUnknown.
Referenced by LoadChannelMap().
void QwRegression::PrintValue | ( | ) | const |
Definition at line 632 of file QwRegression.cc.
References QwLog::endl(), fDependentVar, and QwMessage.
Referenced by main(), and QwRegressionSubsystem::PrintValue().
void QwRegression::ProcessOptions | ( | QwOptions & | options | ) |
Process the configuration options.
Process configuration options using QwOptions functionality.
options | Options object |
Definition at line 528 of file QwRegression.cc.
References fEnableRegression, fRegressionMapFile, and QwOptions::GetValue().
Referenced by QwRegressionSubsystem::ProcessOptions(), and QwRegression().
|
protected |
Definition at line 115 of file QwRegression.h.
Referenced by ConnectChannels(), and LoadChannelMap().
|
protected |
List of channels to use in the regression.
Definition at line 114 of file QwRegression.h.
Referenced by ConnectChannels(), and LoadChannelMap().
|
protected |
Definition at line 121 of file QwRegression.h.
Referenced by AccumulateRunningSum(), CalculateRunningAverage(), QwRegressionSubsystem::ClearEventData(), ConnectChannels(), QwRegressionSubsystem::ConstructBranch(), ConstructBranchAndVector(), QwRegressionSubsystem::ConstructHistograms(), QwRegressionSubsystem::DeaccumulateRunningSum(), QwRegressionSubsystem::DeleteHistograms(), FillDB(), QwRegressionSubsystem::FillHistograms(), FillTreeVector(), LinearRegression(), QwRegressionSubsystem::operator*=(), QwRegressionSubsystem::operator+=(), QwRegressionSubsystem::operator-=(), QwRegressionSubsystem::operator/=(), QwRegressionSubsystem::operator=(), PrintValue(), QwRegression(), QwRegressionSubsystem::Scale(), and ~QwRegression().
|
protected |
Definition at line 120 of file QwRegression.h.
Referenced by ConnectChannels(), LinearRegression(), and QwRegression().
|
protected |
Flag to enable regression.
Definition at line 94 of file QwRegression.h.
Referenced by ConnectChannels(), FillDB(), LinearRegression(), LoadChannelMap(), ProcessOptions(), and QwRegression().
|
protected |
Definition at line 108 of file QwRegression.h.
Referenced by AccumulateRunningSum(), and LinearRegression().
|
protected |
Helicity pattern pointer.
Definition at line 106 of file QwRegression.h.
Referenced by LinearRegression(), and QwRegression().
|
protected |
Definition at line 117 of file QwRegression.h.
Referenced by ConnectChannels(), and LoadChannelMap().
|
protected |
Definition at line 116 of file QwRegression.h.
Referenced by ConnectChannels(), and LoadChannelMap().
|
protected |
Definition at line 122 of file QwRegression.h.
Referenced by ConnectChannels(), and LinearRegression().
|
protected |
Regression dependent and independent variable map.
Definition at line 101 of file QwRegression.h.
Referenced by ProcessOptions(), and QwRegression().
|
protected |
Definition at line 118 of file QwRegression.h.
Referenced by ConnectChannels(), and LoadChannelMap().
|
protected |
Single event pointer.
Definition at line 104 of file QwRegression.h.
Referenced by LinearRegression(), and QwRegression().