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

Container for managing multiple subsystems with common operations. More...

#include <QwSubsystemArray.h>

+ Inheritance diagram for QwSubsystemArray:
+ Collaboration diagram for QwSubsystemArray:

Public Types

typedef Bool_t(* CanContainFn) (VQwSubsystem *)
 

Public Member Functions

 QwSubsystemArray (QwOptions &options, CanContainFn myCanContain)
 Constructor with options.
 
 QwSubsystemArray (const QwSubsystemArray &source)
 Copy constructor by reference.
 
 ~QwSubsystemArray () override
 Virtual destructor.
 
QwSubsystemArrayoperator= (const QwSubsystemArray &value)
 Assignment operator.
 
void SetCodaRunNumber (UInt_t runnum)
 Set the internal record of the CODA run number.
 
void SetCodaSegmentNumber (UInt_t segnum)
 Set the internal record of the CODA segment number.
 
void SetCodaEventNumber (UInt_t evtnum)
 Set the internal record of the CODA event number.
 
void SetCodaEventType (UInt_t evttype)
 Set the internal record of the CODA event type.
 
UInt_t GetCodaRunNumber () const
 Get the internal record of the CODA run number.
 
UInt_t GetCodaSegmentNumber () const
 Get the internal record of the CODA segment number.
 
UInt_t GetCodaEventNumber () const
 Get the internal record of the CODA event number.
 
UInt_t GetCodaEventType () const
 Get the internal record of the CODA event type.
 
void SetCleanParameters (Double_t cleanparameter[3])
 Set the internal record of the CODA event number.
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask.
 
UInt_t GetEventTypeMask () const
 Get event type mask.
 
UInt_t UpdateEventTypeMask ()
 Update the event type mask from the subsystems.
 
void SetDataLoaded (const Bool_t flag)
 Set data loaded flag.
 
Bool_t HasDataLoaded () const
 Get data loaded flag.
 
void ProcessOptionsToplevel (QwOptions &options)
 Process configuration options for the subsystem array itself.
 
void ProcessOptionsSubsystems (QwOptions &options)
 Process configuration options for all subsystems in the array.
 
void ProcessOptions (QwOptions &options)
 Process configuration options (default behavior)
 
void LoadAllEventRanges (QwOptions &options)
 
void push_back (VQwSubsystem *subsys)
 Add the subsystem to this array.
 
virtual VQwSubsystemGetSubsystemByName (const TString &name)
 Get the subsystem with the specified name.
 
virtual std::vector< VQwSubsystem * > GetSubsystemByType (const std::string &type)
 Get the list of subsystems of the specified type.
 
void ClearEventData ()
 
Int_t ProcessConfigurationBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)
 Process the event buffer for configuration events.
 
Int_t ProcessEvBuffer (const UInt_t event_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)
 Process the event buffer for events.
 
void GetROCIDList (std::vector< ROCID_t > &list)
 Get the ROCID list.
 
void ProcessEvent ()
 Process the decoded data in this event.
 
void AtEndOfEventLoop ()
 Perform actions at the end of the event loop.
 
void PrintParamFileList () const
 Print list of parameter files.
 
TList * GetParamFileNameList (TString name) const
 Get list of parameter files.
 
Object construction and maintenance
void ConstructObjects ()
 Construct the objects for this subsystem.
 
void ConstructObjects (TDirectory *folder)
 Construct the objects for this subsystem in a folder.
 
void ConstructObjects (TDirectory *folder, TString &prefix)
 Construct the objects for this subsystem in a folder with a prefix.
 
Histogram construction and maintenance
void ConstructHistograms ()
 Construct the histograms for this subsystem.
 
void ConstructHistograms (TDirectory *folder)
 Construct the histograms for this subsystem in a folder.
 
void ConstructHistograms (TDirectory *folder, TString &prefix)
 Construct the histograms for this subsystem in a folder with a prefix.
 
void FillHistograms ()
 Fill the histograms for this subsystem.
 
void ShareHistograms (const QwSubsystemArray &source)
 Share the histograms with another subsystem.
 
Tree and vector construction and maintenance
void ConstructBranchAndVector (TTree *tree, QwRootTreeBranchVector &values)
 Construct the tree and vector for this subsystem.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
 Construct a branch and vector for this subsystem with a prefix.
 
void ConstructBranch (TTree *tree, TString &prefix)
 Construct a branch for this subsystem with a prefix.
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)
 Construct a branch for this subsystem with a prefix after tree leave trimming.
 
void FillTreeVector (QwRootTreeBranchVector &values) const
 Fill the vector for this subsystem.
 
- Public Member Functions inherited from MQwPublishable< QwSubsystemArray, VQwSubsystem >
 MQwPublishable ()
 Default constructor Initializes empty variable publishing maps.
 
 MQwPublishable (const MQwPublishable &source)
 Copy constructor Creates a new container with cleared publishing maps (variables are not copied).
 
virtual ~MQwPublishable ()
 Virtual destructor.
 
Bool_t RequestExternalValue (const TString &name, VQwHardwareChannel *value) const
 Retrieve a variable value from external sources by copying Searches for the named variable in external subsystem arrays and copies its value into the provided data element.
 
const VQwHardwareChannelRequestExternalPointer (const TString &name) const
 Retrieve a direct pointer to an external variable Searches for the named variable in external subsystem arrays and returns a direct pointer to the data element.
 
virtual const VQwHardwareChannelReturnInternalValue (const TString &name) const
 Retrieve an internal variable by name (pointer version) Searches for the named variable among published internal variables and returns a direct pointer to the data element.
 
Bool_t ReturnInternalValue (const TString &name, VQwHardwareChannel *value) const
 Retrieve an internal variable by name (copy version) Searches for the named variable among published internal variables and copies its value into the provided data element.
 
void ListPublishedValues () const
 List all published variables with descriptions Prints a summary of all currently published variables and their descriptions to the logging output for debugging and inspection purposes.
 
Bool_t PublishInternalValue (const TString name, const TString desc, const VQwSubsystem *subsys, const VQwHardwareChannel *element)
 Publish an internal variable from a subsystem Registers a variable from one of the contained subsystems in the publishing framework, making it available for external access by name.
 

Static Public Member Functions

static void DefineOptions (QwOptions &options)
 Define configuration options for global array.
 

Private Types

typedef std::vector< std::shared_ptr< VQwSubsystem > > SubsysPtrs
 

Private Member Functions

 QwSubsystemArray ()
 Private default constructor.
 

Tree construction and maintenance

These functions are not purely virtual, since not every subsystem is expected to implement them. They are intended for expert output to trees.

size_t fTreeArrayIndex
 
UInt_t fCodaRunNumber
 Index of this data element in root tree.
 
UInt_t fCodaSegmentNumber
 CODA segment number as provided by QwEventBuffer.
 
UInt_t fCodaEventNumber
 CODA event number as provided by QwEventBuffer.
 
UInt_t fCodaEventType
 CODA event type as provided by QwEventBuffer.
 
Double_t fCleanParameter [3]
 
UInt_t fEventTypeMask
 Mask of event types.
 
Bool_t fHasDataLoaded
 Has this array gotten data to be processed?
 
CanContainFn fnCanContain
 Function to determine which subsystems we can accept.
 
std::vector< std::pair< UInt_t, UInt_t > > fBadEventRange
 
double fWindowPeriod
 
std::string fSubsystemsMapFile
 Filename of the global detector map.
 
std::vector< std::string > fSubsystemsDisabledByName
 List of disabled types.
 
std::vector< std::string > fSubsystemsDisabledByType
 List of disabled names.
 
void ConstructTree ()
 Construct the tree for this subsystem.
 
void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder.
 
void ConstructTree (TDirectory *folder, TString &prefix)
 Construct the tree for this subsystem in a folder with a prefix.
 
void FillTree ()
 Fill the tree for this subsystem.
 
void DeleteTree ()
 Delete the tree for this subsystem.
 
void PrintInfo () const
 Print some information about the subsystem.
 
void push_back (std::shared_ptr< VQwSubsystem > subsys)
 
void GetMarkerWordList (const ROCID_t roc_id, const BankID_t bank_id, std::vector< UInt_t > &marker) const
 
void RandomizeEventData (int helicity=0, double time=0.0)
 Randomize the data in this event.
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 Encode the data in this event.
 
double GetWindowPeriod ()
 
void LoadSubsystemsFromParameterFile (QwParameterFile &detectors)
 
static Bool_t CanContain (VQwSubsystem *subsys)
 Test whether this subsystem array can contain a particular subsystem.
 

Additional Inherited Members

- Data Fields inherited from MQwPublishable< QwSubsystemArray, VQwSubsystem >
std::vector< std::vector< TString > > fPublishList
 

Detailed Description

Container for managing multiple subsystems with common operations.

Extends std::vector to provide subsystem-level operations such as event processing, accumulation, tree/histogram construction, and publishing. Uses container-delegation pattern to forward arithmetic operations to individual subsystems while maintaining type safety.

Definition at line 42 of file QwSubsystemArray.h.

Member Typedef Documentation

◆ CanContainFn

typedef Bool_t(* QwSubsystemArray::CanContainFn) (VQwSubsystem *)

Definition at line 56 of file QwSubsystemArray.h.

◆ SubsysPtrs

typedef std::vector<std::shared_ptr<VQwSubsystem> > QwSubsystemArray::SubsysPtrs
private

Definition at line 47 of file QwSubsystemArray.h.

Constructor & Destructor Documentation

◆ QwSubsystemArray() [1/3]

QwSubsystemArray::QwSubsystemArray ( )
private

Private default constructor.

References QwSubsystemArray().

Referenced by operator=(), QwSubsystemArray(), QwSubsystemArray(), QwSubsystemArrayParity::QwSubsystemArrayParity(), QwSubsystemArrayParity::QwSubsystemArrayParity(), and ShareHistograms().

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

◆ QwSubsystemArray() [2/3]

QwSubsystemArray::QwSubsystemArray ( QwOptions & options,
CanContainFn myCanContain )

Constructor with options.

Create a subsystem array based on the configuration option 'detectors'

Definition at line 22 of file QwSubsystemArray.cc.

23: fCleanParameter{0,0,0},fEventTypeMask(0x0),fnCanContain(myCanContain)
24{
26 QwParameterFile detectors(fSubsystemsMapFile.c_str());
27 QwMessage << "Loading subsystems from " << fSubsystemsMapFile << "." << QwLog::endl;
29}
#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
CanContainFn fnCanContain
Function to determine which subsystems we can accept.
Double_t fCleanParameter[3]
std::string fSubsystemsMapFile
Filename of the global detector map.
void ProcessOptionsToplevel(QwOptions &options)
Process configuration options for the subsystem array itself.
UInt_t fEventTypeMask
Mask of event types.
void LoadSubsystemsFromParameterFile(QwParameterFile &detectors)

References QwLog::endl(), fCleanParameter, fEventTypeMask, fnCanContain, fSubsystemsMapFile, LoadSubsystemsFromParameterFile(), ProcessOptionsToplevel(), and QwMessage.

+ Here is the call graph for this function:

◆ QwSubsystemArray() [3/3]

QwSubsystemArray::QwSubsystemArray ( const QwSubsystemArray & source)

Copy constructor by reference.

Copy constructor by reference

Parameters
sourceSource subsystem array

Definition at line 35 of file QwSubsystemArray.cc.

36: std::vector<std::shared_ptr<VQwSubsystem>>(),
37 MQwPublishable(source),
49{
50 for (size_t i = 0; i < 3; i++)
51 fCleanParameter[i] = source.fCleanParameter[i];
52
53 // Make copies of all subsystems rather than copying just the pointers
54 for (const_iterator subsys = source.begin(); subsys != source.end(); ++subsys) {
55 this->push_back(subsys->get()->Clone());
56 // Instruct the subsystem to publish variables
57 if (this->back()->PublishInternalValues() == kFALSE) {
58 QwError << "Not all variables for " << this->back()->GetName()
59 << " could be published!" << QwLog::endl;
60 }
61 }
62}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
void push_back(VQwSubsystem *subsys)
Add the subsystem to this array.
UInt_t fCodaEventType
CODA event type as provided by QwEventBuffer.
std::vector< std::string > fSubsystemsDisabledByName
List of disabled types.
UInt_t fCodaRunNumber
Index of this data element in root tree.
UInt_t fCodaSegmentNumber
CODA segment number as provided by QwEventBuffer.
std::vector< std::string > fSubsystemsDisabledByType
List of disabled names.
Bool_t fHasDataLoaded
Has this array gotten data to be processed?
UInt_t fCodaEventNumber
CODA event number as provided by QwEventBuffer.

References fCleanParameter, fCodaEventNumber, fCodaEventType, fCodaRunNumber, fCodaSegmentNumber, fEventTypeMask, fHasDataLoaded, fnCanContain, fSubsystemsDisabledByName, fSubsystemsDisabledByType, fSubsystemsMapFile, fTreeArrayIndex, MQwPublishable< QwSubsystemArray, VQwSubsystem >::MQwPublishable(), and QwSubsystemArray().

+ Here is the call graph for this function:

◆ ~QwSubsystemArray()

QwSubsystemArray::~QwSubsystemArray ( )
inlineoverride

Virtual destructor.

Definition at line 70 of file QwSubsystemArray.h.

70{ };

Member Function Documentation

◆ AtEndOfEventLoop()

void QwSubsystemArray::AtEndOfEventLoop ( )

Perform actions at the end of the event loop.

Definition at line 424 of file QwSubsystemArray.cc.

425{
426 QwDebug << "QwSubsystemArray at end of event loop" << QwLog::endl;
427 if (!empty()) {
428 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::AtEndOfEventLoop));
429 }
430}
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
virtual void AtEndOfEventLoop()
Perform actions at the end of the event loop.

References VQwSubsystem::AtEndOfEventLoop(), QwLog::endl(), and QwDebug.

Referenced by main().

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

◆ CanContain()

static Bool_t QwSubsystemArray::CanContain ( VQwSubsystem * subsys)
inlinestaticprotected

Test whether this subsystem array can contain a particular subsystem.

Definition at line 290 of file QwSubsystemArray.h.

290 {
291 if (subsys == 0) {
292 QwError << "Zero pointer passed!" << QwLog::endl;
293 }
294 // should never occur
295 return kFALSE;
296 };

References QwLog::endl(), and QwError.

+ Here is the call graph for this function:

◆ ClearEventData()

void QwSubsystemArray::ClearEventData ( )

Definition at line 358 of file QwSubsystemArray.cc.

359{
360 if (!empty()) {
361 SetDataLoaded(kFALSE);
364 std::for_each(begin(), end(),
365 std::mem_fn(&VQwSubsystem::ClearEventData));
366 }
367}
void SetDataLoaded(const Bool_t flag)
Set data loaded flag.
void SetCodaEventNumber(UInt_t evtnum)
Set the internal record of the CODA event number.
void SetCodaEventType(UInt_t evttype)
Set the internal record of the CODA event type.
virtual void ClearEventData()=0

References VQwSubsystem::ClearEventData(), SetCodaEventNumber(), SetCodaEventType(), and SetDataLoaded().

Referenced by QwEventBuffer::FillSubsystemData(), main(), and main().

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

◆ ConstructBranch() [1/2]

void QwSubsystemArray::ConstructBranch ( TTree * tree,
TString & prefix )

Construct a branch for this subsystem with a prefix.

Construct the branch for the flat tree

Parameters
treeTree
prefixPrefix

Definition at line 588 of file QwSubsystemArray.cc.

589{
590 // Only MPS tree should contain event number and type
591 if (prefix == "" || prefix == "yield_") {
592 tree->Branch("CodaEventNumber",&fCodaEventNumber,"CodaEventNumber/i");
593 tree->Branch("CodaEventType",&fCodaEventType,"CodaEventType/i");
594 }
595
596 for (iterator subsys = begin(); subsys != end(); ++subsys) {
597 VQwSubsystem* subsys_ptr = dynamic_cast<VQwSubsystem*>(subsys->get());
598 subsys_ptr->ConstructBranch(tree, prefix);
599 }
600}
virtual void ConstructBranch(TTree *tree, TString &prefix)=0
Construct the branch and tree vector.

References VQwSubsystem::ConstructBranch(), fCodaEventNumber, and fCodaEventType.

+ Here is the call graph for this function:

◆ ConstructBranch() [2/2]

void QwSubsystemArray::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & trim_file )

Construct a branch for this subsystem with a prefix after tree leave trimming.

Construct the branch for the flat tree with tree trim files accepted

Parameters
treeTree
prefixPrefix
trim_fileTrim file

Definition at line 609 of file QwSubsystemArray.cc.

613{
614 QwMessage << " QwSubsystemArray::ConstructBranch " << QwLog::endl;
615
616 std::unique_ptr<QwParameterFile> preamble;
617 std::unique_ptr<QwParameterFile> nextsection;
618 preamble = trim_file.ReadSectionPreamble();
619
620 // Process preamble
621 QwVerbose << "QwSubsystemArrayTracking::ConstructBranch Preamble:" << QwLog::endl;
622 QwVerbose << *preamble << QwLog::endl;
623
624 if (prefix == "" || prefix == "yield_") {
625 tree->Branch("CodaEventNumber",&fCodaEventNumber,"CodaEventNumber/i");
626 tree->Branch("CodaEventType",&fCodaEventType,"CodaEventType/i");
627 }
628
629 for (iterator subsys = begin(); subsys != end(); ++subsys) {
630 VQwSubsystem* subsys_ptr = dynamic_cast<VQwSubsystem*>(subsys->get());
631
632 TString subsysname = subsys_ptr->GetName();
633 //QwMessage << "Tree leaves created for " << subsysname << QwLog::endl;
634
635 if (trim_file.FileHasSectionHeader(subsysname)) {
636 // This section contains modules and their channels to be included in the tree
637 nextsection = trim_file.ReadUntilNextSection();
638 subsys_ptr->ConstructBranch(tree, prefix, *nextsection);
639 QwMessage << "Tree leaves created for " << subsysname << QwLog::endl;
640 } else
641 QwMessage << "No tree leaves created for " << subsysname << QwLog::endl;
642 }
643}
#define QwVerbose
Predefined log drain for verbose messages.
Definition QwLog.h:54
Bool_t FileHasSectionHeader(const std::string &secname)
std::unique_ptr< QwParameterFile > ReadUntilNextSection(const bool add_current_line=false)
std::unique_ptr< QwParameterFile > ReadSectionPreamble()
Rewinds to the start and read until it finds next section header.
TString GetName() const

References VQwSubsystem::ConstructBranch(), QwLog::endl(), fCodaEventNumber, fCodaEventType, QwParameterFile::FileHasSectionHeader(), VQwSubsystem::GetName(), QwMessage, QwVerbose, QwParameterFile::ReadSectionPreamble(), and QwParameterFile::ReadUntilNextSection().

+ Here is the call graph for this function:

◆ ConstructBranchAndVector() [1/2]

void QwSubsystemArray::ConstructBranchAndVector ( TTree * tree,
QwRootTreeBranchVector & values )
inline

Construct the tree and vector for this subsystem.

Definition at line 210 of file QwSubsystemArray.h.

210 {
211 TString tmpstr("");
212 ConstructBranchAndVector(tree,tmpstr,values);
213 };
void ConstructBranchAndVector(TTree *tree, QwRootTreeBranchVector &values)
Construct the tree and vector for this subsystem.

References ConstructBranchAndVector().

Referenced by ConstructBranchAndVector(), and QwSubsystemArrayParity::ConstructBranchAndVector().

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

◆ ConstructBranchAndVector() [2/2]

void QwSubsystemArray::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )

Construct a branch and vector for this subsystem with a prefix.

Construct the branch and tree vector

Parameters
treeTree
prefixPrefix
valuesVector of values

Definition at line 553 of file QwSubsystemArray.cc.

557{
558 fTreeArrayIndex = values.size();
559
560 // Each tree should only contain event number and type once, but will
561 // still reserve space in the values vector, so we don't need to modify
562 // FillTreeVector().
563 values.push_back("CodaEventNumber", 'i');
564 values.push_back("CodaEventType", 'i');
565 values.push_back("Coda_CleanData", 'D');
566 values.push_back("Coda_ScanData1", 'D');
567 values.push_back("Coda_ScanData2", 'D');
568 if (prefix == "" || prefix.Index("yield_") == 0) {
569 tree->Branch("CodaEventNumber",&(values[fTreeArrayIndex]),"CodaEventNumber/i");
570 tree->Branch("CodaEventType",&(values[fTreeArrayIndex+1]),"CodaEventType/i");
571 tree->Branch("Coda_CleanData",&(values[fTreeArrayIndex+2]),"Coda_CleanData/D");
572 tree->Branch("Coda_ScanData1",&(values[fTreeArrayIndex+3]),"Coda_ScanData1/D");
573 tree->Branch("Coda_ScanData2",&(values[fTreeArrayIndex+4]),"Coda_ScanData2/D");
574 }
575 for (iterator subsys = begin(); subsys != end(); ++subsys) {
576 VQwSubsystem* subsys_ptr = dynamic_cast<VQwSubsystem*>(subsys->get());
577 subsys_ptr->ConstructBranchAndVector(tree, prefix, values);
578 }
579
580}
size_type size() const noexcept
Definition QwRootFile.h:81
void push_back(const std::string &name, const char type='D')
Definition QwRootFile.h:195
virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)=0
Construct the branch and tree vector.

References VQwSubsystem::ConstructBranchAndVector(), fTreeArrayIndex, QwRootTreeBranchVector::push_back(), and QwRootTreeBranchVector::size().

+ Here is the call graph for this function:

◆ ConstructHistograms() [1/3]

void QwSubsystemArray::ConstructHistograms ( )
inline

Construct the histograms for this subsystem.

Definition at line 190 of file QwSubsystemArray.h.

190 {
191 ConstructHistograms((TDirectory*) NULL);
192 };
void ConstructHistograms()
Construct the histograms for this subsystem.

References ConstructHistograms().

Referenced by ConstructHistograms(), and ConstructHistograms().

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

◆ ConstructHistograms() [2/3]

void QwSubsystemArray::ConstructHistograms ( TDirectory * folder)
inline

Construct the histograms for this subsystem in a folder.

Definition at line 194 of file QwSubsystemArray.h.

194 {
195 TString prefix = "";
196 ConstructHistograms(folder, prefix);
197 };

References ConstructHistograms().

+ Here is the call graph for this function:

◆ ConstructHistograms() [3/3]

void QwSubsystemArray::ConstructHistograms ( TDirectory * folder,
TString & prefix )

Construct the histograms for this subsystem in a folder with a prefix.

Definition at line 475 of file QwSubsystemArray.cc.

476{
477 if (!empty()) {
478 for (iterator subsys = begin(); subsys != end(); ++subsys){
479 (*subsys)->ConstructHistograms(folder,prefix);
480 }
481 }
482}

◆ ConstructObjects() [1/3]

void QwSubsystemArray::ConstructObjects ( )
inline

Construct the objects for this subsystem.

Definition at line 174 of file QwSubsystemArray.h.

174 {
175 ConstructObjects((TDirectory*) NULL);
176 };
void ConstructObjects()
Construct the objects for this subsystem.

References ConstructObjects().

Referenced by ConstructObjects(), and ConstructObjects().

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

◆ ConstructObjects() [2/3]

void QwSubsystemArray::ConstructObjects ( TDirectory * folder)
inline

Construct the objects for this subsystem in a folder.

Definition at line 178 of file QwSubsystemArray.h.

178 {
179 TString prefix = "";
180 ConstructObjects(folder, prefix);
181 };

References ConstructObjects().

+ Here is the call graph for this function:

◆ ConstructObjects() [3/3]

void QwSubsystemArray::ConstructObjects ( TDirectory * folder,
TString & prefix )

Construct the objects for this subsystem in a folder with a prefix.

Definition at line 465 of file QwSubsystemArray.cc.

466{
467 if (!empty()) {
468 for (iterator subsys = begin(); subsys != end(); ++subsys){
469 (*subsys)->ConstructObjects(folder,prefix);
470 }
471 }
472}

◆ ConstructTree() [1/3]

void QwSubsystemArray::ConstructTree ( )
inline

Construct the tree for this subsystem.

Definition at line 243 of file QwSubsystemArray.h.

243 {
244 ConstructTree((TDirectory*) NULL);
245 };
void ConstructTree()
Construct the tree for this subsystem.

References ConstructTree().

Referenced by ConstructTree(), and ConstructTree().

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

◆ ConstructTree() [2/3]

void QwSubsystemArray::ConstructTree ( TDirectory * folder)
inline

Construct the tree for this subsystem in a folder.

Definition at line 247 of file QwSubsystemArray.h.

247 {
248 TString prefix = "";
249 ConstructTree(folder, prefix);
250 };

References ConstructTree().

+ Here is the call graph for this function:

◆ ConstructTree() [3/3]

void QwSubsystemArray::ConstructTree ( TDirectory * folder,
TString & prefix )

Construct the tree for this subsystem in a folder with a prefix.

Construct the tree for this subsystem

Parameters
folderDirectory where to construct the tree
prefixPrefix for the name of the tree

Definition at line 507 of file QwSubsystemArray.cc.

508{
509 if (!empty()) {
510 for (iterator subsys = begin(); subsys != end(); ++subsys){
511 (*subsys)->ConstructTree(folder, prefix);
512 }
513 }
514}

◆ DefineOptions()

void QwSubsystemArray::DefineOptions ( QwOptions & options)
static

Define configuration options for global array.

Define configuration options for global array

Parameters
optionsOptions

Definition at line 236 of file QwSubsystemArray.cc.

237{
238 options.AddOptions()("detectors",
239 po::value<std::string>()->default_value("detectors.map"),
240 "map file with detectors to include");
241
242 options.AddOptions()("bad-event-list",
243 po::value<std::string>()->default_value(""),
244 "map file with bad event ranges");
245
246 // Versions of boost::program_options below 1.39.0 have a bug in multitoken processing
247 options.AddOptions()("disable-by-type",
248 po::value<std::vector <std::string> >()->multitoken(),
249 "subsystem types to disable");
250 options.AddOptions()("disable-by-name",
251 po::value<std::vector <std::string> >()->multitoken(),
252 "subsystem names to disable");
253}
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
Definition QwOptions.h:170

References QwOptions::AddOptions().

Referenced by QwOptions::DefineOptions().

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

◆ DeleteTree()

void QwSubsystemArray::DeleteTree ( )

Delete the tree for this subsystem.

Delete the tree for this subsystem

Definition at line 528 of file QwSubsystemArray.cc.

529{
530 if (!empty())
531 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::DeleteTree));
532}
virtual void DeleteTree()
Delete the tree for this subsystem.

References VQwSubsystem::DeleteTree().

+ Here is the call graph for this function:

◆ EncodeEventData()

void QwSubsystemArray::EncodeEventData ( std::vector< UInt_t > & buffer)

Encode the data in this event.

Definition at line 442 of file QwSubsystemArray.cc.

443{
444 if (!empty())
445 for (iterator subsys = begin(); subsys != end(); ++subsys) {
446 (*subsys)->EncodeEventData(buffer);
447 }
448}

Referenced by QwEventBuffer::EncodeSubsystemData().

+ Here is the caller graph for this function:

◆ FillHistograms()

void QwSubsystemArray::FillHistograms ( )

Fill the histograms for this subsystem.

Definition at line 484 of file QwSubsystemArray.cc.

485{
486 if (!empty())
487 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::FillHistograms));
488}
virtual void FillHistograms()=0
Fill the histograms for this subsystem.

References VQwSubsystem::FillHistograms().

Referenced by QwSubsystemArrayParity::FillHistograms().

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

◆ FillTree()

void QwSubsystemArray::FillTree ( )

Fill the tree for this subsystem.

Fill the tree for this subsystem

Definition at line 519 of file QwSubsystemArray.cc.

520{
521 if (!empty())
522 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::FillTree));
523}
virtual void FillTree()
Fill the tree for this subsystem.

References VQwSubsystem::FillTree().

+ Here is the call graph for this function:

◆ FillTreeVector()

void QwSubsystemArray::FillTreeVector ( QwRootTreeBranchVector & values) const

Fill the vector for this subsystem.

Fill the tree vector

Parameters
valuesVector of values

Definition at line 650 of file QwSubsystemArray.cc.

651{
652 // Fill the event number and event type
653 size_t index = fTreeArrayIndex;
654 values.SetValue(index++, this->GetCodaEventNumber());
655 values.SetValue(index++, this->GetCodaEventType());
656 values.SetValue(index++, this->fCleanParameter[0]);
657 values.SetValue(index++, this->fCleanParameter[1]);
658 values.SetValue(index++, this->fCleanParameter[2]);
659
660 // Fill the subsystem data
661 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
662 VQwSubsystem* subsys_ptr = dynamic_cast<VQwSubsystem*>(subsys->get());
663 subsys_ptr->FillTreeVector(values);
664 }
665}
void SetValue(size_type index, Double_t val)
Definition QwRootFile.h:108
UInt_t GetCodaEventNumber() const
Get the internal record of the CODA event number.
UInt_t GetCodaEventType() const
Get the internal record of the CODA event type.
virtual void FillTreeVector(QwRootTreeBranchVector &values) const =0
Fill the tree vector.

References fCleanParameter, VQwSubsystem::FillTreeVector(), fTreeArrayIndex, GetCodaEventNumber(), GetCodaEventType(), and QwRootTreeBranchVector::SetValue().

Referenced by QwSubsystemArrayParity::FillTreeVector().

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

◆ GetCodaEventNumber()

UInt_t QwSubsystemArray::GetCodaEventNumber ( ) const
inline

Get the internal record of the CODA event number.

Definition at line 88 of file QwSubsystemArray.h.

88{ return fCodaEventNumber; };

References fCodaEventNumber.

Referenced by FillTreeVector().

+ Here is the caller graph for this function:

◆ GetCodaEventType()

UInt_t QwSubsystemArray::GetCodaEventType ( ) const
inline

Get the internal record of the CODA event type.

Definition at line 90 of file QwSubsystemArray.h.

90{ return fCodaEventType; };

References fCodaEventType.

Referenced by FillTreeVector().

+ Here is the caller graph for this function:

◆ GetCodaRunNumber()

UInt_t QwSubsystemArray::GetCodaRunNumber ( ) const
inline

Get the internal record of the CODA run number.

Definition at line 84 of file QwSubsystemArray.h.

84{ return fCodaRunNumber; };

References fCodaRunNumber.

◆ GetCodaSegmentNumber()

UInt_t QwSubsystemArray::GetCodaSegmentNumber ( ) const
inline

Get the internal record of the CODA segment number.

Definition at line 86 of file QwSubsystemArray.h.

86{ return fCodaSegmentNumber; };

References fCodaSegmentNumber.

◆ GetEventTypeMask()

UInt_t QwSubsystemArray::GetEventTypeMask ( ) const
inline

Get event type mask.

Definition at line 103 of file QwSubsystemArray.h.

103{ return fEventTypeMask; };

References fEventTypeMask.

Referenced by QwEventBuffer::FillSubsystemData().

+ Here is the caller graph for this function:

◆ GetMarkerWordList()

void QwSubsystemArray::GetMarkerWordList ( const ROCID_t roc_id,
const BankID_t bank_id,
std::vector< UInt_t > & marker ) const

QwSubsystemArray::GetMarkerWordList should be called once by QwEventBuffer to build the marker word list as each roc_id and bank_id are reached in the decoding.

Definition at line 385 of file QwSubsystemArray.cc.

389{
390 if (!empty()){
391 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
392 (*subsys)->GetMarkerWordList(roc_id, bank_id, marker);
393 }
394 }
395}

Referenced by QwEventBuffer::CheckForMarkerWords().

+ Here is the caller graph for this function:

◆ GetParamFileNameList()

TList * QwSubsystemArray::GetParamFileNameList ( TString name) const

Get list of parameter files.

Definition at line 789 of file QwSubsystemArray.cc.

790{
791 if (not empty()) {
792
793 TList* return_maps_TList = new TList;
794 return_maps_TList->SetName(name);
795
796 std::map<TString, TString> mapfiles_subsystem;
797
798 for (const_iterator subsys = begin(); subsys != end(); ++subsys)
799 {
800 mapfiles_subsystem = (*subsys)->GetDetectorMaps();
801 for( std::map<TString, TString>::iterator ii= mapfiles_subsystem.begin(); ii!= mapfiles_subsystem.end(); ++ii)
802 {
803 TList *test = new TList;
804 test->SetName((*ii).first);
805 test->AddLast(new TObjString((*ii).second));
806 return_maps_TList -> AddLast(test);
807 }
808 }
809
810 return return_maps_TList;
811 }
812 else {
813 return NULL;
814 }
815};

◆ GetROCIDList()

void QwSubsystemArray::GetROCIDList ( std::vector< ROCID_t > & list)

Get the ROCID list.

Definition at line 450 of file QwSubsystemArray.cc.

451{
452 if (!empty()){
453 std::vector<ROCID_t> tmp;
454 for (iterator subsys = begin(); subsys != end(); ++subsys) {
455 tmp = (*subsys)->GetROCIds();
456 for(auto it = tmp.begin(); it!=tmp.end();it++){
457 if(std::find(list.begin(), list.end(), *it) == list.end() )
458 list.push_back(*it);
459 }
460 }
461 }
462}

Referenced by QwEventBuffer::EncodeSubsystemData().

+ Here is the caller graph for this function:

◆ GetSubsystemByName()

VQwSubsystem * QwSubsystemArray::GetSubsystemByName ( const TString & name)
virtual

Get the subsystem with the specified name.

Get the subsystem in this array with the specified name

Parameters
nameName of the subsystem
Returns
Pointer to the subsystem

Reimplemented in QwSubsystemArrayParity.

Definition at line 309 of file QwSubsystemArray.cc.

310{
311 VQwSubsystem* tmp = NULL;
312 if (!empty()) {
313 // Loop over the subsystems
314 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
315 // Check the name of this subsystem
316 // std::cout<<"QwSubsystemArray::GetSubsystemByName available name=="<<(*subsys)->GetName()<<"== to be compared to =="<<name<<"==\n";
317 if ((*subsys)->GetName() == name) {
318 tmp = (*subsys).get();
319 //std::cout<<"QwSubsystemArray::GetSubsystemByName found a matching name \n";
320 } else {
321 // nothing
322 }
323 }
324 }
325 return tmp;
326}

Referenced by VQwSubsystem::GetSibling(), QwSubsystemArrayParity::GetSubsystemByName(), push_back(), and push_back().

+ Here is the caller graph for this function:

◆ GetSubsystemByType()

std::vector< VQwSubsystem * > QwSubsystemArray::GetSubsystemByType ( const std::string & type)
virtual

Get the list of subsystems of the specified type.

Get the list of subsystems in this array of the specified type

Parameters
typeType of the subsystem
Returns
Vector of subsystems

Definition at line 334 of file QwSubsystemArray.cc.

335{
336 // Vector of subsystem pointers
337 std::vector<VQwSubsystem*> subsys_list;
338
339 // If this array is not empty
340 if (!empty()) {
341
342 // Loop over the subsystems
343 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
344
345 // Test to see if the subsystem inherits from the required type
346 if (VQwSubsystemFactory::InheritsFrom((*subsys).get(),type)) {
347 subsys_list.push_back((*subsys).get());
348 }
349
350 } // end of loop over subsystems
351
352 } // end of if !empty()
353
354 return subsys_list;
355}

Referenced by main().

+ Here is the caller graph for this function:

◆ GetWindowPeriod()

double QwSubsystemArray::GetWindowPeriod ( )
inline

Definition at line 314 of file QwSubsystemArray.h.

314{return fWindowPeriod;};

References fWindowPeriod.

Referenced by main().

+ Here is the caller graph for this function:

◆ HasDataLoaded()

Bool_t QwSubsystemArray::HasDataLoaded ( ) const
inline

Get data loaded flag.

Definition at line 117 of file QwSubsystemArray.h.

117{ return fHasDataLoaded; };

References fHasDataLoaded.

Referenced by ProcessEvent().

+ Here is the caller graph for this function:

◆ LoadAllEventRanges()

void QwSubsystemArray::LoadAllEventRanges ( QwOptions & options)

Definition at line 285 of file QwSubsystemArray.cc.

285 {
286
287 std::string fBadEventListFileName = options.GetValue<std::string>("bad-event-list");
288 if (fBadEventListFileName.size() > 0) {
289 QwParameterFile fBadEventListFile(fBadEventListFileName);
290 // If there is an event list, open the next section
291 std::string bad_event_range;
292 while (fBadEventListFile.ReadNextLine(bad_event_range)){
293 // Find next non-whitespace, non-comment, non-empty line, before EOF
294 fBadEventListFile.TrimWhitespace();
295 fBadEventListFile.TrimComment('#');
296 if (fBadEventListFile.LineIsEmpty()) continue;
297 std::pair<UInt_t,UInt_t> aBadEventRange = QwParameterFile::ParseIntRange(":",bad_event_range);
298 fBadEventRange.push_back(aBadEventRange);
299 QwMessage << "Next Bad event range is " << bad_event_range << QwLog::endl;
300 } // end of loop of reading lines.
301 }
302}
T GetValue(const std::string &key)
Get a templated value.
Definition QwOptions.h:236
static std::pair< int, int > ParseIntRange(const std::string &separatorchars, const std::string &range)
Parse a range of integers as #:# where either can be missing.
std::vector< std::pair< UInt_t, UInt_t > > fBadEventRange

References QwLog::endl(), fBadEventRange, QwOptions::GetValue(), QwParameterFile::LineIsEmpty(), QwParameterFile::ParseIntRange(), QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

Referenced by ProcessOptionsSubsystems().

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

◆ LoadSubsystemsFromParameterFile()

void QwSubsystemArray::LoadSubsystemsFromParameterFile ( QwParameterFile & detectors)
protected

Fill the subsystem array with the contents of a map file

Parameters
detectorsMap file

Definition at line 108 of file QwSubsystemArray.cc.

109{
110 // This is how this should work
111 std::unique_ptr<QwParameterFile> preamble;
112 preamble = detectors.ReadSectionPreamble();
113 // Process preamble
114 QwVerbose << "Preamble:" << QwLog::endl;
115 QwVerbose << *preamble << QwLog::endl;
116 if (preamble) preamble.reset();
117
118 std::unique_ptr<QwParameterFile> section;
119 std::string section_name;
120 while ((section = detectors.ReadNextSection(section_name))) {
121
122 // Debugging output of configuration section
123 QwVerbose << "[" << section_name << "]" << QwLog::endl;
124 QwVerbose << *section << QwLog::endl;
125
126 // Determine type and name of subsystem
127 std::string subsys_type = section_name;
128 std::string subsys_name;
129 if (! section->FileHasVariablePair("=","name",subsys_name)) {
130 QwError << "No name defined in section for subsystem " << subsys_type << "." << QwLog::endl;
131 continue;
132 }
133
134 // If subsystem type is explicitly disabled
135 bool disabled_by_type = false;
136 for (size_t i = 0; i < fSubsystemsDisabledByType.size(); i++)
137 if (subsys_type == fSubsystemsDisabledByType.at(i))
138 disabled_by_type = true;
139 if (disabled_by_type) {
140 QwWarning << "Subsystem of type " << subsys_type << " disabled." << QwLog::endl;
141 continue;
142 }
143
144 // If subsystem name is explicitly disabled
145 bool disabled_by_name = false;
146 for (size_t i = 0; i < fSubsystemsDisabledByName.size(); i++)
147 if (subsys_name == fSubsystemsDisabledByName.at(i))
148 disabled_by_name = true;
149 if (disabled_by_name) {
150 QwWarning << "Subsystem with name " << subsys_name << " disabled." << QwLog::endl;
151 continue;
152 }
153
154 // Create subsystem
155 QwMessage << "Creating subsystem of type " << subsys_type << " "
156 << "with name " << subsys_name << "." << QwLog::endl;
157 VQwSubsystem* subsys = 0;
158 try {
159 subsys =
160 VQwSubsystemFactory::Create(subsys_type, subsys_name);
161 } catch (QwException_TypeUnknown&) {
162 QwError << "No support for subsystems of type " << subsys_type << "." << QwLog::endl;
163 // Fall-through to next error for more the psychological effect of many warnings
164 }
165 if (! subsys) {
166 QwError << "Could not create subsystem " << subsys_type << "." << QwLog::endl;
167 continue;
168 }
169
170 // If this subsystem cannot be stored in this array
171 if (! fnCanContain(subsys)) {
172 QwMessage << "Subsystem " << subsys_name << " cannot be stored in this "
173 << "subsystem array." << QwLog::endl;
174 QwMessage << "Deleting subsystem " << subsys_name << " again" << QwLog::endl;
175 delete subsys; subsys = 0;
176 continue;
177 }
178
179 // Pass detector maps
180 subsys->LoadDetectorMaps(*section);
181 // Add to array
182 this->push_back(subsys);
183
184 // Instruct the subsystem to publish variables
185 if (subsys->PublishInternalValues() == kFALSE) {
186 QwError << "Not all variables for " << subsys->GetName()
187 << " could be published!" << QwLog::endl;
188 }
189 }
190}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
std::unique_ptr< QwParameterFile > ReadNextSection(std::string &secname, const bool keep_header=false)
Bool_t PublishInternalValues() const override
Publish all variables of the subsystem.
virtual Int_t LoadDetectorMaps(QwParameterFile &file)
Parse parameter file to find the map files.

References QwLog::endl(), fnCanContain, fSubsystemsDisabledByName, fSubsystemsDisabledByType, VQwSubsystem::GetName(), VQwSubsystem::LoadDetectorMaps(), VQwSubsystem::PublishInternalValues(), push_back(), QwError, QwMessage, QwVerbose, QwWarning, QwParameterFile::ReadNextSection(), and QwParameterFile::ReadSectionPreamble().

Referenced by QwSubsystemArray().

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

◆ operator=()

QwSubsystemArray & QwSubsystemArray::operator= ( const QwSubsystemArray & source)

Assignment operator.

Assignment operator

Parameters
sourceSubsystem array to assign to this array
Returns
This subsystem array after assignment

Definition at line 70 of file QwSubsystemArray.cc.

71{
73 this->fCodaEventType = source.fCodaEventType;
74 if (!source.empty()){
75 if (this->size() == source.size()){
76 for(size_t i=0;i<source.size();i++){
77 if (source.at(i)==NULL || this->at(i)==NULL){
78 // Either the source or the destination subsystem
79 // are null
80 } else {
81 VQwSubsystem *ptr1 =
82 dynamic_cast<VQwSubsystem*>(this->at(i).get());
83 VQwSubsystem *ptr2 = source.at(i).get();
84 if (typeid(*ptr1)==typeid(*(ptr2))){
85 *(ptr1) = source.at(i).get();
86 } else {
87 // Subsystems don't match
88 QwError << " QwSubsystemArray::operator= types do not mach" << QwLog::endl;
89 QwError << " typeid(*ptr1)=" << typeid(*ptr1).name()
90 << " but typeid(*ptr2)=" << typeid(*ptr2).name()
91 << QwLog::endl;
92 }
93 }
94 }
95 } else {
96 // Array sizes don't match
97 }
98 } else {
99 // The source is empty
100 }
101 return *this;
102}

References QwLog::endl(), fCodaEventNumber, fCodaEventType, QwError, and QwSubsystemArray().

Referenced by QwSubsystemArrayParity::operator=().

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

◆ PrintInfo()

void QwSubsystemArray::PrintInfo ( ) const

Print some information about the subsystem.

Definition at line 536 of file QwSubsystemArray.cc.

537{
538 if (!empty()) {
539 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
540 (*subsys)->PrintInfo();
541 }
542 }
543}

◆ PrintParamFileList()

void QwSubsystemArray::PrintParamFileList ( ) const

Print list of parameter files.

Definition at line 779 of file QwSubsystemArray.cc.

780{
781 if (not empty()) {
782 for (const_iterator subsys = begin(); subsys != end(); ++subsys)
783 {
784 (*subsys)->PrintDetectorMaps(true);
785 }
786 }
787}

Referenced by main().

+ Here is the caller graph for this function:

◆ ProcessConfigurationBuffer()

Int_t QwSubsystemArray::ProcessConfigurationBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )

Process the event buffer for configuration events.

Definition at line 369 of file QwSubsystemArray.cc.

374{
375 if (!empty())
376 for (iterator subsys = begin(); subsys != end(); ++subsys){
377 (*subsys)->ProcessConfigurationBuffer(roc_id, bank_id, buffer, num_words);
378 }
379 return 0;
380}

Referenced by QwEventBuffer::FillSubsystemConfigurationData().

+ Here is the caller graph for this function:

◆ ProcessEvBuffer()

Int_t QwSubsystemArray::ProcessEvBuffer ( const UInt_t event_type,
const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )

Process the event buffer for events.

Definition at line 398 of file QwSubsystemArray.cc.

404{
405 if (!empty()) {
406 SetDataLoaded(kTRUE);
407 for (iterator subsys = begin(); subsys != end(); ++subsys) {
408 (*subsys)->ProcessEvBuffer(event_type, roc_id, bank_id, buffer, num_words);
409 }
410 }
411 return 0;
412}

References SetDataLoaded().

Referenced by QwEventBuffer::FillSubsystemData().

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

◆ ProcessEvent()

void QwSubsystemArray::ProcessEvent ( )

Process the decoded data in this event.

Definition at line 415 of file QwSubsystemArray.cc.

416{
417 if (!empty() && HasDataLoaded()) {
418 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::ProcessEvent));
419 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::ExchangeProcessedData));
420 std::for_each(begin(), end(), boost::mem_fn(&VQwSubsystem::ProcessEvent_2));
421 }
422}
Bool_t HasDataLoaded() const
Get data loaded flag.
virtual void ExchangeProcessedData()
Request processed data from other subsystems for internal use in the second event processing stage....
virtual void ProcessEvent_2()
Process the event data again, including data from other subsystems. Not all derived classes will requ...
virtual void ProcessEvent()=0

References VQwSubsystem::ExchangeProcessedData(), HasDataLoaded(), VQwSubsystem::ProcessEvent(), and VQwSubsystem::ProcessEvent_2().

Referenced by main().

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

◆ ProcessOptions()

void QwSubsystemArray::ProcessOptions ( QwOptions & options)
inline

Process configuration options (default behavior)

Definition at line 126 of file QwSubsystemArray.h.

126{ ProcessOptionsSubsystems(options); };
void ProcessOptionsSubsystems(QwOptions &options)
Process configuration options for all subsystems in the array.

References ProcessOptionsSubsystems().

Referenced by main(), and main().

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

◆ ProcessOptionsSubsystems()

void QwSubsystemArray::ProcessOptionsSubsystems ( QwOptions & options)

Process configuration options for all subsystems in the array.

Handle configuration options for all subsystems in the array

Parameters
optionsOptions

Definition at line 275 of file QwSubsystemArray.cc.

276{
277 LoadAllEventRanges(options);
278
279 for (iterator subsys_iter = begin(); subsys_iter != end(); ++subsys_iter) {
280 VQwSubsystem* subsys = dynamic_cast<VQwSubsystem*>(subsys_iter->get());
281 subsys->ProcessOptions(options);
282 }
283}
void LoadAllEventRanges(QwOptions &options)
virtual void ProcessOptions(QwOptions &)
Process the command line options.

References LoadAllEventRanges(), and VQwSubsystem::ProcessOptions().

Referenced by ProcessOptions().

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

◆ ProcessOptionsToplevel()

void QwSubsystemArray::ProcessOptionsToplevel ( QwOptions & options)

Process configuration options for the subsystem array itself.

Handle configuration options for the subsystem array itself

Parameters
optionsOptions

Definition at line 260 of file QwSubsystemArray.cc.

261{
262 // Filename to use for subsystem creation (single filename could be expanded
263 // to a list)
264 fSubsystemsMapFile = options.GetValue<std::string>("detectors");
265 // Subsystems to disable
266 fSubsystemsDisabledByName = options.GetValueVector<std::string>("disable-by-name");
267 fSubsystemsDisabledByType = options.GetValueVector<std::string>("disable-by-type");
268}
std::vector< T > GetValueVector(const std::string &key)
Get a list of templated values.
Definition QwOptions.h:249

References fSubsystemsDisabledByName, fSubsystemsDisabledByType, fSubsystemsMapFile, QwOptions::GetValue(), and QwOptions::GetValueVector().

Referenced by QwSubsystemArray().

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

◆ push_back() [1/2]

void QwSubsystemArray::push_back ( std::shared_ptr< VQwSubsystem > subsys)

Add the subsystem to this array. Do nothing if the subsystem is null or if there is already a subsystem with that name in the array.

Parameters
subsysSubsystem to add to the array

Definition at line 824 of file QwSubsystemArray.cc.

825{
826
827 if (subsys.get() == NULL) {
828 QwError << "QwSubsystemArray::push_back(): NULL subsys"
829 << QwLog::endl;
830 // This is an empty subsystem...
831 // Do nothing for now.
832
833 } else if (!this->empty() && GetSubsystemByName(subsys->GetName())){
834 // There is already a subsystem with this name!
835 QwError << "QwSubsystemArray::push_back(): subsys " << subsys->GetName()
836 << " already exists" << QwLog::endl;
837
838 } else if (!fnCanContain(subsys.get())) {
839 // There is no support for this type of subsystem
840 QwError << "QwSubsystemArray::push_back(): subsys " << subsys->GetName()
841 << " is not supported by this subsystem array" << QwLog::endl;
842
843 } else {
844 std::shared_ptr<VQwSubsystem> subsys_tmp(subsys);
845 SubsysPtrs::push_back(subsys_tmp);
846
847 // Set the parent of the subsystem to this array
848 subsys_tmp->SetParent(this);
849
850 // Update the event type mask
851 // Note: Active bits in the mask indicate event types that are accepted
852 fEventTypeMask |= subsys_tmp->GetEventTypeMask();
853
854 // Instruct the subsystem to publish variables
855 if (subsys_tmp->PublishInternalValues() == kFALSE) {
856 QwError << "Not all variables for " << subsys_tmp->GetName()
857 << " could be published!" << QwLog::endl;
858 }
859 }
860}
virtual VQwSubsystem * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.

References QwLog::endl(), fEventTypeMask, fnCanContain, GetSubsystemByName(), and QwError.

+ Here is the call graph for this function:

◆ push_back() [2/2]

void QwSubsystemArray::push_back ( VQwSubsystem * subsys)

Add the subsystem to this array.

Add the subsystem to this array. Do nothing if the subsystem is null or if there is already a subsystem with that name in the array.

Parameters
subsysSubsystem to add to the array

Definition at line 199 of file QwSubsystemArray.cc.

200{
201 if (subsys == NULL) {
202 QwError << "QwSubsystemArray::push_back(): NULL subsys"
203 << QwLog::endl;
204 // This is an empty subsystem...
205 // Do nothing for now.
206
207 } else if (!this->empty() && GetSubsystemByName(subsys->GetName())){
208 // There is already a subsystem with this name!
209 QwError << "QwSubsystemArray::push_back(): subsys " << subsys->GetName()
210 << " already exists" << QwLog::endl;
211
212 } else if (!fnCanContain(subsys)) {
213 // There is no support for this type of subsystem
214 QwError << "QwSubsystemArray::push_back(): subsys " << subsys->GetName()
215 << " is not supported by this subsystem array" << QwLog::endl;
216
217 } else {
218 std::shared_ptr<VQwSubsystem> subsys_tmp(subsys);
219 SubsysPtrs::push_back(subsys_tmp);
220
221 // Set the parent of the subsystem to this array
222 subsys_tmp->SetParent(this);
223
224 // Update the event type mask
225 // Note: Active bits in the mask indicate event types that are accepted
226 fEventTypeMask |= subsys_tmp->GetEventTypeMask();
227 }
228}

References QwLog::endl(), fEventTypeMask, fnCanContain, VQwSubsystem::GetName(), GetSubsystemByName(), and QwError.

Referenced by LoadSubsystemsFromParameterFile().

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

◆ RandomizeEventData()

void QwSubsystemArray::RandomizeEventData ( int helicity = 0,
double time = 0.0 )

Randomize the data in this event.

Definition at line 433 of file QwSubsystemArray.cc.

434{
435 if (!empty())
436 for (iterator subsys = begin(); subsys != end(); ++subsys) {
437 (*subsys)->RandomizeEventData(helicity, time);
438 }
439}

Referenced by main().

+ Here is the caller graph for this function:

◆ SetCleanParameters()

void QwSubsystemArray::SetCleanParameters ( Double_t cleanparameter[3])
inline

Set the internal record of the CODA event number.

Definition at line 93 of file QwSubsystemArray.h.

94 {
95 fCleanParameter[0] = cleanparameter[0];
96 fCleanParameter[1] = cleanparameter[1];
97 fCleanParameter[2] = cleanparameter[2];
98 };

References fCleanParameter.

Referenced by QwEventBuffer::FillSubsystemData().

+ Here is the caller graph for this function:

◆ SetCodaEventNumber()

void QwSubsystemArray::SetCodaEventNumber ( UInt_t evtnum)
inline

Set the internal record of the CODA event number.

Definition at line 80 of file QwSubsystemArray.h.

80{ fCodaEventNumber = evtnum; };

References fCodaEventNumber.

Referenced by ClearEventData(), and QwEventBuffer::FillSubsystemData().

+ Here is the caller graph for this function:

◆ SetCodaEventType()

void QwSubsystemArray::SetCodaEventType ( UInt_t evttype)
inline

Set the internal record of the CODA event type.

Definition at line 82 of file QwSubsystemArray.h.

82{ fCodaEventType = evttype; };

References fCodaEventType.

Referenced by ClearEventData(), and QwEventBuffer::FillSubsystemData().

+ Here is the caller graph for this function:

◆ SetCodaRunNumber()

void QwSubsystemArray::SetCodaRunNumber ( UInt_t runnum)
inline

Set the internal record of the CODA run number.

Definition at line 76 of file QwSubsystemArray.h.

76{ fCodaRunNumber = runnum; };

References fCodaRunNumber.

Referenced by QwEventBuffer::FillSubsystemData().

+ Here is the caller graph for this function:

◆ SetCodaSegmentNumber()

void QwSubsystemArray::SetCodaSegmentNumber ( UInt_t segnum)
inline

Set the internal record of the CODA segment number.

Definition at line 78 of file QwSubsystemArray.h.

78{ fCodaSegmentNumber = segnum; };

References fCodaSegmentNumber.

Referenced by QwEventBuffer::FillSubsystemData().

+ Here is the caller graph for this function:

◆ SetDataLoaded()

void QwSubsystemArray::SetDataLoaded ( const Bool_t flag)
inline

Set data loaded flag.

Definition at line 115 of file QwSubsystemArray.h.

115{ fHasDataLoaded = flag; };

References fHasDataLoaded.

Referenced by ClearEventData(), and ProcessEvBuffer().

+ Here is the caller graph for this function:

◆ SetEventTypeMask()

void QwSubsystemArray::SetEventTypeMask ( const UInt_t mask)
inline

Set event type mask.

Definition at line 101 of file QwSubsystemArray.h.

101{ fEventTypeMask = mask; };

References fEventTypeMask.

◆ ShareHistograms()

void QwSubsystemArray::ShareHistograms ( const QwSubsystemArray & source)

Share the histograms with another subsystem.

Definition at line 490 of file QwSubsystemArray.cc.

491{
492 if (!empty() && !source.empty()) {
493 if (this->size() == source.size()) {
494 for (size_t i = 0; i < source.size(); ++i) {
495 this->at(i)->ShareHistograms(source.at(i).get());
496 }
497 }
498 }
499}

References QwSubsystemArray().

Referenced by main().

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

◆ UpdateEventTypeMask()

UInt_t QwSubsystemArray::UpdateEventTypeMask ( )
inline

Update the event type mask from the subsystems.

Definition at line 105 of file QwSubsystemArray.h.

105 {
106 for (iterator subsys_iter = begin(); subsys_iter != end(); ++subsys_iter) {
107 VQwSubsystem* subsys = dynamic_cast<VQwSubsystem*>(subsys_iter->get());
108 fEventTypeMask |= subsys->GetEventTypeMask();
109 }
110 return fEventTypeMask;
111 };
UInt_t GetEventTypeMask() const
Get event type mask.

References fEventTypeMask, and VQwSubsystem::GetEventTypeMask().

+ Here is the call graph for this function:

Field Documentation

◆ fBadEventRange

std::vector< std::pair<UInt_t,UInt_t> > QwSubsystemArray::fBadEventRange
protected

◆ fCleanParameter

Double_t QwSubsystemArray::fCleanParameter[3]
protected

◆ fCodaEventNumber

◆ fCodaEventType

UInt_t QwSubsystemArray::fCodaEventType
protected

CODA event type as provided by QwEventBuffer.

Definition at line 279 of file QwSubsystemArray.h.

Referenced by ConstructBranch(), ConstructBranch(), GetCodaEventType(), operator=(), QwSubsystemArray(), and SetCodaEventType().

◆ fCodaRunNumber

UInt_t QwSubsystemArray::fCodaRunNumber
protected

Index of this data element in root tree.

CODA run number as provided by QwEventBuffer

Definition at line 276 of file QwSubsystemArray.h.

Referenced by GetCodaRunNumber(), QwSubsystemArray(), and SetCodaRunNumber().

◆ fCodaSegmentNumber

UInt_t QwSubsystemArray::fCodaSegmentNumber
protected

CODA segment number as provided by QwEventBuffer.

Definition at line 277 of file QwSubsystemArray.h.

Referenced by GetCodaSegmentNumber(), QwSubsystemArray(), and SetCodaSegmentNumber().

◆ fEventTypeMask

UInt_t QwSubsystemArray::fEventTypeMask
protected

◆ fHasDataLoaded

Bool_t QwSubsystemArray::fHasDataLoaded
protected

Has this array gotten data to be processed?

Definition at line 283 of file QwSubsystemArray.h.

Referenced by HasDataLoaded(), QwSubsystemArray(), and SetDataLoaded().

◆ fnCanContain

CanContainFn QwSubsystemArray::fnCanContain
protected

Function to determine which subsystems we can accept.

Definition at line 287 of file QwSubsystemArray.h.

Referenced by LoadSubsystemsFromParameterFile(), push_back(), push_back(), QwSubsystemArray(), and QwSubsystemArray().

◆ fSubsystemsDisabledByName

std::vector<std::string> QwSubsystemArray::fSubsystemsDisabledByName
private

List of disabled types.

Definition at line 303 of file QwSubsystemArray.h.

Referenced by LoadSubsystemsFromParameterFile(), ProcessOptionsToplevel(), and QwSubsystemArray().

◆ fSubsystemsDisabledByType

std::vector<std::string> QwSubsystemArray::fSubsystemsDisabledByType
private

List of disabled names.

Definition at line 304 of file QwSubsystemArray.h.

Referenced by LoadSubsystemsFromParameterFile(), ProcessOptionsToplevel(), and QwSubsystemArray().

◆ fSubsystemsMapFile

std::string QwSubsystemArray::fSubsystemsMapFile
private

Filename of the global detector map.

Definition at line 302 of file QwSubsystemArray.h.

Referenced by ProcessOptionsToplevel(), QwSubsystemArray(), and QwSubsystemArray().

◆ fTreeArrayIndex

size_t QwSubsystemArray::fTreeArrayIndex
protected

Definition at line 273 of file QwSubsystemArray.h.

Referenced by ConstructBranchAndVector(), FillTreeVector(), and QwSubsystemArray().

◆ fWindowPeriod

double QwSubsystemArray::fWindowPeriod
protected

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