9 #ifndef ICARUSALG_GEOMETRY_DETAILS_ROPANDTPCSETBUILDINGALG_H
10 #define ICARUSALG_GEOMETRY_DETAILS_ROPANDTPCSETBUILDINGALG_H
34 namespace icarus::details {
39 class ROPandTPCsetBuildingAlg;
46 using TPCColl_t = std::vector<geo::TPCGeo const*>;
49 using PlaneColl_t = std::vector<geo::PlaneGeo const*>;
109 std::vector<unsigned int>,
122 {
return std::move(std::get<0U>(*
this)); }
126 {
return std::move(std::get<1U>(*
this)); }
130 {
return std::move(std::get<2U>(*
this)); }
134 {
return std::move(std::get<3U>(*
this)); }
138 {
return std::move(std::get<4U>(*
this)); }
142 {
return std::move(std::get<5U>(*
this)); }
246 template <
typename Pred>
248 (Pred standalonePlane);
350 (std::vector<PlaneColl_t>
const&
planes)
const;
377 template <
typename PlaneColl>
384 (std::vector<geo::PlaneGeo const*>
const&
planes);
389 std::vector<geo::TPCID>
const& ROPTPCIDs,
390 std::vector<geo::TPCID>
const& TPCsetTPCIDs
411 #endif // ICARUSALG_GEOMETRY_DETAILS_ROPANDTPCSETBUILDINGALG_H
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
readout::TPCsetDataContainer< TPCColl_t > fTPCsetTPCs
Output: TPC's in each TPC set.
std::vector< unsigned int > TPCsetCount()&&
Output: number of TPC sets in each cryostat.
readout::TPCsetDataContainer< unsigned int > ROPcount()&&
Output: number of readout planes in each TPC set.
void fillTPCsInSet(std::vector< std::vector< std::vector< geo::TPCID >>> const &AllTPCsOnROPs)
Extracts the final set of TPC sets.
Encapsulate the construction of a single cyostat.
icarus::details::PlaneColl_t PlaneColl_t
Classes identifying readout-related concepts.
unsigned int ROPID_t
Type for the ID number.
unsigned int fMaxTPCsets
Highest number of TPC sets in any cryostat.
readout::TPCsetDataContainer< unsigned int > fROPcount
Output: number of readout planes in each TPC set.
Simple data structure holding the data of the geometry.
readout::ROPDataContainer< PlaneColl_t > ROPplanes()&&
Output: planes in each of the readout plane.
static std::vector< std::vector< geo::PlaneGeo const * > > groupPlanesByDriftCoord(PlaneColl const &planes, double tolerance=0.1)
Returns the planes grouped by their drift coordinate.
std::vector< geo::CryostatGeo > CryostatList_t
Type of list of cryostats.
geo::GeometryData_t::CryostatList_t const * fCryostats
std::vector< std::vector< PlaneColl_t > > groupPlanesAndTPCs()
Extracts composition of all readout planes.
void fillTPCtoTPCsetMap()
Creates the map from each TPC to its TPC set.
geo::PlaneDataContainer< readout::ROPID > PlaneToROP()&&
Output: planes in each of the readout plane.
A few simple data type definitions.
std::vector< unsigned int > fTPCsetCount
Output: number of TPC sets in each cryostat.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Containers to hold one datum per TPC or plane.
ROPandTPCsetBuildingAlg(std::string const &logCategory)
Construction: specify the algorithm configuration.
readout::TPCsetDataContainer< TPCColl_t > TPCsetTPCs()&&
Output: TPC's in each TPC set.
static readout::ROPID::ROPID_t ROPnumberFromPlanes(PlaneColl_t const &planes)
Returns ROP number matching the plane number shared by all planes.
static std::vector< geo::TPCID > extractTPCIDs(std::vector< geo::PlaneGeo const * > const &planes)
Returns a collection with a TPC ID for each plane in the list of planes.
std::vector< PlaneColl_t > sortByNormalCoordinate(std::vector< PlaneColl_t > const &planes) const
Returns the planes sorted by decreasing normal coordinate.
void fillPlanesInROP(readout::TPCsetDataContainer< std::vector< PlaneColl_t >> const &PlanesInProtoROPs)
Builds final readout plane information.
icarus::details::TPCColl_t TPCColl_t
std::vector< std::vector< std::vector< geo::TPCID > > > extractTPCsetsFromROPs(std::vector< std::vector< PlaneColl_t >> const &planes)
Extracts all the TPC sets covered by any of the plane groups.
Structure to hold enough information to computed the expected results.
readout::TPCsetDataContainer< std::vector< PlaneColl_t > > groupPlanesIntoROPs(std::vector< std::vector< std::vector< geo::TPCID >>> const &AllTPCsOnROPs, std::vector< std::vector< PlaneColl_t >> &&AllPlanesInROPs)
Assigns each of the readout planes to a TPC set.
Results_t(ResultsBase_t &&data)
std::tuple< std::vector< unsigned int >, readout::TPCsetDataContainer< TPCColl_t >, readout::TPCsetDataContainer< unsigned int >, readout::ROPDataContainer< PlaneColl_t >, geo::TPCDataContainer< readout::TPCsetID >, geo::PlaneDataContainer< readout::ROPID > > ResultsBase_t
Full group of results of the algorithm.
geo::TPCDataContainer< readout::TPCsetID > TPCtoTPCset()&&
Output: number of readout planes in each TPC set.
std::vector< geo::PlaneGeo const * > PlaneColl_t
Type of collection of planes (pointers to geo::PlaneGeo).
Definition of data types for geometry description.
unsigned int fMaxROPs
Highest number of ROPs in any TPC set.
Extracts TPC sets and readout planes from a list of cryostats.
geo::PlaneDataContainer< readout::ROPID > fPlaneToROP
Output: the ROP each wire plane belongs to.
readout::ROPDataContainer< PlaneColl_t > fROPplanes
Output: planes in each of the readout plane.
geo::TPCDataContainer< readout::TPCsetID > fTPCtoTPCset
Output: the TPC set each TPC belongs to.
Encapsulate the construction of a single detector plane.
void fillPlaneToROPmap()
Creates the map from each wire plane to its readout plane.
ROPandTPCsetBuildingAlg()=default
Construction: use default configuration.
static bool isROPinTPCset(std::vector< geo::TPCID > const &ROPTPCIDs, std::vector< geo::TPCID > const &TPCsetTPCIDs)
Returns whether all the TPCs covered by a ROP are in a given TPC set.
std::string fLogCategory
Category to write messages into.
void clear()
Destroys all the result data members.
Results_t run(geo::GeometryData_t::CryostatList_t const &Cryostats)
Runs the algorithm as configured from start to end.
std::vector< geo::TPCGeo const * > TPCColl_t
Type of collection of TPCs (pointers to geo::TPCGeo).
Containers to hold one datum per TPC set or readout plane.
void checkNormalDirection(std::vector< PlaneColl_t > const &planes) const
Throws an exception if planes do not share the same normal direction.
Encapsulate the construction of a single detector plane.