1 #ifndef __JCOMPASS__JPOLICY__
2 #define __JCOMPASS__JPOLICY__
51 for (T i = __begin; i != __end; ++i) {
64 detector[module->getLocation()] = module->getID();
69 if (module->getFloor() != 0) {
71 const int id = module->getID();
72 const int string = module->getString();
74 if (!zmap[
string].empty()) {
76 if (zmap[
string].count(module->getFloor()) != 0) {
78 (*this)[id].push_back(
id);
82 for (
size_t step = 1; (*this)[id].size() < size && (module->getFloor() + (
int) step <= *zmap[
string].rbegin() ||
83 module->getFloor() - (
int) step >= *zmap[
string]. begin()); ++step) {
84 for (
int sign : { -1, +1 }) {
86 const int floor = module->getFloor() +
sign * step;
88 if (zmap[
string].count(floor) != 0) {
Logical location of module.
Direct access to module in detector data structure.
Logical location of module.
int getFloor() const
Get floor number.
int getString() const
Get string number.
Router for direct addressing of module data in detector data structure.
JDetector::const_iterator const_iterator
const JModule & getModule(const JObjectID &id) const
Get module parameters.
bool hasModule(const JObjectID &id) const
Has module.
Auxiliary classes and methods for orientation calibration based on compasses.
int sign(const T &value)
Get sign of value.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class to define policy for invalid modules.
JPolicy(const JModuleRouter &router, T __begin, T __end, const size_t size=1)
Constructor.