Extracts TPC sets and readout planes from a list of cryostats. More...
#include <ROPandTPCsetBuildingAlg.h>
Classes | |
struct | Results_t |
Public Types | |
using | TPCColl_t = icarus::details::TPCColl_t |
using | PlaneColl_t = icarus::details::PlaneColl_t |
using | ResultsBase_t = 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 > > |
Full group of results of the algorithm. More... | |
Public Member Functions | |
ROPandTPCsetBuildingAlg ()=default | |
Construction: use default configuration. More... | |
ROPandTPCsetBuildingAlg (std::string const &logCategory) | |
Construction: specify the algorithm configuration. More... | |
Results_t | run (geo::GeometryData_t::CryostatList_t const &Cryostats) |
Runs the algorithm as configured from start to end. More... | |
template<typename Pred > | |
auto | groupPlanesAndTPCs (Pred standalonePlane) -> std::vector< std::vector< PlaneColl_t >> |
template<typename PlaneColl > | |
auto | groupPlanesByDriftCoord (PlaneColl const &planes, double tolerance) -> std::vector< PlaneColl_t > |
Private Member Functions | |
void | clear () |
Destroys all the result data members. More... | |
template<typename Pred > | |
std::vector< std::vector < PlaneColl_t > > | groupPlanesAndTPCs (Pred standalonePlane) |
Extracts composition of all readout planes. More... | |
std::vector< std::vector < PlaneColl_t > > | groupPlanesAndTPCs () |
Extracts composition of all readout planes. More... | |
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. More... | |
void | fillTPCsInSet (std::vector< std::vector< std::vector< geo::TPCID >>> const &AllTPCsOnROPs) |
Extracts the final set of TPC sets. More... | |
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. More... | |
void | fillPlanesInROP (readout::TPCsetDataContainer< std::vector< PlaneColl_t >> const &PlanesInProtoROPs) |
Builds final readout plane information. More... | |
void | fillTPCtoTPCsetMap () |
Creates the map from each TPC to its TPC set. More... | |
void | fillPlaneToROPmap () |
Creates the map from each wire plane to its readout plane. More... | |
std::vector< PlaneColl_t > | sortByNormalCoordinate (std::vector< PlaneColl_t > const &planes) const |
Returns the planes sorted by decreasing normal coordinate. More... | |
void | checkNormalDirection (std::vector< PlaneColl_t > const &planes) const |
Throws an exception if planes do not share the same normal direction. More... | |
Static Private Member Functions | |
template<typename PlaneColl > | |
static std::vector < std::vector< geo::PlaneGeo const * > > | groupPlanesByDriftCoord (PlaneColl const &planes, double tolerance=0.1) |
Returns the planes grouped by their drift coordinate. More... | |
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 . More... | |
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. More... | |
static readout::ROPID::ROPID_t | ROPnumberFromPlanes (PlaneColl_t const &planes) |
Returns ROP number matching the plane number shared by all planes . More... | |
Private Attributes | |
std::string | fLogCategory = "ROPandTPCsetBuildingAlg" |
Category to write messages into. More... | |
geo::GeometryData_t::CryostatList_t const * | fCryostats = nullptr |
unsigned int | fMaxTPCsets = 0U |
Highest number of TPC sets in any cryostat. More... | |
unsigned int | fMaxROPs = 0U |
Highest number of ROPs in any TPC set. More... | |
Output | |
std::vector< unsigned int > | fTPCsetCount |
Output: number of TPC sets in each cryostat. More... | |
readout::TPCsetDataContainer < TPCColl_t > | fTPCsetTPCs |
Output: TPC's in each TPC set. More... | |
readout::TPCsetDataContainer < unsigned int > | fROPcount |
Output: number of readout planes in each TPC set. More... | |
readout::ROPDataContainer < PlaneColl_t > | fROPplanes |
Output: planes in each of the readout plane. More... | |
geo::TPCDataContainer < readout::TPCsetID > | fTPCtoTPCset |
Output: the TPC set each TPC belongs to. More... | |
geo::PlaneDataContainer < readout::ROPID > | fPlaneToROP |
Output: the ROP each wire plane belongs to. More... | |
Extracts TPC sets and readout planes from a list of cryostats.
This algorithm parses the wire plane and TPC content of the cryostats and groups planes which share the same drift coordinate. Afterwards, it arranges them into LArSoft readout planes, defining at the same time the TPC sets that contain them.
Readout planes closer to the cathode have lower ID.
An example:
will run the algorithm on Cryostats
and extract one of the results, the map of wire planes in each readout plane. It will use the default configuration of the algorithm, except for the message category being customized into "BuildingAlg"
.
See the constructor documentation.
Definition at line 98 of file ROPandTPCsetBuildingAlg.h.
Definition at line 104 of file ROPandTPCsetBuildingAlg.h.
using icarus::details::ROPandTPCsetBuildingAlg::ResultsBase_t = 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> > |
Full group of results of the algorithm.
Definition at line 115 of file ROPandTPCsetBuildingAlg.h.
Definition at line 103 of file ROPandTPCsetBuildingAlg.h.
|
default |
Construction: use default configuration.
|
inline |
Construction: specify the algorithm configuration.
logCategory | message facility category to write messages into |
usePlaneIDforROPID | whether to use ROPnumberFromPlanes() algorithm |
"ROPandTPCsetBuildingAlg"
): name of the stream destination used for output messages via message facility Definition at line 165 of file ROPandTPCsetBuildingAlg.h.
|
private |
Throws an exception if planes do not share the same normal direction.
Definition at line 979 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Destroys all the result data members.
Definition at line 442 of file ROPandTPCsetBuildingAlg.cxx.
|
staticprivate |
Returns a collection with a TPC ID for each plane in the list of planes
.
Definition at line 1080 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Extracts all the TPC sets covered by any of the plane groups.
groupedPlanes | wire planes, grouped by cryostat. |
The return value is a container that for each cryostat (first index), hosts a list of TPC sets (second index: TPC set within the cryostat), each listing its TPC (third index: runs through all TPCs). The order of the TPC sets within a cryostat is undefined. This function also fills fMaxTPCsets
.
The input parameter groupedPlanes
follows the same structure as the argument AllTPCsOnROPs
of groupPlanesIntoROPs()
.
Definition at line 553 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Builds final readout plane information.
PlanesInProtoROPs | plane-to-ROP assignments in each TPC set |
This function fills fROPcount
and fROPplanes
.
It requires fMaxROPs
, fTPCsetTPCs
and fTPCsetCount
to have been computed already.
Definition at line 757 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Creates the map from each wire plane to its readout plane.
This function fills fPlaneToROP
.
It requires fCryostats
and fROPplanes
to have been computed already.
Definition at line 890 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Extracts the final set of TPC sets.
AllTPCsOnROPs | groups of TPC IDs planes in a readout planes belong to |
The function collects sets of TPCs from all the ROP's. It fills fTPCsetCount
and fTPCsetTPCs
. It requires fMaxTPCsets
to have been already set. The input argument AllTPCsOnROPs
is a vector with index the number of cryostat. For each cryostat, a list of readout planes is presented (unsorted and unlabelled), in each of which the list of TPCs the planes in the readout planes belong to is stored.
Definition at line 605 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Creates the map from each TPC to its TPC set.
This function fills fTPCtoTPCset
.
It requires fCryostats
and fTPCsetTPCs
to have been computed already.
Definition at line 840 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Extracts composition of all readout planes.
Pred | type of the predicate pred with one geo::PlaneGeo argument |
standalonePlane | predicate to determine if a plane is stand-alone |
This function returns a list: for each cryostat (first index), a list of TPC sets (second index: TPC set within the cryostat) each listing its TPC (third index: runs through all TPCs).
If standalonePlane
is specified, it is a functor that returns whether its argument, a geo::PlaneGeo
object, should not be grouped at all (i.e., standalonePlane(plane)
returns false
if the plane
can be grouped to others). Each plane for which standalonePlane
evaluates true
has their own "group" of one plane.
|
private |
Extracts composition of all readout planes.
This function returns a list: for each cryostat (first index), a list of TPC sets (second index: TPC set within the cryostat) each listing its TPC (third index: runs through all TPCs).
Definition at line 545 of file ROPandTPCsetBuildingAlg.cxx.
auto icarus::details::ROPandTPCsetBuildingAlg::groupPlanesAndTPCs | ( | Pred | standalonePlane | ) | -> std::vector<std::vector<PlaneColl_t>> |
Definition at line 457 of file ROPandTPCsetBuildingAlg.cxx.
|
staticprivate |
Returns the planes grouped by their drift coordinate.
PlaneColl | a geo::PlaneGeo collection (forward-iterable) |
planes | collection of the wire planes to be grouped |
tolerance | maximum distance in drift for planes in a single group |
The planes
in the input collection are split into groups which share the same drift coordinate. The tolerance
parameter defines how different that coordinate can be for planes to be grouped together. The result is expressed as a collection of collections of planes: each element of the outer collection is a group of constant pointers to geo::PlaneGeo
objects representing all the planes with the same drift coordinate. The sorting algorithm is guaranteed to be stable, i.e. if any two planes A and B have the same drift coordinate and in the planes
collection A is before B, in the resulting group A will also be before B.
In the current ICARUS geometry description the drift direction is on x axis, and x is the drift coordinate.
auto icarus::details::ROPandTPCsetBuildingAlg::groupPlanesByDriftCoord | ( | PlaneColl const & | planes, |
double | tolerance | ||
) | -> std::vector<PlaneColl_t> |
Definition at line 1023 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Assigns each of the readout planes to a TPC set.
AllTPCsOnROPs | groups of TPC IDs planes in a readout planes belong to |
AllPlanesInROPs | planes grouped by ROP |
This function fills MaxROPs
. In addition, it returns the list by TPC set of the groups of sensitive planes into each readout plane in the set. It requires fTPCsetTPCs
to have been computed already.
The input argument AllTPCsOnROPs
is a vector with index the number of cryostat. For each cryostat, a list of readout planes is presented (unsorted and unlabelled), in each of which the list of TPCs the planes in the readout planes belong to is stored.
Definition at line 663 of file ROPandTPCsetBuildingAlg.cxx.
|
staticprivate |
Returns whether all the TPCs covered by a ROP are in a given TPC set.
Definition at line 1111 of file ROPandTPCsetBuildingAlg.cxx.
|
staticprivate |
Returns ROP number matching the plane number shared by all planes
.
readout::ROPID::getInvalidID()
on failureThe algorithms verifies that all elements in planes
have an ID()
with the same plane number (geo::PlaneID::Plane
), and returns it. If the plane list is empty or if not all planes in the list have the same plane number, readout::ROPID::getInvalidID()
is returned.
Definition at line 1091 of file ROPandTPCsetBuildingAlg.cxx.
auto icarus::details::ROPandTPCsetBuildingAlg::run | ( | geo::GeometryData_t::CryostatList_t const & | Cryostats | ) |
Runs the algorithm as configured from start to end.
Results are in the form of a tuple
that can be used to construct variables with structured binding declarations, or saved to extract the results one by one (see Results_t
for the interface).
Definition at line 353 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Returns the planes
sorted by decreasing normal coordinate.
Definition at line 947 of file ROPandTPCsetBuildingAlg.cxx.
|
private |
Definition at line 192 of file ROPandTPCsetBuildingAlg.h.
|
private |
Category to write messages into.
Definition at line 187 of file ROPandTPCsetBuildingAlg.h.
|
private |
Highest number of ROPs in any TPC set.
Definition at line 223 of file ROPandTPCsetBuildingAlg.h.
|
private |
Highest number of TPC sets in any cryostat.
Definition at line 220 of file ROPandTPCsetBuildingAlg.h.
|
private |
Output: the ROP each wire plane belongs to.
Definition at line 214 of file ROPandTPCsetBuildingAlg.h.
|
private |
Output: number of readout planes in each TPC set.
Definition at line 205 of file ROPandTPCsetBuildingAlg.h.
|
private |
Output: planes in each of the readout plane.
Definition at line 208 of file ROPandTPCsetBuildingAlg.h.
|
private |
Output: number of TPC sets in each cryostat.
Definition at line 199 of file ROPandTPCsetBuildingAlg.h.
|
private |
Output: TPC's in each TPC set.
Definition at line 202 of file ROPandTPCsetBuildingAlg.h.
|
private |
Output: the TPC set each TPC belongs to.
Definition at line 211 of file ROPandTPCsetBuildingAlg.h.