8 #ifndef __QWSUBSYSTEMARRAY__
9 #define __QWSUBSYSTEMARRAY__
15 #include "TDirectory.h"
19 #include <boost/shared_ptr.hpp>
20 #include <boost/mem_fn.hpp>
34 typedef std::vector<boost::shared_ptr<VQwSubsystem> >
SubsysPtrs;
36 using SubsysPtrs::const_iterator;
37 using SubsysPtrs::iterator;
38 using SubsysPtrs::begin;
39 using SubsysPtrs::end;
40 using SubsysPtrs::size;
41 using SubsysPtrs::empty;
90 for (iterator subsys_iter = begin(); subsys_iter != end(); ++subsys_iter) {
128 UInt_t *buffer, UInt_t num_words);
132 const UInt_t bank_id, UInt_t *buffer,
257 void push_back(boost::shared_ptr<VQwSubsystem> subsys);
298 #endif // __QWSUBSYSTEMARRAY__
UInt_t GetCodaRunNumber() const
Get the internal record of the CODA run number.
std::map< TString, const VQwSubsystem * > fPublishedValuesSubsystem
static Bool_t CanContain(VQwSubsystem *subsys)
Test whether this subsystem array can contain a particular subsystem.
UInt_t fCodaRunNumber
Index of this data element in root tree.
std::map< TString, TString > fPublishedValuesDescription
const VQwHardwareChannel * ReturnInternalValue(const TString &name) const
Retrieve the variable name from subsystems in this subsystem array.
Definition of the pure virtual base class of all subsystems.
void ConstructHistograms()
Construct the histograms for this subsystem.
virtual VQwSubsystem * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.
UInt_t GetCodaSegmentNumber() const
Get the internal record of the CODA segment number.
TList * GetParamFileNameList(TString name) const
Get list of parameter files.
QwSubsystemArray()
Private default constructor.
Int_t ProcessEvBuffer(const UInt_t event_type, const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
Process the event buffer for events.
Bool_t PublishInternalValue(const TString name, const TString desc, const VQwSubsystem *subsys, const VQwHardwareChannel *element)
Publish the value name with description from a subsystem in this array.
UInt_t GetEventTypeMask() const
Get event type mask.
void push_back(VQwSubsystem *subsys)
Add the subsystem to this array.
void SetCodaEventNumber(UInt_t evtnum)
Set the internal record of the CODA event number.
UInt_t GetCodaEventType() const
Get the internal record of the CODA event type.
UInt_t fCodaEventNumber
CODA event number as provided by QwEventBuffer.
Bool_t RequestExternalValue(const TString &name, VQwHardwareChannel *value) const
Retrieve the variable name from other subsystem arrays.
void PrintParamFileList() const
Print list of parameter files.
void PrintInfo() const
Print some information about the subsystem.
void ProcessOptions(QwOptions &options)
Process configuration options (default behavior)
void ConstructTree(TDirectory *folder)
Construct the tree for this subsystem in a folder.
void EncodeEventData(std::vector< UInt_t > &buffer)
Encode the data in this event.
UInt_t fCodaSegmentNumber
CODA segment number as provided by QwEventBuffer.
void SetCleanParameters(Double_t cleanparameter[3])
Set the internal record of the CODA event number.
std::map< TString, const VQwHardwareChannel * > fPublishedValuesDataElement
Published values.
void SetEventTypeMask(const UInt_t mask)
Set event type mask.
void SetDataLoaded(const Bool_t flag)
Set data loaded flag.
void SetCodaRunNumber(UInt_t runnum)
Set the internal record of the CODA run number.
std::string fSubsystemsMapFile
Filename of the global detector map.
std::vector< boost::shared_ptr< VQwSubsystem > > SubsysPtrs
void ConstructTree()
Construct the tree for this subsystem.
UInt_t fCodaEventType
CODA event type as provided by QwEventBuffer.
void AtEndOfEventLoop()
Perform actions at the end of the event loop.
void ProcessOptionsToplevel(QwOptions &options)
Process configuration options for the subsystem array itself.
void ListPublishedValues() const
List the published values and description in this subsystem array.
void ConstructBranchAndVector(TTree *tree, std::vector< Double_t > &values)
Construct the tree and vector for this subsystem.
void ConstructBranch(TTree *tree, TString &prefix)
Construct a branch for this subsystem with a prefix.
void FillHistograms()
Fill the histograms for this subsystem.
Bool_t fHasDataLoaded
Has this array gotten data to be processed?
The pure virtual base class of all subsystems.
virtual ~QwSubsystemArray()
Virtual destructor.
static void DefineOptions(QwOptions &options)
Define configuration options for global array.
UInt_t GetCodaEventNumber() const
Get the internal record of the CODA event number.
Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
Process the event buffer for configuration events.
void FillTree()
Fill the tree for this subsystem.
void ShareHistograms(const QwSubsystemArray &source)
Share the histograms with another subsystem.
CanContainFn fnCanContain
Function to determine which subsystems we can accept.
static std::ostream & endl(std::ostream &)
End of the line.
void ProcessOptionsSubsystems(QwOptions &options)
Process configuration options for all subsystems in the array.
Double_t fCleanParameter[3]
Bool_t HasDataLoaded() const
Get data loaded flag.
void ProcessEvent()
Process the decoded data in this event.
An options class which parses command line, config file and environment.
Bool_t PublishByRequest(TString device_name)
Try to publish an internal variable matching the submitted name.
std::vector< std::string > fSubsystemsDisabledByType
List of disabled names.
Bool_t(* CanContainFn)(VQwSubsystem *)
void LoadSubsystemsFromParameterFile(QwParameterFile &detectors)
std::vector< std::string > fSubsystemsDisabledByName
List of disabled types.
void SetCodaEventType(UInt_t evttype)
Set the internal record of the CODA event type.
VQwHardwareChannel * ReturnInternalValueForFriends(const TString &name) const
Retrieve the variable name from subsystems in this subsystem array.
UInt_t fEventTypeMask
Mask of event types.
void ConstructHistograms(TDirectory *folder)
Construct the histograms for this subsystem in a folder.
UInt_t GetEventTypeMask() const
Get event type mask.
void SetCodaSegmentNumber(UInt_t segnum)
Set the internal record of the CODA segment number.
virtual std::vector< VQwSubsystem * > GetSubsystemByType(const std::string &type)
Get the list of subsystems of the specified type.
void DeleteTree()
Delete the tree for this subsystem.
void RandomizeEventData(int helicity=0, double time=0.0)
Randomize the data in this event.
UInt_t UpdateEventTypeMask()
Update the event type mask from the subsystems.
#define QwError
Predefined log drain for errors.
void FillTreeVector(std::vector< Double_t > &values) const
Fill the vector for this subsystem.