QwAnalysis
VQwSubsystemTracking Class Referenceabstract

#include <VQwSubsystemTracking.h>

+ Inheritance diagram for VQwSubsystemTracking:
+ Collaboration diagram for VQwSubsystemTracking:

Public Member Functions

 VQwSubsystemTracking (TString name)
 Constructor with name. More...
 
virtual ~VQwSubsystemTracking ()
 Default destructor. More...
 
Int_t LoadGeometryDefinition (TString mapfile)
 Load geometry definition for tracking subsystems. More...
 
Int_t LoadCrosstalkDefinition (TString mapfile)
 Load crosstalk definition for tracking subsystems. More...
 
virtual void GetHitList (QwHitContainer &grandHitContainer)=0
 Get the hit list. More...
 
const QwGeometryGetDetectorInfo () const
 Get the detector geometry information. More...
 
virtual void FillHardwareErrorSummary ()
 Hardware error summary. More...
 
Tree and branch construction and maintenance

These functions are optional for tracking subsystems; some tracking subsystems might not need to write anything to a tree.

virtual void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 Construct the branch and tree vector. More...
 
virtual void ConstructBranch (TTree *tree, TString &prefix)
 Construct the branch and tree vector. More...
 
virtual void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)
 Construct the branch and tree vector based on the trim file. More...
 
virtual void FillTreeVector (std::vector< Double_t > &values) const
 Fill the tree vector. More...
 
- Public Member Functions inherited from VQwSubsystem
 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 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
 
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...
 
virtual void ConstructBranchAndVector (TTree *tree, std::vector< Double_t > &values)
 Construct the branch and tree vector. More...
 
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...
 

Protected Attributes

QwGeometry fDetectorInfo
 Geometry information of this subsystem. More...
 
size_t fTreeArrayIndex
 Tree indices. More...
 
size_t fTreeArrayNumEntries
 
Double_t fF1TDCResolutionNS
 
- Protected Attributes inherited from VQwSubsystem
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

 VQwSubsystemTracking ()
 Private default constructor (not implemented, will throw linker error on use) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from VQwSubsystem
static void DefineOptions ()
 Define options function (note: no virtual static functions in C++) More...
 
- Protected Member Functions inherited from VQwSubsystem
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...
 

Detailed Description

Definition at line 26 of file VQwSubsystemTracking.h.

Constructor & Destructor Documentation

VQwSubsystemTracking::VQwSubsystemTracking ( )
private

Private default constructor (not implemented, will throw linker error on use)

VQwSubsystemTracking::VQwSubsystemTracking ( TString  name)
inline

Constructor with name.

Definition at line 43 of file VQwSubsystemTracking.h.

References fDetectorInfo, and VQwSubsystem::SetEventTypeMask().

44  : VQwSubsystem(name),
46  SetEventTypeMask(0xfffe); // do not accept 0x1
47  fDetectorInfo.clear(); // clear detector info
48  };
QwGeometry fDetectorInfo
Geometry information of this subsystem.
void SetEventTypeMask(const UInt_t mask)
Set event type mask.
Definition: VQwSubsystem.h:166
size_t fTreeArrayIndex
Tree indices.

+ Here is the call graph for this function:

virtual VQwSubsystemTracking::~VQwSubsystemTracking ( )
inlinevirtual

Default destructor.

Definition at line 51 of file VQwSubsystemTracking.h.

References fDetectorInfo.

51  {
52  // Clear detector info objects
53  QwGeometry::iterator i;
54  for (i = fDetectorInfo.begin(); i != fDetectorInfo.end(); i++) {
55  delete *i;
56  }
57  fDetectorInfo.clear();
58  };
QwGeometry fDetectorInfo
Geometry information of this subsystem.

Member Function Documentation

virtual void VQwSubsystemTracking::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
inlinevirtual

Construct the branch and tree vector.

Implements VQwSubsystem.

Definition at line 69 of file VQwSubsystemTracking.h.

69 { };
virtual void VQwSubsystemTracking::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile trim_file 
)
inlinevirtual

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

Implements VQwSubsystem.

Definition at line 71 of file VQwSubsystemTracking.h.

71 { };
virtual void VQwSubsystemTracking::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)
inlinevirtual

Construct the branch and tree vector.

Implements VQwSubsystem.

Reimplemented in QwScanner, QwRaster, QwMainDetector, QwTriggerScintillator, and QwSciFiDetector.

Definition at line 67 of file VQwSubsystemTracking.h.

67 { };
virtual void VQwSubsystemTracking::FillHardwareErrorSummary ( )
inlinevirtual

Hardware error summary.

Reimplemented in QwScanner, QwDriftChamber, QwMainDetector, QwSciFiDetector, and QwTriggerScintillator.

Definition at line 90 of file VQwSubsystemTracking.h.

Referenced by QwSubsystemArrayTracking::FillHardwareErrorSummary().

90 {};

+ Here is the caller graph for this function:

virtual void VQwSubsystemTracking::FillTreeVector ( std::vector< Double_t > &  values) const
inlinevirtual

Fill the tree vector.

Implements VQwSubsystem.

Reimplemented in QwScanner, QwRaster, QwMainDetector, QwTriggerScintillator, and QwSciFiDetector.

Definition at line 73 of file VQwSubsystemTracking.h.

73 { };
const QwGeometry& VQwSubsystemTracking::GetDetectorInfo ( ) const
inline

Get the detector geometry information.

Definition at line 87 of file VQwSubsystemTracking.h.

References fDetectorInfo.

Referenced by QwSubsystemArrayTracking::GetGeometry().

87 { return fDetectorInfo; };
QwGeometry fDetectorInfo
Geometry information of this subsystem.

+ Here is the caller graph for this function:

virtual void VQwSubsystemTracking::GetHitList ( QwHitContainer grandHitContainer)
pure virtual

Get the hit list.

Implemented in QwScanner, QwDriftChamber, QwMainDetector, QwSciFiDetector, QwTriggerScintillator, QwDriftChamberVDC, and QwRaster.

Referenced by QwSubsystemArrayTracking::GetHitList().

+ Here is the caller graph for this function:

Int_t VQwSubsystemTracking::LoadCrosstalkDefinition ( TString  mapfile)
virtual

Load crosstalk definition for tracking subsystems.

Reimplemented from VQwSubsystem.

Definition at line 96 of file VQwSubsystemTracking.cc.

References QwLog::endl(), fDetectorInfo, VQwSubsystem::fDetectorMaps, QwParameterFile::GetParamFileNameContents(), QwDetectorInfo::LoadCrosstalkDefinition(), QwGeometry::name(), QwMessage, QwWarning, QwParameterFile::ReadNextSection(), QwParameterFile::ReadSectionPreamble(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

97 {
98  // Open parameter file
99  QwParameterFile* map = new QwParameterFile(filename.Data());
100 
101  // Add detector map name to file
103 
104  // Read preamble
105  QwParameterFile* preamble = map->ReadSectionPreamble();
106  preamble->TrimComment("!#"); // Remove everything after a '!' or '#' character
107  preamble->TrimWhitespace(); // Get rid of leading and trailing spaces
108 
109  // Read detector sections
110  QwParameterFile* section;
111  std::string section_name;
112  while ((section = map->ReadNextSection(section_name))) {
113 
114  // Find detector info object for this detector
115  QwGeometry detectors = fDetectorInfo.name(section_name);
116  if (detectors.size() != 1) {
117  QwWarning << "Warning: LoadCrosstalkDefinition detector name " << section_name
118  << " has " << detectors.size() << " matching detectors." << QwLog::endl;
119  QwMessage << "Options are:" << QwLog::endl;
121  exit(-1);
122  }
123  // Get the first (and only) match
124  QwDetectorInfo* detector = detectors[0];
125 
126  // Load preamble parameters
127  detector->LoadCrosstalkDefinition(preamble);
128 
129  // Load section parameters
130  detector->LoadCrosstalkDefinition(section);
131 
132  // Delete object created by ReadNextSection
133  delete section;
134  }
135 
136  // Delete object created by ReadNextSection
137  delete preamble;
138 
139  // Delete QwParameterFile object
140  delete map;
141 
142  return 0; // \todo why?
143 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
void TrimComment(const char commentchar)
const std::pair< TString, TString > GetParamFileNameContents()
QwParameterFile * ReadNextSection(std::string &secname, const bool keep_header=false)
const QwGeometry name(const std::string &name)
Get detectors by name.
Definition: QwGeometry.h:83
QwGeometry fDetectorInfo
Geometry information of this subsystem.
QwParameterFile * ReadSectionPreamble()
Rewinds to the start and read until it finds next section header.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27
void TrimWhitespace(TString::EStripType head_tail=TString::kBoth)
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45
void LoadCrosstalkDefinition(QwParameterFile *map)

+ Here is the call graph for this function:

Int_t VQwSubsystemTracking::LoadGeometryDefinition ( TString  mapfile)
virtual

Load geometry definition for tracking subsystems.

Reimplemented from VQwSubsystem.

Definition at line 13 of file VQwSubsystemTracking.cc.

References QwLog::endl(), fDetectorInfo, VQwSubsystem::fDetectorMaps, QwDetectorInfo::GetOctant(), QwDetectorInfo::GetPackage(), QwParameterFile::GetParamFileNameContents(), QwDetectorInfo::GetRegion(), QwOptions::GetValue(), gQwOptions, QwOptions::HasValue(), kPackage1, kRegionID3, kRegionIDTrig, QwDetectorInfo::LoadGeometryDefinition(), QwGeometry::push_back(), QwMessage, QwParameterFile::ReadNextModule(), QwParameterFile::ReadNextSection(), QwParameterFile::ReadSectionPreamble(), QwParameterFile::RewindToFileStart(), QwDetectorInfo::SetOctant(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

14 {
15  // Open parameter file
16  QwParameterFile* map = new QwParameterFile(filename.Data());
17 
18  // Add detector map name to file
20 
21  // Clear current set of detectors before reading geometry file
22  fDetectorInfo.clear();
23 
24  // Read preamble
25  QwParameterFile* preamble = map->ReadSectionPreamble();
26  preamble->TrimComment("!#"); // Remove everything after a '!' or '#' character
27  preamble->TrimWhitespace(); // Get rid of leading and trailing spaces
28 
29  // Read detector sections
30  QwParameterFile* section;
31  std::string section_name;
32  while ((section = map->ReadNextSection(section_name))) {
33 
34  // Create new detector info object
35  QwDetectorInfo* detector = new QwDetectorInfo(section_name);
36 
37  // Load preamble parameters
38  detector->LoadGeometryDefinition(preamble);
39 
40  // Load section parameters
41  detector->LoadGeometryDefinition(section);
42 
43  // Construct "R2-octant" to request the requested octant
44  std::stringstream octant_option;
45  EQwRegionID region = detector->GetRegion();
46  if (region == kRegionIDTrig) region = kRegionID3;
47  octant_option << "R" << region << "-octant";
48 
49  // Obtain the current octant number from the command line options
50  if (gQwOptions.HasValue(octant_option.str())) {
51  // The octant specified on the command line is for package 2...
52  detector->SetOctant(gQwOptions.GetValue<Int_t>(octant_option.str()));
53  // So if we want package 1 we need to change the octant number
54  if (detector->GetPackage() == kPackage1)
55  detector->SetOctant((detector->GetOctant() + 3) % 8 + 1);
56  } else // no octant explicitly specified
57  detector->SetOctant(0);
58 
59  // Construct "R-octant = " tag to construct the correct module header
60  std::stringstream octant_match;
61  octant_match << octant_option.str() << " = " << detector->GetOctant();
62 
63  // Find modules matching the current octant
64  QwParameterFile* module;
65  std::string module_name;
66  section->RewindToFileStart();
67  while ((module = section->ReadNextModule(module_name))) {
68  // Find matching module
69  if (module_name == octant_match.str()) {
70  // Load section parameters
71  detector->LoadGeometryDefinition(module);
72  }
73 
74  // Delete object created by ReadNextModule
75  delete module;
76  }
77 
78  // Add detector to the list
79  QwMessage << *detector << QwLog::endl;
80  fDetectorInfo.push_back(detector);
81 
82  // Delete object created by ReadNextSection
83  delete section;
84  }
85 
86  // Delete object created by ReadNextSection
87  delete preamble;
88 
89  // Delete QwParameterFile object
90  delete map;
91 
92  return 0; // \todo why?
93 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::map< TString, TString > fDetectorMaps
Definition: VQwSubsystem.h:322
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
EQwDetectorPackage GetPackage() const
bool HasValue(const std::string &key)
Has this key been defined.
Definition: QwOptions.h:233
void TrimComment(const char commentchar)
EQwRegionID GetRegion() const
QwOptions gQwOptions
Definition: QwOptions.cc:27
void SetOctant(const int octant)
const std::pair< TString, TString > GetParamFileNameContents()
QwParameterFile * ReadNextSection(std::string &secname, const bool keep_header=false)
T GetValue(const std::string &key)
Get a templated value.
Definition: QwOptions.h:240
QwParameterFile * ReadNextModule(std::string &secname, bool keep_header=false)
EQwRegionID
Definition: QwTypes.h:16
QwGeometry fDetectorInfo
Geometry information of this subsystem.
void LoadGeometryDefinition(QwParameterFile *map)
QwParameterFile * ReadSectionPreamble()
Rewinds to the start and read until it finds next section header.
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
void TrimWhitespace(TString::EStripType head_tail=TString::kBoth)
int GetOctant() const

+ Here is the call graph for this function:

Field Documentation

QwGeometry VQwSubsystemTracking::fDetectorInfo
protected

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