10 #include "Geometry/AuxDetGeo.h" 18 std::vector<geo::AuxDetGeo*>
const& auxDets)
const 20 double HalfCenterWidth = 0.;
21 double localPoint[3] = {0.};
23 for(
size_t a = 0;
a < auxDets.size(); ++
a) {
25 auxDets[
a]->WorldToLocal(point, localPoint);
27 HalfCenterWidth = 0.5 * (auxDets[
a]->HalfWidth1() + auxDets[
a]->HalfWidth2());
29 if(localPoint[2] >= - auxDets[
a]->
Length()/2 &&
30 localPoint[2] <= auxDets[
a]->Length()/2 &&
31 localPoint[1] >= - auxDets[
a]->HalfHeight() &&
32 localPoint[1] <= auxDets[
a]->HalfHeight() &&
34 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[
a]->HalfWidth2())/(0.5 * auxDets[
a]->
Length()) &&
35 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[
a]->HalfWidth2())/(0.5 * auxDets[
a]->
Length())
41 throw cet::exception(
"ChannelMapLArIAT") <<
"Can't find AuxDet for position (" 52 std::vector<geo::AuxDetGeo*>
const& auxDets,
55 double HalfCenterWidth = 0.;
56 double localPoint[3] = {0.};
69 if(localPoint[2] >= - adsg.
Length()/2 &&
70 localPoint[2] <= adsg.
Length()/2 &&
74 localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length()) &&
75 localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.
HalfWidth2())/(0.5 * adsg.
Length())
80 throw cet::exception(
"Geometry") <<
"Can't find AuxDetSensitive for position (" 91 uint32_t
const& )
const 96 if( itr.second.compare(detName) == 0 )
return itr.first;
98 throw cet::exception(
"Geometry") <<
"No AuxDetGeo matching name: " << detName;
118 if( channel < itr->
second.size() )
119 return std::make_pair(adGeoIdx, itr->second[channel].second);
122 <<
"Given AuxDetSensitive channel, " 124 <<
", cannot be found in vector associated to AuxDetGeo index: " 126 <<
". Vector has size " 127 << itr->second.size();
131 <<
"Given AuxDetGeo with index " 133 <<
" does not correspond to any vector of sensitive volumes";
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet(std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
virtual size_t ChannelToAuxDet(std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const
float Length(const PFPStruct &pfp)
double HalfWidth1() const
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
void WorldToLocal(const double *world, double *local) const
double HalfWidth2() const
static int max(int a, int b)
General GArSoft Utilities.
virtual size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets, size_t &ad) const
double HalfHeight() const
std::map< size_t, std::string > fADGeoToName
map the AuxDetGeo index to the name
second_as<> second
Type of time stored in seconds, in double precision.
std::map< size_t, std::vector< chanAndSV > > fADGeoToChannelAndSV
LArSoft geometry interface.
size_t NSensitiveVolume() const
cet::coded_exception< error, detail::translate > exception