#include "AuxDetChannelMapAlg.h"
|
virtual | ~AuxDetChannelMapAlg ()=default |
|
virtual void | Initialize (AuxDetGeometryData_t &geodata)=0 |
|
virtual void | Uninitialize ()=0 |
|
virtual size_t | NearestAuxDet (const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const |
|
virtual size_t | NearestSensitiveAuxDet (const double *point, std::vector< geo::AuxDetGeo * > const &auxDets, size_t &ad) const |
|
virtual size_t | ChannelToAuxDet (std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const |
|
virtual std::pair< size_t, size_t > | ChannelToSensitiveAuxDet (std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const |
|
virtual uint32_t | PositionToAuxDetChannel (double const worldLoc[3], std::vector< geo::AuxDetGeo * > const &auxDets, size_t &ad, size_t &sv) const =0 |
|
virtual const TVector3 | AuxDetChannelToPosition (uint32_t const &channel, std::string const &auxDetName, std::vector< geo::AuxDetGeo * > const &auxDets) const =0 |
|
|
typedef std::pair< uint32_t, size_t > | chanAndSV |
|
Definition at line 32 of file AuxDetChannelMapAlg.h.
virtual geo::AuxDetChannelMapAlg::~AuxDetChannelMapAlg |
( |
| ) |
|
|
virtualdefault |
virtual const TVector3 geo::AuxDetChannelMapAlg::AuxDetChannelToPosition |
( |
uint32_t const & |
channel, |
|
|
std::string const & |
auxDetName, |
|
|
std::vector< geo::AuxDetGeo * > const & |
auxDets |
|
) |
| const |
|
pure virtual |
size_t geo::AuxDetChannelMapAlg::ChannelToAuxDet |
( |
std::vector< geo::AuxDetGeo * > const & |
auxDets, |
|
|
std::string const & |
detName, |
|
|
uint32_t const & |
channel |
|
) |
| const |
|
virtual |
Definition at line 87 of file AuxDetChannelMapAlg.cxx.
References fADGeoToName.
Referenced by ChannelToSensitiveAuxDet().
96 if( itr.second.compare(detName) == 0 )
return itr.first;
99 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< geo::AuxDetGeo * > const & |
auxDets, |
|
|
std::string const & |
detName, |
|
|
uint32_t const & |
channel |
|
) |
| const |
|
virtual |
Definition at line 107 of file AuxDetChannelMapAlg.cxx.
References ChannelToAuxDet(), and fADGeoToChannelAndSV.
119 if( channel < itr->second.size() )
120 return std::make_pair(adGeoIdx, itr->second[channel].second);
122 throw cet::exception(
"Geometry") <<
"Given AuxDetSensitive channel, " << channel
123 <<
", cannot be found in vector associated to AuxDetGeo index: " 124 << adGeoIdx <<
". Vector has size " << itr->second.size();
127 throw cet::exception(
"Geometry") <<
"Given AuxDetGeo with index " << adGeoIdx
128 <<
" does not correspond to any vector of sensitive volumes";
130 return std::make_pair(adGeoIdx, UINT_MAX);
std::map< size_t, std::vector< chanAndSV > > fADGeoToChannelAndSV
virtual size_t ChannelToAuxDet(std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const
cet::coded_exception< error, detail::translate > exception
size_t geo::AuxDetChannelMapAlg::NearestAuxDet |
( |
const double * |
point, |
|
|
std::vector< geo::AuxDetGeo * > const & |
auxDets |
|
) |
| const |
|
virtual |
Definition at line 15 of file AuxDetChannelMapAlg.cxx.
Referenced by NearestSensitiveAuxDet().
18 double HalfCenterWidth = 0.;
19 double localPoint[3] = {0.};
21 for(
size_t a = 0; a < auxDets.size(); ++a) {
23 auxDets[a]->WorldToLocal(point, localPoint);
25 HalfCenterWidth = 0.5 * (auxDets[a]->HalfWidth1() + auxDets[a]->HalfWidth2());
27 if(localPoint[2] >= - auxDets[a]->Length()/2 &&
28 localPoint[2] <= auxDets[a]->Length()/2 &&
29 localPoint[1] >= - auxDets[a]->HalfHeight() &&
30 localPoint[1] <= auxDets[a]->HalfHeight() &&
32 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[a]->HalfWidth2())/(0.5 * auxDets[a]->Length()) &&
33 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[a]->HalfWidth2())/(0.5 * auxDets[a]->Length())
39 throw cet::exception(
"AuxDetChannelMapAlg") <<
"Can't find AuxDet for position (" cet::coded_exception< error, detail::translate > exception
size_t geo::AuxDetChannelMapAlg::NearestSensitiveAuxDet |
( |
const double * |
point, |
|
|
std::vector< geo::AuxDetGeo * > const & |
auxDets, |
|
|
size_t & |
ad |
|
) |
| const |
|
virtual |
Definition at line 49 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::WorldToLocal().
53 double HalfCenterWidth = 0.;
54 double localPoint[3] = {0.};
67 if(localPoint[2] >= - adsg.
Length()/2 &&
68 localPoint[2] <= adsg.
Length()/2 &&
72 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) &&
73 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length())
78 throw cet::exception(
"Geometry") <<
"Can't find AuxDetSensitive for position (" double HalfWidth2() const
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
double HalfWidth1() const
double HalfHeight() const
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
size_t NSensitiveVolume() const
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
cet::coded_exception< error, detail::translate > exception
virtual uint32_t geo::AuxDetChannelMapAlg::PositionToAuxDetChannel |
( |
double const |
worldLoc[3], |
|
|
std::vector< geo::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:
- /cvmfs/larsoft.opensciencegrid.org/products/larcorealg/v07_03_00/source/larcorealg/Geometry/AuxDetChannelMapAlg.h
- /cvmfs/larsoft.opensciencegrid.org/products/larcorealg/v07_03_00/source/larcorealg/Geometry/AuxDetChannelMapAlg.cxx