QwAnalysis
QwGeometry Class Reference

Collection of QwDetectorInfo pointers that specifies an experimental geometry. More...

#include <QwGeometry.h>

Inherits std::vector< T >.

Data Structures

struct  compare
 Functor for sorting QwDetectorInfo pointers. More...
 

Public Member Functions

 QwGeometry ()
 Default constructor. More...
 
 QwGeometry (const QwGeometry &that)
 Copy constructor. More...
 
virtual ~QwGeometry ()
 Virtual destructor. More...
 
QwGeometryoperator= (const QwGeometry &that)
 Assignment operator. More...
 
void push_back (QwDetectorInfo &detector)
 Add single detector object. More...
 
void push_back (QwDetectorInfo *detector)
 Add single detector pointer. More...
 
void push_back (const QwGeometry &detectors)
 Add another geometry. More...
 
void push_back (std::vector< QwDetectorInfo > &detectors)
 Add vector of detectors. More...
 
const QwGeometry name (const std::string &name)
 Get detectors by name. More...
 
const QwGeometry in (const EQwRegionID &r) const
 Get detectors in given region. More...
 
const QwGeometry in (const EQwDetectorPackage &p) const
 Get detectors in given package. More...
 
const QwGeometry in (const EQwDirectionID &d) const
 Get detectors in given direction. More...
 
const QwGeometry of (const EQwDetectorType &t) const
 Get detectors of given type. More...
 
const QwGeometry as (const QwDetectorInfo *d) const
 Get detectors like specified detector (same region, same package, same type) More...
 
void Print () const
 

Friends

std::ostream & operator<< (std::ostream &stream, const QwGeometry &detectors)
 

Additional Inherited Members

- Data Fields inherited from std::vector< T >
elements
 STL member. More...
 

Detailed Description

Collection of QwDetectorInfo pointers that specifies an experimental geometry.

Definition at line 27 of file QwGeometry.h.

Constructor & Destructor Documentation

QwGeometry::QwGeometry ( )
inline

Default constructor.

Definition at line 39 of file QwGeometry.h.

39 { clear(); };
QwGeometry::QwGeometry ( const QwGeometry that)
inline

Copy constructor.

Definition at line 41 of file QwGeometry.h.

41 : std::vector<QwDetectorInfo*>(that) { };
virtual QwGeometry::~QwGeometry ( )
inlinevirtual

Virtual destructor.

Definition at line 43 of file QwGeometry.h.

43 { };

Member Function Documentation

const QwGeometry QwGeometry::as ( const QwDetectorInfo d) const
inline

Get detectors like specified detector (same region, same package, same type)

Definition at line 128 of file QwGeometry.h.

References QwDetectorInfo::GetDirection(), QwDetectorInfo::GetPackage(), QwDetectorInfo::GetRegion(), QwDetectorInfo::GetType(), and push_back().

128  {
129  QwGeometry results;
130  for (const_iterator i = begin(); i != end(); i++)
131  if ((*i)->GetPackage() == d->GetPackage()
132  && (*i)->GetRegion() == d->GetRegion()
133  && (*i)->GetDirection() == d->GetDirection()
134  && (*i)->GetType() == d->GetType())
135  results.push_back(*i);
136  return results;
137  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
EQwDetectorPackage GetPackage() const
EQwRegionID GetRegion() const
EQwDirectionID GetDirection() const
EQwDetectorType GetType() const
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27

+ Here is the call graph for this function:

const QwGeometry QwGeometry::in ( const EQwRegionID r) const
inline

Get detectors in given region.

Definition at line 92 of file QwGeometry.h.

References push_back().

Referenced by QwTreeEventBuffer::CreateHitList(), QwPartialTrack::DeterminePositionInCerenkovBars(), QwPartialTrack::DeterminePositionInHDC(), QwPartialTrack::DeterminePositionInTriggerScintillators(), QwTreeEventBuffer::GetEntry(), QwTrackingTreeCombine::InAcceptance(), QwTrackingWorker::InitTree(), main(), QwTrackingWorker::ProcessEvent(), QwTrackingTreeCombine::TlCheckForX(), QwTrackingTreeCombine::TlTreeLineSort(), QwDriftChamberHDC::UpdateHits(), and QwDriftChamberVDC::UpdateHits().

92  {
93  QwGeometry results;
94  for (const_iterator i = begin(); i != end(); i++)
95  if ((*i)->GetRegion() == r)
96  results.push_back(*i);
97  return results;
98  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QwGeometry QwGeometry::in ( const EQwDetectorPackage p) const
inline

Get detectors in given package.

Definition at line 101 of file QwGeometry.h.

References push_back().

101  {
102  QwGeometry results;
103  for (const_iterator i = begin(); i != end(); i++)
104  if ((*i)->GetPackage() == p)
105  results.push_back(*i);
106  return results;
107  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27

+ Here is the call graph for this function:

const QwGeometry QwGeometry::in ( const EQwDirectionID d) const
inline

Get detectors in given direction.

Definition at line 110 of file QwGeometry.h.

References push_back().

110  {
111  QwGeometry results;
112  for (const_iterator i = begin(); i != end(); i++)
113  if ((*i)->GetDirection() == d)
114  results.push_back(*i);
115  return results;
116  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27

+ Here is the call graph for this function:

const QwGeometry QwGeometry::name ( const std::string &  name)
inline

Get detectors by name.

Definition at line 83 of file QwGeometry.h.

References push_back().

Referenced by VQwSubsystemTracking::LoadCrosstalkDefinition().

83  {
84  QwGeometry results;
85  for (const_iterator i = begin(); i != end(); i++)
86  if ((*i)->GetDetectorName() == name)
87  results.push_back(*i);
88  return results;
89  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
const QwGeometry name(const std::string &name)
Get detectors by name.
Definition: QwGeometry.h:83
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QwGeometry QwGeometry::of ( const EQwDetectorType t) const
inline

Get detectors of given type.

Definition at line 119 of file QwGeometry.h.

References push_back().

119  {
120  QwGeometry results;
121  for (const_iterator i = begin(); i != end(); i++)
122  if ((*i)->GetType() == t)
123  results.push_back(*i);
124  return results;
125  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55
Collection of QwDetectorInfo pointers that specifies an experimental geometry.
Definition: QwGeometry.h:27

+ Here is the call graph for this function:

QwGeometry& QwGeometry::operator= ( const QwGeometry that)
inline

Assignment operator.

Definition at line 46 of file QwGeometry.h.

References push_back().

46  {
47  if (this != &that) {
48  clear();
49  push_back(that);
50  }
51  return *this;
52  }
void push_back(QwDetectorInfo &detector)
Add single detector object.
Definition: QwGeometry.h:55

+ Here is the call graph for this function:

void QwGeometry::Print ( ) const
inline

Print function

Definition at line 150 of file QwGeometry.h.

References QwLog::endl(), and QwOut.

151 {
152  for (QwGeometry::const_iterator i = begin(); i != end(); i++) {
153  if (*i)
154  (*i)->Print();
155  else
156  QwOut << "(null)" << QwLog::endl;
157  QwOut << QwLog::endl;
158  }
159 }
#define QwOut
Predefined log drain for explicit output.
Definition: QwLog.h:35
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

void QwGeometry::push_back ( QwDetectorInfo detector)
inline

Add single detector object.

Definition at line 55 of file QwGeometry.h.

Referenced by as(), QwSubsystemArrayTracking::GetGeometry(), in(), VQwSubsystemTracking::LoadGeometryDefinition(), name(), of(), and operator=().

55  {
56  std::vector<QwDetectorInfo*>::push_back(&detector);
57  std::sort(begin(),end(),compare());
58  }

+ Here is the caller graph for this function:

void QwGeometry::push_back ( QwDetectorInfo detector)
inline

Add single detector pointer.

Definition at line 61 of file QwGeometry.h.

61  {
62  std::vector<QwDetectorInfo*>::push_back(detector);
63  std::sort(begin(),end(),compare());
64  }
void QwGeometry::push_back ( const QwGeometry detectors)
inline

Add another geometry.

Definition at line 67 of file QwGeometry.h.

67  {
68  QwGeometry::const_iterator i;
69  for (i = detectors.begin(); i != detectors.end(); i++)
70  std::vector<QwDetectorInfo*>::push_back(*i);
71  std::sort(begin(),end(),compare());
72  }
void QwGeometry::push_back ( std::vector< QwDetectorInfo > &  detectors)
inline

Add vector of detectors.

Definition at line 75 of file QwGeometry.h.

75  {
76  std::vector<QwDetectorInfo>::iterator i;
77  for (i = detectors.begin(); i != detectors.end(); i++)
78  std::vector<QwDetectorInfo*>::push_back(&(*i));
79  std::sort(begin(),end(),compare());
80  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const QwGeometry detectors 
)
friend

Output stream operator

Parameters
streamOutput stream
detectorsDetector geometry object
Returns
Output stream

Definition at line 167 of file QwGeometry.h.

168 {
169  for (QwGeometry::const_iterator i = detectors.begin(); i != detectors.end(); i++) {
170  if (*i)
171  stream << *(*i) << std::endl;
172  else
173  stream << "(null)" << std::endl;
174  }
175  return stream;
176 }

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