JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwExtractor Class Reference

Data handler that extracts values into output trees/files. More...

#include <QwExtractor.h>

+ Inheritance diagram for QwExtractor:
+ Collaboration diagram for QwExtractor:

Public Member Functions

 QwExtractor (const TString &name)
 Constructor with name.
 
 QwExtractor (const QwExtractor &source)
 Copy constructor.
 
 ~QwExtractor () override
 Virtual destructor.
 
Int_t LoadChannelMap (const std::string &mapfile) override
 
Int_t ConnectChannels (QwSubsystemArrayParity &event) override
 Connect to channels (event-only extraction).
 
void ConstructTreeBranches (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="") override
 
void ProcessData () override
 
void SetPointer (QwSubsystemArrayParity *ptr)
 
void FillTreeBranches (QwRootFile *treerootfile) override
 
- Public Member Functions inherited from VQwDataHandler
 VQwDataHandler (const TString &name)
 
 VQwDataHandler (const VQwDataHandler &source)
 
virtual void ParseConfigFile (QwParameterFile &file)
 
void SetPointer (QwHelicityPattern *ptr)
 
void SetPointer (QwSubsystemArrayParity *ptr)
 
virtual Int_t ConnectChannels (QwSubsystemArrayParity &, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff)
 
Int_t ConnectChannels (QwHelicityPattern &helicitypattern)
 
virtual void UpdateBurstCounter (Short_t burstcounter)
 
virtual void FinishDataHandler ()
 
 ~VQwDataHandler () override
 
TString GetName ()
 
virtual void ClearEventData ()
 
void InitRunningSum ()
 
void AccumulateRunningSum ()
 
virtual void AccumulateRunningSum (VQwDataHandler &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
 
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)
 
virtual void ConstructHistograms (TDirectory *, TString &)
 Construct the histograms in a folder with a prefix.
 
virtual void FillHistograms ()
 Fill the histograms.
 
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.
 
- Public Member Functions inherited from MQwPublishable_child< QwDataHandlerArray, VQwDataHandler >
 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.
 
QwDataHandlerArrayGetParent () const
 Get the parent container for this child object.
 
- Public Member Functions inherited from MQwCloneable< VQwDataHandler, QwExtractor >
 ~MQwCloneable () override
 Virtual destructor.
 
VQwDataHandlerClone () const override
 Concrete clone method.
 
const VQwFactory< VQwDataHandler > * Factory () const override
 Factory getter.
 
- Public Member Functions inherited from VQwCloneable< VQwDataHandler >
virtual ~VQwCloneable ()
 Virtual destructor.
 
std::string GetClassName () const
 Get demangled name of this class.
 

Protected Attributes

UInt_t fErrorFlagMask
 Default constructor (Protected for child class access)
 
const UInt_t * fErrorFlagPointer
 
Int_t fLocalFlag = 0
 
const QwSubsystemArrayParityfSourcePointer
 
QwSubsystemArrayParityfSourceCopy
 
- Protected Attributes inherited from VQwDataHandler
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.
 
QwSubsystemArrayParityfSubsystemArray
 Single event pointer.
 
QwHelicityPatternfHelicityPattern
 Helicity pattern pointer.
 
std::vector< std::string > fDependentFull
 
std::vector< EQwHandleTypefDependentType
 
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
 
VQwDataHandlerfRunningsum
 

Private Member Functions

 QwExtractor ()
 

Additional Inherited Members

- Public Types inherited from VQwDataHandler
enum  EQwHandleType {
  kHandleTypeUnknown =0 , kHandleTypeMps , kHandleTypeAsym , kHandleTypeDiff ,
  kHandleTypeYield
}
 
typedef std::vector< VQwHardwareChannel * >::iterator Iterator_HdwChan
 
typedef std::vector< VQwHardwareChannel * >::const_iterator ConstIterator_HdwChan
 
- Static Public Member Functions inherited from MQwCloneable< VQwDataHandler, QwExtractor >
static VQwDataHandlerCreate (const std::string &name)
 Object creation.
 
static QwExtractorCast (QwExtractor *type)
 Object dynamic cast.
 
- Protected Member Functions inherited from VQwDataHandler
 VQwDataHandler ()
 
virtual Int_t ConnectChannels (QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff)
 
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)
 
- Protected Member Functions inherited from MQwPublishable_child< QwDataHandlerArray, VQwDataHandler >
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 VQwHardwareChannelRequestExternalPointer (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.
 

Detailed Description

Data handler that extracts values into output trees/files.

Connects to a source subsystem array and publishes selected values (event-level) to ROOT trees for downstream analysis.

Definition at line 21 of file QwExtractor.h.

Constructor & Destructor Documentation

◆ QwExtractor() [1/3]

QwExtractor::QwExtractor ( const TString & name)

Constructor with name.

Definition at line 30 of file QwExtractor.cc.

31: VQwDataHandler(name)
32{
33 ParseSeparator = ":";
34 fKeepRunningSum = kTRUE;
35 fTreeName = "bmw";
36 fTreeComment = "BMOD Extractor";
37 fErrorFlagMask = 0x9000;
39
40}
const UInt_t * fErrorFlagPointer
Definition QwExtractor.h:52
UInt_t fErrorFlagMask
Default constructor (Protected for child class access)
Definition QwExtractor.h:51
std::string ParseSeparator
std::string fTreeComment
std::string fTreeName

References fErrorFlagMask, fErrorFlagPointer, VQwDataHandler::fKeepRunningSum, VQwDataHandler::fTreeComment, VQwDataHandler::fTreeName, VQwDataHandler::ParseSeparator, and VQwDataHandler::VQwDataHandler().

Referenced by QwExtractor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QwExtractor() [2/3]

QwExtractor::QwExtractor ( const QwExtractor & source)

Copy constructor.

Definition at line 42 of file QwExtractor.cc.

43: VQwDataHandler(source)
44{
45 fErrorFlagMask = 0x9000;
47}

References fErrorFlagMask, fErrorFlagPointer, QwExtractor(), and VQwDataHandler::VQwDataHandler().

+ Here is the call graph for this function:

◆ ~QwExtractor()

QwExtractor::~QwExtractor ( )
override

Virtual destructor.

Destructor.

Definition at line 50 of file QwExtractor.cc.

50{delete fSourceCopy;}
QwSubsystemArrayParity * fSourceCopy
Definition QwExtractor.h:56

References fSourceCopy.

◆ QwExtractor() [3/3]

QwExtractor::QwExtractor ( )
private

Member Function Documentation

◆ ConnectChannels()

Int_t QwExtractor::ConnectChannels ( QwSubsystemArrayParity & event)
overridevirtual

Connect to channels (event-only extraction).

Parameters
eventSubsystem array providing per-MPS yields to extract.
Returns
0 on success; non-zero on failure.

Connect to the dependent and independent channels (implementation)

Reimplemented from VQwDataHandler.

Definition at line 55 of file QwExtractor.cc.

56{
57 // Keep a pointer to the source Detectors/RingOutput
58 //fSourcePointer = &event;
59 SetPointer(&event);
60 fSourceCopy = new QwSubsystemArrayParity(event);
61 // Make a copy of RingOutput
62 // Normal ConnectChannels for the test variable/ErrorFlag
63 // Store error flag pointer
64 QwMessage << "Using event error flag" << QwLog::endl;
65 fErrorFlagPointer = event.GetEventcutErrorFlagPointer();
66 return 0;
67}
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
void SetPointer(QwSubsystemArrayParity *ptr)
Definition QwExtractor.h:44

References QwLog::endl(), fErrorFlagPointer, fSourceCopy, QwMessage, and SetPointer().

+ Here is the call graph for this function:

◆ ConstructTreeBranches()

void QwExtractor::ConstructTreeBranches ( QwRootFile * treerootfile,
const std::string & treeprefix = "",
const std::string & branchprefix = "" )
overridevirtual

Construct TTree branches for output variables, using running sum if configured for statistics trees.

Reimplemented from VQwDataHandler.

Definition at line 69 of file QwExtractor.cc.

73{
74 // Check if tree name is specified
75 if (fTreeName == "") {
76 QwWarning << "QwCorrelator: no tree name specified, use 'tree-name = value'" << QwLog::endl;
77 return;
78 }
79
80 // Construct tree name and create new tree
81 fTreeName = treeprefix + fTreeName;
83 //fTree = treerootfile->GetTree(fTreeName);
84}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
void ConstructTreeBranches(const std::string &name, const std::string &desc, T &object, const std::string &prefix="")
Construct the tree branches of a generic object.

References QwRootFile::ConstructTreeBranches(), QwLog::endl(), fSourceCopy, VQwDataHandler::fTreeComment, VQwDataHandler::fTreeName, and QwWarning.

+ Here is the call graph for this function:

◆ FillTreeBranches()

void QwExtractor::FillTreeBranches ( QwRootFile * treerootfile)
overridevirtual

Reimplemented from VQwDataHandler.

Definition at line 104 of file QwExtractor.cc.

105{
106 if (fTreeName.size()>0 && fLocalFlag == 1 ){
107 //QwMessage << fLocalFlag << " passed mask " << "0x" << std::hex<< fErrorFlagMask << std::dec << QwLog::endl;
108 treerootfile->FillTreeBranches(*fSourceCopy);
109 treerootfile->FillTree(fTreeName);
110 }
111 //else {
112 // QwMessage << fLocalFlag << " failed mask " << "0x" << fErrorFlagMask << std::dec << QwLog::endl;
113 //}
114}
Int_t FillTree(const std::string &name)
Fill the tree with name.
Definition QwRootFile.h:949
void FillTreeBranches(const std::string &name, const T &object)
Fill the tree branches of a generic object by tree name.
Int_t fLocalFlag
Definition QwExtractor.h:53

References QwRootFile::FillTree(), QwRootFile::FillTreeBranches(), fLocalFlag, fSourceCopy, and VQwDataHandler::fTreeName.

+ Here is the call graph for this function:

◆ LoadChannelMap()

Int_t QwExtractor::LoadChannelMap ( const std::string & mapfile)
overridevirtual

Reimplemented from VQwDataHandler.

Definition at line 52 of file QwExtractor.cc.

52{return 0;}

◆ ProcessData()

void QwExtractor::ProcessData ( )
overridevirtual

Copy dependent variables to output variables (default processing).

Reimplemented from VQwDataHandler.

Definition at line 86 of file QwExtractor.cc.

87{
88 fLocalFlag = 0;
89 if (fErrorFlagMask!=0 && fErrorFlagPointer!=NULL) {
91 //QwMessage << "0x" << std::hex << *fErrorFlagPointer << " passed mask " << "0x" << std::hex << fErrorFlagMask << std::dec << QwLog::endl;
92 fLocalFlag = 1;
93 fSourceCopy->operator=(*fSourcePointer);
94 }// else {
95 // QwMessage << "0x" << std::hex << *fErrorFlagPointer << " failed mask " << "0x" << std::hex << fErrorFlagMask << std::dec << QwLog::endl;
96 // }
97 }
98 else{
99 fLocalFlag = 1;
100 fSourceCopy->operator=(*fSourcePointer);
101 }
102}

References fErrorFlagMask, fErrorFlagPointer, fLocalFlag, and fSourceCopy.

◆ SetPointer()

void QwExtractor::SetPointer ( QwSubsystemArrayParity * ptr)
inline

Definition at line 44 of file QwExtractor.h.

44{fSourcePointer = ptr;};
const QwSubsystemArrayParity * fSourcePointer
Definition QwExtractor.h:55

References fSourcePointer.

Referenced by ConnectChannels().

+ Here is the caller graph for this function:

Field Documentation

◆ fErrorFlagMask

UInt_t QwExtractor::fErrorFlagMask
protected

Default constructor (Protected for child class access)

Error flag mask

Definition at line 51 of file QwExtractor.h.

Referenced by ProcessData(), QwExtractor(), and QwExtractor().

◆ fErrorFlagPointer

const UInt_t* QwExtractor::fErrorFlagPointer
protected

Definition at line 52 of file QwExtractor.h.

Referenced by ConnectChannels(), ProcessData(), QwExtractor(), and QwExtractor().

◆ fLocalFlag

Int_t QwExtractor::fLocalFlag = 0
protected

Definition at line 53 of file QwExtractor.h.

Referenced by FillTreeBranches(), and ProcessData().

◆ fSourceCopy

QwSubsystemArrayParity* QwExtractor::fSourceCopy
protected

◆ fSourcePointer

const QwSubsystemArrayParity* QwExtractor::fSourcePointer
protected

Definition at line 55 of file QwExtractor.h.

Referenced by SetPointer().


The documentation for this class was generated from the following files: