9 #ifndef ICARUSCODE_PMT_ALGORITHMS_PMTVERTICALSLICINGALG_H
10 #define ICARUSCODE_PMT_ALGORITHMS_PMTVERTICALSLICINGALG_H
17 #include "messagefacility/MessageLogger/MessageLogger.h"
18 #include "cetlib_except/exception.h"
36 namespace icarus::trigger {
class PMTverticalSlicingAlg; }
50 using PMTlist_t = std::vector<geo::OpDetGeo const*>;
59 using Slices_t = std::vector<PMTtowerOnPlane_t>;
79 std::vector<std::pair<double, PMTlist_t>>
PMTwalls
91 std::vector<std::pair<double, PMTlist_t>>
PMTwalls
116 std::vector<std::pair<double, PMTlist_t>>
PMTwalls
125 template <
typename TPCCont>
128 template <
typename TPCCont>
151 template <
typename TPCCont>
153 (TPCCont
const& TPCcont)
160 throw cet::exception(
"PMTverticalSlicingAlg")
161 <<
"determineDriftDir(): no TPC in the specified object!";
164 auto const dir = iTPC->template DriftDir<geo::Vector_t>();
165 while(++iTPC != tend) {
166 if (areParallel(iTPC->template DriftDir<geo::Vector_t>(),
dir))
168 throw cet::exception(
"PMTverticalSlicingAlg")
169 <<
"determineDriftDir(): TPC " << iTPC->ID()
170 <<
" has a drift direction incompatible with " <<
dir <<
".\n";
179 template <
typename TPCCont>
181 (TPCCont
const& TPCcont)
188 throw cet::exception(
"PMTverticalSlicingAlg")
189 <<
"determineLengthDir(): no TPC in the specified object!";
192 auto const dir = iTPC->template LengthDir<geo::Vector_t>();
193 while(++iTPC != tend) {
194 if (areParallel(iTPC->template LengthDir<geo::Vector_t>(),
dir))
196 throw cet::exception(
"PMTverticalSlicingAlg")
197 <<
"determineLengthDir(): TPC " << iTPC->ID()
198 <<
" has a width direction incompatible with " <<
dir <<
".\n";
209 #endif // ICARUSCODE_PMT_ALGORITHMS_PMTVERTICALSLICINGALG_H
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
std::vector< geo::OpDetGeo const * > PMTlist_t
Type of optical detector list.
PMTverticalSlicingAlg(std::string logCategory="PMTverticalSlicingAlg")
Constructor: no configuration parameters so far.
void appendSlices(Slices_t &slices, PMTlist_t const &PMTs, geo::Vector_t const &planeNorm, geo::Vector_t const &clusterDir) const
Computes slices and appends them to an existing list.
static std::vector< PMTlist_t > clusterPMTby(PMTlist_t const &PMTs, geo::Vector_t const &dir)
Clusters the PMTs along the specified direction.
static PMTlist_t getPMTs(geo::GeometryCore const &geom)
Returns a list of all geo::OpDetGeo in the whole geometry.
Geometry information for a single cryostat.
static geo::Vector_t determineLengthDir(TPCCont const &TPCcont)
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
void appendCryoSlices(Slices_t &slices, geo::CryostatGeo const &cryo) const
Computes slices from all PMT in cryo and appends them to slices.
Definitions of geometry vector data types.
Description of geometry of one entire detector.
std::string fLogCategory
Category for message streaming.
std::vector< TCSlice > slices
static bool areParallel(geo::Vector_t const &a, geo::Vector_t const &b)
Returns whether a and b are parallel.
std::vector< std::pair< double, PMTlist_t > > PMTwalls(geo::CryostatGeo const &cryo) const
Groups optical detectors under the specified cryostat into walls.
Functions pulling in STL customization if available.
static double PMTwallPosition(PMTlist_t const &PMTs, geo::Vector_t const &dir)
Returns an (arbitrary) coordinate along dir representing the PMT list.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
static geo::Vector_t determineDriftDir(TPCCont const &TPCcont)
std::vector< PMTtowerOnPlane_t > Slices_t
Type of PMT towers, per plane.
PMTlist_t PMTtower_t
Type of optical detector list in a PMT tower.
std::vector< PMTtower_t > PMTtowerOnPlane_t
Type of list of PMT towers on a single optical detector plane.
static PMTlist_t getCryoPMTs(geo::CryostatGeo const &cryo)
Returns a list of all geo::OpDetGeo in cryostat cryo.
Algorithm clustering PMT according to their position.