Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
geo::DuneApaChannelMapAlg Class Reference

#include <DuneApaChannelMapAlg.h>

Inheritance diagram for geo::DuneApaChannelMapAlg:
geo::ChannelMapAlg geo::ProtoDUNEChannelMapAlg geo::ProtoDUNEChannelMapAlgv7 geo::ProtoDUNEChannelMapAlgv8

Classes

struct  PlaneData_t
 all data we need for each APA More...
 

Public Member Functions

 DuneApaChannelMapAlg (const fhicl::ParameterSet &pset)
 
void setSorter (const geo::GeoObjectSorter &sort)
 
void Initialize (GeometryData_t const &geodata) override
 Geometry initialisation. More...
 
void Uninitialize () override
 Deconfiguration: prepare for a following call of Initialize() More...
 
std::vector< WireIDChannelToWire (raw::ChannelID_t channel) const override
 
unsigned int Nchannels () const override
 Returns the total number of channels present (not necessarily contiguous) More...
 
unsigned int Nchannels (readout::ROPID const &ropid) const override
 Returns the number of channels in the specified ROP. More...
 
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. More...
 
double WireCoordinate (double YPos, double ZPos, geo::PlaneID const &planeID) const override
 Returns the index of the wire nearest to the specified position. More...
 
SigType_t SignalTypeForChannelImpl (raw::ChannelID_t const channel) const override
 Return the signal type of the specified channel. More...
 
std::set< PlaneID > const & PlaneIDs () const override
 Returns a list of the plane IDs in the whole detector. More...
 
virtual geo::GeoObjectSorter const & Sorter () const override
 Returns the object to sort geometry with. More...
 
unsigned int NOpChannels (unsigned int NOpDets) const override
 Returns the number of optical channels contained in some detectors. More...
 
unsigned int NOpHardwareChannels (unsigned int opDet) const override
 Returns the number of channels in the specified optical detectors. More...
 
unsigned int OpChannel (unsigned int detNum, unsigned int channel=0) const override
 Returns the channel ID of the specified hardware channel. More...
 
unsigned int OpDetFromOpChannel (unsigned int opChannel) const override
 Returns the optical detector the specified optical channel belongs. More...
 
unsigned int HardwareChannelFromOpChannel (unsigned int opChannel) const override
 Returns the hardware channel number of specified optical channel. More...
 
virtual 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. More...
 
virtual WireID NearestWireID (const TVector3 &worldPos, geo::PlaneID const &planeID) const override
 Returns the ID of the wire nearest to the specified position. More...
 
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. More...
 
virtual raw::ChannelID_t PlaneWireToChannel (geo::WireID const &wireID) const override
 Returns the channel ID a wire is connected to. More...
 
TPC set mapping
virtual unsigned int NTPCsets (readout::CryostatID const &cryoid) const override
 Returns the total number of TPC sets in the specified cryostat. More...
 
virtual unsigned int MaxTPCsets () const override
 
virtual bool HasTPCset (readout::TPCsetID const &tpcsetid) const override
 
virtual readout::TPCsetID TPCtoTPCset (geo::TPCID const &tpcid) const override
 Returns the ID of the TPC set the specified TPC belongs to. More...
 
virtual std::vector< geo::TPCIDTPCsetToTPCs (readout::TPCsetID const &tpcsetid) const override
 Returns a list of ID of TPCs belonging to the specified TPC set. More...
 
virtual geo::TPCID FirstTPCinTPCset (readout::TPCsetID const &tpcsetid) const override
 
Readout plane mapping
virtual unsigned int NROPs (readout::TPCsetID const &tpcsetid) const override
 Returns the total number of ROP in the specified TPC set. More...
 
virtual unsigned int MaxROPs () const override
 
virtual bool HasROP (readout::ROPID const &ropid) const override
 
virtual readout::ROPID WirePlaneToROP (geo::PlaneID const &planeid) const override
 Returns the ID of the ROP planeid belongs to, or invalid if none. More...
 
virtual std::vector< geo::PlaneIDROPtoWirePlanes (readout::ROPID const &ropid) const override
 Returns a list of ID of wire planes belonging to the specified ROP. More...
 
virtual std::vector< geo::TPCIDROPtoTPCs (readout::ROPID const &ropid) const override
 Returns a list of ID of TPCs the specified ROP spans. More...
 
virtual readout::ROPID ChannelToROP (raw::ChannelID_t channel) const override
 
virtual raw::ChannelID_t FirstChannelInROP (readout::ROPID const &ropid) const override
 Returns the ID of the first channel in the specified readout plane. More...
 
virtual geo::PlaneID FirstWirePlaneInROP (readout::ROPID const &ropid) const override
 Returns the ID of the first plane belonging to the specified ROP. More...
 
- Public Member Functions inherited from geo::ChannelMapAlg
virtual ~ChannelMapAlg ()=default
 Virtual destructor. More...
 
virtual unsigned int MaxOpChannel (unsigned int NOpDets) const
 Returns the number of optical channels contained in some detectors. More...
 
virtual bool IsValidOpChannel (unsigned int opChannel, unsigned int NOpDets) const
 Returns whether the ID identifies a valid optical detector channel. More...
 
unsigned int NearestWire (const TVector3 &worldPos, geo::PlaneID const &planeID) const
 Returns the index of the wire nearest to the specified position. More...
 
unsigned int NearestWire (const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const
 Returns the index of the wire nearest to the specified position. More...
 
virtual size_t NearestAuxDet (const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const
 Returns the auxiliary detector closest to the specified point. More...
 
virtual size_t NearestSensitiveAuxDet (const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const
 Returns sensitive auxiliary detector closest to specified point. More...
 
virtual size_t ChannelToAuxDet (std::vector< geo::AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
 Returns the index of the detector containing the specified channel. More...
 
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet (std::vector< geo::AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
 Returns the index of the sensitive detector containing the channel. More...
 
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > FirstChannelInNextPlane () const
 Retrieve the private fFirstChannelInNextPlane vector for testing. More...
 
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > FirstChannelInThisPlane () const
 Retrieve the private fFirstChannelInThisPlane vector for testing. More...
 
virtual bool HasChannel (raw::ChannelID_t channel) const
 Returns whether the specified channel is valid This default implementation assumes all channels up to Nchannels() valid. More...
 
geo::SigType_t SignalTypeForChannel (raw::ChannelID_t const channel) const
 Return the signal type of the specified channel. More...
 
geo::SigType_t SignalTypeForROPID (readout::ROPID const &ropid) const
 Return the signal type on the specified readout plane. More...
 

Protected Types

template<class T >
using Vector = std::vector< T >
 
template<class T >
using TwoVector = Vector< Vector< T >>
 
template<class T >
using ThreeVector = Vector< TwoVector< T >>
 
template<class T >
using FourVector = Vector< ThreeVector< T >>
 
- Protected Types inherited from geo::ChannelMapAlg
template<typename T >
using TPCInfoMap_t = std::vector< std::vector< T >>
 Data type for per-TPC information. More...
 
template<typename T >
using PlaneInfoMap_t = TPCInfoMap_t< std::vector< T >>
 Data type for per-plane information. More...
 

Protected Member Functions

bool HasCryostat (CryostatID const &cid) const
 Returns whether the specified ID represents a valid cryostat. More...
 
- Protected Member Functions inherited from geo::ChannelMapAlg
template<typename T >
T const & AccessElement (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
 Returns the specified element of the plane map. More...
 
template<typename T >
size_t AccessElementSize (PlaneInfoMap_t< T > const &map, geo::TPCID const &id) const
 Returns the number of elements in the specified TPC of the plane map. More...
 
template<typename T >
T const * GetElementPtr (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
 Returns a pointer to the specified element, or nullptr if invalid. More...
 
template<typename T >
T const & AccessElement (TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
 Returns the specified element of the TPC map. More...
 
template<typename T >
size_t AccessElementSize (TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
 Returns the number of elements in the specified cryostat of the TPC map. More...
 
template<typename T >
bool isValidElement (TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
 Returns whether the ID specifies a valid entry. More...
 
template<typename T >
bool isValidElement (TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
 
template<typename T >
bool isValidElement (PlaneInfoMap_t< T > const &map, geo::CryostatID const &id) const
 Returns whether the ID specifies a valid entry. More...
 
template<typename T >
bool isValidElement (PlaneInfoMap_t< T > const &map, geo::TPCID const &id) const
 
template<typename T >
bool isValidElement (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
 
virtual geo::SigType_t SignalTypeForROPIDImpl (readout::ROPID const &ropid) const
 Return the signal type on the specified readout plane. More...
 

Protected Attributes

unsigned int fOpDetFlag
 
unsigned int fChannelsPerOpDet
 Flag for OpDet channel map. More...
 
unsigned int fNcryostat
 number of cryostats in the detector More...
 
unsigned int fNchannels
 number of channels in the detector More...
 
unsigned int fChannelsPerAPA
 number of channels in each APA More...
 
raw::ChannelID_t fTopChannel
 book keeping highest channel # More...
 
unsigned int fNTpcMax
 Max # TPCs in any cryostat. More...
 
unsigned int fNApaMax
 Max # TPCs in any cryostat. More...
 
unsigned int fNRopMax
 Max # ROPs in any APA. More...
 
std::vector< unsigned int > fNTpc
 number of TPCs in each cryostat More...
 
std::vector< unsigned int > fNApa
 number of APAs in each cryostat More...
 
std::set< View_tfViews
 vector of the views present in the detector More...
 
std::set< PlaneIDfPlaneIDs
 vector of the PlaneIDs present in the detector More...
 
ThreeVector< unsigned int > fWiresPerPlane
 

wires/TPC plane for each (cry, tpc, pla)

More...
 
TwoVector< unsigned int > fPlanesPerTpc
 

planes for each (cry, tpc)

More...
 
TwoVector< unsigned int > fRopsPerApa
 

ROPs for each (cry, apa)

More...
 
ThreeVector< unsigned int > fApaTpcs
 TPCs for each APA. More...
 
ThreeVector< unsigned int > fPlanesPerRop
 

TPC planes for each (cry, apa, rop)

More...
 
FourVector< unsigned int > fRopTpc
 

TPC planes for each (cry, apa, rop, rpl)

More...
 
FourVector< unsigned int > fRopPlane
 

TPC plane index for each (cry, apa, rop, rpl)

More...
 
TwoVector< unsigned int > fChannelsPerApa
 

channels for each APA

More...
 
ThreeVector< unsigned int > fChannelsPerRop
 

channels for each Rop

More...
 
ThreeVector< unsigned int > fAnchoredWires
 

anchored wires for each (cry, tpc, pla)

More...
 
ThreeVector< unsigned int > fPlaneApa
 APA for each TPC plane (cry, tpc, pla) More...
 
ThreeVector< unsigned int > fPlaneRop
 ROP for each TPC plane (cry, tpc, pla) More...
 
ThreeVector< unsigned int > fPlaneRopIndex
 Index in ROP for each TPC plane (cry, tpc, pla) More...
 
ThreeVector< unsigned int > fAnchoredPlaneRop
 ROP holding the anchored wires for (cry, tpc, pla) More...
 
ThreeVector< unsigned int > fWiresPerRop
 

wires/ROP for each (cry, apa, rop)

More...
 
PlaneInfoMap_t< raw::ChannelID_tfFirstChannelInThisRop
 (cry, apa, rop) More...
 
PlaneInfoMap_t< raw::ChannelID_tfFirstChannelInNextRop
 (cry, apa, rop) More...
 
const geo::GeoObjectSorterfSorter
 sorts geo::XXXGeo objects More...
 
PlaneInfoMap_t< PlaneData_tfPlaneData
 
std::vector< double > fWirePitch
 
std::vector< double > fOrientation
 
std::vector< double > fSinOrientation
 
std::vector< double > fCosOrientation
 
- Protected Attributes inherited from geo::ChannelMapAlg
PlaneInfoMap_t< raw::ChannelID_tfFirstChannelInThisPlane
 
PlaneInfoMap_t< raw::ChannelID_tfFirstChannelInNextPlane
 
std::map< std::string, size_t > fADNameToGeo
 map the names of the dets to the AuxDetGeo objects More...
 
std::map< size_t, std::vector< size_t > > fADChannelToSensitiveGeo
 

Detailed Description

Definition at line 45 of file DuneApaChannelMapAlg.h.

Member Typedef Documentation

template<class T >
using geo::DuneApaChannelMapAlg::FourVector = Vector<ThreeVector<T>>
protected

Definition at line 244 of file DuneApaChannelMapAlg.h.

template<class T >
using geo::DuneApaChannelMapAlg::ThreeVector = Vector<TwoVector<T>>
protected

Definition at line 242 of file DuneApaChannelMapAlg.h.

template<class T >
using geo::DuneApaChannelMapAlg::TwoVector = Vector<Vector<T>>
protected

Definition at line 240 of file DuneApaChannelMapAlg.h.

template<class T >
using geo::DuneApaChannelMapAlg::Vector = std::vector<T>
protected

Definition at line 238 of file DuneApaChannelMapAlg.h.

Constructor & Destructor Documentation

DuneApaChannelMapAlg::DuneApaChannelMapAlg ( const fhicl::ParameterSet pset)

Definition at line 43 of file DuneApaChannelMapAlg.cxx.

44 : fSorter(nullptr) {
45  fChannelsPerOpDet = p.get<unsigned int>("ChannelsPerOpDet");
46  fOpDetFlag = 0;
47  // If DetectorVersion is present, then check if this is 35t.
48  string sdet;
49  p.get_if_present<string>("DetectorVersion", sdet);
50  if ( sdet.substr(0,7) == "dune35t" ) fOpDetFlag = 1;
51 }
const geo::GeoObjectSorter * fSorter
sorts geo::XXXGeo objects
unsigned int fChannelsPerOpDet
Flag for OpDet channel map.
p
Definition: test.py:223

Member Function Documentation

ROPID DuneApaChannelMapAlg::ChannelToROP ( raw::ChannelID_t  channel) const
overridevirtual

Returns the ID of the ROP the channel belongs to (invalid if none)

Exceptions
cet::exception(category: "Geometry") if non-existent channel

Implements geo::ChannelMapAlg.

Definition at line 707 of file DuneApaChannelMapAlg.cxx.

707  {
708  Index ncry = fNcryostat;
709  for ( Index icry=0; icry<ncry; ++icry ) {
710  Index napa = fNApa[icry];
711  for ( Index iapa=0; iapa<napa; ++iapa ) {
712  Index nrop = fRopsPerApa[icry][iapa];
713  for ( Index irop=0; irop<nrop; ++irop ) {
714  Index icha1 = fFirstChannelInThisRop[icry][iapa][irop];
715  Index icha2 = fFirstChannelInNextRop[icry][iapa][irop];
716  if ( icha >= icha1 && icha < icha2 ) return ROPID(icry, iapa, irop);
717  }
718  }
719  }
720  return(ROPID(CryostatID::InvalidID, TPCsetID::InvalidID, ROPID::InvalidID));
721 }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
unsigned int Index
readout::ROPID ROPID
std::vector< unsigned int > fNApa
number of APAs in each cryostat
unsigned int fNcryostat
number of cryostats in the detector
TwoVector< unsigned int > fRopsPerApa
ROPs for each (cry, apa)
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:208
static constexpr ROPID_t InvalidID
Special code for an invalid ID.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextRop
(cry, apa, rop)
vector< WireID > DuneApaChannelMapAlg::ChannelToWire ( raw::ChannelID_t  channel) const
overridevirtual

Returns a list of TPC wires connected to the specified readout channel ID

Exceptions
cet::exception(category: "Geometry") if non-existent channel

Implements geo::ChannelMapAlg.

Definition at line 324 of file DuneApaChannelMapAlg.cxx.

324  {
325  vector< WireID > wirids;
326  if ( icha >= fNchannels ) return wirids;
327  // Loop over ROPs to find the one holding this channel.
328  Index ncry = fNcryostat;
329  Index icry = badIndex;
330  Index iapa = badIndex;
331  Index irop = badIndex;
332  Index ichaRop = badIndex; // Channel number in the ROP
333  bool found = false;
334  for ( icry=0; icry<ncry; ++icry ) {
335  Index napa = fNApa[icry];
336  for ( iapa=0; iapa<napa; ++iapa ) {
337  Index nrop = fRopsPerApa[icry][iapa];
338  for ( irop=0; irop<nrop; ++irop ) {
339  Index icha1 = fFirstChannelInThisRop[icry][iapa][irop];
340  Index icha2 = fFirstChannelInNextRop[icry][iapa][irop];
341  found = icha >= icha1 && icha < icha2;
342  if ( found ) {
343  ichaRop = icha - icha1;
344  break;
345  }
346  }
347  if ( found ) break;
348  }
349  if ( found ) break;
350  }
351  if ( icry >= ncry ) {
352  mf::LogError("DuneApaChannelMapAlg") << "Unable to find APA plane for channel " << icha;
353  throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": Unable to find APA plane for channel " << icha;
354  return wirids;
355  }
356  // Extract TPC(s) from ROP
357  Index nrpl = fPlanesPerRop[icry][iapa][irop];
358  if ( nrpl == 0 ) throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": No TPC planes.";
359  if ( nrpl > 2 ) throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": Too many TPC planes.";
360  Index itpc1 = fRopTpc[icry][iapa][irop][0];
361  Index ipla = fRopPlane[icry][iapa][irop][0];
362  Index itpc2 = (nrpl > 1 ) ? fRopTpc[icry][iapa][irop][1] : itpc1;
363  Index nAnchored = fAnchoredWires[icry][itpc1][ipla];
364  bool wrapped = ipla < 2;
365  if ( wrapped && itpc2 == itpc1 )
366  throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": 2nd plane not found for wrapped ROP";
367  if ( wrapped && ipla != fRopPlane[icry][iapa][irop][1] )
368  throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": Wrapped planes have inconsistent indices.";
369  // For now, assume the second TPC plane has the same # anchored wires.
370  // Code will need some work if we want to relax this assumption.
371  if ( wrapped && fAnchoredWires[icry][itpc2][ipla] != nAnchored )
372  throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": Planes have inconsistent anchor counts.";
373  // If this is a wrapped ROP and the wire number is larger than nAnchored, then
374  // the first wire for this channel is in the other TPC plane.
375  Index itpc = itpc1;
376  Index iwir = ichaRop;
377  if ( wrapped && iwir >= nAnchored ) {
378  itpc = itpc2;
379  iwir -= nAnchored;
380  }
381  if ( iwir >= nAnchored ) {
382  throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": Invalid channel: iwir =" << iwir;
383  }
384  // Loop over wires and create IDs.
385  while ( iwir < fWiresPerPlane[icry][itpc][ipla] ) {
386  WireID wirid(icry, itpc, ipla, iwir);
387  wirids.push_back(wirid);
388  iwir += fAnchoredWires[icry][itpc][ipla];
389  itpc = (itpc == itpc1) ? itpc2 : itpc1;
390  }
391  return wirids;
392 }
Index badIndex
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Index
ThreeVector< unsigned int > fAnchoredWires
anchored wires for each (cry, tpc, pla)
FourVector< unsigned int > fRopPlane
TPC plane index for each (cry, apa, rop, rpl)
std::vector< unsigned int > fNApa
number of APAs in each cryostat
ThreeVector< unsigned int > fPlanesPerRop
TPC planes for each (cry, apa, rop)
unsigned int fNcryostat
number of cryostats in the detector
FourVector< unsigned int > fRopTpc
TPC planes for each (cry, apa, rop, rpl)
unsigned int fNchannels
number of channels in the detector
TwoVector< unsigned int > fRopsPerApa
ROPs for each (cry, apa)
ThreeVector< unsigned int > fWiresPerPlane
wires/TPC plane for each (cry, tpc, pla)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextRop
(cry, apa, rop)
ChannelID_t DuneApaChannelMapAlg::FirstChannelInROP ( readout::ROPID const &  ropid) const
overridevirtual

Returns the ID of the first channel in the specified readout plane.

Parameters
ropidID of the readout plane
Returns
ID of first channel, or raw::InvalidChannelID if ID is invalid

Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour for non-existing readout planes is undefined.

Implements geo::ChannelMapAlg.

Definition at line 732 of file DuneApaChannelMapAlg.cxx.

732  {
733  Index icry = ropid.Cryostat;
734  Index iapa = ropid.TPCset;
735  Index irop = ropid.ROP;
736  Index icha1 = fFirstChannelInThisRop[icry][iapa][irop];
737  return icha1;
738 }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
unsigned int Index
TPCID DuneApaChannelMapAlg::FirstTPCinTPCset ( readout::TPCsetID const &  tpcsetid) const
overridevirtual

Returns the ID of the first TPC belonging to the specified TPC set

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 637 of file DuneApaChannelMapAlg.cxx.

637  {
638  Index icry = apaid.Cryostat;
639  Index iapa = apaid.TPCset;
640  Index itpc = TPCID::InvalidID;
641  if ( fApaTpcs[icry][iapa].size() ) itpc = fApaTpcs[icry][iapa][0];
642  return TPCID(icry, itpc);
643 }
static constexpr TPCID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:403
ThreeVector< unsigned int > fApaTpcs
TPCs for each APA.
unsigned int Index
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
PlaneID DuneApaChannelMapAlg::FirstWirePlaneInROP ( readout::ROPID const &  ropid) const
overridevirtual

Returns the ID of the first plane belonging to the specified ROP.

Parameters
ropidID of the readout plane
Returns
ID of first channel, or raw::InvalidChannelID if ID is invalid

Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour for non-existing readout planes is undefined.

Implements geo::ChannelMapAlg.

Definition at line 742 of file DuneApaChannelMapAlg.cxx.

742  {
743  vector<PlaneID> plaids = ROPtoWirePlanes(ropid);
744  if ( plaids.size() ) return plaids[0];
746 }
static constexpr TPCID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:403
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of wire planes belonging to the specified ROP.
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:208
static constexpr PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:490
Index DuneApaChannelMapAlg::HardwareChannelFromOpChannel ( unsigned int  opChannel) const
overridevirtual

Returns the hardware channel number of specified optical channel.

Parameters
opChannelthe optical detector channel being queried
Returns
the optical detector the specified optical channel belongs to

If the specified optical channel is invalid, behaviour is undefined.

Reimplemented from geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 589 of file DuneApaChannelMapAlg.cxx.

589  {
590  if ( fOpDetFlag == 1 ) return opChannel%12;
591  unsigned int channel = opChannel % fChannelsPerOpDet;
592  return channel;
593 }
uint8_t channel
Definition: CRTFragment.hh:201
unsigned int fChannelsPerOpDet
Flag for OpDet channel map.
bool geo::DuneApaChannelMapAlg::HasCryostat ( CryostatID const &  cid) const
inlineprotected

Returns whether the specified ID represents a valid cryostat.

Definition at line 298 of file DuneApaChannelMapAlg.h.

299  { return cid.Cryostat < fNcryostat; }
unsigned int fNcryostat
number of cryostats in the detector
bool DuneApaChannelMapAlg::HasROP ( readout::ROPID const &  ropid) const
overridevirtual

Returns whether we have the specified ROP

Returns
whether the readout plane is valid and exists

Implements geo::ChannelMapAlg.

Definition at line 662 of file DuneApaChannelMapAlg.cxx.

662  {
663  return HasTPCset(ropid) && (ropid.ROP < NROPs(ropid));
664 }
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
bool DuneApaChannelMapAlg::HasTPCset ( readout::TPCsetID const &  tpcsetid) const
overridevirtual

Returns whether we have the specified TPC set

Returns
whether the TPC set is valid and exists
Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 611 of file DuneApaChannelMapAlg.cxx.

611  {
612  return HasCryostat(tpcsetid) && (tpcsetid.TPCset < NTPCsets(tpcsetid));
613 }
bool HasCryostat(CryostatID const &cid) const
Returns whether the specified ID represents a valid cryostat.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
void DuneApaChannelMapAlg::Initialize ( GeometryData_t const &  geodata)
overridevirtual

Geometry initialisation.

Implements geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 61 of file DuneApaChannelMapAlg.cxx.

61  {
62  Uninitialize();
63 
64  vector<CryostatGeo> const& crygeos = geodata.cryostats;
65  Index ncry = crygeos.size();
66  fNcryostat = ncry;
67  if ( ncry == 0 ) {
68  mf::LogError("DuneApaChannelMapAlg") << "No cryostats found.";
69  return;
70  }
71  CryostatGeo const& crygeo = crygeos[0];
72 
73  mf::LogInfo("DuneApaChannelMapAlg") << "Initializing channel map...";
74  fNTpc.resize(ncry);
75  fNApa.resize(ncry);
76  // The first channel array for each APA plane allow the cryostats to differ.
77  fPlanesPerTpc.resize(ncry);
78  fWiresPerPlane.resize(ncry);
79  fApaTpcs.resize(ncry);
80  fFirstChannelInThisPlane.resize(ncry);
81  fFirstChannelInNextPlane.resize(ncry);
82  fAnchoredPlaneRop.resize(ncry);
83  fPlaneApa.resize(ncry);
84  fPlaneRop.resize(ncry);
85  fPlaneRopIndex.resize(ncry);
86  fAnchoredWires.resize(ncry);
87  fFirstChannelInThisRop.resize(ncry);
88  fFirstChannelInNextRop.resize(ncry);
89  fRopsPerApa.resize(ncry);
90  fChannelsPerApa.resize(ncry);
91  fChannelsPerRop.resize(ncry);
92  fPlanesPerRop.resize(ncry);
93  fRopTpc.resize(ncry);
94  fRopPlane.resize(ncry);
95  fNTpcMax = 0;
96  fNApaMax = 0;
97  fNRopMax = 0;
98  for ( Index icry=0; icry<ncry; ++icry ) {
99  Index ntpc = crygeos[icry].NTPC();
100  Index napa = ntpc/2; // Assume 1 APA for every two TPCs
101  fNTpc[icry] = ntpc;
102  fNApa[icry] = napa;
103  if ( ntpc > fNTpcMax ) fNTpcMax = ntpc;
104  if ( napa > fNApaMax ) fNApaMax = napa;
105  fPlanesPerTpc[icry].resize(ntpc);
106  fWiresPerPlane[icry].resize(ntpc);
107  fFirstChannelInThisPlane[icry].resize(ntpc);
108  fFirstChannelInNextPlane[icry].resize(ntpc);
109  fAnchoredPlaneRop[icry].resize(ntpc);
110  fPlaneApa[icry].resize(ntpc);
111  fPlaneRop[icry].resize(ntpc);
112  fPlaneRopIndex[icry].resize(ntpc);
113  fAnchoredWires[icry].resize(ntpc);
114  fRopsPerApa[icry].resize(napa, 4);
115  fChannelsPerApa[icry].resize(napa, 0);
116  fApaTpcs[icry].resize(napa);
117  fChannelsPerRop[icry].resize(napa);
118  fPlanesPerRop[icry].resize(napa);
119  fFirstChannelInThisRop[icry].resize(napa);
120  fFirstChannelInNextRop[icry].resize(napa);
121  fRopTpc[icry].resize(napa);
122  fRopPlane[icry].resize(napa);
123  for ( Index itpc=0; itpc<ntpc; ++itpc ) {
124  Index npla = crygeo.TPC(itpc).Nplanes();
125  if ( npla != 3 ) {
126  mf::LogError("DuneApaChannelMapAlg")
127  << "# planes/TPC is " << npla << " rather than 3 " << " for TPC " << itpc;
128  return;
129  }
130  fPlaneApa[icry][itpc].resize(npla, badIndex);
131  fPlaneRop[icry][itpc].resize(npla, badIndex);
132  fPlaneRopIndex[icry][itpc].resize(npla, badIndex);
133  fFirstChannelInThisPlane[icry][itpc].resize(npla, 0);
134  fFirstChannelInNextPlane[icry][itpc].resize(npla, 0);
135  fAnchoredPlaneRop[icry][itpc].resize(npla, 0);
136  fAnchoredWires[icry][itpc].resize(npla, 0);
137  fWiresPerPlane[icry][itpc].resize(npla, 0);
138  fPlanesPerTpc[icry][itpc] = npla;
139  for ( Index ipla=0; ipla<npla; ++ipla ) {
140  Index nwir = crygeo.TPC(itpc).Plane(ipla).Nwires();
141  fWiresPerPlane[icry][itpc][ipla] = nwir;
142  }
143  }
144  Index itpc = 0;
145  for ( Index iapa=0; iapa<napa; ++iapa ) {
146  Index nrop = fRopsPerApa[icry][iapa];
147  if ( nrop > fNRopMax ) fNRopMax = nrop;
148  fApaTpcs[icry][iapa].push_back(itpc);
149  fApaTpcs[icry][iapa].push_back(itpc+1);
150  fChannelsPerRop[icry][iapa].resize(nrop);
151  fFirstChannelInThisRop[icry][iapa].resize(nrop, 0);
152  fFirstChannelInNextRop[icry][iapa].resize(nrop, 0);
153  fPlanesPerRop[icry][iapa].resize(nrop, 0);
154  fRopTpc[icry][iapa].resize(nrop);
155  fRopPlane[icry][iapa].resize(nrop);
156  Index ipla = 0;
157  // Induction planes
158  for ( Index irop=0; irop<2; ++irop ) {
159  fPlanesPerRop[icry][iapa][irop] = 2;
160  fRopTpc[icry][iapa][irop].push_back(itpc);
161  fRopTpc[icry][iapa][irop].push_back(itpc+1);
162  fRopPlane[icry][iapa][irop].push_back(ipla);
163  fRopPlane[icry][iapa][irop].push_back(ipla);
164  ++ipla;
165  }
166  // Collection planes.
167  for ( Index irop=2; irop<4; ++irop ) {
168  fPlanesPerRop[icry][iapa][irop] = 1;
169  fRopTpc[icry][iapa][irop].push_back(itpc);
170  fRopPlane[icry][iapa][irop].push_back(ipla);
171  ++itpc;
172  }
173  }
174  }
175  fPlaneIDs.clear();
176  fTopChannel = 0;
177 
178  // Map planes to ROPs and wires to channels.
179  // We use the geometry to deduce the numbers of channels/plane.
180  // For induction planes, we look for the first adjacent pair of wires
181  // with the same center z-position and assume the index of the first
182  // of those gives the count of wires read out from one side.
183  // These are called anchored wires.
184  ChannelID_t icha = 0;
185  for ( Index icry=0; icry!=ncry; ++icry ) {
186  Index napa = fNApa[icry];
187  for ( Index iapa=0; iapa!=napa; ++iapa ) {
188  Index nrop = fRopsPerApa[icry][iapa];
189  for ( Index irop=0; irop!=nrop; ++irop ) {
190  Index nrpl = fPlanesPerRop[icry][iapa][irop];
191  fFirstChannelInThisRop[icry][iapa][irop] = icha;
192  for ( Index irpl=0; irpl!=nrpl; ++irpl ) {
193  Index itpc = fRopTpc[icry][iapa][irop][irpl];
194  Index ipla = fRopPlane[icry][iapa][irop][irpl];
195  fPlaneApa[icry][itpc][ipla] = iapa;
196  fPlaneRop[icry][itpc][ipla] = irop;
197  fPlaneRopIndex[icry][itpc][ipla] = irpl;
198  const PlaneGeo& plageo = crygeos[icry].TPC(itpc).Plane(ipla);
199 #if 0
200 const PlaneGeo plageo2 = plageo;
201 #endif
202  View_t view = plageo.View();
203  const Vector<View_t> eview = {geo::kU, geo::kV, geo::kZ};
204  if ( view != eview[ipla] ) {
205  throw cet::exception("DuneApaChannelMapAlg") << __func__
206  << ": View " << view << " is not the expected " << eview[ipla];
207  }
208  double xyz[3] = {0.};
209  double xyz_next[3] = {0.};
210  Index nAnchoredWires = 0; // # wires from this TPC plane contributing to the ROP
211  // Collection plane.
212  Index nwir = fWiresPerPlane[icry][itpc][ipla];
213  if ( view == geo::kZ ) {
214  nAnchoredWires = nwir;
215  // Induction planes.
216  } else {
217  for ( unsigned int iwir=0; iwir+1<nwir; ++iwir ) {
218  plageo.Wire(iwir).GetCenter(xyz);
219  plageo.Wire(iwir+1).GetCenter(xyz_next);
220  if ( xyz[2] == xyz_next[2] ) {
221  nAnchoredWires = iwir;
222  break;
223  }
224  }
225  }
226  fAnchoredWires[icry][itpc][ipla] = nAnchoredWires;
227  fFirstChannelInThisPlane[icry][itpc][ipla] = icha;
228  icha += nAnchoredWires;
229  fFirstChannelInNextPlane[icry][itpc][ipla] = icha;
230  fAnchoredPlaneRop[icry][itpc][ipla] = irop;
231  }
232  fFirstChannelInNextRop[icry][iapa][irop] = icha;
233  }
234  }
235  }
236  fNchannels = icha;
238 
239  // Assign first channels for the TPCs.
240  fPlaneData.resize(ncry);
241  for ( Index icry=0; icry<ncry; ++icry ) {
242  Index ntpc = fNTpc[icry];
243  fPlaneData[icry].resize(ntpc);
244  for ( Index itpc=0; itpc<ntpc; ++itpc ) {
245  fPlaneData[icry][itpc].resize(crygeos[icry].TPC(itpc).Nplanes());
246  for ( Index ipla=0; ipla<crygeos[icry].TPC(itpc).Nplanes(); ++ipla ) {
247  PlaneData_t& PlaneData = fPlaneData[icry][itpc][ipla];
248  const PlaneGeo& thePlane = crygeos[icry].TPC(itpc).Plane(ipla);
249  double xyz[3];
250  fPlaneIDs.emplace(icry, itpc, ipla);
251  thePlane.Wire(0).GetCenter(xyz);
252  PlaneData.fFirstWireCenterY = xyz[1];
253  PlaneData.fFirstWireCenterZ = xyz[2];
254  // we are interested in the ordering of wire numbers: we find that a
255  // point is N wires left of a wire W: is that wire W + N or W - N?
256  // In fact, for TPC #0 it is W + N for V and Z planes, W - N for U
257  // plane; for TPC #0 it is W + N for V and Z planes, W - N for U
258  PlaneData.fWireSortingInZ = thePlane.WireIDincreasesWithZ()? +1.: -1.;
259 
260  // find boundaries of the outside APAs for this plane by looking at endpoints of wires
261 
262  double endpoint[3];
263  thePlane.Wire(0).GetStart(endpoint);
264  PlaneData.fYmax = endpoint[1];
265  PlaneData.fYmin = endpoint[1];
266  PlaneData.fZmax = endpoint[2];
267  PlaneData.fZmin = endpoint[2];
268  unsigned int nwires = thePlane.Nwires();
269  for (unsigned int iwire=0;iwire<nwires;iwire++){
270  thePlane.Wire(iwire).GetStart(endpoint);
271  PlaneData.fYmax = std::max(PlaneData.fYmax,endpoint[1]);
272  PlaneData.fYmin = std::min(PlaneData.fYmin,endpoint[1]);
273  PlaneData.fZmax = std::max(PlaneData.fZmax,endpoint[2]);
274  PlaneData.fZmin = std::min(PlaneData.fZmin,endpoint[2]);
275  thePlane.Wire(iwire).GetEnd(endpoint);
276  PlaneData.fYmax = std::max(PlaneData.fYmax,endpoint[1]);
277  PlaneData.fYmin = std::min(PlaneData.fYmin,endpoint[1]);
278  PlaneData.fZmax = std::max(PlaneData.fZmax,endpoint[2]);
279  PlaneData.fZmin = std::min(PlaneData.fZmin,endpoint[2]);
280  } // loop on wire
281 
282  } // for plane
283  } // for TPC
284  } // for cryostat
285 
286  Index npla = crygeo.TPC(0).Nplanes();
287  fWirePitch.resize(npla);
288  fOrientation.resize(npla);
289  fSinOrientation.resize(npla);
290  fCosOrientation.resize(npla);
291 
292  for ( Index ipla=0; ipla<npla; ++ipla ) {
293  fWirePitch[ipla] = crygeo.TPC(0).WirePitch(ipla);
294  fOrientation[ipla] = crygeo.TPC(0).Plane(ipla).Wire(0).ThetaZ();
295  fSinOrientation[ipla] = sin(fOrientation[ipla]);
296  fCosOrientation[ipla] = cos(fOrientation[ipla]);
297  }
298 
299  for ( Index icry=0; icry<ncry; ++icry ) {
300  mf::LogVerbatim("DuneApaChannelMapAlg") << "Cryostat " << icry << ":";
301  mf::LogVerbatim("DuneApaChannelMapAlg") << " " << fNchannels << " total channels";
302  mf::LogVerbatim("DuneApaChannelMapAlg") << " " << fNTpc[icry]/2 << " APAs";
303  mf::LogVerbatim("DuneApaChannelMapAlg") << " For all identical APA:" ;
304  mf::LogVerbatim("DuneApaChannelMapAlg") << " Number of channels per APA = " << fChannelsPerAPA ;
305  mf::LogVerbatim("DuneApaChannelMapAlg") << " U channels per APA = " << 2*fAnchoredWires[0][0][0] ;
306  mf::LogVerbatim("DuneApaChannelMapAlg") << " V channels per APA = " << 2*fAnchoredWires[0][0][1] ;
307  mf::LogVerbatim("DuneApaChannelMapAlg") << " Z channels per APA = " << 2*fAnchoredWires[0][0][2] ;
308  mf::LogVerbatim("DuneApaChannelMapAlg") << " Pitch in U Plane = " << fWirePitch[0] ;
309  mf::LogVerbatim("DuneApaChannelMapAlg") << " Pitch in V Plane = " << fWirePitch[1] ;
310  mf::LogVerbatim("DuneApaChannelMapAlg") << " Pitch in Z Plane = " << fWirePitch[2] ;
311  }
312 
313 }
unsigned int fNApaMax
Max # TPCs in any cryostat.
void GetStart(double *xyz) const
Definition: WireGeo.h:157
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
unsigned int fNRopMax
Max # ROPs in any APA.
Index badIndex
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
std::vector< double > fOrientation
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Planes which measure V.
Definition: geo_types.h:130
ThreeVector< unsigned int > fApaTpcs
TPCs for each APA.
ThreeVector< unsigned int > fChannelsPerRop
channels for each Rop
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
std::vector< double > fCosOrientation
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
Planes which measure Z direction.
Definition: geo_types.h:132
ThreeVector< unsigned int > fPlaneRop
ROP for each TPC plane (cry, tpc, pla)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Index
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
ThreeVector< unsigned int > fAnchoredWires
anchored wires for each (cry, tpc, pla)
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition: WireGeo.h:250
std::vector< double > fWirePitch
PlaneInfoMap_t< PlaneData_t > fPlaneData
TwoVector< unsigned int > fPlanesPerTpc
planes for each (cry, tpc)
ThreeVector< unsigned int > fPlaneApa
APA for each TPC plane (cry, tpc, pla)
Planes which measure U.
Definition: geo_types.h:129
TwoVector< unsigned int > fChannelsPerApa
channels for each APA
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:184
FourVector< unsigned int > fRopPlane
TPC plane index for each (cry, apa, rop, rpl)
std::vector< unsigned int > fNApa
number of APAs in each cryostat
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
ThreeVector< unsigned int > fPlanesPerRop
TPC planes for each (cry, apa, rop)
unsigned int fNcryostat
number of cryostats in the detector
double WirePitch(unsigned plane=0) const
Definition: TPCGeo.cxx:396
std::vector< double > fSinOrientation
static int max(int a, int b)
FourVector< unsigned int > fRopTpc
TPC planes for each (cry, apa, rop, rpl)
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
unsigned int fChannelsPerAPA
number of channels in each APA
ThreeVector< unsigned int > fPlaneRopIndex
Index in ROP for each TPC plane (cry, tpc, pla)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
unsigned int fNchannels
number of channels in the detector
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
void GetEnd(double *xyz) const
Definition: WireGeo.h:163
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:269
bool WireIDincreasesWithZ() const
Returns whether the higher z wires have higher wire ID.
Definition: PlaneGeo.cxx:525
TwoVector< unsigned int > fRopsPerApa
ROPs for each (cry, apa)
unsigned int fNTpcMax
Max # TPCs in any cryostat.
raw::ChannelID_t fTopChannel
book keeping highest channel #
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
ThreeVector< unsigned int > fWiresPerPlane
wires/TPC plane for each (cry, tpc, pla)
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:73
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
std::vector< unsigned int > fNTpc
number of TPCs in each cryostat
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
ThreeVector< unsigned int > fAnchoredPlaneRop
ROP holding the anchored wires for (cry, tpc, pla)
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextRop
(cry, apa, rop)
Index DuneApaChannelMapAlg::MaxROPs ( ) const
overridevirtual

Returns the largest number of ROPs a TPC set in the detector has

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 656 of file DuneApaChannelMapAlg.cxx.

656  {
657  return fNRopMax;
658 }
unsigned int fNRopMax
Max # ROPs in any APA.
Index DuneApaChannelMapAlg::MaxTPCsets ( ) const
overridevirtual

Returns the largest number of TPC sets any cryostat in the detector has

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 605 of file DuneApaChannelMapAlg.cxx.

605  {
606  return fNApaMax;
607 }
unsigned int fNApaMax
Max # TPCs in any cryostat.
unsigned int DuneApaChannelMapAlg::Nchannels ( ) const
overridevirtual

Returns the total number of channels present (not necessarily contiguous)

Implements geo::ChannelMapAlg.

Definition at line 396 of file DuneApaChannelMapAlg.cxx.

396  {
397  return fNchannels;
398 }
unsigned int fNchannels
number of channels in the detector
unsigned int DuneApaChannelMapAlg::Nchannels ( readout::ROPID const &  ropid) const
overridevirtual

Returns the number of channels in the specified ROP.

Returns
number of channels in the specified ROP, 0 if non-existent
Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 402 of file DuneApaChannelMapAlg.cxx.

402  {
403  Index icry = ropid.Cryostat;
404  Index iapa = ropid.TPCset;
405  Index irop = ropid.ROP;
406  Index icha1 = fFirstChannelInThisRop[icry][iapa][irop];
407  Index icha2 = fFirstChannelInNextRop[icry][iapa][irop];
408  return icha2 - icha1;
409 }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
unsigned int Index
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextRop
(cry, apa, rop)
virtual WireID geo::DuneApaChannelMapAlg::NearestWireID ( const TVector3 &  worldPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
inlineoverridevirtual

Returns the ID of the wire nearest to the specified position.

Parameters
worldPosposition to be tested
PlaneNonumber of plane containing the wire
TPCNonumber of TPC containing the wire
cstatnumber of cryostat containing the wire
Returns
the ID of the wire closest to worldPos in the specified plane
See also
NearestWireID(const TVector3&, geo::PlaneID const&)
Deprecated:
Use the version with geo::PlaneID instead

Implements geo::ChannelMapAlg.

Definition at line 77 of file DuneApaChannelMapAlg.h.

81  { return NearestWireID(worldPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
virtual 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.
WireID DuneApaChannelMapAlg::NearestWireID ( const TVector3 &  worldPos,
geo::PlaneID const &  planeID 
) const
overridevirtual

Returns the ID of the wire nearest to the specified position.

Parameters
worldPosposition to be tested
planeIDplane containing the wire
Returns
the ID of the wire closest to worldPos in the specified plane
Exceptions
InvalidWireIDErrorthe ID found is not present in the detector
See also
WireCoordinate(double, double, geo::PlaneID const&)

The plane is required to be valid and exist in the detector. Otherwise, the behaviour is undefined. An exception is thrown if the wire that would be the closest is actually not present; but no check is performed whether the specified position is outside the wire plane: wires are extrapolated to be infinitely long. In other words, the result can be trusted only as long as the position is within the specified wire plane.

Reimplemented from geo::ChannelMapAlg.

Definition at line 446 of file DuneApaChannelMapAlg.cxx.

446  {
447 
448 
449  // cap the position to be within the boundaries of the wire endpoints.
450  // This simulates charge drifting in from outside of the wire frames inwards towards
451  // the first and last collection wires on the side, and towards the right endpoints
452 
453  const PlaneData_t& PlaneData = AccessElement(fPlaneData, plaid);
454  double ycap = std::max(PlaneData.fYmin,std::min(PlaneData.fYmax,xyz.Y()));
455  double zcap = std::max(PlaneData.fZmin,std::min(PlaneData.fZmax,xyz.Z()));
456 
457  int iwirSigned = 0.5 + WireCoordinate(ycap, zcap, plaid);
458  Index iwir = (iwirSigned < 0) ? 0 : iwirSigned;
459  Index icry = plaid.Cryostat;
460  Index itpc = plaid.TPC;
461  Index ipla = plaid.Plane;
462  Index iwirMax = fWiresPerPlane[icry][itpc][ipla] - 1;
463  if ( iwir > iwirMax ) iwir = iwirMax;
464  return WireID(plaid, iwir);
465 }
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.
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
unsigned int Index
PlaneInfoMap_t< PlaneData_t > fPlaneData
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
ThreeVector< unsigned int > fWiresPerPlane
wires/TPC plane for each (cry, tpc, pla)
Index DuneApaChannelMapAlg::NOpChannels ( unsigned int  NOpDets) const
overridevirtual

Returns the number of optical channels contained in some detectors.

Parameters
NOpDetsnumber of optical detectors
Returns
optical channels contained in NOpDets detectors

This function returns how many channels can be expected to be present in a detector with NOpDets optical detectors. This is an upper limit, as not all channels have necessarily to be present.

For example: if a detector has four channels per optical detector, the returned value will be four times the argument NOpDets. If there is a single channel on each optical detector, the return value will be the value NOpDets (this is in fact the fallback implementation). If each optical detector can have anywhere between 2 and 12 channels, the returned value is 12 times NOpDets, and it will be an overestimation of the number of channels.

Reimplemented from geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 552 of file DuneApaChannelMapAlg.cxx.

552  {
553  if ( fOpDetFlag == 1 ) return 12*NOpDets;
554  return fChannelsPerOpDet*NOpDets;
555 }
unsigned int fChannelsPerOpDet
Flag for OpDet channel map.
Index DuneApaChannelMapAlg::NOpHardwareChannels ( unsigned int  opDet) const
overridevirtual

Returns the number of channels in the specified optical detectors.

Parameters
opDetID of the chosen optical detector
Returns
optical channels contained in optical detector with ID opDet

This function returns how many channels are actually present in the optical detector with the specified ID.

For example: if a detector has four channels per optical detector, the returned value will be four, regardless opDet, and . If there is a single channel on each optical detector, the return value will be 1, again ignoring opDet (this is in fact the fallback implementation). If each optical detector can have anywhere between 2 and 12 channels, the returned value will be 2, 12, etc., that is the exact number of channels in opDet.

Although implementations are encouraged to return 0 on invalid optical detectors, the actual return value in that case is undefined.

Reimplemented from geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 559 of file DuneApaChannelMapAlg.cxx.

559  {
560  if ( fOpDetFlag == 1 ) {
561  // CSU 3-sipm design
562  if (opDet == 0 || opDet == 4 || opDet == 6) return 8;
563  // LSU 2-sipm design
564  if (opDet == 2) return 2;
565  // IU 12-sipm design
566  return 12;
567  }
568  return fChannelsPerOpDet;
569 }
unsigned int fChannelsPerOpDet
Flag for OpDet channel map.
Index DuneApaChannelMapAlg::NROPs ( readout::TPCsetID const &  tpcsetid) const
overridevirtual

Returns the total number of ROP in the specified TPC set.

Parameters
tpcsetidTPC set ID
Returns
number of readout planes in the TPC set, or 0 if no TPC set found

Note that this methods explicitly check the existence of the TPC set.

Implements geo::ChannelMapAlg.

Definition at line 647 of file DuneApaChannelMapAlg.cxx.

647  {
648  if (!HasTPCset(apaid)) return 0;
649  Index icry = apaid.Cryostat;
650  Index iapa = apaid.TPCset;
651  return fRopsPerApa[icry][iapa];
652 }
unsigned int Index
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
TwoVector< unsigned int > fRopsPerApa
ROPs for each (cry, apa)
Index DuneApaChannelMapAlg::NTPCsets ( readout::CryostatID const &  cryoid) const
overridevirtual

Returns the total number of TPC sets in the specified cryostat.

Parameters
cryoidcryostat ID
Returns
number of TPC sets in the cryostat, or 0 if no cryostat found

Implements geo::ChannelMapAlg.

Definition at line 597 of file DuneApaChannelMapAlg.cxx.

597  {
598  if (!HasCryostat(cryid)) return 0;
599  Index icry = cryid.Cryostat;
600  return fNApa[icry];
601 }
bool HasCryostat(CryostatID const &cid) const
Returns whether the specified ID represents a valid cryostat.
unsigned int Index
std::vector< unsigned int > fNApa
number of APAs in each cryostat
Index DuneApaChannelMapAlg::OpChannel ( unsigned int  detNum,
unsigned int  hwchannel = 0 
) const
overridevirtual

Returns the channel ID of the specified hardware channel.

Parameters
detNumoptical detector ID
hwchannelhardware channel within the specified optical detector
Returns
ID of the channel identified by detector and hardware channel IDs

If the input IDs identify a non-existing channel, the result is undefined.

Reimplemented from geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 573 of file DuneApaChannelMapAlg.cxx.

573  {
574  if ( fOpDetFlag == 1 ) return (detNum * 12) + channel;
575  unsigned int uniqueChannel = (detNum * fChannelsPerOpDet) + channel;
576  return uniqueChannel;
577 }
uint8_t channel
Definition: CRTFragment.hh:201
unsigned int fChannelsPerOpDet
Flag for OpDet channel map.
Index DuneApaChannelMapAlg::OpDetFromOpChannel ( unsigned int  opChannel) const
overridevirtual

Returns the optical detector the specified optical channel belongs.

Parameters
opChannelthe optical detector channel being queried
Returns
the optical detector the specified optical channel belongs to

If the specified optical channel is invalid, behaviour is undefined.

Reimplemented from geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 581 of file DuneApaChannelMapAlg.cxx.

581  {
582  if ( fOpDetFlag == 1 ) return opChannel/12;
583  unsigned int detectorNum = opChannel/fChannelsPerOpDet;
584  return detectorNum;
585 }
unsigned int fChannelsPerOpDet
Flag for OpDet channel map.
std::set< PlaneID > const & DuneApaChannelMapAlg::PlaneIDs ( ) const
overridevirtual

Returns a list of the plane IDs in the whole detector.

Implements geo::ChannelMapAlg.

Definition at line 546 of file DuneApaChannelMapAlg.cxx.

546  {
547  return fPlaneIDs;
548 }
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
virtual raw::ChannelID_t geo::DuneApaChannelMapAlg::PlaneWireToChannel ( unsigned int  plane,
unsigned int  wire,
unsigned int  tpc,
unsigned int  cstat 
) const
inlineoverridevirtual

Returns the channel ID a wire is connected to.

Parameters
planenumber of plane
wirenumber of wire
tpcnumber of TPC
cstatnumber of cryostat
Returns
the ID of the channel
See also
PlaneWireToChannel(geo::WireID const&)
Deprecated:
Use the version with geo::WireID

Implements geo::ChannelMapAlg.

Definition at line 86 of file DuneApaChannelMapAlg.h.

90  { return PlaneWireToChannel(geo::WireID(cstat, tpc, plane, wire)); }
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.
ChannelID_t DuneApaChannelMapAlg::PlaneWireToChannel ( geo::WireID const &  wireID) const
overridevirtual

Returns the channel ID a wire is connected to.

Parameters
wireIDID of the wire
Returns
the ID of the channel
See also
PlaneWireToChannel(geo::WireID const&)

Behaviour on an invalid or not present wires is undefined.

Deprecated:
Use the version with geo::WireID

Reimplemented from geo::ChannelMapAlg.

Definition at line 469 of file DuneApaChannelMapAlg.cxx.

469  {
470  Index icry = wirid.Cryostat;
471  Index itpc = wirid.TPC;
472  Index ipla = wirid.Plane;
473  Index ichaRop = wirid.Wire;
474  Index iapa = fPlaneApa[icry][itpc][ipla];
475  Index irop = fPlaneRop[icry][itpc][ipla];
476  Index irpl = fPlaneRopIndex[icry][itpc][ipla];
477  Index nrpl = fPlanesPerRop[icry][iapa][irop];
478  Index ncha = fAnchoredWires[icry][itpc][ipla];
479  if ( nrpl > 1 ) { // Wrapped ROP
480  Index ipla1 = fRopPlane[icry][iapa][irop][0];
481  Index ipla2 = fRopPlane[icry][iapa][irop][1];
482  // Wire is in the back TPC.
483  if ( irpl == 1 ) {
484  ichaRop += fAnchoredWires[icry][itpc][ipla1];
485  ncha += fAnchoredWires[icry][itpc][ipla1];
486  // Wire is in the front TPC.
487  } else {
488  ncha += fAnchoredWires[icry][itpc][ipla2];
489  }
490  }
491  // Channel # in ROP is modulus the # channels in the ROP.
492  Index icha1 = fFirstChannelInThisRop[icry][iapa][irop];
493  Index icha = icha1 + ichaRop%ncha;
494  return icha;
495 }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
ThreeVector< unsigned int > fPlaneRop
ROP for each TPC plane (cry, tpc, pla)
unsigned int Index
ThreeVector< unsigned int > fAnchoredWires
anchored wires for each (cry, tpc, pla)
ThreeVector< unsigned int > fPlaneApa
APA for each TPC plane (cry, tpc, pla)
FourVector< unsigned int > fRopPlane
TPC plane index for each (cry, apa, rop, rpl)
ThreeVector< unsigned int > fPlanesPerRop
TPC planes for each (cry, apa, rop)
ThreeVector< unsigned int > fPlaneRopIndex
Index in ROP for each TPC plane (cry, tpc, pla)
vector< TPCID > DuneApaChannelMapAlg::ROPtoTPCs ( readout::ROPID const &  ropid) const
overridevirtual

Returns a list of ID of TPCs the specified ROP spans.

Parameters
ropidID of the readout plane
Returns
the list of TPC IDs, empty if readout plane ID is invalid

Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour on non-existing readout planes is undefined.

Implements geo::ChannelMapAlg.

Definition at line 695 of file DuneApaChannelMapAlg.cxx.

695  {
696  vector<TPCID> tpcids;
697  vector<PlaneID> plaids = ROPtoWirePlanes(ropid);
698  for ( const PlaneID& plaid : plaids ) {
699  TPCID tpcid = plaid;
700  if ( find(tpcids.begin(), tpcids.end(), tpcid) == tpcids.end() ) tpcids.push_back(tpcid);
701  }
702  return tpcids;
703 }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of wire planes belonging to the specified ROP.
vector< PlaneID > DuneApaChannelMapAlg::ROPtoWirePlanes ( readout::ROPID const &  ropid) const
overridevirtual

Returns a list of ID of wire planes belonging to the specified ROP.

Parameters
ropidID of the readout plane to convert into wire planes
Returns
the list of wire plane IDs, empty if readout plane ID is invalid

Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour on non-existing readout planes is undefined.

Implements geo::ChannelMapAlg.

Definition at line 679 of file DuneApaChannelMapAlg.cxx.

679  {
680  vector<PlaneID> plaids;
681  Index icry = ropid.Cryostat;
682  Index iapa = ropid.TPCset;
683  Index irop = ropid.ROP;
684  Index nrpl = fPlanesPerRop[icry][iapa][irop];
685  for ( Index irpl=0; irpl<nrpl; ++irpl ) {
686  Index itpc = fRopTpc[icry][iapa][irop][irpl];
687  Index ipla = fRopPlane[icry][iapa][irop][irpl];
688  plaids.push_back(PlaneID(icry, itpc, ipla));
689  }
690  return plaids;
691 }
unsigned int Index
FourVector< unsigned int > fRopPlane
TPC plane index for each (cry, apa, rop, rpl)
ThreeVector< unsigned int > fPlanesPerRop
TPC planes for each (cry, apa, rop)
FourVector< unsigned int > fRopTpc
TPC planes for each (cry, apa, rop, rpl)
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
void DuneApaChannelMapAlg::setSorter ( const geo::GeoObjectSorter sort)

Definition at line 55 of file DuneApaChannelMapAlg.cxx.

55  {
56  fSorter = &sort;
57 }
const geo::GeoObjectSorter * fSorter
sorts geo::XXXGeo objects
SigType_t DuneApaChannelMapAlg::SignalTypeForChannelImpl ( raw::ChannelID_t const  channel) const
overridevirtual

Return the signal type of the specified channel.

Parameters
channelID of the channel
Returns
signal type of the channel, or geo::kMysteryType if not known

On any type of error (e.g., invalid or unknown channel ID), geo::kMysteryType is returned.

Implements geo::ChannelMapAlg.

Definition at line 499 of file DuneApaChannelMapAlg.cxx.

499  {
500  Index ncry = fNcryostat;
501  for ( Index icry=0; icry<ncry; ++icry ) {
502  Index napa=fNApa[icry];
503  for ( Index iapa=0; iapa<napa; ++iapa ) {
504  Index nrop = fRopsPerApa[icry][iapa];
505  for ( Index irop=0; irop<nrop; ++irop ) {
506  Index icha1 = fFirstChannelInThisRop[icry][iapa][irop];
507  Index icha2 = fFirstChannelInNextRop[icry][iapa][irop];
508  if ( icha >= icha1 && icha < icha2 ) {
509  if ( irop < 2 ) return geo::kInduction;
510  else if ( irop < 4 ) return geo::kCollection;
511  else return geo::kMysteryType;
512  }
513  }
514  }
515  }
516  return geo::kMysteryType;
517 }
Who knows?
Definition: geo_types.h:147
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisRop
(cry, apa, rop)
unsigned int Index
Signal from induction planes.
Definition: geo_types.h:145
std::vector< unsigned int > fNApa
number of APAs in each cryostat
unsigned int fNcryostat
number of cryostats in the detector
TwoVector< unsigned int > fRopsPerApa
ROPs for each (cry, apa)
Signal from collection planes.
Definition: geo_types.h:146
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextRop
(cry, apa, rop)
geo::GeoObjectSorter const & DuneApaChannelMapAlg::Sorter ( ) const
overridevirtual

Returns the object to sort geometry with.

Implements geo::ChannelMapAlg.

Definition at line 724 of file DuneApaChannelMapAlg.cxx.

724  {
725  if ( fSorter == nullptr )
726  throw cet::exception("DuneApaChannelMapAlg") << __func__ << ": Sorter is missing.";
727  return *fSorter;
728 } // DuneApaChannelMapAlg::Sorter()
const geo::GeoObjectSorter * fSorter
sorts geo::XXXGeo objects
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
vector< TPCID > DuneApaChannelMapAlg::TPCsetToTPCs ( readout::TPCsetID const &  tpcsetid) const
overridevirtual

Returns a list of ID of TPCs belonging to the specified TPC set.

Parameters
tpcsetidID of the TPC set to convert into TPC IDs
Returns
the list of TPCs, empty if TPC set is invalid

Implements geo::ChannelMapAlg.

Definition at line 627 of file DuneApaChannelMapAlg.cxx.

627  {
628  Index icry = apaid.Cryostat;
629  Index iapa = apaid.TPCset;
630  vector<TPCID> tpcids;
631  for ( Index itpc : fApaTpcs[icry][iapa] ) tpcids.push_back(TPCID(icry, itpc));
632  return tpcids;
633 }
ThreeVector< unsigned int > fApaTpcs
TPCs for each APA.
unsigned int Index
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
TPCsetID DuneApaChannelMapAlg::TPCtoTPCset ( geo::TPCID const &  tpcid) const
overridevirtual

Returns the ID of the TPC set the specified TPC belongs to.

Parameters
tpcidID of the TPC
Returns
the ID of the corresponding TPC set

Implements geo::ChannelMapAlg.

Definition at line 617 of file DuneApaChannelMapAlg.cxx.

617  {
618  Index icry = tpcid.Cryostat;
619  Index itpc = tpcid.TPC;
620  Index ipla = 0;
621  Index iapa = fPlaneApa[icry][itpc][ipla];
622  return TPCsetID(icry, iapa);
623 }
unsigned int Index
ThreeVector< unsigned int > fPlaneApa
APA for each TPC plane (cry, tpc, pla)
IDparameter< readout::TPCsetID > TPCsetID
Member type of validated readout::TPCsetID parameter.
void DuneApaChannelMapAlg::Uninitialize ( )
overridevirtual

Deconfiguration: prepare for a following call of Initialize()

Implements geo::ChannelMapAlg.

Reimplemented in geo::ProtoDUNEChannelMapAlg, geo::ProtoDUNEChannelMapAlgv7, and geo::ProtoDUNEChannelMapAlgv8.

Definition at line 317 of file DuneApaChannelMapAlg.cxx.

317  {
318  PlaneInfoMap_t<ChannelID_t>().swap(fFirstChannelInThisPlane);
319  PlaneInfoMap_t<ChannelID_t>().swap(fFirstChannelInNextPlane);
320 }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
void swap(Handle< T > &a, Handle< T > &b)
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
double DuneApaChannelMapAlg::WireCoordinate ( double  YPos,
double  ZPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
overridevirtual

Returns the index of the wire nearest to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
PlaneNonumber of plane
TPCNonumber of TPC
cstatnumber of cryostat
Returns
an index interpolation between the two nearest wires
See also
WireCoordinate(double, double, geo::PlaneID const&)
Deprecated:
Use the version with geo::PlaneID instead

Implements geo::ChannelMapAlg.

Definition at line 414 of file DuneApaChannelMapAlg.cxx.

415  {
416  return WireCoordinate(YPos, ZPos, PlaneID(cstat, TPCNo, PlaneNo));
417 }
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.
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
double DuneApaChannelMapAlg::WireCoordinate ( double  YPos,
double  ZPos,
geo::PlaneID const &  planeID 
) const
overridevirtual

Returns the index of the wire nearest to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
planeIDID of the plane
Returns
an index interpolation between the two nearest wires
See also
NearestWireID()

Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.

The plane is required to be valid and exist in the detector. Otherwise, the behaviour is undefined.

Reimplemented from geo::ChannelMapAlg.

Definition at line 422 of file DuneApaChannelMapAlg.cxx.

422  {
423  const PlaneData_t& PlaneData = AccessElement(fPlaneData, plaid);
424  Index icry = plaid.Cryostat;
425  Index itpc = plaid.TPC;
426  Index ipla = plaid.Plane;
427  // The formula used here is geometric:
428  // distance = delta_y cos(theta_z) + delta_z sin(theta_z)
429  // with a correction for the orientation of the TPC:
430  // odd TPCs have supplementary wire angle (pi-theta_z), changing cosine sign
431  double backsign = (fPlaneRopIndex[icry][itpc][ipla] == 1) ? -1.0 : 1.0;
432  float distance =
433  -(YPos - PlaneData.fFirstWireCenterY) * backsign * fCosOrientation[ipla]
434  + (ZPos - PlaneData.fFirstWireCenterZ) * fSinOrientation[ipla]
435  ;
436  // The sign of this formula is correct if the wire with larger ID is on the
437  // "right" (intuitively, larger z; rigorously, smaller intercept)
438  // than this one.
439  // Of course, we are not always that lucky. fWireSortingInZ fixes our luck.
440  return PlaneData.fWireSortingInZ * distance/fWirePitch[ipla];
441 }
std::vector< double > fCosOrientation
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
unsigned int Index
std::vector< double > fWirePitch
PlaneInfoMap_t< PlaneData_t > fPlaneData
std::vector< double > fSinOrientation
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
ThreeVector< unsigned int > fPlaneRopIndex
Index in ROP for each TPC plane (cry, tpc, pla)
ROPID DuneApaChannelMapAlg::WirePlaneToROP ( geo::PlaneID const &  planeid) const
overridevirtual

Returns the ID of the ROP planeid belongs to, or invalid if none.

Parameters
planeidID of the wire plane
Returns
the ID of the corresponding ROP, or invalid ID when planeid is

Note that this check is performed on the validity of the wire plane ID, that does not necessarily imply that the wire plane specified by the ID actually exists. Check if the wire plane exists with HasPlane(). The behaviour on non-existing wire planes is undefined.

Implements geo::ChannelMapAlg.

Definition at line 668 of file DuneApaChannelMapAlg.cxx.

668  {
669  Index icry = plaid.Cryostat;
670  Index itpc = plaid.TPC;
671  Index ipla = plaid.Plane;
672  Index iapa = fPlaneApa[icry][itpc][ipla];
673  Index irop = fPlaneRop[icry][itpc][ipla];
674  return ROPID(icry, iapa, irop);
675 }
ThreeVector< unsigned int > fPlaneRop
ROP for each TPC plane (cry, tpc, pla)
unsigned int Index
ThreeVector< unsigned int > fPlaneApa
APA for each TPC plane (cry, tpc, pla)
readout::ROPID ROPID

Member Data Documentation

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fAnchoredPlaneRop
protected

ROP holding the anchored wires for (cry, tpc, pla)

Definition at line 271 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fAnchoredWires
protected

anchored wires for each (cry, tpc, pla)

Definition at line 267 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fApaTpcs
protected

TPCs for each APA.

Definition at line 261 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fChannelsPerAPA
protected

number of channels in each APA

Definition at line 249 of file DuneApaChannelMapAlg.h.

TwoVector<unsigned int> geo::DuneApaChannelMapAlg::fChannelsPerApa
protected

channels for each APA

Definition at line 265 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fChannelsPerOpDet
protected

Flag for OpDet channel map.

Definition at line 246 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fChannelsPerRop
protected

channels for each Rop

Definition at line 266 of file DuneApaChannelMapAlg.h.

std::vector< double > geo::DuneApaChannelMapAlg::fCosOrientation
protected

Definition at line 295 of file DuneApaChannelMapAlg.h.

PlaneInfoMap_t<raw::ChannelID_t> geo::DuneApaChannelMapAlg::fFirstChannelInNextRop
protected

(cry, apa, rop)

Definition at line 274 of file DuneApaChannelMapAlg.h.

PlaneInfoMap_t<raw::ChannelID_t> geo::DuneApaChannelMapAlg::fFirstChannelInThisRop
protected

(cry, apa, rop)

Definition at line 273 of file DuneApaChannelMapAlg.h.

std::vector<unsigned int> geo::DuneApaChannelMapAlg::fNApa
protected

number of APAs in each cryostat

Definition at line 255 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fNApaMax
protected

Max # TPCs in any cryostat.

Definition at line 252 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fNchannels
protected

number of channels in the detector

Definition at line 248 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fNcryostat
protected

number of cryostats in the detector

Definition at line 247 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fNRopMax
protected

Max # ROPs in any APA.

Definition at line 253 of file DuneApaChannelMapAlg.h.

std::vector<unsigned int> geo::DuneApaChannelMapAlg::fNTpc
protected

number of TPCs in each cryostat

Definition at line 254 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fNTpcMax
protected

Max # TPCs in any cryostat.

Definition at line 251 of file DuneApaChannelMapAlg.h.

unsigned int geo::DuneApaChannelMapAlg::fOpDetFlag
protected

Definition at line 245 of file DuneApaChannelMapAlg.h.

std::vector< double > geo::DuneApaChannelMapAlg::fOrientation
protected

Definition at line 293 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fPlaneApa
protected

APA for each TPC plane (cry, tpc, pla)

Definition at line 268 of file DuneApaChannelMapAlg.h.

PlaneInfoMap_t<PlaneData_t> geo::DuneApaChannelMapAlg::fPlaneData
protected

Definition at line 290 of file DuneApaChannelMapAlg.h.

std::set<PlaneID> geo::DuneApaChannelMapAlg::fPlaneIDs
protected

vector of the PlaneIDs present in the detector

Definition at line 257 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fPlaneRop
protected

ROP for each TPC plane (cry, tpc, pla)

Definition at line 269 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fPlaneRopIndex
protected

Index in ROP for each TPC plane (cry, tpc, pla)

Definition at line 270 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fPlanesPerRop
protected

TPC planes for each (cry, apa, rop)

Definition at line 262 of file DuneApaChannelMapAlg.h.

TwoVector<unsigned int> geo::DuneApaChannelMapAlg::fPlanesPerTpc
protected

planes for each (cry, tpc)

Definition at line 259 of file DuneApaChannelMapAlg.h.

FourVector<unsigned int> geo::DuneApaChannelMapAlg::fRopPlane
protected

TPC plane index for each (cry, apa, rop, rpl)

Definition at line 264 of file DuneApaChannelMapAlg.h.

TwoVector<unsigned int> geo::DuneApaChannelMapAlg::fRopsPerApa
protected

ROPs for each (cry, apa)

Definition at line 260 of file DuneApaChannelMapAlg.h.

FourVector<unsigned int> geo::DuneApaChannelMapAlg::fRopTpc
protected

TPC planes for each (cry, apa, rop, rpl)

Definition at line 263 of file DuneApaChannelMapAlg.h.

std::vector< double > geo::DuneApaChannelMapAlg::fSinOrientation
protected

Definition at line 294 of file DuneApaChannelMapAlg.h.

const geo::GeoObjectSorter* geo::DuneApaChannelMapAlg::fSorter
protected

sorts geo::XXXGeo objects

Definition at line 275 of file DuneApaChannelMapAlg.h.

raw::ChannelID_t geo::DuneApaChannelMapAlg::fTopChannel
protected

book keeping highest channel #

Definition at line 250 of file DuneApaChannelMapAlg.h.

std::set<View_t> geo::DuneApaChannelMapAlg::fViews
protected

vector of the views present in the detector

Definition at line 256 of file DuneApaChannelMapAlg.h.

std::vector< double > geo::DuneApaChannelMapAlg::fWirePitch
protected

Definition at line 292 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fWiresPerPlane
protected

wires/TPC plane for each (cry, tpc, pla)

Definition at line 258 of file DuneApaChannelMapAlg.h.

ThreeVector<unsigned int> geo::DuneApaChannelMapAlg::fWiresPerRop
protected

wires/ROP for each (cry, apa, rop)

Definition at line 272 of file DuneApaChannelMapAlg.h.


The documentation for this class was generated from the following files: