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 27 of file QwExtractor.cc.

28: VQwDataHandler(name)
29{
30 ParseSeparator = ":";
31 fKeepRunningSum = kTRUE;
32 fTreeName = "bmw";
33 fTreeComment = "BMOD Extractor";
34 fErrorFlagMask = 0x9000;
36
37}
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 39 of file QwExtractor.cc.

40: VQwDataHandler(source)
41{
42 fErrorFlagMask = 0x9000;
44}

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 47 of file QwExtractor.cc.

47{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 52 of file QwExtractor.cc.

53{
54 // Keep a pointer to the source Detectors/RingOutput
55 //fSourcePointer = &event;
56 SetPointer(&event);
57 fSourceCopy = new QwSubsystemArrayParity(event);
58 // Make a copy of RingOutput
59 // Normal ConnectChannels for the test variable/ErrorFlag
60 // Store error flag pointer
61 QwMessage << "Using event error flag" << QwLog::endl;
62 fErrorFlagPointer = event.GetEventcutErrorFlagPointer();
63 return 0;
64}
#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 66 of file QwExtractor.cc.

70{
71 // Check if tree name is specified
72 if (fTreeName == "") {
73 QwWarning << "QwCorrelator: no tree name specified, use 'tree-name = value'" << QwLog::endl;
74 return;
75 }
76
77 // Construct tree name and create new tree
78 fTreeName = treeprefix + fTreeName;
80 //fTree = treerootfile->GetTree(fTreeName);
81}
#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 101 of file QwExtractor.cc.

102{
103 if (fTreeName.size()>0 && fLocalFlag == 1 ){
104 //QwMessage << fLocalFlag << " passed mask " << "0x" << std::hex<< fErrorFlagMask << std::dec << QwLog::endl;
105 treerootfile->FillTreeBranches(*fSourceCopy);
106 treerootfile->FillTree(fTreeName);
107 }
108 //else {
109 // QwMessage << fLocalFlag << " failed mask " << "0x" << fErrorFlagMask << std::dec << QwLog::endl;
110 //}
111}
Int_t FillTree(const std::string &name)
Fill the tree with name.
Definition QwRootFile.h:955
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 49 of file QwExtractor.cc.

49{return 0;}

◆ ProcessData()

void QwExtractor::ProcessData ( )
overridevirtual

Copy dependent variables to output variables (default processing).

Reimplemented from VQwDataHandler.

Definition at line 83 of file QwExtractor.cc.

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

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: