Jpp  18.5.2
the software that should make you happy
 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 JRange< double > &Z=JRange< double >())
 Constructor. More...
 
 JDetectorSubset (const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
 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 119 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 JRange< double > &  Z = JRange<double>() 
)
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 162 of file JDetectorSubset.hh.

166  :
167  JDetectorSubset_t(detector, track, Rmax, Z),
168  compare(comparator)
169  {
170  std::sort(this->begin(), this->end(), compare);
171  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
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 JRange< double > &  Z = JRange<double>() 
)
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 185 of file JDetectorSubset.hh.

188  :
189  JDetectorSubset_t(detector, track, Rmax, Z),
190  compare()
191  {
192  std::sort(this->begin(), this->end(), compare);
193  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
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 207 of file JDetectorSubset.hh.

210  :
211  JDetectorSubset_t(detector, position, Dmax),
212  compare(comparator)
213  {
214  std::sort(this->begin(), this->end(), compare);
215  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
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 228 of file JDetectorSubset.hh.

230  :
231  JDetectorSubset_t(detector, position, Dmax),
232  compare()
233  {
234  std::sort(this->begin(), this->end(), compare);
235  }
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
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 243 of file JDetectorSubset.hh.

244  {
245  return compare;
246  }
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 255 of file JDetectorSubset.hh.

256  {
257  return std::lower_bound(this->begin(), this->end(), value, compare);
258  }
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 268 of file JDetectorSubset.hh.

270  {
271  return range_type(this->lower_bound(xmin),
272  this->lower_bound(xmax));
273  }
const double xmax
Definition: JQuadrature.cc:24
const_iterator lower_bound(const double value) const
Find first module after given value according specified comparator.
JRange< int > range_type
const double xmin
Definition: JQuadrature.cc:23

Member Data Documentation

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

Definition at line 276 of file JDetectorSubset.hh.


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