66 if ( opChannel >= this->
NOpChannels(NOpDets) )
return false;
70 if (opdet >= NOpDets)
return false;
81 std::vector<geo::AuxDetGeo*>
const& auxDets)
const 83 double HalfCenterWidth = 0.;
84 double localPoint[3] = {0.};
86 for(
size_t a = 0; a < auxDets.size(); ++a) {
88 auxDets[a]->WorldToLocal(point, localPoint);
90 HalfCenterWidth = 0.5 * (auxDets[a]->HalfWidth1() + auxDets[a]->HalfWidth2());
92 if( localPoint[2] >= - auxDets[a]->Length()/2 &&
93 localPoint[2] <= auxDets[a]->Length()/2 &&
94 localPoint[1] >= - auxDets[a]->HalfHeight() &&
95 localPoint[1] <= auxDets[a]->HalfHeight() &&
97 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[a]->HalfWidth2())/(0.5 * auxDets[a]->Length()) &&
98 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[a]->HalfWidth2())/(0.5 * auxDets[a]->Length())
104 throw cet::exception(
"ChannelMap") <<
"Can't find AuxDet for position (" 107 << point[2] <<
")\n";
115 std::vector<geo::AuxDetGeo*>
const& auxDets)
const 117 double HalfCenterWidth = 0.;
118 double localPoint[3] = {0.};
131 if( localPoint[2] >= - adsg.
Length()/2 &&
132 localPoint[2] <= adsg.
Length()/2 &&
136 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) &&
137 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length())
142 throw cet::exception(
"Geometry") <<
"Can't find AuxDetSensitive for position (" 145 << point[2] <<
")\n";
152 std::string
const& detName,
153 uint32_t
const& )
const 158 if( itr.first.compare(detName) == 0 )
return itr.second;
161 throw cet::exception(
"Geometry") <<
"No AuxDetGeo matching name: " << detName;
170 std::string
const& detName,
171 uint32_t
const& channel)
const 181 if( channel < itr->second.size() )
182 return std::make_pair(adGeoIdx, itr->second[channel]);
184 throw cet::exception(
"Geometry") <<
"Given AuxDetSensitive channel, " << channel
185 <<
", cannot be found in vector associated to AuxDetGeo index: " 186 << adGeoIdx <<
". Vector has size " << itr->second.size();
189 throw cet::exception(
"Geometry") <<
"Given AuxDetGeo with index " << adGeoIdx
190 <<
" does not correspond to any vector of sensitive volumes";
192 return std::make_pair(adGeoIdx, UINT_MAX);
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.
double HalfWidth2() const
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.
virtual geo::SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
WireID_t Wire
Index of the wire within its plane.
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
Returns the auxiliary detector closest to the specified point.
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 size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
Returns sensitive auxiliary detector closest to specified point.
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
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 raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first channel in the specified readout plane.
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.
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.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Namespace collecting geometry-related classes utilities.
cet::coded_exception< error, detail::translate > exception