11 #ifndef DUNE_COLDBOXCHANNELMAPALG_H 12 #define DUNE_COLDBOXCHANNELMAPALG_H 41 class ColdBoxChannelMapAlg;
46 namespace geo {
namespace dune{
namespace vd {
61 unsigned int nChannels,
63 : firstChannel(firstChannel), nChannels(nChannels), ropid(ropid)
74 return ((iNextData == dend) && (channel >=
endChannel()))
75 ?
nullptr: &(std::prev(iNextData)->second);
83 for(
auto it = dbegin; it != dend; ++it ){
84 if (it->second.ropid == ropid)
return &(it->second);
136 virtual void Uninitialize()
override;
154 virtual unsigned int Nchannels()
const override;
166 unsigned int cstat)
const override 167 {
return PlaneWireToChannel(
geo::WireID(cstat, tpc, plane, wire)); }
182 virtual double WireCoordinate
183 (
double YPos,
double ZPos,
geo::PlaneID const& planeID)
const override;
185 unsigned int PlaneNo,
187 unsigned int cstat)
const override 188 {
return WireCoordinate(YPos, ZPos,
geo::PlaneID(cstat, TPCNo, PlaneNo)); }
193 (
const TVector3& worldPos,
geo::PlaneID const& planeID)
const override;
195 unsigned int PlaneNo,
197 unsigned int cstat)
const override 198 {
return NearestWireID(worldPos,
geo::PlaneID(cstat, TPCNo, PlaneNo)); }
201 virtual std::set<geo::PlaneID>
const& PlaneIDs()
const override;
216 virtual unsigned int NTPCsets
220 virtual unsigned int MaxTPCsets()
const override;
248 virtual std::vector<geo::TPCID> TPCsetToTPCs
270 virtual unsigned int NROPs
274 virtual unsigned int MaxROPs()
const override;
305 virtual std::vector<geo::PlaneID> ROPtoWirePlanes
321 virtual std::vector<geo::TPCID> ROPtoTPCs
382 : std::pair<raw::ChannelID_t, raw::ChannelID_t>
385 using std::pair<raw::ChannelID_t, raw::ChannelID_t>::pair;
395 {
return (channel >=
begin()) && (channel <
end()); }
422 std::vector<unsigned int>&& TPCsetCount,
436 assert(fTPCsetCount.size() == fTPCsetTPCs.
dimSize<0U>());
437 assert(fTPCsetCount.size() == fROPcount.
dimSize<0U>());
438 assert(fTPCsetCount.size() == fROPplanes.
dimSize<0U>());
439 assert(fTPCsetCount.size() == fTPCtoTPCset.
dimSize<0U>());
440 assert(fTPCsetCount.size() == fPlaneToROP.
dimSize<0U>());
447 {
return fROPplanes.
dimSize<0U>(); }
454 fTPCsetCount.clear(); fTPCsetTPCs.
clear();
462 return !fTPCsetCount.empty() && !fTPCsetTPCs.
empty()
464 && !fTPCtoTPCset.
empty() && !fPlaneToROP.
empty();
477 {
return fChannelRange; }
481 {
return fChannelRange.
begin(); }
485 {
return fChannelRange.
end() - 1; }
489 {
return fChannelRange.
end(); }
528 { assert(fReadoutMapInfo);
return fReadoutMapInfo.
fTPCsetCount; }
532 {
return TPCsetCount()[cid.
Cryostat]; }
536 { assert(fReadoutMapInfo);
return fReadoutMapInfo.
fTPCsetTPCs; }
540 {
return TPCsetTPCs()[sid]; }
544 { assert(fReadoutMapInfo);
return fReadoutMapInfo.
fROPcount; }
548 {
return ROPcount()[sid]; }
552 { assert(fReadoutMapInfo);
return fReadoutMapInfo.
fROPplanes; }
556 {
return ROPplanes()[rid]; }
560 { assert(fReadoutMapInfo);
return fReadoutMapInfo.
fTPCtoTPCset; }
564 { assert(fReadoutMapInfo);
return fReadoutMapInfo.
fPlaneToROP; }
568 {
return PlaneToROP()[pid]; }
588 void fillChannelToWireMap
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
ChannelRange_t fChannelRange
Range of channels covered by the plane.
readout::TPCsetDataContainer< TPCColl_t > const & TPCsetTPCs() const
All geo::TPCGeo objects in each TPC set.
Interface for a class providing readout channel mapping to geometry.
void addROP(readout::ROPID const &rid, raw::ChannelID_t firstROPchannel, unsigned int nChannels)
virtual double WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the index of the wire nearest to the specified position.
void clear()
Frees the memory and leaves the object unusable until next set().
unsigned int nChannels() const
Returns the number of mapped channels.
Classes identifying readout-related concepts.
readout::ROPID ropid
ID of the ROP we cover.
void clear()
Resets the data of the map to like just constructed.
geo::GeoObjectSorterCRU fSorter
class to sort geo objects
readout::ROPID const & PlaneToROP(geo::PlaneID const &pid) const
The readout plane the specified wire plane pid belongs to.
Simple data structure holding the data of the geometry.
The data type to uniquely identify a Plane.
raw::ChannelID_t endChannel() const
Returns the ID of the first invalid channel (the last channel, plus 1).
constexpr raw::ChannelID_t end() const
Returns the ID of the channel after the last one in the range.
Class identifying a set of TPC sharing readout channels.
raw::ChannelID_t firstChannel
std::vector< unsigned int > const & TPCsetCount() const
Returns the number of TPC sets in each cryostat.
std::vector< geo::CryostatGeo > CryostatList_t
Type of list of cryostats.
CryostatID_t Cryostat
Index of cryostat.
geo::PlaneDataContainer< PlaneInfo_t > fPlaneInfo
Range of channels covered by each of the wire planes.
PlaneColl_t const & ROPplanes(readout::ROPID const &rid) const
All geo::PlaneId objects in the specified readout plane rid.
readout::ROPDataContainer< PlaneColl_t > fROPplanes
All geo::PlaneGeo objects in each readout plane.
Container with one element per geometry wire plane.
virtual geo::WireID NearestWireID(const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the ID of the wire nearest to the specified position.
unsigned int NCryostats() const
unsigned int ROPcount(readout::TPCsetID const &sid) const
Number of readout planes in the specified TPC set sid.
unsigned int TPCsetCount(readout::CryostatID const &cid) const
Returns the number of TPC sets in the specified cryostat cid.
constexpr bool contains(raw::ChannelID_t channel) const
Returns whether this range includes the specified channel.
constexpr raw::ChannelID_t endChannel() const
Returns the ID of the channel after the last in the range.
geo::dune::vd::ChannelToWireMap fChannelToWireMap
Mapping of channels and ROP's.
constexpr readout::ROPID ROP() const
Returns the ID of the readout plane this wire plane belongs to.
Containers to hold one datum per TPC or plane.
unsigned int MaxTPCsets() const
ChannelsInROPStruct const * find(readout::ROPID const &ropid) const
Returns data of the ROP ropid, nullptr if none.
std::vector< unsigned int > fTPCsetCount
Number of TPC sets in each cryostat.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
geo::TPCDataContainer< readout::TPCsetID > fTPCtoTPCset
The TPC set each TPC belongs to.
Collected information about TPC sets and readout planes in the geometry.
raw::ChannelID_t fEndChannel
readout::TPCsetDataContainer< unsigned int > fROPcount
Number of readout planes in each TPC set.
enum geo::_plane_sigtype SigType_t
std::vector< geo::PlaneID > PlaneColl_t
constexpr raw::ChannelID_t firstChannel() const
Returns the ID of the last channel in the range.
ChannelsInROPStruct(raw::ChannelID_t firstChannel, unsigned int nChannels, readout::ROPID const &ropid)
readout::ROPID fROPID
Which readout plane this wire plane belongs to.
void setEndChannel(raw::ChannelID_t channel)
Sets the ID of the channels after the last valid one.
geo::PlaneDataContainer< readout::ROPID > const & PlaneToROP() const
The readout plane including each wire plane.
ReadoutMappingInfo_t fReadoutMapInfo
Information about TPC sets and readout planes in the geometry.
readout::TPCsetDataContainer< unsigned int > const & ROPcount() const
Number of readout planes in each TPC set.
static int max(int a, int b)
The data type to uniquely identify a TPC.
Definition of data types for geometry description.
Class identifying a set of planes sharing readout channels.
Interface to algorithm class for sorting VD CRUs of geo::XXXGeo objects.
readout::ROPDataContainer< PlaneColl_t > const & ROPplanes() const
All geo::PlaneGeo objects in each readout plane.
constexpr raw::ChannelID_t begin() const
Returns the ID of the first channel in the range.
TPCColl_t const & TPCsetTPCs(readout::TPCsetID const &sid) const
All geo::TPCID objects in the specified TPC set sid.
readout::TPCsetDataContainer< TPCColl_t > fTPCsetTPCs
All geo::TPCGeo objects in each TPC set.
void clear()
Makes the container empty, with no usable storage space.
unsigned int MaxROPs() const
ChannelsInROPStruct()=default
Collection of information on one plane.
geo::PlaneDataContainer< readout::ROPID > fPlaneToROP
The ROP each wire plane belongs to.
virtual geo::GeoObjectSorter const & Sorter() const override
Return the sorter.
geo::TPCDataContainer< readout::TPCsetID > const & TPCtoTPCset() const
The TPC set including each TPC.
constexpr raw::ChannelID_t lastChannel() const
Returns the ID of the last channel in the range.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
bool empty() const
Returns whether the container has no elements (false by assumptions).
Data in the geometry description.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
constexpr ChannelRange_t const & channelRange() const
Returns the range of channels covered by the wire plane.
std::map< raw::ChannelID_t, ChannelsInROPStruct > fROPfirstChannel
Interface to algorithm class for a specific detector channel mapping.
Containers to hold one datum per TPC set or readout plane.
second_as<> second
Type of time stored in seconds, in double precision.
LArSoft geometry interface.
unsigned int dimSize() const
Dimensions of the Level dimension of this container.
virtual raw::ChannelID_t PlaneWireToChannel(unsigned int plane, unsigned int wire, unsigned int tpc, unsigned int cstat) const override
Returns the channel ID a wire is connected to.
std::size_t PlaneType_t
Type for plane type identifier.
std::vector< geo::TPCID > TPCColl_t
The data type to uniquely identify a cryostat.
ChannelsInROPStruct const * find(raw::ChannelID_t channel) const
Returns data of the ROP including channel, nullptr if none.