8 #include "messagefacility/MessageLogger/MessageLogger.h"
14 double HalfCenterWidth = 0.;
15 double localPoint[3] = {0.};
18 for(
size_t a = 0;
a < auxDets.size(); ++
a) {
20 auxDets[
a].WorldToLocal(point, localPoint);
22 HalfCenterWidth = 0.5 * (auxDets[
a].HalfWidth1() + auxDets[
a].HalfWidth2());
24 if( localPoint[2] >= - (auxDets[
a].
Length()/2 + tolerance) &&
25 localPoint[2] <= (auxDets[
a].Length()/2 +
tolerance) &&
26 localPoint[1] >= - auxDets[
a].HalfHeight() - tolerance &&
27 localPoint[1] <= auxDets[
a].HalfHeight() + tolerance &&
29 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[
a].HalfWidth2())/(0.5 * auxDets[
a].
Length()) - tolerance &&
30 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[
a].HalfWidth2())/(0.5 * auxDets[
a].
Length()) + tolerance
36 mf::LogDebug(
"ChannelMapSBND") <<
"Can't find AuxDet for position ("
48 double HalfCenterWidth = 0.;
49 double localPoint[3] = {0.};
51 size_t auxDetIdx = this->
NearestAuxDet(point, auxDets, tolerance);
53 if(auxDetIdx == UINT_MAX)
67 localPoint[1] >= - adsg.
HalfHeight() - tolerance &&
68 localPoint[1] <= adsg.
HalfHeight() + tolerance &&
70 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) - tolerance &&
71 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) + tolerance
76 mf::LogDebug(
"ChannelMapSBND") <<
"Can't find AuxDetSensitive for position ("
float Length(const PFPStruct &pfp)
double HalfWidth2() const
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
double HalfWidth1() const
double HalfHeight() const
virtual size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const override
Returns sensitive auxiliary detector closest to specified point.
size_t NSensitiveVolume() const
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
Channel mapping for SBND.
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const override
Returns the auxiliary detector closest to the specified point.