JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
VQwSubsystem Class Referenceabstract

Base class for subsystems implementing container-delegation pattern. More...

#include <VQwSubsystem.h>

+ Inheritance diagram for VQwSubsystem:
+ Collaboration diagram for VQwSubsystem:

Public Member Functions

 VQwSubsystem (const TString &name)
 Constructor with name.
 
 VQwSubsystem (const VQwSubsystem &orig)
 Copy constructor by object.
 
 ~VQwSubsystem () override
 Default destructor.
 
virtual void ProcessOptions (QwOptions &)
 Process the command line options.
 
TString GetName () const
 
Bool_t HasDataLoaded () const
 
VQwSubsystemGetSibling (const std::string &name) const
 Get the sibling with specified name.
 
virtual std::vector< TString > GetParamFileNameList ()
 
virtual std::map< TString, TString > GetDetectorMaps ()
 
Bool_t PublishByRequest (TString) override
 Try to publish an internal variable matching the submitted name.
 
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.
 
virtual Int_t LoadChannelMap (TString mapfile)=0
 Mandatory map file definition.
 
virtual Int_t LoadInputParameters (TString mapfile)=0
 Mandatory parameter file definition.
 
virtual Int_t LoadGeometryDefinition (TString)
 Optional geometry definition.
 
virtual Int_t LoadCrosstalkDefinition (TString)
 Optional crosstalk definition.
 
virtual Int_t LoadEventCuts (TString)
 Optional event cut file.
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask.
 
UInt_t GetEventTypeMask () const
 Get event type mask.
 
virtual void ClearEventData ()=0
 
virtual Int_t ProcessConfigurationBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)=0
 
virtual 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)
 
virtual Int_t ProcessEvBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)=0
 TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version.
 
virtual void ProcessEvent ()=0
 
virtual void ExchangeProcessedData ()
 Request processed data from other subsystems for internal use in the second event processing stage. Not all derived classes will require data from other subsystems.
 
virtual void ProcessEvent_2 ()
 Process the event data again, including data from other subsystems. Not all derived classes will require a second stage of event data processing.
 
virtual void AtEndOfEventLoop ()
 Perform actions at the end of the event loop.
 
virtual void RandomizeEventData (int=0, double=0.0)
 
virtual void EncodeEventData (std::vector< UInt_t > &)
 
Objects construction and maintenance
virtual void ConstructObjects ()
 Construct the objects for this subsystem.
 
virtual void ConstructObjects (TDirectory *folder)
 Construct the objects for this subsystem in a folder.
 
virtual void ConstructObjects (TString &prefix)
 Construct the objects for this subsystem with a prefix.
 
virtual void ConstructObjects (TDirectory *, TString &)
 Construct the objects for this subsystem in a folder with a prefix.
 
Histogram construction and maintenance
virtual void ConstructHistograms ()
 Construct the histograms for this subsystem.
 
virtual void ConstructHistograms (TDirectory *folder)
 Construct the histograms for this subsystem in a folder.
 
virtual void ConstructHistograms (TString &prefix)
 Construct the histograms for this subsystem with a prefix.
 
virtual void ConstructHistograms (TDirectory *folder, TString &prefix)=0
 Construct the histograms for this subsystem in a folder with a prefix.
 
virtual void FillHistograms ()=0
 Fill the histograms for this subsystem.
 
Tree and branch construction and maintenance

The methods should exist for all subsystems and are therefore defined as pure virtual.

virtual void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)=0
 Construct the branch and tree vector.
 
virtual void ConstructBranchAndVector (TTree *tree, QwRootTreeBranchVector &values)
 Construct the branch and tree vector.
 
virtual void ConstructBranch (TTree *tree, TString &prefix)=0
 Construct the branch and tree vector.
 
virtual void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)=0
 Construct the branch and tree vector based on the trim file.
 
virtual void FillTreeVector (QwRootTreeBranchVector &values) const =0
 Fill the tree vector.
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects.
 
- Public Member Functions inherited from MQwPublishable_child< QwSubsystemArray, VQwSubsystem >
 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 (QwSubsystemArray *parent)
 Set the parent container for this child object.
 
QwSubsystemArrayGetParent () const
 Get the parent container for this child object.
 

Static Public Member Functions

static void DefineOptions ()
 Define options function (note: no virtual static functions in C++)
 

Protected Attributes

std::vector< std::vector< TString > > fPublishList
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element.
 

Expert 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.

TString fSystemName
 Name of this subsystem.
 
UInt_t fEventTypeMask
 Mask of event types.
 
Bool_t fIsDataLoaded
 Has this subsystem gotten data to be processed?
 
std::vector< TString > fDetectorMapsNames
 Names of loaded detector map files.
 
std::map< TString, TString > fDetectorMaps
 Map of file name to full path or content.
 
ROCID_t fCurrentROC_ID
 ROC ID that is currently being processed.
 
BankID_t fCurrentBank_ID
 Bank ID (and Marker word) that is currently being processed;.
 
std::vector< ROCID_tfROC_IDs
 Vector of ROC IDs associated with this subsystem.
 
std::vector< std::vector< BankID_t > > fBank_IDs
 Vector of Bank IDs per ROC ID associated with this subsystem.
 
std::vector< std::vector< std::vector< UInt_t > > > fMarkerWords
 Vector of marker words per ROC & subbank associated with this subsystem.
 
virtual void ConstructTree ()
 Construct the tree for this subsystem.
 
virtual void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder.
 
virtual void ConstructTree (TString &prefix)
 Construct the tree for this subsystem with a prefix.
 
virtual void ConstructTree (TDirectory *, TString &)
 Construct the tree for this subsystem in a folder with a prefix.
 
virtual void FillTree ()
 Fill the tree for this subsystem.
 
virtual void DeleteTree ()
 Delete the tree for this subsystem.
 
virtual void PrintInfo () const
 Print some information about the subsystem.
 
virtual VQwSubsystemoperator= (VQwSubsystem *value)
 Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)
 
virtual void PrintDetectorMaps (Bool_t status) const
 
void GetMarkerWordList (const ROCID_t roc_id, const BankID_t bank_id, std::vector< UInt_t > &marker) const
 
std::vector< ROCID_tGetROCIds () const
 
void ClearAllBankRegistrations ()
 Clear all registration of ROC and Bank IDs for this subsystem.
 
virtual Int_t RegisterROCNumber (const ROCID_t roc_id, const BankID_t bank_id=0)
 Tell the object that it will decode data from this ROC and sub-bank.
 
Int_t RegisterSubbank (const BankID_t bank_id)
 Tell the object that it will decode data from this sub-bank in the ROC currently open for registration.
 
Int_t RegisterMarkerWord (const UInt_t markerword)
 
void RegisterRocBankMarker (QwParameterFile &mapstr)
 
Int_t GetSubbankIndex () const
 
Int_t GetSubbankIndex (const ROCID_t roc_id, const BankID_t bank_id) const
 
void SetDataLoaded (Bool_t flag)
 
template<class T>
Int_t FindIndex (const std::vector< T > &myvec, const T value) const
 
Bool_t Compare (VQwSubsystem *source)
 
 VQwSubsystem ()
 

Additional Inherited Members

- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor.
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor.
 
virtual ~MQwHistograms ()
 Virtual destructor.
 
MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 
- Protected Member Functions inherited from MQwPublishable_child< QwSubsystemArray, VQwSubsystem >
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

Base class for subsystems implementing container-delegation pattern.

VQwSubsystem serves as the foundation for all analysis subsystems and implements the container-delegation architectural pattern. Unlike individual data elements that use the dual-operator pattern, subsystems delegate arithmetic operations to their contained elements and avoid virtual operators.

Container-Delegation Pattern:
VQwSubsystem uses a fundamentally different approach from VQwDataElement:

Key Design Principles:

  • No virtual operators in subsystem base classes
  • Single operator versions: Only type-specific operators needed
  • Delegation to elements: Operators iterate over contained objects
  • Type safety via typeid: Runtime type checking without inheritance conflicts
Implementation Pattern:
VQwSubsystem& operator+=(const VQwSubsystem& value) {
// Iterate over contained elements
for(size_t i=0; i<fElements.size(); i++) {
VQwDataElement* elem1 = this->GetElement(i);
VQwDataElement* elem2 = value.GetElement(i);
if (typeid(*elem1) == typeid(*elem2)) {
*elem1 += *elem2; // Delegates to element operators
} else {
// Handle type mismatch
}
}
return *this;
}
The pure virtual base class of all data elements.
VQwSubsystem(const TString &name)
Constructor with name.
Subsystem Architecture:
Specialized Abstract Bases:
Some hierarchies introduce specialized bases between VQwSubsystem and concrete implementations (e.g., VQwBPM, VQwBCM, VQwClock) to enable polymorphic dispatch for specific detector types while maintaining the container-delegation pattern.
Representative Example:
QwBeamLine demonstrates the complete subsystem implementation:
  • Container management for BPMs, BCMs, and other beam devices
  • Type-safe delegation to heterogeneous element collections
  • CODA buffer processing with ROC/Bank mapping
  • Event-level processing and running statistics
  • Integration with QwSubsystemArrayParity via factory pattern
Composition over Inheritance:
The container-delegation pattern provides:
  • Type safety: Runtime checks without virtual operator conflicts
  • Flexibility: Support for heterogeneous element collections
  • Performance: Direct delegation without virtual dispatch overhead
  • Maintainability: Clear separation between container and element concerns

Definition at line 114 of file VQwSubsystem.h.

Constructor & Destructor Documentation

◆ VQwSubsystem() [1/3]

VQwSubsystem::VQwSubsystem ( const TString & name)
inline

Constructor with name.

Definition at line 119 of file VQwSubsystem.h.

120 : MQwHistograms(),
122 fSystemName(name), fEventTypeMask(0x0), fIsDataLoaded(kFALSE),
125 }
MQwHistograms()
Default constructor.
BankID_t fCurrentBank_ID
Bank ID (and Marker word) that is currently being processed;.
TString fSystemName
Name of this subsystem.
Bool_t fIsDataLoaded
Has this subsystem gotten data to be processed?
void ClearAllBankRegistrations()
Clear all registration of ROC and Bank IDs for this subsystem.
ROCID_t fCurrentROC_ID
ROC ID that is currently being processed.
UInt_t fEventTypeMask
Mask of event types.

References ClearAllBankRegistrations(), fCurrentBank_ID, fCurrentROC_ID, fEventTypeMask, fIsDataLoaded, fSystemName, MQwHistograms::MQwHistograms(), MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::MQwPublishable_child(), and VQwSubsystem().

Referenced by QwBeamLine::AccumulateRunningSum(), QwBeamMod::AccumulateRunningSum(), QwCombinerSubsystem::AccumulateRunningSum(), QwHelicity::AccumulateRunningSum(), QwIntegratedRaster::AccumulateRunningSum(), QwMollerDetector::AccumulateRunningSum(), QwScaler::AccumulateRunningSum(), VQwDetectorArray::AccumulateRunningSum(), VQwSubsystemParity::AccumulateRunningSum(), QwBeamLine::CheckForBurpFail(), QwBeamMod::CheckForBurpFail(), QwCombinerSubsystem::CheckForBurpFail(), QwFakeHelicity::CheckForBurpFail(), QwHelicity::CheckForBurpFail(), QwIntegratedRaster::CheckForBurpFail(), QwMollerDetector::CheckForBurpFail(), QwScaler::CheckForBurpFail(), VQwDetectorArray::CheckForBurpFail(), VQwSubsystemParity::CheckForBurpFail(), QwHelicity::CheckPatternNum(), QwBeamLine::Compare(), QwBeamMod::Compare(), QwHelicity::Compare(), QwIntegratedRaster::Compare(), QwMollerDetector::Compare(), QwScaler::Compare(), VQwDetectorArray::Compare(), Compare(), QwBeamLine::CopyTemplatedDataElements(), QwBeamLine::DeaccumulateRunningSum(), QwBeamMod::DeaccumulateRunningSum(), QwCombinerSubsystem::DeaccumulateRunningSum(), QwHelicity::DeaccumulateRunningSum(), QwIntegratedRaster::DeaccumulateRunningSum(), QwMollerDetector::DeaccumulateRunningSum(), QwScaler::DeaccumulateRunningSum(), VQwDetectorArray::DeaccumulateRunningSum(), VQwSubsystemParity::DeaccumulateRunningSum(), QwIntegratedRaster::Difference(), VQwSubsystemParity::Difference(), GetSibling(), QwBeamMod::LoadGeometry(), QwHelicity::MatchActualHelicity(), QwHelicity::MergeCounters(), QwCombinerSubsystem::operator*=(), QwBeamLine::operator+=(), QwBeamMod::operator+=(), QwCombinerSubsystem::operator+=(), QwHelicity::operator+=(), QwIntegratedRaster::operator+=(), QwMollerDetector::operator+=(), QwScaler::operator+=(), VQwDetectorArray::operator+=(), VQwSubsystemParity::operator+=(), QwBeamLine::operator-=(), QwBeamMod::operator-=(), QwCombinerSubsystem::operator-=(), QwHelicity::operator-=(), QwIntegratedRaster::operator-=(), QwMollerDetector::operator-=(), QwScaler::operator-=(), VQwDetectorArray::operator-=(), VQwSubsystemParity::operator-=(), QwCombinerSubsystem::operator/=(), QwBeamLine::operator=(), QwBeamMod::operator=(), QwCombinerSubsystem::operator=(), QwHelicity::operator=(), QwIntegratedRaster::operator=(), QwMollerDetector::operator=(), QwScaler::operator=(), VQwDetectorArray::operator=(), operator=(), VQwSubsystemParity::operator=(), QwBeamLine::QwBeamLine(), QwBeamLine::QwBeamLine(), QwBeamMod::QwBeamMod(), QwBeamMod::QwBeamMod(), QwBlindDetectorArray::QwBlindDetectorArray(), QwBlindDetectorArray::QwBlindDetectorArray(), QwCombinerSubsystem::QwCombinerSubsystem(), QwCombinerSubsystem::QwCombinerSubsystem(), QwDetectorArray::QwDetectorArray(), QwDetectorArray::QwDetectorArray(), QwFakeHelicity::QwFakeHelicity(), QwHelicity::QwHelicity(), QwHelicity::QwHelicity(), QwIntegratedRaster::QwIntegratedRaster(), QwIntegratedRaster::QwIntegratedRaster(), QwMollerDetector::QwMollerDetector(), QwMollerDetector::QwMollerDetector(), QwScaler::QwScaler(), QwScaler::QwScaler(), QwBeamLine::Ratio(), QwBeamMod::Ratio(), QwCombinerSubsystem::Ratio(), QwHelicity::Ratio(), QwIntegratedRaster::Ratio(), QwMollerDetector::Ratio(), QwScaler::Ratio(), VQwDetectorArray::Ratio(), VQwSubsystemParity::Ratio(), QwBeamLine::SetRandomEventAsymmetry(), QwMollerDetector::SingleEventCuts(), QwIntegratedRaster::Sum(), VQwSubsystemParity::Sum(), QwBeamLine::UpdateErrorFlag(), QwBeamMod::UpdateErrorFlag(), QwCombinerSubsystem::UpdateErrorFlag(), QwHelicity::UpdateErrorFlag(), QwIntegratedRaster::UpdateErrorFlag(), QwMollerDetector::UpdateErrorFlag(), QwScaler::UpdateErrorFlag(), VQwDetectorArray::UpdateErrorFlag(), VQwSubsystemParity::UpdateErrorFlag(), VQwDetectorArray::VQwDetectorArray(), VQwDetectorArray::VQwDetectorArray(), VQwSubsystem(), VQwSubsystem(), VQwSubsystemParity::VQwSubsystemParity(), and VQwSubsystemParity::VQwSubsystemParity().

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

◆ VQwSubsystem() [2/3]

VQwSubsystem::VQwSubsystem ( const VQwSubsystem & orig)
inline

Copy constructor by object.

Definition at line 127 of file VQwSubsystem.h.

128 : MQwHistograms(orig),
131 fROC_IDs(orig.fROC_IDs),
132 fBank_IDs(orig.fBank_IDs),
134 {
139 }
std::vector< std::vector< TString > > fPublishList
std::vector< ROCID_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
std::vector< std::vector< BankID_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
std::vector< std::vector< std::vector< UInt_t > > > fMarkerWords
Vector of marker words per ROC & subbank associated with this subsystem.

References fBank_IDs, fCurrentBank_ID, fCurrentROC_ID, fIsDataLoaded, fMarkerWords, fPublishList, fROC_IDs, fSystemName, MQwHistograms::MQwHistograms(), MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::MQwPublishable_child(), and VQwSubsystem().

+ Here is the call graph for this function:

◆ ~VQwSubsystem()

VQwSubsystem::~VQwSubsystem ( )
inlineoverride

Default destructor.

Definition at line 142 of file VQwSubsystem.h.

142{ }

◆ VQwSubsystem() [3/3]

VQwSubsystem::VQwSubsystem ( )
private

Member Function Documentation

◆ AtEndOfEventLoop()

virtual void VQwSubsystem::AtEndOfEventLoop ( )
inlinevirtual

Perform actions at the end of the event loop.

Definition at line 238 of file VQwSubsystem.h.

238{QwDebug << fSystemName << " at end of event loop" << QwLog::endl;};
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297

References QwLog::endl(), fSystemName, and QwDebug.

Referenced by QwSubsystemArray::AtEndOfEventLoop().

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

◆ ClearAllBankRegistrations()

void VQwSubsystem::ClearAllBankRegistrations ( )
protected

Clear all registration of ROC and Bank IDs for this subsystem.

Clear all registration of ROC and Bank IDs for this subsystem and reset current ROC/bank IDs to null.

Definition at line 143 of file VQwSubsystem.cc.

144{
145 fBank_IDs.clear();
146 fROC_IDs.clear();
149}
static const BankID_t kNullBankID
Definition QwTypes.h:23
static const ROCID_t kNullROCID
Bank ID will combine both bank and marker words.
Definition QwTypes.h:22

References fBank_IDs, fCurrentBank_ID, fCurrentROC_ID, fROC_IDs, kNullBankID, and kNullROCID.

Referenced by VQwSubsystem().

+ Here is the caller graph for this function:

◆ ClearEventData()

virtual void VQwSubsystem::ClearEventData ( )
pure virtual

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwFakeHelicity, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by QwSubsystemArray::ClearEventData().

+ Here is the caller graph for this function:

◆ Compare()

Bool_t VQwSubsystem::Compare ( VQwSubsystem * source)
inlineprotected

Definition at line 506 of file VQwSubsystem.h.

506 {
507 return (typeid(*this) == typeid(*source));
508 }

References VQwSubsystem().

Referenced by VQwSubsystemParity::Difference(), and VQwSubsystemParity::Sum().

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

◆ ConstructBranch() [1/2]

virtual void VQwSubsystem::ConstructBranch ( TTree * tree,
TString & prefix )
pure virtual

Construct the branch and tree vector.

Construct the branches for this subsystem.

Parameters
treeOutput ROOT tree.
prefixName prefix for all branch names.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by QwSubsystemArray::ConstructBranch(), and QwSubsystemArray::ConstructBranch().

+ Here is the caller graph for this function:

◆ ConstructBranch() [2/2]

virtual void VQwSubsystem::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & trim_file )
pure virtual

Construct the branch and tree vector based on the trim file.

Construct the branches for this subsystem using a trim file.

Parameters
treeOutput ROOT tree.
prefixName prefix for all branch names.
trim_fileTrim file describing which branches to construct.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

◆ ConstructBranchAndVector() [1/2]

virtual void VQwSubsystem::ConstructBranchAndVector ( TTree * tree,
QwRootTreeBranchVector & values )
inlinevirtual

Construct the branch and tree vector.

Reimplemented in QwBeamLine, QwBeamMod, QwHelicity, QwMollerDetector, QwScaler, and VQwDetectorArray.

Definition at line 303 of file VQwSubsystem.h.

303 {
304 TString tmpstr("");
305 ConstructBranchAndVector(tree,tmpstr,values);
306 };
virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)=0
Construct the branch and tree vector.

References ConstructBranchAndVector().

+ Here is the call graph for this function:

◆ ConstructBranchAndVector() [2/2]

virtual void VQwSubsystem::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )
pure virtual

Construct the branch and tree vector.

Construct the branch and fill the provided values vector.

Parameters
treeOutput ROOT tree to which branches are added.
prefixName prefix for all branch names.
valuesVector that will be filled by FillTreeVector.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by QwSubsystemArray::ConstructBranchAndVector(), ConstructBranchAndVector(), QwBeamMod::LoadGeometry(), and QwBeamLine::SetRandomEventAsymmetry().

+ Here is the caller graph for this function:

◆ ConstructHistograms() [1/4]

virtual void VQwSubsystem::ConstructHistograms ( )
inlinevirtual

Construct the histograms for this subsystem.

Reimplemented in QwBeamLine, QwBeamMod, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Definition at line 270 of file VQwSubsystem.h.

270 {
271 TString tmpstr("");
272 ConstructHistograms((TDirectory*) NULL, tmpstr);
273 };
virtual void ConstructHistograms()
Construct the histograms for this subsystem.

References ConstructHistograms().

Referenced by ConstructHistograms(), ConstructHistograms(), ConstructHistograms(), QwBeamMod::LoadGeometry(), QwIntegratedRaster::Scale(), QwBeamLine::SetRandomEventAsymmetry(), and QwMollerDetector::SingleEventCuts().

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

◆ ConstructHistograms() [2/4]

virtual void VQwSubsystem::ConstructHistograms ( TDirectory * folder)
inlinevirtual

Construct the histograms for this subsystem in a folder.

Reimplemented in QwBeamLine, QwBeamMod, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Definition at line 275 of file VQwSubsystem.h.

275 {
276 TString tmpstr("");
277 ConstructHistograms(folder, tmpstr);
278 };

References ConstructHistograms().

+ Here is the call graph for this function:

◆ ConstructHistograms() [3/4]

virtual void VQwSubsystem::ConstructHistograms ( TDirectory * folder,
TString & prefix )
pure virtual

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

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

◆ ConstructHistograms() [4/4]

virtual void VQwSubsystem::ConstructHistograms ( TString & prefix)
inlinevirtual

Construct the histograms for this subsystem with a prefix.

Reimplemented in QwBeamLine, QwBeamMod, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Definition at line 280 of file VQwSubsystem.h.

280 {
281 ConstructHistograms((TDirectory*) NULL, prefix);
282 };

References ConstructHistograms().

+ Here is the call graph for this function:

◆ ConstructObjects() [1/4]

virtual void VQwSubsystem::ConstructObjects ( )
inlinevirtual

Construct the objects for this subsystem.

Definition at line 249 of file VQwSubsystem.h.

249 {
250 TString tmpstr("");
251 ConstructObjects((TDirectory*) NULL, tmpstr);
252 };
virtual void ConstructObjects()
Construct the objects for this subsystem.

References ConstructObjects().

Referenced by ConstructObjects(), ConstructObjects(), and ConstructObjects().

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

◆ ConstructObjects() [2/4]

virtual void VQwSubsystem::ConstructObjects ( TDirectory * ,
TString &  )
inlinevirtual

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

Definition at line 263 of file VQwSubsystem.h.

263{ };

◆ ConstructObjects() [3/4]

virtual void VQwSubsystem::ConstructObjects ( TDirectory * folder)
inlinevirtual

Construct the objects for this subsystem in a folder.

Definition at line 254 of file VQwSubsystem.h.

254 {
255 TString tmpstr("");
256 ConstructObjects(folder, tmpstr);
257 };

References ConstructObjects().

+ Here is the call graph for this function:

◆ ConstructObjects() [4/4]

virtual void VQwSubsystem::ConstructObjects ( TString & prefix)
inlinevirtual

Construct the objects for this subsystem with a prefix.

Definition at line 259 of file VQwSubsystem.h.

259 {
260 ConstructObjects((TDirectory*) NULL, prefix);
261 };

References ConstructObjects().

+ Here is the call graph for this function:

◆ ConstructTree() [1/4]

virtual void VQwSubsystem::ConstructTree ( )
inlinevirtual

Construct the tree for this subsystem.

Definition at line 362 of file VQwSubsystem.h.

362 {
363 TString tmpstr("");
364 ConstructTree((TDirectory*) NULL, tmpstr);
365 };
virtual void ConstructTree()
Construct the tree for this subsystem.

References ConstructTree().

Referenced by ConstructTree(), ConstructTree(), and ConstructTree().

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

◆ ConstructTree() [2/4]

virtual void VQwSubsystem::ConstructTree ( TDirectory * ,
TString &  )
inlinevirtual

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

Definition at line 376 of file VQwSubsystem.h.

376{ return; };

◆ ConstructTree() [3/4]

virtual void VQwSubsystem::ConstructTree ( TDirectory * folder)
inlinevirtual

Construct the tree for this subsystem in a folder.

Definition at line 367 of file VQwSubsystem.h.

367 {
368 TString tmpstr("");
369 ConstructTree(folder, tmpstr);
370 };

References ConstructTree().

+ Here is the call graph for this function:

◆ ConstructTree() [4/4]

virtual void VQwSubsystem::ConstructTree ( TString & prefix)
inlinevirtual

Construct the tree for this subsystem with a prefix.

Definition at line 372 of file VQwSubsystem.h.

372 {
373 ConstructTree((TDirectory*) NULL, prefix);
374 };

References ConstructTree().

+ Here is the call graph for this function:

◆ DefineOptions()

static void VQwSubsystem::DefineOptions ( )
inlinestatic

Define options function (note: no virtual static functions in C++)

Definition at line 146 of file VQwSubsystem.h.

146{ /* No default options defined */ };

Referenced by DefineOptionsParity().

+ Here is the caller graph for this function:

◆ DeleteTree()

virtual void VQwSubsystem::DeleteTree ( )
inlinevirtual

Delete the tree for this subsystem.

Definition at line 380 of file VQwSubsystem.h.

380{ return; };

Referenced by QwSubsystemArray::DeleteTree().

+ Here is the caller graph for this function:

◆ EncodeEventData()

virtual void VQwSubsystem::EncodeEventData ( std::vector< UInt_t > & )
inlinevirtual

Reimplemented in QwBeamLine, QwHelicity, QwIntegratedRaster, and VQwDetectorArray.

Definition at line 243 of file VQwSubsystem.h.

243{ };

◆ ExchangeProcessedData()

virtual void VQwSubsystem::ExchangeProcessedData ( )
inlinevirtual

Request processed data from other subsystems for internal use in the second event processing stage. Not all derived classes will require data from other subsystems.

Reimplemented in QwIntegratedRaster, and VQwDetectorArray.

Definition at line 229 of file VQwSubsystem.h.

229{ };

Referenced by QwSubsystemArray::ProcessEvent().

+ Here is the caller graph for this function:

◆ FillHistograms()

virtual void VQwSubsystem::FillHistograms ( )
pure virtual

Fill the histograms for this subsystem.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by QwSubsystemArray::FillHistograms().

+ Here is the caller graph for this function:

◆ FillTree()

virtual void VQwSubsystem::FillTree ( )
inlinevirtual

Fill the tree for this subsystem.

Definition at line 378 of file VQwSubsystem.h.

378{ return; };

Referenced by QwSubsystemArray::FillTree().

+ Here is the caller graph for this function:

◆ FillTreeVector()

virtual void VQwSubsystem::FillTreeVector ( QwRootTreeBranchVector & values) const
pure virtual

Fill the tree vector.

Fill the tree export vector with the current event values.

Parameters
valuesOutput vector to be filled.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by QwSubsystemArray::FillTreeVector().

+ Here is the caller graph for this function:

◆ FindIndex()

template<class T>
Int_t VQwSubsystem::FindIndex ( const std::vector< T > & myvec,
const T value ) const
inlineprotected

Definition at line 467 of file VQwSubsystem.h.

468 {
469 Int_t index = -1;
470 for (size_t i=0 ; i < myvec.size(); i++ ){
471 if (myvec[i]==value){
472 index=i;
473 break;
474 }
475 }
476 return index;
477 };

Referenced by GetMarkerWordList(), GetSubbankIndex(), RegisterMarkerWord(), and RegisterROCNumber().

+ Here is the caller graph for this function:

◆ GetDetectorMaps()

std::map< TString, TString > VQwSubsystem::GetDetectorMaps ( )
virtual

Definition at line 311 of file VQwSubsystem.cc.

312{
313 return fDetectorMaps;
314}
std::map< TString, TString > fDetectorMaps
Map of file name to full path or content.

References fDetectorMaps.

◆ GetEventTypeMask()

UInt_t VQwSubsystem::GetEventTypeMask ( ) const
inline

Get event type mask.

Definition at line 208 of file VQwSubsystem.h.

208{ return fEventTypeMask; };

References fEventTypeMask.

Referenced by QwHelicity::ProcessEvBuffer(), ProcessEvBuffer(), and QwSubsystemArray::UpdateEventTypeMask().

+ Here is the caller graph for this function:

◆ GetMarkerWordList()

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

Definition at line 454 of file VQwSubsystem.h.

454 {
455 Int_t rocindex = FindIndex(fROC_IDs, roc_id);
456 if (rocindex>=0){
457 Int_t bankindex = FindIndex(fBank_IDs[rocindex],bank_id);
458 if (bankindex>=0 && fMarkerWords.at(rocindex).at(bankindex).size()>0){
459 std::vector<UInt_t> m = fMarkerWords.at(rocindex).at(bankindex);
460 marker.insert(marker.end(), m.begin(), m.end());
461 }
462 }
463 }
Int_t FindIndex(const std::vector< T > &myvec, const T value) const

References fBank_IDs, FindIndex(), fMarkerWords, and fROC_IDs.

+ Here is the call graph for this function:

◆ GetName()

◆ GetParamFileNameList()

std::vector< TString > VQwSubsystem::GetParamFileNameList ( )
virtual

Definition at line 303 of file VQwSubsystem.cc.

304{
305 return fDetectorMapsNames;
306}
std::vector< TString > fDetectorMapsNames
Names of loaded detector map files.

References fDetectorMapsNames.

◆ GetROCIds()

std::vector< ROCID_t > VQwSubsystem::GetROCIds ( ) const
inline

Definition at line 502 of file VQwSubsystem.h.

502{ return fROC_IDs; }

References fROC_IDs.

◆ GetSibling()

VQwSubsystem * VQwSubsystem::GetSibling ( const std::string & name) const

Get the sibling with specified name.

Get a sibling subsystem by name from the parent array.

Parameters
nameName of the sibling subsystem.
Returns
Pointer to the sibling, or NULL if not found.

Definition at line 129 of file VQwSubsystem.cc.

130{
131 // Get the parent and check for existence
132 QwSubsystemArray* parent = GetParent();
133 if (parent != 0)
134 // Return the subsystem with name in the parent
135 return parent->GetSubsystemByName(name);
136 else
137 return 0; // GetParent() prints error already
138}
virtual VQwSubsystem * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.

References MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::GetParent(), QwSubsystemArray::GetSubsystemByName(), and VQwSubsystem().

+ Here is the call graph for this function:

◆ GetSubbankIndex() [1/2]

Int_t VQwSubsystem::GetSubbankIndex ( ) const
inlineprotected

Get the current flat subbank index (based on current ROC/bank).

Returns
Subbank index, or -1 if not found.

Definition at line 443 of file VQwSubsystem.h.

Int_t GetSubbankIndex() const

References fCurrentBank_ID, fCurrentROC_ID, and GetSubbankIndex().

Referenced by GetSubbankIndex(), QwBeamLine::LoadChannelMap(), QwBeamMod::LoadChannelMap(), QwHelicity::LoadChannelMap(), QwMollerDetector::LoadChannelMap(), QwScaler::LoadChannelMap(), VQwDetectorArray::LoadChannelMap(), QwBeamLine::ProcessEvBuffer(), QwBeamMod::ProcessEvBuffer(), QwHelicity::ProcessEvBuffer(), QwScaler::ProcessEvBuffer(), and VQwDetectorArray::ProcessEvBuffer().

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

◆ GetSubbankIndex() [2/2]

Int_t VQwSubsystem::GetSubbankIndex ( const ROCID_t roc_id,
const BankID_t bank_id ) const
protected

Compute the flat subbank index from ROC and bank IDs.

Parameters
roc_idROC identifier.
bank_idSubbank identifier within the ROC.
Returns
Subbank index, or -1 if not found.

Definition at line 152 of file VQwSubsystem.cc.

153{
154 // Bool_t lDEBUG=kTRUE;
155 Int_t index = -1;
156 Int_t roc_index = FindIndex(fROC_IDs, roc_id);//will return the vector index for the Roc from the vector fROC_IDs.
157 // std::cout << "------------- roc_index" << roc_index <<std::endl;
158 if (roc_index>=0){
159 index = FindIndex(fBank_IDs[roc_index],bank_id);
160 // std::cout << " Find Index " << index
161 // << " roc index " << roc_index
162 // << " index " << index <<std::endl;
163
164 if (index>=0){
165 for (Int_t i=0; i<roc_index; i++){
166 index += (fBank_IDs[i].size());
167 // std::cout << " i " << i
168 // << " fBank_IDs[i].size() " << fBank_IDs[i].size()
169 // << " index " << index
170 // << std::endl;
171 }
172 }
173 }
174 // std::cout << "return:index " << index << std::endl;
175 return index;
176}

References fBank_IDs, FindIndex(), and fROC_IDs.

+ Here is the call graph for this function:

◆ HasDataLoaded()

Bool_t VQwSubsystem::HasDataLoaded ( ) const
inline

Definition at line 152 of file VQwSubsystem.h.

152{return fIsDataLoaded;}

References fIsDataLoaded.

Referenced by QwBeamMod::FillHistograms(), QwHelicityPattern::LoadEventData(), and QwHelicity::ProcessEvent().

+ Here is the caller graph for this function:

◆ LoadChannelMap()

virtual Int_t VQwSubsystem::LoadChannelMap ( TString mapfile)
pure virtual

Mandatory map file definition.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by LoadDetectorMaps().

+ Here is the caller graph for this function:

◆ LoadCrosstalkDefinition()

virtual Int_t VQwSubsystem::LoadCrosstalkDefinition ( TString )
inlinevirtual

Optional crosstalk definition.

Definition at line 201 of file VQwSubsystem.h.

201{ return 0; };

Referenced by LoadDetectorMaps().

+ Here is the caller graph for this function:

◆ LoadDetectorMaps()

Int_t VQwSubsystem::LoadDetectorMaps ( QwParameterFile & file)
virtual

Parse parameter file to find the map files.

Parse a parameter file and dispatch to the appropriate loaders based on key-value pairs (map, param, eventcut, geom, cross, mask).

Parameters
fileParameter file to read and parse.
Returns
0 on success; non-zero on error.

Definition at line 41 of file VQwSubsystem.cc.

42{
43 Bool_t local_debug = false;
44
45 file.RewindToFileStart();
46
47 while (file.ReadNextLine()) {
48 // Trim comments and whitespace
49 file.TrimComment('!');
50 file.TrimComment('#');
51 file.TrimWhitespace();
52
53 // Find key-value pairs
54 std::string key, value;
55 if (file.HasVariablePair("=", key, value)) {
56 if ( value.size() > 0) {
57
58 // If-Ordering Optimization for parity
59 // Beamline 1423
60 // MainDetector 123
61 // Lumi 123
62 // Helicity 1
63 // Scanner 12
64 // Beammod 1
65 // 1(6),2(4),3(3),4(1)
66 // map, param, eventcut, geom
67
68 // Map file definition
69 if (key == "map" ) {
70 LoadChannelMap(value);
71 // fDetectorMapsNames.push_back(value);
72 }
73 // Parameter file definition
74 else if (key == "param" ) {
75 LoadInputParameters(value);
76 // fDetectorMapsNames.push_back(value);
77 }
78 // Event cut file definition
79 else if (key == "eventcut") {
80 LoadEventCuts(value);
81 // fDetectorMapsNames.push_back(value);
82 }
83 // Geometry file definition
84 else if (key == "geom" ) {
86 // fDetectorMapsNames.push_back(value);
87 }
88 // Crosstalk file definition
89 else if (key == "cross" ) {
91 // fDetectorMapsNames.push_back(value);
92 }
93 //Event type mask
94 else if (key == "mask") {
95 SetEventTypeMask(file.GetUInt(value));
96 }
97 }
98
99 } // end of HasVariablePair
100 } // end of while
101
102
103 //
104 // The above approach that fDetectorMapsNames.push_back(value) in VQwSubsystem doesn't work, because it reads the following...
105 //
106 // >>> VQwSubsystem::LoadDetectorMaps Subsystem Main Detector uses the following map files :
107 // ---> 1/3 : qweak_maindet.map
108 // ---> 2/3 : qweak_maindet_pedestal.map
109 // ---> 3/3 : qweak_maindet_eventcuts.in
110
111 //
112 // So, fDetectorMapsNams.push_back will be called LoadChannelMap(), LoadInputParameter(), LoadEventCuts(),
113 // and LoadGeometryDefinition() in each subsystem.
114 //
115 // >>> VQwSubsystem::LoadDetectorMaps Subsystem Main Detector uses the following map files :
116 // ---> 1/3 : /home/jhlee/QwAnalysis/trunk/Parity/prminput/qweak_maindet.10213-.map
117 // ---> 2/3 : /home/jhlee/QwAnalysis/trunk/Parity/prminput/qweak_maindet_pedestal.10229-.map
118 // ---> 3/3 : /home/jhlee/QwAnalysis/trunk/Parity/prminput/qweak_maindet_eventcuts.in
119 //
120 // Friday, March 18 15:32:09 EDT 2011, jhlee
121
122 PrintDetectorMaps(local_debug);
123
124 return 0;
125}
void TrimWhitespace(TString::EStripType head_tail=TString::kBoth)
Bool_t HasVariablePair(const std::string &separatorchars, std::string &varname, std::string &varvalue)
void TrimComment(const char commentchar)
static UInt_t GetUInt(const TString &varvalue)
virtual Int_t LoadChannelMap(TString mapfile)=0
Mandatory map file definition.
void SetEventTypeMask(const UInt_t mask)
Set event type mask.
virtual Int_t LoadEventCuts(TString)
Optional event cut file.
virtual Int_t LoadGeometryDefinition(TString)
Optional geometry definition.
virtual Int_t LoadInputParameters(TString mapfile)=0
Mandatory parameter file definition.
virtual void PrintDetectorMaps(Bool_t status) const
virtual Int_t LoadCrosstalkDefinition(TString)
Optional crosstalk definition.

References QwParameterFile::GetUInt(), QwParameterFile::HasVariablePair(), LoadChannelMap(), LoadCrosstalkDefinition(), LoadEventCuts(), LoadGeometryDefinition(), LoadInputParameters(), PrintDetectorMaps(), QwParameterFile::ReadNextLine(), QwParameterFile::RewindToFileStart(), SetEventTypeMask(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

Referenced by QwSubsystemArray::LoadSubsystemsFromParameterFile().

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

◆ LoadEventCuts()

virtual Int_t VQwSubsystem::LoadEventCuts ( TString )
inlinevirtual

Optional event cut file.

Reimplemented in QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwSubsystemParity.

Definition at line 203 of file VQwSubsystem.h.

203{ return 0; };

Referenced by LoadDetectorMaps().

+ Here is the caller graph for this function:

◆ LoadGeometryDefinition()

virtual Int_t VQwSubsystem::LoadGeometryDefinition ( TString )
inlinevirtual

Optional geometry definition.

Reimplemented in QwBeamLine.

Definition at line 199 of file VQwSubsystem.h.

199{ return 0; };

Referenced by LoadDetectorMaps().

+ Here is the caller graph for this function:

◆ LoadInputParameters()

virtual Int_t VQwSubsystem::LoadInputParameters ( TString mapfile)
pure virtual

Mandatory parameter file definition.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by LoadDetectorMaps().

+ Here is the caller graph for this function:

◆ operator=()

VQwSubsystem & VQwSubsystem::operator= ( VQwSubsystem * value)
virtual

Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)

Reimplemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, VQwDetectorArray, and VQwSubsystemParity.

Definition at line 295 of file VQwSubsystem.cc.

296{
297 this->fIsDataLoaded = value->fIsDataLoaded;
298 return *this;
299}

References fIsDataLoaded, and VQwSubsystem().

Referenced by QwHelicity::operator=(), and QwScaler::operator=().

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

◆ PrintDetectorMaps()

void VQwSubsystem::PrintDetectorMaps ( Bool_t status) const
virtual

Definition at line 319 of file VQwSubsystem.cc.

320{
321 Bool_t local_debug = false;
322 if (status) {
323 QwMessage << " >>> VQwSubsystem::LoadDetectorMaps Subsystem " << fSystemName
324 << " uses the following map files:" << QwLog::endl;
325
326 Int_t index = 0;
327 size_t total = fDetectorMaps.size();
328
329 if (total != 0) {
330
331 for (std::map<TString,TString>::const_iterator ii = fDetectorMaps.begin();
332 ii != fDetectorMaps.end(); ++ii) {
333
334 index++;
335 TString name = (*ii).first;
336 TString all = (*ii).second;
337 QwMessage << " ---> " << index << "/" << total << ": " << name << QwLog::endl;
338 if (local_debug)
339 QwMessage << " " << all << QwLog::endl;
340
341 }
342
343 } else {
344 QwMessage << " ---> No map files" << QwLog::endl;
345 }
346 }
347}
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49

References QwLog::endl(), fDetectorMaps, fSystemName, and QwMessage.

Referenced by LoadDetectorMaps().

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

◆ PrintInfo()

void VQwSubsystem::PrintInfo ( ) const
virtual

Print some information about the subsystem.

Print some information about the subsystem (name, ROCs/banks, parent).

Reimplemented in QwBeamLine, QwIntegratedRaster, QwScaler, and VQwDetectorArray.

Definition at line 281 of file VQwSubsystem.cc.

282{
283 std::cout << "Name of this subsystem: " << fSystemName << std::endl;
284 for (size_t roc_index = 0; roc_index < fROC_IDs.size(); roc_index++) {
285 std::cout << "ROC" << std::dec << fROC_IDs[roc_index] << ": ";
286 for (size_t bank_index = 0; bank_index < fBank_IDs[roc_index].size(); bank_index++)
287 std::cout << std::hex << "0x" << fBank_IDs[roc_index][bank_index] << " ";
288 std::cout << std::dec << std::endl;
289 }
290 std::cout << "in array " << std::hex << GetParent() << std::dec << std::endl;
291}

References fBank_IDs, fROC_IDs, fSystemName, and MQwPublishable_child< QwSubsystemArray, VQwSubsystem >::GetParent().

Referenced by QwScaler::PrintInfo().

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

◆ ProcessConfigurationBuffer()

virtual Int_t VQwSubsystem::ProcessConfigurationBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )
pure virtual

◆ ProcessEvBuffer() [1/2]

virtual Int_t VQwSubsystem::ProcessEvBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )
pure virtual

TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version.

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

◆ ProcessEvBuffer() [2/2]

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

TODO: Subsystems should be changing their ProcessEvBuffer routines to take the event_type as the first argument. But in the meantime, default to just calling the non-event-type-aware ProcessEvBuffer routine.

Reimplemented in QwHelicity, and QwMollerDetector.

Definition at line 215 of file VQwSubsystem.h.

215 {
216 /// TODO: Subsystems should be changing their ProcessEvBuffer routines to take the event_type as the first
217 /// argument. But in the meantime, default to just calling the non-event-type-aware ProcessEvBuffer routine.
218 if (((0x1 << (event_type - 1)) & this->GetEventTypeMask()) == 0) return 0;
219 else return this->ProcessEvBuffer(roc_id, bank_id, buffer, num_words);
220 };
UInt_t GetEventTypeMask() const
Get event type mask.
virtual 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)

References GetEventTypeMask(), and ProcessEvBuffer().

Referenced by ProcessEvBuffer().

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

◆ ProcessEvent()

virtual void VQwSubsystem::ProcessEvent ( )
pure virtual

Implemented in QwBeamLine, QwBeamMod, QwCombinerSubsystem, QwFakeHelicity, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Referenced by QwSubsystemArray::ProcessEvent().

+ Here is the caller graph for this function:

◆ ProcessEvent_2()

virtual void VQwSubsystem::ProcessEvent_2 ( )
inlinevirtual

Process the event data again, including data from other subsystems. Not all derived classes will require a second stage of event data processing.

Reimplemented in QwBeamMod, QwIntegratedRaster, and VQwDetectorArray.

Definition at line 234 of file VQwSubsystem.h.

234{ };

Referenced by QwSubsystemArray::ProcessEvent().

+ Here is the caller graph for this function:

◆ ProcessOptions()

virtual void VQwSubsystem::ProcessOptions ( QwOptions & )
inlinevirtual

Process the command line options.

Reimplemented in QwBeamLine, QwBeamMod, QwHelicity, QwIntegratedRaster, QwMollerDetector, QwScaler, and VQwDetectorArray.

Definition at line 148 of file VQwSubsystem.h.

148{ };

Referenced by QwSubsystemArray::ProcessOptionsSubsystems().

+ Here is the caller graph for this function:

◆ PublishByRequest()

Bool_t VQwSubsystem::PublishByRequest ( TString )
inlineoverridevirtual

Try to publish an internal variable matching the submitted name.

Implements MQwPublishable_child< QwSubsystemArray, VQwSubsystem >.

Definition at line 170 of file VQwSubsystem.h.

170 {
171 return kFALSE; // when not implemented, this returns failure
172 };

◆ PublishInternalValues()

Bool_t VQwSubsystem::PublishInternalValues ( ) const
inlineoverridevirtual

Publish all variables of the subsystem.

Implements MQwPublishable_child< QwSubsystemArray, VQwSubsystem >.

Definition at line 175 of file VQwSubsystem.h.

175 {
176 return kTRUE; // when not implemented, this returns success
177 };

Referenced by QwSubsystemArray::LoadSubsystemsFromParameterFile().

+ Here is the caller graph for this function:

◆ RandomizeEventData()

virtual void VQwSubsystem::RandomizeEventData ( int = 0,
double = 0.0 )
inlinevirtual

Reimplemented in QwBeamLine, and QwIntegratedRaster.

Definition at line 242 of file VQwSubsystem.h.

242{ };

◆ RegisterMarkerWord()

Int_t VQwSubsystem::RegisterMarkerWord ( const UInt_t markerword)
protected

Register a marker word within the current ROC/bank context.

Parameters
markerwordMarker word value.
Returns
0 on success; ERROR if no current ROC.

Definition at line 241 of file VQwSubsystem.cc.

242{
243 static BankID_t bankIDmask = 0xffffffff;
244 Int_t stat = 0;
246 Int_t roc_index = FindIndex(fROC_IDs, fCurrentROC_ID);
247 Int_t bank_index = FindIndex(fBank_IDs[roc_index],(fCurrentBank_ID&bankIDmask));
248 fMarkerWords.at(roc_index).at(bank_index).push_back(markerword);
249 BankID_t tmpbank = markerword;
250 tmpbank = ((tmpbank)<<32) + (fCurrentBank_ID&bankIDmask);
251 RegisterSubbank(tmpbank);
252 } else {
253 // There is not a ROC registered yet!
254 QwError << std::hex << "VQwSubsystem::RegisterSubbank: "
255 << "This Marker word (" << markerword << ") "
256 << "does not have an associated ROC! "
257 << "Add a 'ROC=#' line to the map file."
258 << std::dec << QwLog::endl;
259 stat = ERROR;
262 }
263 return stat;
264}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
ULong64_t BankID_t
Definition QwTypes.h:21
Int_t ERROR
Int_t RegisterSubbank(const BankID_t bank_id)
Tell the object that it will decode data from this sub-bank in the ROC currently open for registratio...

References QwLog::endl(), ERROR, fBank_IDs, fCurrentBank_ID, fCurrentROC_ID, FindIndex(), fMarkerWords, fROC_IDs, kNullBankID, kNullROCID, QwError, and RegisterSubbank().

Referenced by RegisterRocBankMarker().

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

◆ RegisterRocBankMarker()

void VQwSubsystem::RegisterRocBankMarker ( QwParameterFile & mapstr)
protected

Parse and register ROC/bank/marker entries from a map string.

Parameters
mapstrParameter string positioned at a registration line.

Definition at line 267 of file VQwSubsystem.cc.

267 {
268 UInt_t value = 0;
269 if (mapstr.PopValue("roc",value)) {
270 RegisterROCNumber(value,0);
271 }
272 if (mapstr.PopValue("bank",value)) {
273 RegisterSubbank(value);
274 }
275 if (mapstr.PopValue("markerword",value)) {
276 RegisterMarkerWord(value);
277 }
278}
Bool_t PopValue(const std::string keyname, T &retvalue)
virtual Int_t RegisterROCNumber(const ROCID_t roc_id, const BankID_t bank_id=0)
Tell the object that it will decode data from this ROC and sub-bank.
Int_t RegisterMarkerWord(const UInt_t markerword)

References QwParameterFile::PopValue(), RegisterMarkerWord(), RegisterROCNumber(), and RegisterSubbank().

Referenced by QwBeamLine::LoadChannelMap(), QwBeamMod::LoadChannelMap(), QwHelicity::LoadChannelMap(), QwMollerDetector::LoadChannelMap(), QwScaler::LoadChannelMap(), and VQwDetectorArray::LoadChannelMap().

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

◆ RegisterROCNumber()

Int_t VQwSubsystem::RegisterROCNumber ( const ROCID_t roc_id,
const BankID_t bank_id = 0 )
protectedvirtual

Tell the object that it will decode data from this ROC and sub-bank.

Register that this subsystem will decode data from a specific ROC/bank.

Parameters
roc_idROC identifier.
bank_idSubbank identifier within the ROC (default 0).
Returns
0 on success; ERROR if already registered.

Definition at line 179 of file VQwSubsystem.cc.

180{
181 Int_t stat = 0;
182 Int_t roc_index = 0;
183 roc_index = FindIndex(fROC_IDs, roc_id);
184
185 //will return the vector index for this roc_id on the vector fROC_IDs
186 if (roc_index==-1){
187 fROC_IDs.push_back(roc_id); // new ROC number is added.
188 roc_index = (fROC_IDs.size() - 1);
189 std::vector<BankID_t> tmpvec(1,bank_id);
190 fBank_IDs.push_back(tmpvec);
191 fMarkerWords.resize(fROC_IDs.size());
192 fMarkerWords.at(roc_index).resize(1);
193 } else {
194 Int_t bank_index = FindIndex(fBank_IDs[roc_index],bank_id);
195 if (bank_index==-1) { // if the bank_id is not registered then register it.
196 fBank_IDs[roc_index].push_back(bank_id);
197 fMarkerWords.at(roc_index).resize(fBank_IDs.at(roc_index).size());
198 } else {
199 // This subbank in this ROC has already been registered!
200 QwError << std::hex << "VQwSubsystem::RegisterROCNumber: "
201 << "This subbank (0x" << bank_id << ") "
202 << "in this ROC (0x" << roc_id << ") "
203 << "has already been registered!"
204 << std::dec << QwLog::endl;
205 stat = ERROR;
206 }
207 }
208 if (stat!=-1){
209 fCurrentROC_ID = roc_id;
210 fCurrentBank_ID = bank_id;
211 } else {
214 }
215 return stat;
216}

References QwLog::endl(), ERROR, fBank_IDs, fCurrentBank_ID, fCurrentROC_ID, FindIndex(), fMarkerWords, fROC_IDs, kNullBankID, kNullROCID, and QwError.

Referenced by RegisterRocBankMarker(), and RegisterSubbank().

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

◆ RegisterSubbank()

Int_t VQwSubsystem::RegisterSubbank ( const BankID_t bank_id)
protected

Tell the object that it will decode data from this sub-bank in the ROC currently open for registration.

Register a subbank under the current ROC registration.

Parameters
bank_idSubbank identifier to register.
Returns
0 on success; ERROR if no current ROC.

Definition at line 219 of file VQwSubsystem.cc.

220{
221 Int_t stat = 0;
223 stat = RegisterROCNumber(fCurrentROC_ID, bank_id);
224 fCurrentBank_ID = bank_id;
225 } else {
226 // There is not a ROC registered yet!
227 QwError << std::hex << "VQwSubsystem::RegisterSubbank: "
228 << "This subbank (" << bank_id << ") "
229 << "does not have an associated ROC! "
230 << "Add a 'ROC=#' line to the map file."
231 << std::dec << QwLog::endl;
232 stat = ERROR;
235 }
236 return stat;
237}

References QwLog::endl(), ERROR, fCurrentBank_ID, fCurrentROC_ID, kNullBankID, kNullROCID, QwError, and RegisterROCNumber().

Referenced by RegisterMarkerWord(), and RegisterRocBankMarker().

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

◆ SetDataLoaded()

void VQwSubsystem::SetDataLoaded ( Bool_t flag)
inlineprotected

Definition at line 451 of file VQwSubsystem.h.

451{fIsDataLoaded = flag;};

References fIsDataLoaded.

Referenced by QwHelicity::ClearEventData(), QwBeamMod::ProcessEvBuffer(), and QwHelicity::ProcessEvBuffer().

+ Here is the caller graph for this function:

◆ SetEventTypeMask()

void VQwSubsystem::SetEventTypeMask ( const UInt_t mask)
inline

Set event type mask.

Definition at line 206 of file VQwSubsystem.h.

206{ fEventTypeMask = mask; };

References fEventTypeMask.

Referenced by LoadDetectorMaps(), and VQwSubsystemParity::VQwSubsystemParity().

+ Here is the caller graph for this function:

Field Documentation

◆ fBank_IDs

std::vector< std::vector<BankID_t> > VQwSubsystem::fBank_IDs
protected

Vector of Bank IDs per ROC ID associated with this subsystem.

Definition at line 497 of file VQwSubsystem.h.

Referenced by ClearAllBankRegistrations(), GetMarkerWordList(), GetSubbankIndex(), PrintInfo(), RegisterMarkerWord(), RegisterROCNumber(), and VQwSubsystem().

◆ fCurrentBank_ID

◆ fCurrentROC_ID

◆ fDetectorMaps

◆ fDetectorMapsNames

std::vector<TString> VQwSubsystem::fDetectorMapsNames
protected

Names of loaded detector map files.

Definition at line 487 of file VQwSubsystem.h.

Referenced by GetParamFileNameList(), and QwMollerDetector::LoadChannelMap().

◆ fEventTypeMask

UInt_t VQwSubsystem::fEventTypeMask
protected

Mask of event types.

Definition at line 483 of file VQwSubsystem.h.

Referenced by GetEventTypeMask(), SetEventTypeMask(), and VQwSubsystem().

◆ fIsDataLoaded

Bool_t VQwSubsystem::fIsDataLoaded
protected

Has this subsystem gotten data to be processed?

Definition at line 485 of file VQwSubsystem.h.

Referenced by HasDataLoaded(), operator=(), SetDataLoaded(), VQwSubsystem(), and VQwSubsystem().

◆ fMarkerWords

std::vector< std::vector< std::vector<UInt_t> > > VQwSubsystem::fMarkerWords
protected

Vector of marker words per ROC & subbank associated with this subsystem.

Definition at line 499 of file VQwSubsystem.h.

Referenced by GetMarkerWordList(), RegisterMarkerWord(), RegisterROCNumber(), and VQwSubsystem().

◆ fPublishList

◆ fROC_IDs

std::vector<ROCID_t> VQwSubsystem::fROC_IDs
protected

Vector of ROC IDs associated with this subsystem.

Definition at line 495 of file VQwSubsystem.h.

Referenced by ClearAllBankRegistrations(), GetMarkerWordList(), GetROCIds(), GetSubbankIndex(), PrintInfo(), RegisterMarkerWord(), RegisterROCNumber(), and VQwSubsystem().

◆ fSystemName

TString VQwSubsystem::fSystemName
protected

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