QwAnalysis
VQwSubsystem Class Referenceabstract

The pure virtual base class of all subsystems. More...

#include <VQwSubsystem.h>

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

Public Member Functions

 VQwSubsystem (const TString &name)
 Constructor with name. More...
 
 VQwSubsystem (const VQwSubsystem &orig)
 Copy constructor by object. More...
 
virtual ~VQwSubsystem ()
 Default destructor. More...
 
virtual void ProcessOptions (QwOptions &options)
 Process the command line options. More...
 
TString GetSubsystemName () const
 
Bool_t HasDataLoaded () const
 
void SetParent (QwSubsystemArray *parent)
 Set the parent of this subsystem to the specified array. More...
 
QwSubsystemArrayGetParent (const unsigned int parent=0) const
 Get the parent of this subsystem. More...
 
VQwSubsystemGetSibling (const std::string &name) const
 Get the sibling with specified name. More...
 
Bool_t PublishInternalValue (const TString &name, const TString &desc, const VQwHardwareChannel *value) const
 Publish a variable name to the parent subsystem array. More...
 
virtual Bool_t PublishInternalValues () const
 Publish all variables of the subsystem. More...
 
virtual Bool_t PublishByRequest (TString device_name)
 Try to publish an internal variable matching the submitted name. More...
 
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 parent subsystem array. More...
 
virtual const VQwHardwareChannelReturnInternalValue (const TString &name) const
 Return a pointer to a varialbe to the parent subsystem array to be delivered to a different subsystem. More...
 
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. More...
 
virtual std::vector< TString > GetParamFileNameList ()
 
virtual std::map< TString,
TString > 
GetDetectorMaps ()
 
virtual Int_t LoadDetectorMaps (QwParameterFile &file)
 Parse parameter file to find the map files. More...
 
virtual Int_t LoadChannelMap (TString mapfile)=0
 Mandatory map file definition. More...
 
virtual Int_t LoadInputParameters (TString mapfile)=0
 Mandatory parameter file definition. More...
 
virtual Int_t LoadGeometryDefinition (TString mapfile)
 Optional geometry definition. More...
 
virtual Int_t LoadCrosstalkDefinition (TString mapfile)
 Optional crosstalk definition. More...
 
virtual Int_t LoadEventCuts (TString mapfile)
 Optional event cut file. More...
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask. More...
 
UInt_t GetEventTypeMask () const
 Get event type mask. More...
 
virtual void ClearEventData ()=0
 
virtual Int_t ProcessConfigurationBuffer (const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)=0
 
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)
 
virtual Int_t ProcessEvBuffer (const UInt_t roc_id, const UInt_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. More...
 
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. More...
 
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. More...
 
virtual void AtEndOfEventLoop ()
 Perform actions at the end of the event loop. More...
 
virtual void RandomizeEventData (int helicity=0, double time=0.0)
 
virtual void EncodeEventData (std::vector< UInt_t > &buffer)
 
virtual void PrintInfo () const
 Print some information about the subsystem. More...
 
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) More...
 
virtual void PrintDetectorMaps (Bool_t status) const
 
Histogram construction and maintenance
virtual void ConstructHistograms ()
 Construct the histograms for this subsystem. More...
 
virtual void ConstructHistograms (TDirectory *folder)
 Construct the histograms for this subsystem in a folder. More...
 
virtual void ConstructHistograms (TString &prefix)
 Construct the histograms for this subsystem with a prefix. More...
 
virtual void ConstructHistograms (TDirectory *folder, TString &prefix)=0
 Construct the histograms for this subsystem in a folder with a prefix. More...
 
virtual void FillHistograms ()=0
 Fill the histograms for this subsystem. More...
 
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, std::vector< Double_t > &values)=0
 Construct the branch and tree vector. More...
 
virtual void ConstructBranchAndVector (TTree *tree, std::vector< Double_t > &values)
 Construct the branch and tree vector. More...
 
virtual void ConstructBranch (TTree *tree, TString &prefix)=0
 Construct the branch and tree vector. More...
 
virtual void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)=0
 Construct the branch and tree vector based on the trim file. More...
 
virtual void FillTreeVector (std::vector< Double_t > &values) const =0
 Fill the tree vector. More...
 
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.

virtual void ConstructTree ()
 Construct the tree for this subsystem. More...
 
virtual void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder. More...
 
virtual void ConstructTree (TString &prefix)
 Construct the tree for this subsystem with a prefix. More...
 
virtual void ConstructTree (TDirectory *folder, TString &prefix)
 Construct the tree for this subsystem in a folder with a prefix. More...
 
virtual void FillTree ()
 Fill the tree for this subsystem. More...
 
virtual void DeleteTree ()
 Delete the tree for this subsystem. More...
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects. More...
 

Static Public Member Functions

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

Protected Member Functions

void UpdatePublishedValue (const TString &name, VQwHardwareChannel *data_channel)
 
void ClearAllBankRegistrations ()
 Clear all registration of ROC and Bank IDs for this subsystem. More...
 
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. More...
 
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 registration. More...
 
Int_t GetSubbankIndex () const
 
Int_t GetSubbankIndex (const UInt_t roc_id, const UInt_t bank_id) const
 
void SetDataLoaded (Bool_t flag)
 
Int_t FindIndex (const std::vector< UInt_t > &myvec, const UInt_t value) const
 
Bool_t Compare (VQwSubsystem *source)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor. More...
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor. More...
 
virtual ~MQwHistograms ()
 Virtual destructor. More...
 
virtual MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram. More...
 

Protected Attributes

std::map< TString,
VQwHardwareChannel * > 
fPublishedInternalValues
 Map of published internal values. More...
 
std::vector< std::vector
< TString > > 
fPublishList
 List of parameters to be published (loaded at the channel map) More...
 
TString fSystemName
 Name of this subsystem. More...
 
UInt_t fEventTypeMask
 Mask of event types. More...
 
Bool_t fIsDataLoaded
 Has this subsystem gotten data to be processed? More...
 
std::vector< TString > fDetectorMapsNames
 
std::map< TString, TString > fDetectorMaps
 
Int_t fCurrentROC_ID
 ROC ID that is currently being processed. More...
 
Int_t fCurrentBank_ID
 Bank ID that is currently being processed. More...
 
std::vector< UInt_t > fROC_IDs
 Vector of ROC IDs associated with this subsystem. More...
 
std::vector< std::vector
< UInt_t > > 
fBank_IDs
 Vector of Bank IDs per ROC ID associated with this subsystem. More...
 
std::vector< QwSubsystemArray * > fArrays
 Vector of pointers to subsystem arrays that contain this subsystem. More...
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element. More...
 

Private Member Functions

 VQwSubsystem ()
 

Detailed Description

The pure virtual base class of all subsystems.

Virtual base class for the classes containing the event-based information from each tracking subsystem and the parity analysis. The subclasses VQwSubsystemTracking and VQwSubsystemParity are base classes for the classes containing the event-based information from each tracking subsystem and parity analysis, respectively.

This will define the interfaces used in communicating with the CODA routines.

Definition at line 59 of file VQwSubsystem.h.

Constructor & Destructor Documentation

VQwSubsystem::VQwSubsystem ( const TString &  name)
inline

Constructor with name.

Definition at line 64 of file VQwSubsystem.h.

References ClearAllBankRegistrations().

65  : MQwHistograms(),
66  fSystemName(name), fEventTypeMask(0x0), fIsDataLoaded(kFALSE),
69  }
UInt_t fEventTypeMask
Mask of event types.
Definition: VQwSubsystem.h:317
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
MQwHistograms()
Default constructor.
Definition: MQwHistograms.h:25
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326
Bool_t fIsDataLoaded
Has this subsystem gotten data to be processed?
Definition: VQwSubsystem.h:319
void ClearAllBankRegistrations()
Clear all registration of ROC and Bank IDs for this subsystem.

+ Here is the call graph for this function:

VQwSubsystem::VQwSubsystem ( const VQwSubsystem orig)
inline

Copy constructor by object.

Definition at line 71 of file VQwSubsystem.h.

72  : MQwHistograms(orig),
79  fROC_IDs(orig.fROC_IDs),
80  fBank_IDs(orig.fBank_IDs)
81  { }
UInt_t fEventTypeMask
Mask of event types.
Definition: VQwSubsystem.h:317
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
std::vector< std::vector< TString > > fPublishList
List of parameters to be published (loaded at the channel map)
Definition: VQwSubsystem.h:144
MQwHistograms()
Default constructor.
Definition: MQwHistograms.h:25
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
Definition: VQwSubsystem.h:331
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
Definition: VQwSubsystem.h:329
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326
Bool_t fIsDataLoaded
Has this subsystem gotten data to be processed?
Definition: VQwSubsystem.h:319
virtual VQwSubsystem::~VQwSubsystem ( )
inlinevirtual

Default destructor.

Definition at line 84 of file VQwSubsystem.h.

84 { }
VQwSubsystem::VQwSubsystem ( )
private

Member Function Documentation

virtual void VQwSubsystem::AtEndOfEventLoop ( )
inlinevirtual

Perform actions at the end of the event loop.

Reimplemented in QwBeamMod.

Definition at line 198 of file VQwSubsystem.h.

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

Referenced by QwSubsystemArray::AtEndOfEventLoop().

198 {QwDebug << fSystemName << " at end of event loop" << QwLog::endl;};
#define QwDebug
Predefined log drain for debugging output.
Definition: QwLog.h:60
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VQwSubsystem::ClearAllBankRegistrations ( )
protected

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

Definition at line 229 of file VQwSubsystem.cc.

References fBank_IDs, fCurrentBank_ID, fCurrentROC_ID, and fROC_IDs.

Referenced by QwSciFiDetector::ClearAllBankRegistrations(), QwRaster::ClearAllBankRegistrations(), QwDriftChamber::ClearAllBankRegistrations(), QwMainDetector::ClearAllBankRegistrations(), QwTriggerScintillator::ClearAllBankRegistrations(), QwScanner::ClearAllBankRegistrations(), and VQwSubsystem().

230 {
231  fBank_IDs.clear();
232  fROC_IDs.clear();
233  fCurrentROC_ID = -1;
234  fCurrentBank_ID = -1;
235 }
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
Definition: VQwSubsystem.h:331
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
Definition: VQwSubsystem.h:329
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326

+ Here is the caller graph for this function:

Bool_t VQwSubsystem::Compare ( VQwSubsystem source)
inlineprotected

Definition at line 340 of file VQwSubsystem.h.

340  {
341  return (typeid(*this) == typeid(*source));
342  }
virtual void VQwSubsystem::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
pure virtual
virtual void VQwSubsystem::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile trim_file 
)
pure virtual
virtual void VQwSubsystem::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)
pure virtual
virtual void VQwSubsystem::ConstructBranchAndVector ( TTree *  tree,
std::vector< Double_t > &  values 
)
inlinevirtual

Construct the branch and tree vector.

Definition at line 236 of file VQwSubsystem.h.

References ConstructBranchAndVector().

236  {
237  TString tmpstr("");
238  ConstructBranchAndVector(tree,tmpstr,values);
239  };
virtual void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)=0
Construct the branch and tree vector.

+ Here is the call graph for this function:

virtual void VQwSubsystem::ConstructHistograms ( )
inlinevirtual

Construct the histograms for this subsystem.

Definition at line 209 of file VQwSubsystem.h.

Referenced by QwComptonPhotonDetector::ConstructHistograms(), QwMainCerenkovDetector::ConstructHistograms(), QwBeamLine::ConstructHistograms(), QwIntegratedRaster::ConstructHistograms(), QwLumi::ConstructHistograms(), and ConstructHistograms().

209  {
210  TString tmpstr("");
211  ConstructHistograms((TDirectory*) NULL, tmpstr);
212  };
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Definition: VQwSubsystem.h:209

+ Here is the caller graph for this function:

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

Construct the histograms for this subsystem in a folder.

Reimplemented in QwMainCerenkovDetector.

Definition at line 214 of file VQwSubsystem.h.

References ConstructHistograms().

214  {
215  TString tmpstr("");
216  ConstructHistograms(folder, tmpstr);
217  };
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Definition: VQwSubsystem.h:209

+ Here is the call graph for this function:

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

Construct the histograms for this subsystem with a prefix.

Definition at line 219 of file VQwSubsystem.h.

References ConstructHistograms().

219  {
220  ConstructHistograms((TDirectory*) NULL, prefix);
221  };
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
Definition: VQwSubsystem.h:209

+ Here is the call graph for this function:

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

Construct the tree for this subsystem.

Definition at line 257 of file VQwSubsystem.h.

Referenced by ConstructTree().

257  {
258  TString tmpstr("");
259  ConstructTree((TDirectory*) NULL, tmpstr);
260  };
virtual void ConstructTree()
Construct the tree for this subsystem.
Definition: VQwSubsystem.h:257

+ Here is the caller graph for this function:

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

Construct the tree for this subsystem in a folder.

Definition at line 262 of file VQwSubsystem.h.

References ConstructTree().

262  {
263  TString tmpstr("");
264  ConstructTree(folder, tmpstr);
265  };
virtual void ConstructTree()
Construct the tree for this subsystem.
Definition: VQwSubsystem.h:257

+ Here is the call graph for this function:

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

Construct the tree for this subsystem with a prefix.

Definition at line 267 of file VQwSubsystem.h.

References ConstructTree().

267  {
268  ConstructTree((TDirectory*) NULL, prefix);
269  };
virtual void ConstructTree()
Construct the tree for this subsystem.
Definition: VQwSubsystem.h:257

+ Here is the call graph for this function:

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

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

Reimplemented in QwComptonElectronDetector, and QwComptonPhotonDetector.

Definition at line 271 of file VQwSubsystem.h.

271 { return; };
static void VQwSubsystem::DefineOptions ( )
inlinestatic

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

Definition at line 88 of file VQwSubsystem.h.

Referenced by DefineOptionsParity(), and DefineOptionsTracking().

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

+ Here is the caller graph for this function:

virtual void VQwSubsystem::DeleteTree ( )
inlinevirtual

Delete the tree for this subsystem.

Reimplemented in QwComptonElectronDetector, and QwComptonPhotonDetector.

Definition at line 275 of file VQwSubsystem.h.

Referenced by QwSubsystemArray::DeleteTree().

275 { return; };

+ Here is the caller graph for this function:

virtual void VQwSubsystem::EncodeEventData ( std::vector< UInt_t > &  buffer)
inlinevirtual
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 QwLumi, QwIntegratedRaster, QwBeamMod, and QwMainCerenkovDetector.

Definition at line 189 of file VQwSubsystem.h.

Referenced by QwSubsystemArray::ProcessEvent().

189 { };

+ Here is the caller graph for this function:

virtual void VQwSubsystem::FillHistograms ( )
pure virtual
virtual void VQwSubsystem::FillTree ( )
inlinevirtual

Fill the tree for this subsystem.

Reimplemented in QwComptonElectronDetector, and QwComptonPhotonDetector.

Definition at line 273 of file VQwSubsystem.h.

Referenced by QwSubsystemArray::FillTree().

273 { return; };

+ Here is the caller graph for this function:

virtual void VQwSubsystem::FillTreeVector ( std::vector< Double_t > &  values) const
pure virtual
Int_t VQwSubsystem::FindIndex ( const std::vector< UInt_t > &  myvec,
const UInt_t  value 
) const
protected

Definition at line 237 of file VQwSubsystem.cc.

Referenced by GetSubbankIndex(), and RegisterROCNumber().

238 {
239  Int_t index = -1;
240  for (size_t i=0 ; i < myvec.size(); i++ ){
241  if (myvec[i]==value){
242  index=i;
243  break;
244  }
245  }
246  return index;
247 }

+ Here is the caller graph for this function:

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

Definition at line 360 of file VQwSubsystem.cc.

References fDetectorMaps.

361 {
362  return fDetectorMaps;
363 }
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
UInt_t VQwSubsystem::GetEventTypeMask ( ) const
inline

Get event type mask.

Definition at line 168 of file VQwSubsystem.h.

References fEventTypeMask.

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

168 { return fEventTypeMask; };
UInt_t fEventTypeMask
Mask of event types.
Definition: VQwSubsystem.h:317

+ Here is the caller graph for this function:

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

Definition at line 353 of file VQwSubsystem.cc.

References fDetectorMapsNames.

354 {
355  return fDetectorMapsNames;
356 }
std::vector< TString > fDetectorMapsNames
Definition: VQwSubsystem.h:321
QwSubsystemArray * VQwSubsystem::GetParent ( const unsigned int  parent = 0) const

Get the parent of this subsystem.

Get the parent of this subsystem, and print an error if no parent is defined.

Parameters
parentParent number (default = 0)
Returns
Pointer to the parent subsystem array

Definition at line 151 of file VQwSubsystem.cc.

References QwLog::endl(), fArrays, GetSubsystemName(), and QwError.

Referenced by QwMainDetector::AddSoftwareMeantimeToHits(), QwTriggerScintillator::AddSoftwareMeantimeToHits(), GetSibling(), PublishInternalValue(), and RequestExternalValue().

152 {
153  // This is ambiguously for multiple parents
154  if (fArrays.size() > 0 && fArrays.size() > parent)
155  return fArrays.at(parent);
156  else {
157  QwError << "Subsystem " << GetSubsystemName() << " has no parent!" << QwLog::endl;
158  return 0;
159  }
160 }
std::vector< QwSubsystemArray * > fArrays
Vector of pointers to subsystem arrays that contain this subsystem.
Definition: VQwSubsystem.h:334
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Get the sibling with specified name.

Get the sibling of this subsystem with the specified name. If no parents is defined, an error is printed by GetParent(). If no sibling with that name exists, the null pointer is returned.

Parameters
nameName of the sibling subsystem
Returns
Pointer to the sibling subsystem

Definition at line 170 of file VQwSubsystem.cc.

References GetParent(), and QwSubsystemArray::GetSubsystemByName().

171 {
172  // Get the parent and check for existence
173  QwSubsystemArray* parent = GetParent();
174  if (parent != 0)
175  // Return the subsystem with name in the parent
176  return parent->GetSubsystemByName(name);
177  else
178  return 0; // GetParent() prints error already
179 }
virtual VQwSubsystem * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.
QwSubsystemArray * GetParent(const unsigned int parent=0) const
Get the parent of this subsystem.

+ Here is the call graph for this function:

Int_t VQwSubsystem::GetSubbankIndex ( ) const
inlineprotected

Definition at line 303 of file VQwSubsystem.h.

References fCurrentBank_ID, fCurrentROC_ID, and GetSubbankIndex().

Referenced by GetSubbankIndex(), QwScaler::LoadChannelMap(), QwHelicity::LoadChannelMap(), QwComptonPhotonDetector::LoadChannelMap(), QwBeamLine::LoadChannelMap(), QwMainCerenkovDetector::LoadChannelMap(), QwIntegratedRaster::LoadChannelMap(), QwBeamMod::LoadChannelMap(), QwMollerDetector::LoadChannelMap(), QwLumi::LoadChannelMap(), QwTriggerScintillator::ProcessConfigurationBuffer(), QwSciFiDetector::ProcessConfigurationBuffer(), QwMainDetector::ProcessConfigurationBuffer(), QwDriftChamber::ProcessConfigurationBuffer(), QwScanner::ProcessConfigurationBuffer(), QwScaler::ProcessEvBuffer(), QwRaster::ProcessEvBuffer(), QwSciFiDetector::ProcessEvBuffer(), QwTriggerScintillator::ProcessEvBuffer(), QwDriftChamber::ProcessEvBuffer(), QwComptonPhotonDetector::ProcessEvBuffer(), QwMainDetector::ProcessEvBuffer(), QwHelicity::ProcessEvBuffer(), QwMainCerenkovDetector::ProcessEvBuffer(), QwBeamLine::ProcessEvBuffer(), QwBeamMod::ProcessEvBuffer(), QwIntegratedRaster::ProcessEvBuffer(), QwLumi::ProcessEvBuffer(), QwScanner::ProcessEvBuffer(), QwRaster::RegisterROCNumber(), QwSciFiDetector::RegisterSubbank(), QwDriftChamber::RegisterSubbank(), QwMainDetector::RegisterSubbank(), QwTriggerScintillator::RegisterSubbank(), QwScanner::RegisterSubbank(), QwTriggerScintillator::ReportConfiguration(), QwSciFiDetector::ReportConfiguration(), QwMainDetector::ReportConfiguration(), QwDriftChamber::ReportConfiguration(), and QwScanner::ReportConfiguration().

Int_t GetSubbankIndex() const
Definition: VQwSubsystem.h:303
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t VQwSubsystem::GetSubbankIndex ( const UInt_t  roc_id,
const UInt_t  bank_id 
) const
protected

Definition at line 249 of file VQwSubsystem.cc.

References fBank_IDs, FindIndex(), and fROC_IDs.

250 {
251  // Bool_t lDEBUG=kTRUE;
252  Int_t index = -1;
253  Int_t roc_index = FindIndex(fROC_IDs, roc_id);//will return the vector index for the Roc from the vector fROC_IDs.
254  // std::cout << "------------- roc_index" << roc_index <<std::endl;
255  if (roc_index>=0){
256  index = FindIndex(fBank_IDs[roc_index],bank_id);
257  // std::cout << " Find Index " << index
258  // << " roc index " << roc_index
259  // << " index " << index <<std::endl;
260 
261  if (index>=0){
262  for (Int_t i=0; i<roc_index; i++){
263  index += (fBank_IDs[i].size());
264  // std::cout << " i " << i
265  // << " fBank_IDs[i].size() " << fBank_IDs[i].size()
266  // << " index " << index
267  // << std::endl;
268  }
269  }
270  }
271  // std::cout << "return:index " << index << std::endl;
272  return index;
273 }
Int_t FindIndex(const std::vector< UInt_t > &myvec, const UInt_t value) const
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
Definition: VQwSubsystem.h:331
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
Definition: VQwSubsystem.h:329

+ Here is the call graph for this function:

TString VQwSubsystem::GetSubsystemName ( ) const
inline

Definition at line 93 of file VQwSubsystem.h.

References fSystemName.

Referenced by QwMainDetector::AddSoftwareMeantimeToHits(), QwTriggerScintillator::AddSoftwareMeantimeToHits(), QwBeamLine::AddToElementList(), QwSubsystemArray::ConstructBranch(), QwDriftChamberHDC::ConstructHistograms(), QwDriftChamberVDC::ConstructHistograms(), QwMainCerenkovDetector::ExchangeProcessedData(), QwBeamLine::GetChannel(), QwBeamLine::GetElement(), GetParent(), QwBeamLine::LoadChannelMap(), QwMainCerenkovDetector::LoadChannelMap(), QwIntegratedRaster::LoadChannelMap(), QwBeamMod::LoadChannelMap(), QwLumi::LoadChannelMap(), QwSubsystemArray::LoadSubsystemsFromParameterFile(), QwHelicity::operator+=(), QwBeamLine::PrintValue(), QwIntegratedRaster::PrintValue(), QwLumi::PrintValue(), QwMainCerenkovDetector::PrintValue(), QwTriggerScintillator::ProcessConfigurationBuffer(), QwSciFiDetector::ProcessConfigurationBuffer(), QwMainDetector::ProcessConfigurationBuffer(), QwDriftChamber::ProcessConfigurationBuffer(), QwScanner::ProcessConfigurationBuffer(), QwSciFiDetector::ProcessEvBuffer(), QwDriftChamber::ProcessEvBuffer(), QwMainDetector::ProcessEvBuffer(), PublishInternalValue(), QwSubsystemArray::push_back(), QwHelicityPattern::QwHelicityPattern(), QwTriggerScintillator::ReportConfiguration(), QwSciFiDetector::ReportConfiguration(), QwMainDetector::ReportConfiguration(), QwDriftChamber::ReportConfiguration(), QwDriftChamberHDC::SubtractReferenceTimes(), QwDriftChamberVDC::SubtractReferenceTimes(), QwSciFiDetector::SubtractReferenceTimes(), QwMainDetector::SubtractReferenceTimes(), QwTriggerScintillator::SubtractReferenceTimes(), and QwScanner::SubtractReferenceTimes().

93 {return fSystemName;};
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315

+ Here is the caller graph for this function:

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

Optional crosstalk definition.

Reimplemented in VQwSubsystemTracking.

Definition at line 161 of file VQwSubsystem.h.

Referenced by LoadDetectorMaps().

161 { return 0; };

+ Here is the caller graph for this function:

Int_t VQwSubsystem::LoadDetectorMaps ( QwParameterFile file)
virtual

Parse parameter file to find the map files.

Definition at line 37 of file VQwSubsystem.cc.

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().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual Int_t VQwSubsystem::LoadEventCuts ( TString  mapfile)
inlinevirtual

Optional event cut file.

Reimplemented in QwComptonElectronDetector, QwMollerDetector, QwRegressionSubsystem, QwScanner, QwLumi, QwBeamMod, QwIntegratedRaster, QwScaler, QwComptonPhotonDetector, VQwSubsystemParity, QwMainCerenkovDetector, QwBeamLine, QwHelicity, and QwRaster.

Definition at line 163 of file VQwSubsystem.h.

Referenced by LoadDetectorMaps().

163 { return 0; };

+ Here is the caller graph for this function:

virtual Int_t VQwSubsystem::LoadGeometryDefinition ( TString  mapfile)
inlinevirtual

Optional geometry definition.

Reimplemented in QwScanner, VQwSubsystemTracking, and QwBeamLine.

Definition at line 159 of file VQwSubsystem.h.

Referenced by LoadDetectorMaps().

159 { return 0; };

+ Here is the caller graph for this function:

virtual Int_t VQwSubsystem::LoadInputParameters ( TString  mapfile)
pure virtual
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 QwMainCerenkovDetector, QwLumi, QwIntegratedRaster, QwComptonElectronDetector, QwHelicity, QwBeamMod, QwMollerDetector, QwBeamLine, QwComptonPhotonDetector, QwRegressionSubsystem, QwScaler, VQwSubsystemParity, and QwScanner.

Definition at line 345 of file VQwSubsystem.cc.

References fIsDataLoaded.

Referenced by QwScanner::operator=(), QwScaler::operator=(), QwHelicity::operator=(), QwComptonElectronDetector::operator=(), QwIntegratedRaster::operator=(), and QwLumi::operator=().

346 {
347  this->fIsDataLoaded = value->fIsDataLoaded;
348  return *this;
349 }
Bool_t fIsDataLoaded
Has this subsystem gotten data to be processed?
Definition: VQwSubsystem.h:319

+ Here is the caller graph for this function:

void VQwSubsystem::PrintDetectorMaps ( Bool_t  status) const
virtual

Definition at line 367 of file VQwSubsystem.cc.

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

Referenced by LoadDetectorMaps().

368 {
369  Bool_t local_debug = false;
370  if (status) {
371  QwMessage << " >>> VQwSubsystem::LoadDetectorMaps Subsystem " << fSystemName
372  << " uses the following map files:" << QwLog::endl;
373 
374  Int_t index = 0;
375  size_t total = fDetectorMaps.size();
376 
377  if (total != 0) {
378 
379  for (std::map<TString,TString>::const_iterator ii = fDetectorMaps.begin();
380  ii != fDetectorMaps.end(); ++ii) {
381 
382  index++;
383  TString name = (*ii).first;
384  TString all = (*ii).second;
385  QwMessage << " ---> " << index << "/" << total << ": " << name << QwLog::endl;
386  if (local_debug)
387  QwMessage << " " << all << QwLog::endl;
388 
389  }
390 
391  } else {
392  QwMessage << " ---> No map files" << QwLog::endl;
393  }
394  }
395 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VQwSubsystem::PrintInfo ( ) const
virtual

Print some information about the subsystem.

Reimplemented in QwScanner, QwMainCerenkovDetector, QwLumi, QwIntegratedRaster, QwBeamLine, QwComptonPhotonDetector, and QwScaler.

Definition at line 331 of file VQwSubsystem.cc.

References fArrays, fBank_IDs, fROC_IDs, and fSystemName.

Referenced by QwScaler::PrintInfo(), and QwComptonPhotonDetector::PrintInfo().

332 {
333  std::cout << "Name of this subsystem: " << fSystemName << std::endl;
334  for (size_t roc_index = 0; roc_index < fROC_IDs.size(); roc_index++) {
335  std::cout << "ROC" << std::dec << fROC_IDs[roc_index] << ": ";
336  for (size_t bank_index = 0; bank_index < fBank_IDs[roc_index].size(); bank_index++)
337  std::cout << std::hex << "0x" << fBank_IDs[roc_index][bank_index] << " ";
338  std::cout << std::dec << std::endl;
339  }
340  for (size_t array = 0; array < fArrays.size(); array++)
341  std::cout << "in array " << std::hex << fArrays.at(array) << std::dec << std::endl;
342 }
std::vector< QwSubsystemArray * > fArrays
Vector of pointers to subsystem arrays that contain this subsystem.
Definition: VQwSubsystem.h:334
TString fSystemName
Name of this subsystem.
Definition: VQwSubsystem.h:315
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
Definition: VQwSubsystem.h:331
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
Definition: VQwSubsystem.h:329

+ Here is the caller graph for this function:

virtual Int_t VQwSubsystem::ProcessConfigurationBuffer ( const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
pure virtual
virtual Int_t VQwSubsystem::ProcessEvBuffer ( const UInt_t  event_type,
const UInt_t  roc_id,
const UInt_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 QwMollerDetector, and QwHelicity.

Definition at line 175 of file VQwSubsystem.h.

References GetEventTypeMask().

175  {
176  /// TODO: Subsystems should be changing their ProcessEvBuffer routines to take the event_type as the first
177  /// argument. But in the meantime, default to just calling the non-event-type-aware ProcessEvBuffer routine.
178  if (((0x1 << (event_type - 1)) & this->GetEventTypeMask()) == 0) return 0;
179  else return this->ProcessEvBuffer(roc_id, bank_id, buffer, num_words);
180  };
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)
Definition: VQwSubsystem.h:175
UInt_t GetEventTypeMask() const
Get event type mask.
Definition: VQwSubsystem.h:168

+ Here is the call graph for this function:

virtual Int_t VQwSubsystem::ProcessEvBuffer ( const UInt_t  roc_id,
const UInt_t  bank_id,
UInt_t *  buffer,
UInt_t  num_words 
)
pure virtual
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 QwLumi, QwIntegratedRaster, QwBeamMod, and QwMainCerenkovDetector.

Definition at line 194 of file VQwSubsystem.h.

Referenced by QwSubsystemArray::ProcessEvent().

194 { };

+ Here is the caller graph for this function:

virtual void VQwSubsystem::ProcessOptions ( QwOptions options)
inlinevirtual
virtual Bool_t VQwSubsystem::PublishByRequest ( TString  device_name)
inlinevirtual

Try to publish an internal variable matching the submitted name.

Reimplemented in QwLumi, and QwBeamLine.

Definition at line 113 of file VQwSubsystem.h.

113  {
114  return kFALSE; // when not implemented, this returns failure
115  };
Bool_t VQwSubsystem::PublishInternalValue ( const TString &  name,
const TString &  desc,
const VQwHardwareChannel value 
) const

Publish a variable name to the parent subsystem array.

Publish a variable name to the subsystem array

Parameters
nameName of the variable
descDescription of the variable
valueChannel to publish
Returns
True if the variable could be published, false otherwise

Definition at line 208 of file VQwSubsystem.cc.

References QwLog::endl(), GetParent(), GetSubsystemName(), QwSubsystemArray::PublishInternalValue(), and QwError.

Referenced by QwBeamLine::PublishByRequest(), QwLumi::PublishByRequest(), QwBeamLine::PublishInternalValues(), and QwMainCerenkovDetector::PublishInternalValues().

212 {
213  // Get the parent and check for existence
214  QwSubsystemArray* parent = GetParent();
215  if (parent != 0) {
216  // Publish the variable with name in the parent
217  if (parent->PublishInternalValue(name, desc, this, value) == kFALSE) {
218  QwError << "Could not publish variable " << name
219  << " in subsystem " << GetSubsystemName() << "!" << QwLog::endl;
220  return kFALSE; // Error: variable could not be puslished
221  }
222  } else {
223  QwError << "I am an orphan :-(" << QwLog::endl;
224  return kFALSE; // Error: no parent defined
225  }
226  return kTRUE; // Success
227 }
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.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
QwSubsystemArray * GetParent(const unsigned int parent=0) const
Get the parent of this subsystem.
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40
TString GetSubsystemName() const
Definition: VQwSubsystem.h:93

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual Bool_t VQwSubsystem::PublishInternalValues ( ) const
inlinevirtual

Publish all variables of the subsystem.

Reimplemented in QwLumi, QwMainCerenkovDetector, and QwBeamLine.

Definition at line 109 of file VQwSubsystem.h.

Referenced by QwSubsystemArray::LoadSubsystemsFromParameterFile().

109  {
110  return kTRUE; // when not implemented, this returns success
111  };

+ Here is the caller graph for this function:

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

Reimplemented in QwLumi, QwIntegratedRaster, and QwBeamLine.

Definition at line 202 of file VQwSubsystem.h.

202 { };
Int_t VQwSubsystem::RegisterROCNumber ( const UInt_t  roc_id,
const UInt_t  bank_id = 0 
)
protectedvirtual

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

Reimplemented in QwDriftChamber.

Definition at line 275 of file VQwSubsystem.cc.

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

Referenced by QwScaler::LoadChannelMap(), QwHelicity::LoadChannelMap(), QwComptonPhotonDetector::LoadChannelMap(), QwBeamLine::LoadChannelMap(), QwMainCerenkovDetector::LoadChannelMap(), QwIntegratedRaster::LoadChannelMap(), QwBeamMod::LoadChannelMap(), QwMollerDetector::LoadChannelMap(), QwLumi::LoadChannelMap(), QwSciFiDetector::RegisterROCNumber(), QwRaster::RegisterROCNumber(), QwDriftChamber::RegisterROCNumber(), QwMainDetector::RegisterROCNumber(), QwTriggerScintillator::RegisterROCNumber(), QwScanner::RegisterROCNumber(), and RegisterSubbank().

276 {
277  Int_t stat = 0;
278  Int_t roc_index = 0;
279  roc_index = FindIndex(fROC_IDs, roc_id);
280 
281  //will return the vector index for this roc_id on the vector fROC_IDs
282  if (roc_index==-1){
283  fROC_IDs.push_back(roc_id); // new ROC number is added.
284  roc_index = (fROC_IDs.size() - 1);
285  std::vector<UInt_t> tmpvec(1,bank_id);
286  fBank_IDs.push_back(tmpvec);
287  } else {
288  Int_t bank_index = FindIndex(fBank_IDs[roc_index],bank_id);
289  if (bank_index==-1) { // if the bank_id is not registered then register it.
290  fBank_IDs[roc_index].push_back(bank_id);
291  } else {
292  // This subbank in this ROC has already been registered!
293  QwError << std::hex << "VQwSubsystem::RegisterROCNumber: "
294  << "This subbank (0x" << bank_id << ") "
295  << "in this ROC (0x" << roc_id << ") "
296  << "has already been registered!"
297  << std::dec << QwLog::endl;
298  stat = ERROR;
299  }
300  }
301  if (stat!=-1){
302  fCurrentROC_ID = roc_id;
303  fCurrentBank_ID = bank_id;
304  } else {
305  fCurrentROC_ID = -1;
306  fCurrentBank_ID = -1;
307  }
308  return stat;
309 }
Int_t FindIndex(const std::vector< UInt_t > &myvec, const UInt_t value) const
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
Definition: VQwSubsystem.h:331
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
Definition: VQwSubsystem.h:329
Int_t ERROR
Definition: VQwSubsystem.cc:34
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t VQwSubsystem::RegisterSubbank ( const UInt_t  bank_id)
protected

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

Definition at line 311 of file VQwSubsystem.cc.

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

Referenced by QwScaler::LoadChannelMap(), QwHelicity::LoadChannelMap(), QwComptonPhotonDetector::LoadChannelMap(), QwBeamLine::LoadChannelMap(), QwMainCerenkovDetector::LoadChannelMap(), QwIntegratedRaster::LoadChannelMap(), QwBeamMod::LoadChannelMap(), QwMollerDetector::LoadChannelMap(), QwLumi::LoadChannelMap(), QwSciFiDetector::RegisterSubbank(), QwRaster::RegisterSubbank(), QwDriftChamber::RegisterSubbank(), QwMainDetector::RegisterSubbank(), QwTriggerScintillator::RegisterSubbank(), and QwScanner::RegisterSubbank().

312 {
313  Int_t stat = 0;
314  if (fCurrentROC_ID != -1){
315  stat = RegisterROCNumber(fCurrentROC_ID, bank_id);
316  fCurrentBank_ID = bank_id;
317  } else {
318  // There is not a ROC registered yet!
319  QwError << std::hex << "VQwSubsystem::RegisterSubbank: "
320  << "This subbank (" << bank_id << ") "
321  << "does not have an associated ROC! "
322  << "Add a 'ROC=#' line to the map file."
323  << std::dec << QwLog::endl;
324  stat = ERROR;
325  fCurrentROC_ID = -1;
326  fCurrentBank_ID = -1;
327  }
328  return stat;
329 }
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Definition: VQwSubsystem.h:325
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.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Int_t ERROR
Definition: VQwSubsystem.cc:34
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
Definition: VQwSubsystem.h:326
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t VQwSubsystem::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 parent subsystem array.

Get the value corresponding to some variable name from a different subsystem.

Parameters
nameName of the desired variable
valuePointer to the value to be filled by the call
Returns
True if the variable was found, false if not found

Definition at line 188 of file VQwSubsystem.cc.

References GetParent(), and QwSubsystemArray::RequestExternalValue().

Referenced by QwMainCerenkovDetector::ExchangeProcessedData(), QwBeamMod::ExchangeProcessedData(), and QwLumi::ExchangeProcessedData().

191 {
192  // Get the parent and check for existence (NOTE: only one parent supported)
193  QwSubsystemArray* parent = GetParent();
194  if (parent != 0) {
195  return parent->RequestExternalValue(name, value);
196  }
197  return kFALSE; // Error: could not find variable in parent
198 }
Bool_t RequestExternalValue(const TString &name, VQwHardwareChannel *value) const
Retrieve the variable name from other subsystem arrays.
QwSubsystemArray * GetParent(const unsigned int parent=0) const
Get the parent of this subsystem.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual const VQwHardwareChannel* VQwSubsystem::ReturnInternalValue ( const TString &  name) const
inlinevirtual

Return a pointer to a varialbe to the parent subsystem array to be delivered to a different subsystem.

Definition at line 124 of file VQwSubsystem.h.

124  {
125  std::cout << " VQwHardwareChannel::ReturnInternalValue for value name, " << name.Data()
126  << " define the routine in the respective subsystem to process this! " <<std::endl;
127  return 0;
128  };
virtual Bool_t VQwSubsystem::ReturnInternalValue ( const TString &  name,
VQwHardwareChannel value 
) const
inlinevirtual

Return a named value to the parent subsystem array to be delivered to a different subsystem.

Definition at line 132 of file VQwSubsystem.h.

133  {
134  return kFALSE;
135  };
void VQwSubsystem::SetEventTypeMask ( const UInt_t  mask)
inline

Set event type mask.

Definition at line 166 of file VQwSubsystem.h.

References fEventTypeMask.

Referenced by LoadDetectorMaps(), QwMainDetector::QwMainDetector(), QwSciFiDetector::QwSciFiDetector(), QwTriggerScintillator::QwTriggerScintillator(), VQwSubsystemParity::VQwSubsystemParity(), and VQwSubsystemTracking::VQwSubsystemTracking().

166 { fEventTypeMask = mask; };
UInt_t fEventTypeMask
Mask of event types.
Definition: VQwSubsystem.h:317

+ Here is the caller graph for this function:

void VQwSubsystem::SetParent ( QwSubsystemArray parent)

Set the parent of this subsystem to the specified array.

Set the parent of this subsystem to the specified parent array. A subsystem can have multiple parents, but that is not recommended.

Parameters
parentParent array

Definition at line 130 of file VQwSubsystem.cc.

References fArrays.

131 {
132  // Ignore null array pointers
133  if (! parent) return;
134 
135  // Check whether array already in parent list
136  for (size_t i = 0; i < fArrays.size(); i++) {
137  // Equality tested by pointer equality
138  if (fArrays.at(i) == parent) return;
139  }
140 
141  // Add array to the list
142  fArrays.push_back(parent);
143 }
std::vector< QwSubsystemArray * > fArrays
Vector of pointers to subsystem arrays that contain this subsystem.
Definition: VQwSubsystem.h:334
void VQwSubsystem::UpdatePublishedValue ( const TString &  name,
VQwHardwareChannel data_channel 
)
inlineprotected

Definition at line 146 of file VQwSubsystem.h.

References fPublishedInternalValues.

146  {
147  fPublishedInternalValues[name] = data_channel;
148  };
std::map< TString, VQwHardwareChannel * > fPublishedInternalValues
Map of published internal values.
Definition: VQwSubsystem.h:142

Field Documentation

std::vector<QwSubsystemArray*> VQwSubsystem::fArrays
protected

Vector of pointers to subsystem arrays that contain this subsystem.

Definition at line 334 of file VQwSubsystem.h.

Referenced by GetParent(), PrintInfo(), and SetParent().

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

Definition at line 321 of file VQwSubsystem.h.

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

UInt_t VQwSubsystem::fEventTypeMask
protected

Mask of event types.

Definition at line 317 of file VQwSubsystem.h.

Referenced by GetEventTypeMask(), QwScanner::QwScanner(), and SetEventTypeMask().

Bool_t VQwSubsystem::fIsDataLoaded
protected

Has this subsystem gotten data to be processed?

Definition at line 319 of file VQwSubsystem.h.

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

std::map<TString, VQwHardwareChannel*> VQwSubsystem::fPublishedInternalValues
protected

Map of published internal values.

Definition at line 142 of file VQwSubsystem.h.

Referenced by UpdatePublishedValue().

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

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