66 if ( opChannel >= this->
NOpChannels(NOpDets) )
return false;
70 if (opdet >= NOpDets)
return false;
81 std::vector<geo::AuxDetGeo>
const& auxDets,
double tolerance)
const
83 double HalfCenterWidth = 0.;
84 double localPoint[3] = {0.};
87 for(
size_t a = 0;
a < auxDets.size(); ++
a) {
89 auxDets[
a].WorldToLocal(point, localPoint);
91 HalfCenterWidth = 0.5 * (auxDets[
a].HalfWidth1() + auxDets[
a].HalfWidth2());
93 if( localPoint[2] >= - (auxDets[
a].
Length()/2 + tolerance) &&
94 localPoint[2] <= (auxDets[
a].Length()/2 +
tolerance) &&
95 localPoint[1] >= - auxDets[
a].HalfHeight() - tolerance &&
96 localPoint[1] <= auxDets[
a].HalfHeight() + tolerance &&
98 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[
a].HalfWidth2())/(0.5 * auxDets[
a].
Length()) - tolerance &&
99 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[
a].HalfWidth2())/(0.5 * auxDets[
a].
Length()) + tolerance
105 throw cet::exception(
"ChannelMap") <<
"Can't find AuxDet for position ("
108 << point[2] <<
")\n";
116 std::vector<geo::AuxDetGeo>
const& auxDets,
double tolerance)
const
118 double HalfCenterWidth = 0.;
119 double localPoint[3] = {0.};
121 size_t auxDetIdx = this->
NearestAuxDet(point, auxDets, tolerance);
134 localPoint[1] >= - adsg.
HalfHeight() - tolerance &&
135 localPoint[1] <= adsg.
HalfHeight() + tolerance &&
137 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) - tolerance &&
138 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) + tolerance
143 throw cet::exception(
"Geometry") <<
"Can't find AuxDetSensitive for position ("
146 << point[2] <<
")\n";
153 std::string
const& detName,
154 uint32_t
const& )
const
159 if( itr.first.compare(detName) == 0 )
return itr.second;
162 throw cet::exception(
"Geometry") <<
"No AuxDetGeo matching name: " << detName;
171 std::string
const& detName,
172 uint32_t
const& channel)
const
182 if( channel < itr->
second.size() )
183 return std::make_pair(adGeoIdx, itr->second[channel]);
185 throw cet::exception(
"Geometry") <<
"Given AuxDetSensitive channel, " << channel
186 <<
", cannot be found in vector associated to AuxDetGeo index: "
187 << adGeoIdx <<
". Vector has size " << itr->second.size();
190 throw cet::exception(
"Geometry") <<
"Given AuxDetGeo with index " << adGeoIdx
191 <<
" does not correspond to any vector of sensitive volumes";
193 return std::make_pair(adGeoIdx, UINT_MAX);
float Length(const PFPStruct &pfp)
double HalfWidth2() const
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet(std::vector< geo::AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the sensitive detector containing the channel.
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
geo::SigType_t SignalTypeForROPID(readout::ROPID const &ropid) const
Return the signal type on the specified readout plane.
geo::SigType_t SignalTypeForChannel(raw::ChannelID_t const channel) const
Return the signal type of the specified channel.
The data type to uniquely identify a Plane.
WireID_t Wire
Index of the wire within its plane.
virtual unsigned int NOpChannels(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual unsigned int OpDetFromOpChannel(unsigned int opChannel) const
Returns the optical detector the specified optical channel belongs.
double HalfWidth1() const
double HalfHeight() const
unsigned int NearestWire(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the index of the wire nearest to the specified position.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first channel in the specified readout plane.
enum geo::_plane_sigtype SigType_t
std::map< std::string, size_t > fADNameToGeo
map the names of the dets to the AuxDetGeo objects
size_t NSensitiveVolume() const
Class identifying a set of planes sharing readout channels.
Encapsulate the geometry of an auxiliary detector.
std::map< size_t, std::vector< size_t > > fADChannelToSensitiveGeo
virtual geo::SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
virtual geo::SigType_t SignalTypeForROPIDImpl(readout::ROPID const &ropid) const
Return the signal type on the specified readout plane.
virtual unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const
Returns the hardware channel number of specified optical channel.
virtual unsigned int MaxOpChannel(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual size_t ChannelToAuxDet(std::vector< geo::AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the detector containing the specified channel.
size_t NOpDets(int cryostat)
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
virtual unsigned int OpChannel(unsigned int detNum, unsigned int hwchannel=0) const
Returns the channel ID of the specified hardware channel.
virtual unsigned int NOpHardwareChannels(unsigned int opDet) const
Returns the number of channels in the specified optical detectors.
virtual geo::WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the ID of the wire nearest to the specified position.
virtual bool IsValidOpChannel(unsigned int opChannel, unsigned int NOpDets) const
Returns whether the ID identifies a valid optical detector channel.
Interface to algorithm class for a specific detector channel mapping.
virtual size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const
Returns sensitive auxiliary detector closest to specified point.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const
Returns the auxiliary detector closest to the specified point.