Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Protected Attributes | List of all members
JDETECTOR::JDetectorSubset< JComparator_t > Class Template Reference

Detector subset with binary search functionality. More...

#include <JDetectorSubset.hh>

Inheritance diagram for JDETECTOR::JDetectorSubset< JComparator_t >:
JDETECTOR::JDetectorSubset_t std::vector< JModule >

Classes

struct  range_type
 Auxiliary class for range of iterators. More...
 

Public Member Functions

 JDetectorSubset (const JDetector &detector, const JAxis3D &track, const JComparator_t &comparator, const double Rmax=std::numeric_limits< double >::max(), const JRangeZ Z=JRangeZ())
 Constructor. More...
 
 JDetectorSubset (const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRangeZ Z=JRangeZ())
 Constructor. More...
 
 JDetectorSubset (const JDetector &detector, const JVector3D &position, const JComparator_t &comparator, const double Dmax=std::numeric_limits< double >::max())
 Constructor. More...
 
 JDetectorSubset (const JDetector &detector, const JVector3D &position, const double Dmax=std::numeric_limits< double >::max())
 Constructor. More...
 
const JComparator_t & getComparator () const
 Get comparator. More...
 
const_iterator lower_bound (const double value) const
 Find first module after given value according specified comparator. More...
 
range_type getRange (const double xmin, const double xmax) const
 Get range of modules between given values according specified comparator. More...
 

Protected Attributes

const JComparator_t compare
 

Detailed Description

template<class JComparator_t>
class JDETECTOR::JDetectorSubset< JComparator_t >

Detector subset with binary search functionality.

Definition at line 118 of file JDetectorSubset.hh.

Constructor & Destructor Documentation

template<class JComparator_t >
JDETECTOR::JDetectorSubset< JComparator_t >::JDetectorSubset ( const JDetector detector,
const JAxis3D track,
const JComparator_t &  comparator,
const double  Rmax = std::numeric_limits<double>::max(),
const JRangeZ  Z = JRangeZ() 
)
inline

Constructor.

See constructor JDetectorSubset_t::JDetectorSubset_t. The modules are sorted according the specified comparator.

Parameters
detectordetector
trackparticle track
comparatorcomparator
Rmaxmaximal distance of approach [m]
Zrange of positions along z-axis [m]

Definition at line 161 of file JDetectorSubset.hh.

165  :
166  JDetectorSubset_t(detector, track, Rmax, Z),
167  compare(comparator)
168  {
169  std::sort(this->begin(), this->end(), compare);
170  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRangeZ Z=JRangeZ())
Constructor.
const JComparator_t compare
template<class JComparator_t >
JDETECTOR::JDetectorSubset< JComparator_t >::JDetectorSubset ( const JDetector detector,
const JAxis3D track,
const double  Rmax = std::numeric_limits<double>::max(),
const JRangeZ  Z = JRangeZ() 
)
inline

Constructor.

See constructor JDetectorSubset_t::JDetectorSubset_t. The modules are sorted according the default comparator.

Parameters
detectordetector
trackparticle track
Rmaxmaximal distance of approach [m]
Zrange of positions along z-axis [m]

Definition at line 184 of file JDetectorSubset.hh.

187  :
188  JDetectorSubset_t(detector, track, Rmax, Z),
189  compare()
190  {
191  std::sort(this->begin(), this->end(), compare);
192  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRangeZ Z=JRangeZ())
Constructor.
const JComparator_t compare
template<class JComparator_t >
JDETECTOR::JDetectorSubset< JComparator_t >::JDetectorSubset ( const JDetector detector,
const JVector3D position,
const JComparator_t &  comparator,
const double  Dmax = std::numeric_limits<double>::max() 
)
inline

Constructor.

See constructor JDetectorSubset_t::JDetectorSubset_t. The modules are sorted according the specified comparator.

Parameters
detectordetector
positionposition of vertex
comparatorcomparator
Dmaxmaximal distance [m]

Definition at line 206 of file JDetectorSubset.hh.

209  :
210  JDetectorSubset_t(detector, position, Dmax),
211  compare(comparator)
212  {
213  std::sort(this->begin(), this->end(), compare);
214  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRangeZ Z=JRangeZ())
Constructor.
const JComparator_t compare
template<class JComparator_t >
JDETECTOR::JDetectorSubset< JComparator_t >::JDetectorSubset ( const JDetector detector,
const JVector3D position,
const double  Dmax = std::numeric_limits<double>::max() 
)
inline

Constructor.

See constructor JDetectorSubset_t::JDetectorSubset_t. The modules are sorted according the default comparator.

Parameters
detectordetector
positionposition of vertex
Dmaxmaximal distance [m]

Definition at line 227 of file JDetectorSubset.hh.

229  :
230  JDetectorSubset_t(detector, position, Dmax),
231  compare()
232  {
233  std::sort(this->begin(), this->end(), compare);
234  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRangeZ Z=JRangeZ())
Constructor.
const JComparator_t compare

Member Function Documentation

template<class JComparator_t >
const JComparator_t& JDETECTOR::JDetectorSubset< JComparator_t >::getComparator ( ) const
inline

Get comparator.

Returns
compartor

Definition at line 242 of file JDetectorSubset.hh.

243  {
244  return compare;
245  }
const JComparator_t compare
template<class JComparator_t >
const_iterator JDETECTOR::JDetectorSubset< JComparator_t >::lower_bound ( const double  value) const
inline

Find first module after given value according specified comparator.

Parameters
valuevalue
Returns
iterator to module

Definition at line 254 of file JDetectorSubset.hh.

255  {
256  return std::lower_bound(this->begin(), this->end(), value, compare);
257  }
const JComparator_t compare
template<class JComparator_t >
range_type JDETECTOR::JDetectorSubset< JComparator_t >::getRange ( const double  xmin,
const double  xmax 
) const
inline

Get range of modules between given values according specified comparator.

Parameters
xminminimal value
xmaxmaximal value
Returns
range of iterators

Definition at line 267 of file JDetectorSubset.hh.

269  {
270  return range_type(this->lower_bound(xmin),
271  this->lower_bound(xmax));
272  }
const_iterator lower_bound(const double value) const
Find first module after given value according specified comparator.

Member Data Documentation

template<class JComparator_t >
const JComparator_t JDETECTOR::JDetectorSubset< JComparator_t >::compare
protected

Definition at line 275 of file JDetectorSubset.hh.


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