#include "AuxDetChannelMapAlg.h"
|
virtual | ~AuxDetChannelMapAlg ()=default |
|
virtual void | Initialize (AuxDetGeometryData_t &geodata)=0 |
|
virtual void | Uninitialize ()=0 |
|
virtual size_t | NearestAuxDet (Point_t const &point, std::vector< AuxDetGeo > const &auxDets, double tolerance=0) const |
|
virtual size_t | NearestSensitiveAuxDet (Point_t const &point, std::vector< AuxDetGeo > const &auxDets, size_t &ad, double tolerance=0) const |
|
virtual size_t | ChannelToAuxDet (std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t channel) const |
|
virtual std::pair< size_t, size_t > | ChannelToSensitiveAuxDet (std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t channel) const |
|
virtual uint32_t | PositionToAuxDetChannel (Point_t const &worldLoc, std::vector< AuxDetGeo > const &auxDets, size_t &ad, size_t &sv) const =0 |
|
virtual Point_t | AuxDetChannelToPosition (uint32_t channel, std::string const &auxDetName, std::vector< AuxDetGeo > const &auxDets) const =0 |
|
|
using | chanAndSV = std::pair< uint32_t, size_t > |
|
Definition at line 27 of file AuxDetChannelMapAlg.h.
virtual geo::AuxDetChannelMapAlg::~AuxDetChannelMapAlg |
( |
| ) |
|
|
virtualdefault |
virtual Point_t geo::AuxDetChannelMapAlg::AuxDetChannelToPosition |
( |
uint32_t |
channel, |
|
|
std::string const & |
auxDetName, |
|
|
std::vector< AuxDetGeo > const & |
auxDets |
|
) |
| const |
|
pure virtual |
size_t geo::AuxDetChannelMapAlg::ChannelToAuxDet |
( |
std::vector< AuxDetGeo > const & |
auxDets, |
|
|
std::string const & |
detName, |
|
|
uint32_t |
channel |
|
) |
| const |
|
virtual |
Definition at line 85 of file AuxDetChannelMapAlg.cxx.
References fADGeoToName.
Referenced by ChannelToSensitiveAuxDet().
94 if (itr.second.compare(detName) == 0)
return itr.first;
96 throw cet::exception(
"Geometry") <<
"No AuxDetGeo matching name: " << detName;
std::map< size_t, std::string > fADGeoToName
map the AuxDetGeo index to the name
cet::coded_exception< error, detail::translate > exception
std::pair< size_t, size_t > geo::AuxDetChannelMapAlg::ChannelToSensitiveAuxDet |
( |
std::vector< AuxDetGeo > const & |
auxDets, |
|
|
std::string const & |
detName, |
|
|
uint32_t |
channel |
|
) |
| const |
|
virtual |
Definition at line 102 of file AuxDetChannelMapAlg.cxx.
References ChannelToAuxDet(), and fADGeoToChannelAndSV.
115 if (channel < itr->
second.size())
116 return std::make_pair(adGeoIdx, itr->second[channel].second);
119 <<
"Given AuxDetSensitive channel, " << channel
120 <<
", cannot be found in vector associated to AuxDetGeo index: " << adGeoIdx
121 <<
". Vector has size " << itr->second.size();
124 throw cet::exception(
"Geometry") <<
"Given AuxDetGeo with index " << adGeoIdx
125 <<
" does not correspond to any vector of sensitive volumes";
std::map< size_t, std::vector< chanAndSV > > fADGeoToChannelAndSV
virtual size_t ChannelToAuxDet(std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t channel) const
second_as<> second
Type of time stored in seconds, in double precision.
cet::coded_exception< error, detail::translate > exception
size_t geo::AuxDetChannelMapAlg::NearestAuxDet |
( |
Point_t const & |
point, |
|
|
std::vector< AuxDetGeo > const & |
auxDets, |
|
|
double |
tolerance = 0 |
|
) |
| const |
|
virtual |
Definition at line 17 of file AuxDetChannelMapAlg.cxx.
References tca::Length().
Referenced by NearestSensitiveAuxDet().
21 for (
size_t a = 0; a < auxDets.size(); ++a) {
22 auto const localPoint = auxDets[a].toLocalCoords(point);
23 double const HalfCenterWidth = 0.5 * (auxDets[a].HalfWidth1() + auxDets[a].HalfWidth2());
25 if (localPoint.Z() >= (-auxDets[a].Length() / 2 - tolerance) &&
26 localPoint.Z() <= (auxDets[a].Length() / 2 + tolerance) &&
27 localPoint.Y() >= (-auxDets[a].HalfHeight() - tolerance) &&
28 localPoint.Y() <= (auxDets[a].HalfHeight() + tolerance) &&
30 localPoint.X() >= (-HalfCenterWidth +
31 localPoint.Z() * (HalfCenterWidth - auxDets[a].HalfWidth2()) /
32 (0.5 * auxDets[a].
Length()) -
34 localPoint.X() <= (HalfCenterWidth -
35 localPoint.Z() * (HalfCenterWidth - auxDets[a].HalfWidth2()) /
36 (0.5 * auxDets[a].
Length()) +
43 throw cet::exception(
"AuxDetChannelMapAlg") <<
"Can't find AuxDet for position (" << point.X()
44 <<
"," << point.Y() <<
"," << point.Z() <<
")\n";
float Length(const PFPStruct &pfp)
cet::coded_exception< error, detail::translate > exception
size_t geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet |
( |
Point_t const & |
point, |
|
|
std::vector< AuxDetGeo > const & |
auxDets, |
|
|
size_t & |
ad, |
|
|
double |
tolerance = 0 |
|
) |
| const |
|
virtual |
Definition at line 48 of file AuxDetChannelMapAlg.cxx.
References geo::AuxDetSensitiveGeo::HalfHeight(), geo::AuxDetSensitiveGeo::HalfWidth1(), geo::AuxDetSensitiveGeo::HalfWidth2(), geo::AuxDetSensitiveGeo::Length(), NearestAuxDet(), geo::AuxDetGeo::NSensitiveVolume(), geo::AuxDetGeo::SensitiveVolume(), and geo::AuxDetSensitiveGeo::toLocalCoords().
55 AuxDetGeo
const& adg = auxDets[ad];
57 for (
size_t a = 0; a < adg.NSensitiveVolume(); ++a) {
58 AuxDetSensitiveGeo
const& adsg = adg.SensitiveVolume(a);
59 auto const localPoint = adsg.toLocalCoords(point);
61 double const HalfCenterWidth = 0.5 * (adsg.HalfWidth1() + adsg.HalfWidth2());
63 if (localPoint.Z() >= -(adsg.Length() / 2 + tolerance) &&
64 localPoint.Z() <= adsg.Length() / 2 + tolerance &&
65 localPoint.Y() >= -(adsg.HalfHeight() + tolerance) &&
66 localPoint.Y() <= adsg.HalfHeight() + tolerance &&
70 localPoint.Z() * (HalfCenterWidth - adsg.HalfWidth2()) / (0.5 * adsg.Length()) -
74 localPoint.Z() * (HalfCenterWidth - adsg.HalfWidth2()) / (0.5 * adsg.Length()) +
80 throw cet::exception(
"Geometry") <<
"Can't find AuxDetSensitive for position (" << point.X()
81 <<
"," << point.Y() <<
"," << point.Z() <<
")\n";
virtual size_t NearestAuxDet(Point_t const &point, std::vector< AuxDetGeo > const &auxDets, double tolerance=0) const
cet::coded_exception< error, detail::translate > exception
virtual uint32_t geo::AuxDetChannelMapAlg::PositionToAuxDetChannel |
( |
Point_t const & |
worldLoc, |
|
|
std::vector< AuxDetGeo > const & |
auxDets, |
|
|
size_t & |
ad, |
|
|
size_t & |
sv |
|
) |
| const |
|
pure virtual |
virtual void geo::AuxDetChannelMapAlg::Uninitialize |
( |
| ) |
|
|
pure virtual |
std::map<size_t, std::vector<chanAndSV> > geo::AuxDetChannelMapAlg::fADGeoToChannelAndSV |
|
protected |
std::map<size_t, std::string> geo::AuxDetChannelMapAlg::fADGeoToName |
|
protected |
std::map<std::string, size_t> geo::AuxDetChannelMapAlg::fNameToADGeo |
|
protected |
The documentation for this class was generated from the following files: