JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
VQwSubsystem.h
Go to the documentation of this file.
1/*!
2 * \file VQwSubsystem.h
3 * \brief Definition of the pure virtual base class of all subsystems
4 *
5 * \author P. M. King
6 * \date 2007-05-08 15:40
7 */
8
9#pragma once
10
11// System headers
12#include <iostream>
13#include <vector>
14
15// ROOT headers
16#include "Rtypes.h"
17#include "TString.h"
18#include "TDirectory.h"
19#include "TTree.h"
20
21// RNTuple headers
22#ifdef HAS_RNTUPLE_SUPPORT
23#include "ROOT/RNTupleModel.hxx"
24#endif // HAS_RNTUPLE_SUPPORT
25
26// Qweak headers
27#include "MQwHistograms.h"
28#include "MQwPublishable.h"
29// Note: the factory header is included here because every subsystem
30// has to register itself with a subsystem factory.
31#include "QwFactory.h"
32
33// Forward declarations
36class QwParameterFile;
37
38
39/**
40 * \class VQwSubsystem
41 * \ingroup QwAnalysis
42 * \brief Base class for subsystems implementing container-delegation pattern
43 *
44 * VQwSubsystem serves as the foundation for all analysis subsystems and
45 * implements the container-delegation architectural pattern. Unlike individual
46 * data elements that use the dual-operator pattern, subsystems delegate
47 * arithmetic operations to their contained elements and avoid virtual operators.
48 *
49 * \par Container-Delegation Pattern:
50 * VQwSubsystem uses a fundamentally different approach from VQwDataElement:
51 *
52 * **Key Design Principles:**
53 * - **No virtual operators** in subsystem base classes
54 * - **Single operator versions**: Only type-specific operators needed
55 * - **Delegation to elements**: Operators iterate over contained objects
56 * - **Type safety via typeid**: Runtime type checking without inheritance conflicts
57 *
58 * \par Implementation Pattern:
59 * \code
60 * VQwSubsystem& operator+=(const VQwSubsystem& value) {
61 * // Iterate over contained elements
62 * for(size_t i=0; i<fElements.size(); i++) {
63 * VQwDataElement* elem1 = this->GetElement(i);
64 * VQwDataElement* elem2 = value.GetElement(i);
65 * if (typeid(*elem1) == typeid(*elem2)) {
66 * *elem1 += *elem2; // Delegates to element operators
67 * } else {
68 * // Handle type mismatch
69 * }
70 * }
71 * return *this;
72 * }
73 * \endcode
74 *
75 * \par Subsystem Architecture:
76 * - **CODA Integration**: ProcessEvBuffer(), ProcessConfigurationBuffer()
77 * - **Event Processing**: ProcessEvent(), ClearEventData()
78 * - **Data Management**: LoadChannelMap(), LoadInputParameters()
79 * - **Output Generation**: ConstructHistograms(), ConstructBranch()
80 * - **Factory Registration**: MQwSubsystemCloneable integration
81 *
82 * \par Specialized Abstract Bases:
83 * Some hierarchies introduce specialized bases between VQwSubsystem and
84 * concrete implementations (e.g., VQwBPM, VQwBCM, VQwClock) to enable
85 * polymorphic dispatch for specific detector types while maintaining
86 * the container-delegation pattern.
87 *
88 * \par Representative Example:
89 * QwBeamLine demonstrates the complete subsystem implementation:
90 * - Container management for BPMs, BCMs, and other beam devices
91 * - Type-safe delegation to heterogeneous element collections
92 * - CODA buffer processing with ROC/Bank mapping
93 * - Event-level processing and running statistics
94 * - Integration with QwSubsystemArrayParity via factory pattern
95 *
96 * \par Composition over Inheritance:
97 * The container-delegation pattern provides:
98 * - **Type safety**: Runtime checks without virtual operator conflicts
99 * - **Flexibility**: Support for heterogeneous element collections
100 * - **Performance**: Direct delegation without virtual dispatch overhead
101 * - **Maintainability**: Clear separation between container and element concerns
102 *
103 * \dot
104 * digraph example {
105 * node [shape=box, fontname=Helvetica, fontsize=10];
106 * VQwSubsystem [ label="VQwSubsystem\n(container-delegation)" URL="\ref VQwSubsystem"];
107 * VQwSubsystemParity [ label="VQwSubsystemParity" URL="\ref VQwSubsystemParity"];
108 * QwBeamLine [ label="QwBeamLine\n(canonical example)" URL="\ref QwBeamLine"];
109 * VQwSubsystem -> VQwSubsystemParity;
110 * VQwSubsystemParity -> QwBeamLine;
111 * }
112 * \enddot
113 */
114class VQwSubsystem: virtual public VQwSubsystemCloneable, public MQwHistograms, public MQwPublishable_child<QwSubsystemArray,VQwSubsystem> {
115
116 public:
117
118 /// Constructor with name
126 /// Copy constructor by object
140
141 /// Default destructor
142 ~VQwSubsystem() override { }
143
144
145 /// \brief Define options function (note: no virtual static functions in C++)
146 static void DefineOptions() { /* No default options defined */ };
147 /// Process the command line options
148 virtual void ProcessOptions(QwOptions & /*options*/) { };
149
150
151 TString GetName() const {return fSystemName;};
152 Bool_t HasDataLoaded() const {return fIsDataLoaded;}
153
154 /// \brief Get the sibling with specified name
155 /**
156 * Get a sibling subsystem by name from the parent array.
157 *
158 * @param name Name of the sibling subsystem.
159 * @return Pointer to the sibling, or NULL if not found.
160 */
161 VQwSubsystem* GetSibling(const std::string& name) const;
162
163
164 public:
165
166 virtual std::vector<TString> GetParamFileNameList();
167 virtual std::map<TString, TString> GetDetectorMaps();
168
169 /// \brief Try to publish an internal variable matching the submitted name
170 Bool_t PublishByRequest(TString /*device_name*/) override{
171 return kFALSE; // when not implemented, this returns failure
172 };
173
174 /// \brief Publish all variables of the subsystem
175 Bool_t PublishInternalValues() const override {
176 return kTRUE; // when not implemented, this returns success
177 };
178
179 protected:
180
181 std::vector<std::vector<TString> > fPublishList;
182
183 public:
184
185 /// \brief Parse parameter file to find the map files
186 /**
187 * Parse a parameter file and dispatch to the appropriate loaders
188 * based on key-value pairs (map, param, eventcut, geom, cross, mask).
189 *
190 * @param file Parameter file to read and parse.
191 * @return 0 on success; non-zero on error.
192 */
193 virtual Int_t LoadDetectorMaps(QwParameterFile& file);
194 /// Mandatory map file definition
195 virtual Int_t LoadChannelMap(TString mapfile) = 0;
196 /// Mandatory parameter file definition
197 virtual Int_t LoadInputParameters(TString mapfile) = 0;
198 /// Optional geometry definition
199 virtual Int_t LoadGeometryDefinition(TString /*mapfile*/) { return 0; };
200 /// Optional crosstalk definition
201 virtual Int_t LoadCrosstalkDefinition(TString /*mapfile*/) { return 0; };
202 /// Optional event cut file
203 virtual Int_t LoadEventCuts(TString /*mapfile*/) { return 0; };
204
205 /// Set event type mask
206 void SetEventTypeMask(const UInt_t mask) { fEventTypeMask = mask; };
207 /// Get event type mask
208 UInt_t GetEventTypeMask() const { return fEventTypeMask; };
209
210
211 virtual void ClearEventData() = 0;
212
213 virtual Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) = 0;
214
215 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){
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 };
221 /// TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version.
222 virtual Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) = 0;
223
224 virtual void ProcessEvent() = 0;
225 /*! \brief Request processed data from other subsystems for internal
226 * use in the second event processing stage. Not all derived
227 * classes will require data from other subsystems.
228 */
229 virtual void ExchangeProcessedData() { };
230 /*! \brief Process the event data again, including data from other
231 * subsystems. Not all derived classes will require
232 * a second stage of event data processing.
233 */
234 virtual void ProcessEvent_2() { };
235
236
237 /// \brief Perform actions at the end of the event loop
238 virtual void AtEndOfEventLoop(){QwDebug << fSystemName << " at end of event loop" << QwLog::endl;};
239
240
241 // Not all derived classes will have the following functions
242 virtual void RandomizeEventData(int /*helicity*/ = 0, double /*time*/ = 0.0) { };
243 virtual void EncodeEventData(std::vector<UInt_t> & /*buffer*/) { };
244
245
246 /// \name Objects construction and maintenance
247 // @{
248 /// Construct the objects for this subsystem
249 virtual void ConstructObjects() {
250 TString tmpstr("");
251 ConstructObjects((TDirectory*) NULL, tmpstr);
252 };
253 /// Construct the objects for this subsystem in a folder
254 virtual void ConstructObjects(TDirectory *folder) {
255 TString tmpstr("");
256 ConstructObjects(folder, tmpstr);
257 };
258 /// Construct the objects for this subsystem with a prefix
259 virtual void ConstructObjects(TString &prefix) {
260 ConstructObjects((TDirectory*) NULL, prefix);
261 };
262 /// \brief Construct the objects for this subsystem in a folder with a prefix
263 virtual void ConstructObjects(TDirectory * /*folder*/, TString & /*prefix*/) { };
264 // @}
265
266
267 /// \name Histogram construction and maintenance
268 // @{
269 /// Construct the histograms for this subsystem
270 virtual void ConstructHistograms() {
271 TString tmpstr("");
272 ConstructHistograms((TDirectory*) NULL, tmpstr);
273 };
274 /// Construct the histograms for this subsystem in a folder
275 virtual void ConstructHistograms(TDirectory *folder) {
276 TString tmpstr("");
277 ConstructHistograms(folder, tmpstr);
278 };
279 /// Construct the histograms for this subsystem with a prefix
280 virtual void ConstructHistograms(TString &prefix) {
281 ConstructHistograms((TDirectory*) NULL, prefix);
282 };
283 /// \brief Construct the histograms for this subsystem in a folder with a prefix
284 virtual void ConstructHistograms(TDirectory *folder, TString &prefix) = 0;
285 /// \brief Fill the histograms for this subsystem
286 virtual void FillHistograms() = 0;
287 // @}
288
289
290 /// \name Tree and branch construction and maintenance
291 /// The methods should exist for all subsystems and are therefore defined
292 /// as pure virtual.
293 // @{
294 /// \brief Construct the branch and tree vector
295 /**
296 * Construct the branch and fill the provided values vector.
297 * @param tree Output ROOT tree to which branches are added.
298 * @param prefix Name prefix for all branch names.
299 * @param values Vector that will be filled by FillTreeVector.
300 */
301 virtual void ConstructBranchAndVector(TTree *tree, TString& prefix, QwRootTreeBranchVector &values) = 0;
302 /// \brief Construct the branch and tree vector
303 virtual void ConstructBranchAndVector(TTree *tree, QwRootTreeBranchVector &values) {
304 TString tmpstr("");
305 ConstructBranchAndVector(tree,tmpstr,values);
306 };
307 /// \brief Construct the branch and tree vector
308 /**
309 * Construct the branches for this subsystem.
310 * @param tree Output ROOT tree.
311 * @param prefix Name prefix for all branch names.
312 */
313 virtual void ConstructBranch(TTree *tree, TString& prefix) = 0;
314 /// \brief Construct the branch and tree vector based on the trim file
315 /**
316 * Construct the branches for this subsystem using a trim file.
317 * @param tree Output ROOT tree.
318 * @param prefix Name prefix for all branch names.
319 * @param trim_file Trim file describing which branches to construct.
320 */
321 virtual void ConstructBranch(TTree *tree, TString& prefix, QwParameterFile& trim_file) = 0;
322 /// \brief Fill the tree vector
323 /**
324 * Fill the tree export vector with the current event values.
325 * @param values Output vector to be filled.
326 */
327 virtual void FillTreeVector(QwRootTreeBranchVector &values) const = 0;
328
329#ifdef HAS_RNTUPLE_SUPPORT
330 /// \brief Construct the RNTuple fields and vector
331 /**
332 * Construct the RNTuple fields and fill the export vector.
333 * @param model Output RNTuple model.
334 * @param prefix Name prefix for field names.
335 * @param values Export values vector.
336 * @param fieldPtrs Shared pointers to field backing storage.
337 */
338 virtual void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs) = 0;
339 /// \brief Construct the RNTuple fields and vector
340 virtual void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs) {
341 TString tmpstr("");
342 ConstructNTupleAndVector(model, tmpstr, values, fieldPtrs);
343 };
344 /// \brief Fill the RNTuple vector
345 /**
346 * Fill the RNTuple vector with the current event values.
347 * @param values Output vector to be filled.
348 */
349 virtual void FillNTupleVector(std::vector<Double_t>& values) const = 0;
350#endif // HAS_RNTUPLE_SUPPORT
351 // @}
352
353
354
355
356 /// \name Expert tree construction and maintenance
357 /// These functions are not purely virtual, since not every subsystem is
358 /// expected to implement them. They are intended for expert output to
359 /// trees.
360 // @{
361 /// \brief Construct the tree for this subsystem
362 virtual void ConstructTree() {
363 TString tmpstr("");
364 ConstructTree((TDirectory*) NULL, tmpstr);
365 };
366 /// \brief Construct the tree for this subsystem in a folder
367 virtual void ConstructTree(TDirectory *folder) {
368 TString tmpstr("");
369 ConstructTree(folder, tmpstr);
370 };
371 /// \brief Construct the tree for this subsystem with a prefix
372 virtual void ConstructTree(TString &prefix) {
373 ConstructTree((TDirectory*) NULL, prefix);
374 };
375 /// \brief Construct the tree for this subsystem in a folder with a prefix
376 virtual void ConstructTree(TDirectory * /*folder*/, TString & /*prefix*/) { return; };
377 /// \brief Fill the tree for this subsystem
378 virtual void FillTree() { return; };
379 /// \brief Delete the tree for this subsystem
380 virtual void DeleteTree() { return; };
381 // @}
382
383 /// \brief Print some information about the subsystem
384 /**
385 * Print some information about the subsystem (name, ROCs/banks, parent).
386 */
387 virtual void PrintInfo() const;
388
389 /// \brief Assignment
390 /// Note: Must be called at the beginning of all subsystems routine
391 /// call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)
392 virtual VQwSubsystem& operator=(VQwSubsystem *value);
393
394
395 virtual void PrintDetectorMaps(Bool_t status) const;
396
397 protected:
398
399 /*! \brief Clear all registration of ROC and Bank IDs for this subsystem
400 */
401 /**
402 * Clear all registration of ROC and Bank IDs for this subsystem and
403 * reset current ROC/bank IDs to null.
404 */
406
407 /*! \brief Tell the object that it will decode data from this ROC and sub-bank
408 */
409 /**
410 * Register that this subsystem will decode data from a specific ROC/bank.
411 * @param roc_id ROC identifier.
412 * @param bank_id Subbank identifier within the ROC (default 0).
413 * @return 0 on success; ERROR if already registered.
414 */
415 virtual Int_t RegisterROCNumber(const ROCID_t roc_id, const BankID_t bank_id = 0);
416
417 /*! \brief Tell the object that it will decode data from this sub-bank in the ROC currently open for registration
418 */
419 /**
420 * Register a subbank under the current ROC registration.
421 * @param bank_id Subbank identifier to register.
422 * @return 0 on success; ERROR if no current ROC.
423 */
424 Int_t RegisterSubbank(const BankID_t bank_id);
425
426 /**
427 * Register a marker word within the current ROC/bank context.
428 * @param markerword Marker word value.
429 * @return 0 on success; ERROR if no current ROC.
430 */
431 Int_t RegisterMarkerWord(const UInt_t markerword);
432
433 /**
434 * Parse and register ROC/bank/marker entries from a map string.
435 * @param mapstr Parameter string positioned at a registration line.
436 */
438
439 /**
440 * Get the current flat subbank index (based on current ROC/bank).
441 * @return Subbank index, or -1 if not found.
442 */
444 /**
445 * Compute the flat subbank index from ROC and bank IDs.
446 * @param roc_id ROC identifier.
447 * @param bank_id Subbank identifier within the ROC.
448 * @return Subbank index, or -1 if not found.
449 */
450 Int_t GetSubbankIndex(const ROCID_t roc_id, const BankID_t bank_id) const;
451 void SetDataLoaded(Bool_t flag){fIsDataLoaded = flag;};
452
453 public:
454 void GetMarkerWordList(const ROCID_t roc_id, const BankID_t bank_id, std::vector<UInt_t> &marker)const{
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 }
464
465 protected:
466 template < class T >
467 Int_t FindIndex(const std::vector<T> &myvec, const T value) const
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 };
478
479 protected:
480
481 TString fSystemName; ///< Name of this subsystem
482
483 UInt_t fEventTypeMask; ///< Mask of event types
484
485 Bool_t fIsDataLoaded; ///< Has this subsystem gotten data to be processed?
486
487 std::vector<TString> fDetectorMapsNames; ///< Names of loaded detector map files
488 std::map<TString, TString> fDetectorMaps; ///< Map of file name to full path or content
489 protected:
490
491 ROCID_t fCurrentROC_ID; ///< ROC ID that is currently being processed
492 BankID_t fCurrentBank_ID; ///< Bank ID (and Marker word) that is currently being processed;
493
494 /// Vector of ROC IDs associated with this subsystem
495 std::vector<ROCID_t> fROC_IDs;
496 /// Vector of Bank IDs per ROC ID associated with this subsystem
497 std::vector< std::vector<BankID_t> > fBank_IDs;
498 /// Vector of marker words per ROC & subbank associated with this subsystem
499 std::vector< std::vector< std::vector<UInt_t> > > fMarkerWords;
500
501 public:
502 std::vector<ROCID_t> GetROCIds() const { return fROC_IDs; }
503 protected:
504
505 // Comparison of type
506 Bool_t Compare(VQwSubsystem* source) {
507 return (typeid(*this) == typeid(*source));
508 }
509
510 private:
511
512 // Private constructor (not implemented, will throw linker error on use)
514
515}; // class VQwSubsystem
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
Mix-in class for histogram management functionality.
Factory pattern implementation for creating analysis objects.
class VQwCloneable< VQwSubsystem > VQwSubsystemCloneable
Mix-in factory functionality for subsystems.
Definition QwFactory.h:251
ULong64_t BankID_t
Definition QwTypes.h:21
UInt_t ROCID_t
Definition QwTypes.h:20
MQwHistograms()
Default constructor.
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
Command-line and configuration file options processor.
Definition QwOptions.h:141
Configuration file parser with flexible tokenization and search capabilities.
A helper class to manage a vector of branch entries for ROOT trees.
Definition QwRootFile.h:53
Container for managing multiple subsystems with common operations.
Abstract base for concrete hardware channels implementing dual-operator pattern.
Base class for subsystems implementing container-delegation pattern.
std::vector< std::vector< TString > > fPublishList
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.
virtual void RandomizeEventData(int=0, double=0.0)
virtual void ConstructObjects(TString &prefix)
Construct the objects for this subsystem with a prefix.
~VQwSubsystem() override
Default destructor.
std::vector< ROCID_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
virtual void ConstructTree(TDirectory *, TString &)
Construct the tree for this subsystem in a folder with a prefix.
virtual void EncodeEventData(std::vector< UInt_t > &)
virtual void AtEndOfEventLoop()
Perform actions at the end of the event loop.
virtual void DeleteTree()
Delete the tree for this subsystem.
virtual Int_t LoadChannelMap(TString mapfile)=0
Mandatory map file definition.
BankID_t fCurrentBank_ID
Bank ID (and Marker word) that is currently being processed;.
virtual void ConstructHistograms(TString &prefix)
Construct the histograms for this subsystem with a prefix.
virtual void ConstructBranchAndVector(TTree *tree, QwRootTreeBranchVector &values)
Construct the branch and tree vector.
Bool_t PublishInternalValues() const override
Publish all variables of the subsystem.
virtual std::map< TString, TString > GetDetectorMaps()
void GetMarkerWordList(const ROCID_t roc_id, const BankID_t bank_id, std::vector< UInt_t > &marker) const
TString fSystemName
Name of this subsystem.
Int_t GetSubbankIndex() const
std::vector< TString > fDetectorMapsNames
Names of loaded detector map files.
UInt_t GetEventTypeMask() const
Get event type mask.
virtual void ConstructTree(TString &prefix)
Construct the tree for this subsystem with a prefix.
virtual void ProcessOptions(QwOptions &)
Process the command line options.
virtual void FillTree()
Fill the tree for this subsystem.
Bool_t PublishByRequest(TString) override
Try to publish an internal variable matching the submitted name.
virtual void ConstructBranch(TTree *tree, TString &prefix, QwParameterFile &trim_file)=0
Construct the branch and tree vector based on the trim file.
std::vector< std::vector< BankID_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
void SetEventTypeMask(const UInt_t mask)
Set event type mask.
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Bool_t Compare(VQwSubsystem *source)
virtual void FillHistograms()=0
Fill the histograms for this subsystem.
VQwSubsystem(const VQwSubsystem &orig)
Copy constructor by object.
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
virtual void PrintInfo() const
Print some information about the subsystem.
virtual void ConstructHistograms(TDirectory *folder)
Construct the histograms for this subsystem in a folder.
virtual void ConstructHistograms(TDirectory *folder, TString &prefix)=0
Construct the histograms for this subsystem in a folder with a prefix.
virtual void ConstructObjects()
Construct the objects for this subsystem.
void RegisterRocBankMarker(QwParameterFile &mapstr)
virtual Int_t LoadEventCuts(TString)
Optional event cut file.
static void DefineOptions()
Define options function (note: no virtual static functions in C++)
virtual Int_t LoadGeometryDefinition(TString)
Optional geometry definition.
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 v...
Bool_t fIsDataLoaded
Has this subsystem gotten data to be processed?
virtual void ExchangeProcessedData()
Request processed data from other subsystems for internal use in the second event processing stage....
virtual void FillTreeVector(QwRootTreeBranchVector &values) const =0
Fill the tree vector.
virtual Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)=0
virtual void ConstructTree(TDirectory *folder)
Construct the tree for this subsystem in a folder.
virtual void ClearEventData()=0
virtual Int_t LoadDetectorMaps(QwParameterFile &file)
Parse parameter file to find the map files.
Int_t FindIndex(const std::vector< T > &myvec, const T value) const
virtual void ConstructObjects(TDirectory *, TString &)
Construct the objects for this subsystem in a folder with a prefix.
virtual void ProcessEvent_2()
Process the event data again, including data from other subsystems. Not all derived classes will requ...
TString GetName() const
Int_t RegisterMarkerWord(const UInt_t markerword)
virtual std::vector< TString > GetParamFileNameList()
std::map< TString, TString > fDetectorMaps
Map of file name to full path or content.
virtual void ConstructTree()
Construct the tree for this subsystem.
void ClearAllBankRegistrations()
Clear all registration of ROC and Bank IDs for this subsystem.
virtual Int_t LoadInputParameters(TString mapfile)=0
Mandatory parameter file definition.
virtual void PrintDetectorMaps(Bool_t status) const
VQwSubsystem(const TString &name)
Constructor with name.
virtual void ConstructObjects(TDirectory *folder)
Construct the objects for this subsystem in a folder.
std::vector< ROCID_t > GetROCIds() const
virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)=0
Construct the branch and tree vector.
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...
void SetDataLoaded(Bool_t flag)
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 void ConstructBranch(TTree *tree, TString &prefix)=0
Construct the branch and tree vector.
virtual Int_t LoadCrosstalkDefinition(TString)
Optional crosstalk definition.
ROCID_t fCurrentROC_ID
ROC ID that is currently being processed.
Bool_t HasDataLoaded() const
virtual void ProcessEvent()=0
std::vector< std::vector< std::vector< UInt_t > > > fMarkerWords
Vector of marker words per ROC & subbank associated with this subsystem.
VQwSubsystem * GetSibling(const std::string &name) const
Get the sibling with specified name.
UInt_t fEventTypeMask
Mask of event types.