9 #ifndef __VQWSUBSYSTEM__
10 #define __VQWSUBSYSTEM__
19 #include "TDirectory.h"
125 std::cout <<
" VQwHardwareChannel::ReturnInternalValue for value name, " << name.Data()
126 <<
" define the routine in the respective subsystem to process this! " <<std::endl;
175 virtual 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){
182 virtual Int_t
ProcessEvBuffer(
const UInt_t roc_id,
const UInt_t bank_id, UInt_t* buffer, UInt_t num_words) = 0;
245 virtual void FillTreeVector(std::vector<Double_t>& values)
const = 0;
271 virtual void ConstructTree(TDirectory *folder, TString &prefix) {
return; };
304 Int_t
GetSubbankIndex(
const UInt_t roc_id,
const UInt_t bank_id)
const;
311 Int_t
FindIndex(
const std::vector<UInt_t> &myvec,
const UInt_t value)
const ;
341 return (
typeid(*
this) ==
typeid(*source));
352 #endif // __VQWSUBSYSTEM__
Int_t GetSubbankIndex() const
virtual void EncodeEventData(std::vector< UInt_t > &buffer)
virtual void ConstructBranch(TTree *tree, TString &prefix)=0
Construct the branch and tree vector.
VQwSubsystem(const VQwSubsystem &orig)
Copy constructor by object.
virtual 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)
std::map< TString, TString > fDetectorMaps
virtual void FillTreeVector(std::vector< Double_t > &values) const =0
Fill the tree vector.
VQwSubsystem * GetSibling(const std::string &name) const
Get the sibling with specified name.
virtual std::vector< TString > GetParamFileNameList()
void SetParent(QwSubsystemArray *parent)
Set the parent of this subsystem to the specified array.
virtual void ProcessOptions(QwOptions &options)
Process the command line options.
virtual Bool_t PublishByRequest(TString device_name)
Try to publish an internal variable matching the submitted name.
std::vector< QwSubsystemArray * > fArrays
Vector of pointers to subsystem arrays that contain this subsystem.
virtual Int_t LoadChannelMap(TString mapfile)=0
Mandatory map file definition.
class VQwCloneable< VQwSubsystem > VQwSubsystemCloneable
Mix-in factory functionality for subsystems.
virtual void RandomizeEventData(int helicity=0, double time=0.0)
virtual void ProcessEvent_2()
Process the event data again, including data from other subsystems. Not all derived classes will requ...
Bool_t HasDataLoaded() const
virtual const VQwHardwareChannel * ReturnInternalValue(const TString &name) const
Return a pointer to a varialbe to the parent subsystem array to be delivered to a different subsystem...
virtual Int_t LoadDetectorMaps(QwParameterFile &file)
Parse parameter file to find the map files.
virtual void ConstructHistograms(TDirectory *folder)
Construct the histograms for this subsystem in a folder.
virtual void ConstructTree(TString &prefix)
Construct the tree for this subsystem with a prefix.
virtual void ConstructTree(TDirectory *folder, TString &prefix)
Construct the tree for this subsystem in a folder with a prefix.
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
UInt_t fEventTypeMask
Mask of event types.
virtual std::map< TString, TString > GetDetectorMaps()
virtual Int_t LoadEventCuts(TString mapfile)
Optional event cut file.
std::map< TString, VQwHardwareChannel * > fPublishedInternalValues
Map of published internal values.
virtual Int_t LoadCrosstalkDefinition(TString mapfile)
Optional crosstalk definition.
Int_t FindIndex(const std::vector< UInt_t > &myvec, const UInt_t value) const
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
#define QwDebug
Predefined log drain for debugging output.
virtual void ConstructBranchAndVector(TTree *tree, std::vector< Double_t > &values)
Construct the branch and tree vector.
static void DefineOptions()
Define options function (note: no virtual static functions in C++)
virtual void ConstructTree(TDirectory *folder)
Construct the tree for this subsystem in a folder.
TString fSystemName
Name of this subsystem.
void SetEventTypeMask(const UInt_t mask)
Set event type mask.
virtual void FillHistograms()=0
Fill the histograms for this subsystem.
virtual void DeleteTree()
Delete the tree for this subsystem.
virtual void PrintInfo() const
Print some information about the subsystem.
std::vector< std::vector< TString > > fPublishList
List of parameters to be published (loaded at the channel map)
virtual void ProcessEvent()=0
The pure virtual base class of all subsystems.
virtual Bool_t ReturnInternalValue(const TString &name, VQwHardwareChannel *value) const
Return a named value to the parent subsystem array to be delivered to a different subsystem...
VQwSubsystem(const TString &name)
Constructor with name.
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
virtual ~VQwSubsystem()
Default destructor.
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Int_t RegisterSubbank(const UInt_t bank_id)
Tell the object that it will decode data from this sub-bank in the ROC currently open for registratio...
virtual Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id=0)
Tell the object that it will decode data from this ROC and sub-bank.
virtual Int_t LoadGeometryDefinition(TString mapfile)
Optional geometry definition.
virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)=0
Construct the branch and tree vector.
static std::ostream & endl(std::ostream &)
End of the line.
Bool_t Compare(VQwSubsystem *source)
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
Bool_t RequestExternalValue(const TString &name, VQwHardwareChannel *value) const
Request a named value which is owned by an external subsystem; the request will be handled by the par...
void UpdatePublishedValue(const TString &name, VQwHardwareChannel *data_channel)
QwSubsystemArray * GetParent(const unsigned int parent=0) const
Get the parent of this subsystem.
virtual void FillTree()
Fill the tree for this subsystem.
Bool_t PublishInternalValue(const TString &name, const TString &desc, const VQwHardwareChannel *value) const
Publish a variable name to the parent subsystem array.
virtual void ConstructTree()
Construct the tree for this subsystem.
std::vector< TString > fDetectorMapsNames
virtual Int_t LoadInputParameters(TString mapfile)=0
Mandatory parameter file definition.
UInt_t GetEventTypeMask() const
Get event type mask.
virtual Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)=0
virtual void ConstructHistograms(TString &prefix)
Construct the histograms for this subsystem with a prefix.
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Bool_t fIsDataLoaded
Has this subsystem gotten data to be processed?
void ClearAllBankRegistrations()
Clear all registration of ROC and Bank IDs for this subsystem.
virtual void ExchangeProcessedData()
Request processed data from other subsystems for internal use in the second event processing stage...
virtual Bool_t PublishInternalValues() const
Publish all variables of the subsystem.
virtual void PrintDetectorMaps(Bool_t status) const
TString GetSubsystemName() const
virtual void ClearEventData()=0
virtual void AtEndOfEventLoop()
Perform actions at the end of the event loop.
void SetDataLoaded(Bool_t flag)