JAPAn
Just Another Parity Analyzer
|
Data handler computing correlations and linear-regression coefficients. More...
#include <QwCorrelator.h>
Public Member Functions | |
QwCorrelator (const TString &name) | |
Constructor with name. | |
QwCorrelator (const QwCorrelator &name) | |
~QwCorrelator () override | |
void | ProcessOptions (QwOptions &options) |
void | ParseConfigFile (QwParameterFile &file) override |
Int_t | LoadChannelMap (const std::string &mapfile) override |
Int_t | ConnectChannels (QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) override |
Connect to Channels (asymmetry/difference only) | |
void | ProcessData () override |
void | FinishDataHandler () override |
void | CalcCorrelations () |
void | ConstructTreeBranches (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="") override |
Construct the tree branches. | |
void | FillTreeBranches (QwRootFile *treerootfile) override |
Fill the tree branches. | |
void | ConstructHistograms (TDirectory *folder, TString &prefix) override |
Construct the histograms in a folder with a prefix. | |
void | FillHistograms () override |
Fill the histograms. | |
void | ClearEventData () override |
void | AccumulateRunningSum (VQwDataHandler &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override |
![]() | |
VQwDataHandler (const TString &name) | |
VQwDataHandler (const VQwDataHandler &source) | |
void | SetPointer (QwHelicityPattern *ptr) |
void | SetPointer (QwSubsystemArrayParity *ptr) |
virtual Int_t | ConnectChannels (QwSubsystemArrayParity &, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) |
virtual Int_t | ConnectChannels (QwSubsystemArrayParity &) |
Int_t | ConnectChannels (QwHelicityPattern &helicitypattern) |
virtual void | UpdateBurstCounter (Short_t burstcounter) |
~VQwDataHandler () override | |
TString | GetName () |
void | InitRunningSum () |
void | AccumulateRunningSum () |
void | CalculateRunningAverage () |
void | PrintValue () const |
void | WritePromptSummary (QwPromptSummary *ps, TString type) |
virtual void | ConstructNTupleFields (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="") |
RNTuple methods. | |
virtual void | FillNTupleFields (QwRootFile *treerootfile) |
void | FillTreeVector (QwRootTreeBranchVector &values) const |
void | ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) |
void | SetRunLabel (TString x) |
Int_t | LoadChannelMap () |
Bool_t | PublishInternalValues () const override |
Publish all variables of the subsystem. | |
Bool_t | PublishByRequest (TString device_name) override |
Try to publish an internal variable matching the submitted name. | |
![]() | |
MQwPublishable_child () | |
Default constructor Initializes the child object and sets up self-reference for publishing. | |
MQwPublishable_child (const MQwPublishable_child &source) | |
Copy constructor. | |
virtual | ~MQwPublishable_child () |
Virtual destructor. | |
void | SetParent (QwDataHandlerArray *parent) |
Set the parent container for this child object. | |
QwDataHandlerArray * | GetParent () const |
Get the parent container for this child object. | |
![]() | |
~MQwCloneable () override | |
Virtual destructor. | |
VQwDataHandler * | Clone () const override |
Concrete clone method. | |
const VQwFactory< VQwDataHandler > * | Factory () const override |
Factory getter. | |
![]() | |
virtual | ~VQwCloneable () |
Virtual destructor. | |
std::string | GetClassName () const |
Get demangled name of this class. | |
Static Public Member Functions | |
static void | DefineOptions (QwOptions &options) |
![]() | |
static VQwDataHandler * | Create (const std::string &name) |
Object creation. | |
static QwCorrelator * | Cast (QwCorrelator *type) |
Object dynamic cast. | |
Protected Member Functions | |
void | OpenAlphaFile (const std::string &prefix) |
void | WriteAlphaFile () |
void | CloseAlphaFile () |
void | OpenAliasFile (const std::string &prefix) |
void | WriteAliasFile () |
void | CloseAliasFile () |
![]() | |
VQwDataHandler () | |
void | SetEventcutErrorFlagPointer (const UInt_t *errorflagptr) |
UInt_t | GetEventcutErrorFlag () const |
std::pair< EQwHandleType, std::string > | ParseHandledVariable (const std::string &variable) |
void | CalcOneOutput (const VQwHardwareChannel *dv, VQwHardwareChannel *output, std::vector< const VQwHardwareChannel * > &ivs, std::vector< Double_t > &sens) |
![]() | |
Bool_t | RequestExternalValue (const TString &name, VQwHardwareChannel *value) const |
Retrieve the variable name from other subsystem arrays Get the value corresponding to some variable name from a different data array. | |
const VQwHardwareChannel * | RequestExternalPointer (const TString &name) const |
Retrieve a pointer to an external variable by name Requests a direct pointer to a variable from sibling subsystems via the parent container. | |
Bool_t | PublishInternalValue (const TString name, const TString desc, const VQwHardwareChannel *element) const |
Publish a variable from this child into the parent container. | |
Protected Attributes | |
Int_t | fBlock |
bool | fDisableHistos |
std::vector< std::string > | fIndependentFull |
std::vector< EQwHandleType > | fIndependentType |
std::vector< std::string > | fIndependentName |
std::vector< const VQwHardwareChannel * > | fIndependentVar |
std::vector< Double_t > | fIndependentValues |
std::string | fAlphaOutputFileBase |
std::string | fAlphaOutputFileSuff |
std::string | fAlphaOutputPath |
TFile * | fAlphaOutputFile |
TTree * | fTree |
std::string | fAliasOutputFileBase |
std::string | fAliasOutputFileSuff |
std::string | fAliasOutputPath |
std::ofstream | fAliasOutputFile |
int | fTotalCount |
int | fGoodCount |
int | fErrCounts_EF |
std::vector< int > | fErrCounts_IV |
std::vector< int > | fErrCounts_DV |
unsigned int | fGoodEvent |
![]() | |
Int_t | fPriority |
Short_t | fBurstCounter |
When a datahandler array is processed, handlers with lower priority will be processed before handlers with higher priority. | |
TString | fName |
std::string | fMapFile |
std::string | fTreeName |
std::string | fTreeComment |
std::string | fPrefix |
TString | run_label |
const UInt_t * | fErrorFlagPtr |
Error flag pointer. | |
QwSubsystemArrayParity * | fSubsystemArray |
Single event pointer. | |
QwHelicityPattern * | fHelicityPattern |
Helicity pattern pointer. | |
std::vector< std::string > | fDependentFull |
std::vector< EQwHandleType > | fDependentType |
std::vector< std::string > | fDependentName |
std::vector< const VQwHardwareChannel * > | fDependentVar |
std::vector< Double_t > | fDependentValues |
std::vector< VQwHardwareChannel * > | fOutputVar |
std::vector< Double_t > | fOutputValues |
std::vector< std::vector< TString > > | fPublishList |
std::string | ParseSeparator |
Bool_t | fKeepRunningSum |
Bool_t | fRunningsumFillsTree |
VQwDataHandler * | fRunningsum |
Private Member Functions | |
QwCorrelator () | |
Private Attributes | |
TString | fNameNoSpaces |
int | nP |
int | nY |
std::vector< TH1D > | fHnames |
std::vector< TH1D > | fH1iv |
std::vector< TH1D > | fH1dv |
std::vector< std::vector< TH2D > > | fH2iv |
std::vector< std::vector< TH2D > > | fH2dv |
LinRegBevPeb | linReg |
Int_t | fCycleCounter |
Static Private Attributes | |
static bool | fPrintCorrelations = false |
Additional Inherited Members | |
![]() | |
enum | EQwHandleType { kHandleTypeUnknown =0 , kHandleTypeMps , kHandleTypeAsym , kHandleTypeDiff , kHandleTypeYield } |
typedef std::vector< VQwHardwareChannel * >::iterator | Iterator_HdwChan |
typedef std::vector< VQwHardwareChannel * >::const_iterator | ConstIterator_HdwChan |
Data handler computing correlations and linear-regression coefficients.
Uses Bevington/Pebay algorithms to estimate correlations between independent and dependent variables selected from subsystem arrays. Produces summary histograms and optional output trees/files for further analysis.
Definition at line 33 of file QwCorrelator.h.
QwCorrelator::QwCorrelator | ( | const TString & | name | ) |
Constructor with name.
Definition at line 31 of file QwCorrelator.cc.
References ClearEventData(), fAliasOutputFileBase, fAliasOutputFileSuff, fAliasOutputPath, fAlphaOutputFile, fAlphaOutputFileBase, fAlphaOutputFileSuff, fAlphaOutputPath, fBlock, fCycleCounter, fDisableHistos, fNameNoSpaces, fTree, VQwDataHandler::fTreeComment, VQwDataHandler::fTreeName, nP, nY, VQwDataHandler::ParseSeparator, and VQwDataHandler::VQwDataHandler().
Referenced by AccumulateRunningSum(), and QwCorrelator().
QwCorrelator::QwCorrelator | ( | const QwCorrelator & | name | ) |
Definition at line 58 of file QwCorrelator.cc.
References ClearEventData(), QwLog::endl(), fAliasOutputFileBase, fAliasOutputFileSuff, fAliasOutputPath, fAlphaOutputFile, fAlphaOutputFileBase, fAlphaOutputFileSuff, fAlphaOutputPath, fBlock, fCycleCounter, fDisableHistos, fTree, nP, nY, QwCorrelator(), QwWarning, and VQwDataHandler::VQwDataHandler().
|
override |
Definition at line 79 of file QwCorrelator.cc.
References CloseAliasFile(), and CloseAlphaFile().
|
private |
|
overridevirtual |
Reimplemented from VQwDataHandler.
Definition at line 163 of file QwCorrelator.cc.
References QwLog::endl(), linReg, QwCorrelator(), QwWarning, and VQwDataHandler::VQwDataHandler().
void QwCorrelator::CalcCorrelations | ( | ) |
Definition at line 175 of file QwCorrelator.cc.
References QwLog::endl(), VQwDataHandler::fDependentVar, fErrCounts_DV, fErrCounts_EF, fErrCounts_IV, fGoodCount, fIndependentVar, fPrintCorrelations, fTotalCount, fTree, VQwDataHandler::GetName(), linReg, nP, nY, QwMessage, QwVerbose, QwWarning, WriteAliasFile(), and WriteAlphaFile().
Referenced by FinishDataHandler().
|
overridevirtual |
Reimplemented from VQwDataHandler.
Definition at line 147 of file QwCorrelator.cc.
References fErrCounts_DV, fErrCounts_EF, fErrCounts_IV, fGoodCount, fGoodEvent, fTotalCount, and linReg.
Referenced by QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 688 of file QwCorrelator.cc.
References QwLog::endl(), fAliasOutputFile, and QwWarning.
Referenced by ~QwCorrelator().
|
protected |
Definition at line 679 of file QwCorrelator.cc.
References fAlphaOutputFile.
Referenced by ~QwCorrelator().
|
overridevirtual |
Connect to Channels (asymmetry/difference only)
asym | Subsystem array with asymmetries |
diff | Subsystem array with differences |
Fill vector of pointers to the relevant data elements
Reimplemented from VQwDataHandler.
Definition at line 290 of file QwCorrelator.cc.
References QwLog::endl(), VQwDataHandler::fDependentFull, VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, VQwDataHandler::fDependentValues, VQwDataHandler::fDependentVar, fErrCounts_DV, fErrCounts_IV, fIndependentFull, fIndependentName, fIndependentType, fIndependentValues, fIndependentVar, QwSubsystemArrayParity::GetEventcutErrorFlagPointer(), VQwDataHandler::kHandleTypeAsym, VQwDataHandler::kHandleTypeDiff, VQwDataHandler::kHandleTypeMps, linReg, nP, nY, QwWarning, MQwPublishable< U, T >::RequestExternalPointer(), MQwPublishable_child< QwDataHandlerArray, VQwDataHandler >::RequestExternalPointer(), and VQwDataHandler::SetEventcutErrorFlagPointer().
|
overridevirtual |
Construct the histograms in a folder with a prefix.
Reimplemented from VQwDataHandler.
Definition at line 471 of file QwCorrelator.cc.
References VQwDataHandler::fDependentName, fDisableHistos, fH1dv, fH1iv, fH2dv, fH2iv, fHnames, fIndependentName, VQwDataHandler::fName, nP, and nY.
|
overridevirtual |
Construct the tree branches.
Reimplemented from VQwDataHandler.
Definition at line 383 of file QwCorrelator.cc.
References QwLog::endl(), fGoodCount, fTotalCount, fTree, VQwDataHandler::fTreeComment, VQwDataHandler::fTreeName, QwRootFile::GetTree(), linReg, QwRootFile::NewTree(), nP, nY, OpenAliasFile(), OpenAlphaFile(), and QwWarning.
|
static |
Definition at line 86 of file QwCorrelator.cc.
References QwOptions::AddOptions(), and fPrintCorrelations.
Referenced by DefineOptionsParity().
|
overridevirtual |
Fill the histograms.
Reimplemented from VQwDataHandler.
Definition at line 555 of file QwCorrelator.cc.
References VQwDataHandler::fDependentValues, fDisableHistos, fGoodEvent, fH1dv, fH1iv, fH2dv, fH2iv, fIndependentValues, nP, and nY.
|
inlineoverridevirtual |
Fill the tree branches.
Reimplemented from VQwDataHandler.
Definition at line 69 of file QwCorrelator.h.
|
inlineoverridevirtual |
Reimplemented from VQwDataHandler.
Definition at line 58 of file QwCorrelator.h.
References CalcCorrelations().
|
overridevirtual |
Load the channel map
mapfile | Filename of map file |
Reimplemented from VQwDataHandler.
Definition at line 248 of file QwCorrelator.cc.
References QwLog::endl(), VQwDataHandler::fDependentFull, VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, fIndependentFull, fIndependentName, fIndependentType, QwParameterFile::GetNextToken(), QwParameterFile::LineIsEmpty(), VQwDataHandler::ParseHandledVariable(), QwError, QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().
|
protected |
Definition at line 661 of file QwCorrelator.cc.
References QwLog::endl(), fAliasOutputFile, fAliasOutputFileBase, fAliasOutputFileSuff, fAliasOutputPath, QwWarning, and VQwDataHandler::run_label.
Referenced by ConstructTreeBranches().
|
protected |
Definition at line 647 of file QwCorrelator.cc.
References QwLog::endl(), fAlphaOutputFile, fAlphaOutputFileBase, fAlphaOutputFileSuff, fAlphaOutputPath, QwError, and VQwDataHandler::run_label.
Referenced by ConstructTreeBranches().
|
overridevirtual |
Parse configuration file for map file, priority, tree settings.
Reimplemented from VQwDataHandler.
Definition at line 97 of file QwCorrelator.cc.
References QwLog::endl(), fAliasOutputFileBase, fAliasOutputFileSuff, fAliasOutputPath, fAlphaOutputFileBase, fAlphaOutputFileSuff, fAlphaOutputPath, fBlock, fDisableHistos, VQwDataHandler::ParseConfigFile(), QwParameterFile::PopValue(), and QwWarning.
|
overridevirtual |
Copy dependent variables to output variables (default processing).
Reimplemented from VQwDataHandler.
Definition at line 113 of file QwCorrelator.cc.
References fBlock, VQwDataHandler::fDependentValues, VQwDataHandler::fDependentVar, fErrCounts_DV, fErrCounts_EF, fErrCounts_IV, fGoodCount, fGoodEvent, fIndependentValues, fIndependentVar, fTotalCount, VQwDataHandler::GetEventcutErrorFlag(), and linReg.
void QwCorrelator::ProcessOptions | ( | QwOptions & | options | ) |
Definition at line 93 of file QwCorrelator.cc.
|
protected |
Definition at line 699 of file QwCorrelator.cc.
References QwLog::endl(), fAliasOutputFile, fCycleCounter, VQwDataHandler::fDependentFull, fIndependentFull, linReg, nP, nY, and QwWarning.
Referenced by CalcCorrelations().
|
protected |
Definition at line 581 of file QwCorrelator.cc.
References fAlphaOutputFile, VQwDataHandler::fDependentFull, fIndependentFull, linReg, nP, and nY.
Referenced by CalcCorrelations().
|
protected |
Definition at line 107 of file QwCorrelator.h.
Referenced by CloseAliasFile(), OpenAliasFile(), and WriteAliasFile().
|
protected |
Definition at line 104 of file QwCorrelator.h.
Referenced by OpenAliasFile(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 105 of file QwCorrelator.h.
Referenced by OpenAliasFile(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 106 of file QwCorrelator.h.
Referenced by OpenAliasFile(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 97 of file QwCorrelator.h.
Referenced by CloseAlphaFile(), OpenAlphaFile(), QwCorrelator(), QwCorrelator(), and WriteAlphaFile().
|
protected |
Definition at line 94 of file QwCorrelator.h.
Referenced by OpenAlphaFile(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 95 of file QwCorrelator.h.
Referenced by OpenAlphaFile(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 96 of file QwCorrelator.h.
Referenced by OpenAlphaFile(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 81 of file QwCorrelator.h.
Referenced by ParseConfigFile(), ProcessData(), QwCorrelator(), and QwCorrelator().
|
private |
Definition at line 135 of file QwCorrelator.h.
Referenced by QwCorrelator(), QwCorrelator(), and WriteAliasFile().
|
protected |
Definition at line 83 of file QwCorrelator.h.
Referenced by ConstructHistograms(), FillHistograms(), ParseConfigFile(), QwCorrelator(), and QwCorrelator().
|
protected |
Definition at line 117 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ClearEventData(), ConnectChannels(), and ProcessData().
|
protected |
Definition at line 115 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ClearEventData(), and ProcessData().
|
protected |
Definition at line 116 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ClearEventData(), ConnectChannels(), and ProcessData().
|
protected |
Definition at line 113 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ClearEventData(), ConstructTreeBranches(), and ProcessData().
|
protected |
Definition at line 119 of file QwCorrelator.h.
Referenced by ClearEventData(), FillHistograms(), and ProcessData().
|
private |
Definition at line 129 of file QwCorrelator.h.
Referenced by ConstructHistograms(), and FillHistograms().
|
private |
Definition at line 128 of file QwCorrelator.h.
Referenced by ConstructHistograms(), and FillHistograms().
|
private |
Definition at line 131 of file QwCorrelator.h.
Referenced by ConstructHistograms(), and FillHistograms().
|
private |
Definition at line 130 of file QwCorrelator.h.
Referenced by ConstructHistograms(), and FillHistograms().
|
private |
Definition at line 127 of file QwCorrelator.h.
Referenced by ConstructHistograms().
|
protected |
Definition at line 85 of file QwCorrelator.h.
Referenced by ConnectChannels(), LoadChannelMap(), WriteAliasFile(), and WriteAlphaFile().
|
protected |
Definition at line 89 of file QwCorrelator.h.
Referenced by ConnectChannels(), ConstructHistograms(), and LoadChannelMap().
|
protected |
Definition at line 88 of file QwCorrelator.h.
Referenced by ConnectChannels(), and LoadChannelMap().
|
protected |
Definition at line 92 of file QwCorrelator.h.
Referenced by ConnectChannels(), FillHistograms(), and ProcessData().
|
protected |
Definition at line 91 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ConnectChannels(), and ProcessData().
|
private |
Definition at line 123 of file QwCorrelator.h.
Referenced by QwCorrelator().
|
staticprivate |
Definition at line 42 of file QwCorrelator.h.
Referenced by CalcCorrelations(), DefineOptions(), and REGISTER_DATA_HANDLER_FACTORY().
|
protected |
Definition at line 112 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ClearEventData(), ConstructTreeBranches(), and ProcessData().
|
protected |
Definition at line 102 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ConstructTreeBranches(), QwCorrelator(), and QwCorrelator().
|
private |
Definition at line 133 of file QwCorrelator.h.
Referenced by AccumulateRunningSum(), CalcCorrelations(), ClearEventData(), ConnectChannels(), ConstructTreeBranches(), ProcessData(), WriteAliasFile(), and WriteAlphaFile().
|
private |
Definition at line 124 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ConnectChannels(), ConstructHistograms(), ConstructTreeBranches(), FillHistograms(), QwCorrelator(), QwCorrelator(), WriteAliasFile(), and WriteAlphaFile().
|
private |
Definition at line 124 of file QwCorrelator.h.
Referenced by CalcCorrelations(), ConnectChannels(), ConstructHistograms(), ConstructTreeBranches(), FillHistograms(), QwCorrelator(), QwCorrelator(), WriteAliasFile(), and WriteAlphaFile().