1 #ifndef __JDETECTOR__JDETECTORSUBSET__
2 #define __JDETECTOR__JDETECTORSUBSET__
22 namespace JDETECTOR {}
23 namespace JPP {
using namespace JDETECTOR; }
56 const double Rmax = std::numeric_limits<double>::max(),
63 for (JDetector::const_iterator i = detector.begin(); i != detector.end(); ++i) {
67 pos.
transform(transformation.getRotation(), transformation.getPosition());
69 if (Z(pos.getZ()) && pos.getX() <= Rmax) {
73 module.transform(transformation);
75 this->push_back(module);
94 const double Dmax = std::numeric_limits<double>::max())
96 for (JDetector::const_iterator i = detector.begin(); i != detector.end(); ++i) {
102 if (pos.getLength() <= Dmax) {
106 module.
sub(position);
108 this->push_back(module);
118 template<
class JComparator_t>
134 const_iterator
end) :
140 inline const_iterator
end()
const {
return __end; }
164 const JComparator_t& comparator,
165 const double Rmax = std::numeric_limits<double>::max(),
170 std::sort(this->begin(), this->end(),
compare);
187 const double Rmax = std::numeric_limits<double>::max(),
192 std::sort(this->begin(), this->end(),
compare);
209 const JComparator_t& comparator,
210 const double Dmax = std::numeric_limits<double>::max()) :
214 std::sort(this->begin(), this->end(),
compare);
230 const double Dmax = std::numeric_limits<double>::max()) :
234 std::sort(this->begin(), this->end(),
compare);
257 return std::lower_bound(this->begin(), this->end(), value,
compare);
269 const double xmax)
const
JDetectorSubset_t(const JDetector &detector, const JVector3D &position, const double Dmax=std::numeric_limits< double >::max())
Constructor.
Data structure for direction in three dimensions.
const_iterator lower_bound(const double value) const
Find first module after given value according specified comparator.
Data structure for a composite optical module.
Auxiliary classes to compare modules.
const JDirection3D & getDirection() const
Get direction.
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.
Data structure for detector geometry and calibration.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
JDetectorSubset(const JDetector &detector, const JVector3D &position, const double Dmax=std::numeric_limits< double >::max())
Constructor.
Auxiliary class for range of iterators.
JModule & sub(const JVector3D &pos)
Subtract position.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Data structure for vector in three dimensions.
const JComparator_t & getComparator() const
Get comparator.
range_type getRange(const double xmin, const double xmax) const
Get range of modules between given values according specified comparator.
JDetectorSubset(const JDetector &detector, const JVector3D &position, const JComparator_t &comparator, const double Dmax=std::numeric_limits< double >::max())
Constructor.
range_type(const_iterator begin, const_iterator end)
Constructor.
JDetectorSubset_t(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
Constructor.
const JPosition3D & getPosition() const
Get position.
Detector subset with binary search functionality.
Detector subset without binary search functionality.
const JComparator_t compare
Auxiliary class to define a range between two values.
Data structure for position in three dimensions.
const_iterator begin() const
begin of iteration
do set_variable DETECTOR_TXT $WORKDIR detector
const_iterator end() const
end of iteration
JDetectorSubset(const JDetector &detector, const JAxis3D &track, const double Rmax=std::numeric_limits< double >::max(), const JRange< double > &Z=JRange< double >())
Constructor.
bool empty() const
check emptyness