Public Types | Public Member Functions | Private Attributes | List of all members
geo::ProtoDUNEChannelMapAlgv8 Class Reference

#include <ProtoDUNEChannelMapAlgv8.h>

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

Public Types

typedef unsigned int Index
 

Public Member Functions

 ProtoDUNEChannelMapAlgv8 (const fhicl::ParameterSet &pset)
 
void Initialize (GeometryData_t const &geodata) override
 Geometry initialisation. More...
 
void Uninitialize () override
 Deconfiguration: prepare for a following call of Initialize() More...
 
Index NOpChannels (Index NOpDets) const override
 Returns the number of optical channels contained in some detectors. More...
 
Index MaxOpChannel (Index NOpDets) const override
 Returns the number of optical channels contained in some detectors. More...
 
Index NOpHardwareChannels (Index opDet) const override
 Returns the number of channels in the specified optical detectors. More...
 
Index OpChannel (Index detNum, Index channel) const override
 Returns the channel ID of the specified hardware channel. More...
 
Index OpDetFromOpChannel (Index opChannel) const override
 Returns the optical detector the specified optical channel belongs. More...
 
Index HardwareChannelFromOpChannel (Index opChannel) const override
 Returns the hardware channel number of specified optical channel. More...
 
bool IsValidOpChannel (Index opChannel, Index) const override
 Returns whether the ID identifies a valid optical detector channel. More...
 
Index SSPfromOpDet (Index opDet) const
 
Index FirstSSPChFromOpDet (Index OpDet) const
 
Index OpChannelFromSSP (Index ssp, Index sspch) const
 
void PrintChannelMaps () const
 
- Public Member Functions inherited from geo::DuneApaChannelMapAlg
 DuneApaChannelMapAlg (const fhicl::ParameterSet &pset)
 
void setSorter (const geo::GeoObjectSorter &sort)
 
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...
 
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...
 
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
 
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...
 
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...
 

Private Attributes

Index fMaxOpChannel
 
Index fNOpChannels
 
std::map< Index, IndexfSSP
 
std::map< Index, IndexfSSPChOne
 
std::map< Index, IndexfOpDet
 
std::map< Index, IndexfHWChannel
 

Additional Inherited Members

- Protected Types inherited from geo::DuneApaChannelMapAlg
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 inherited from geo::DuneApaChannelMapAlg
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 inherited from geo::DuneApaChannelMapAlg
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 30 of file ProtoDUNEChannelMapAlgv8.h.

Member Typedef Documentation

Definition at line 34 of file ProtoDUNEChannelMapAlgv8.h.

Constructor & Destructor Documentation

geo::ProtoDUNEChannelMapAlgv8::ProtoDUNEChannelMapAlgv8 ( const fhicl::ParameterSet pset)

Definition at line 37 of file ProtoDUNEChannelMapAlgv8.cxx.

40  {
41  fSorter = new GeoObjectSorterAPA(p);
42  }
const geo::GeoObjectSorter * fSorter
sorts geo::XXXGeo objects
DuneApaChannelMapAlg(const fhicl::ParameterSet &pset)
p
Definition: test.py:223

Member Function Documentation

Index geo::ProtoDUNEChannelMapAlgv8::FirstSSPChFromOpDet ( Index  OpDet) const
Index geo::ProtoDUNEChannelMapAlgv8::HardwareChannelFromOpChannel ( Index  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::DuneApaChannelMapAlg.

Definition at line 253 of file ProtoDUNEChannelMapAlgv8.cxx.

253  {
254  if (!IsValidOpChannel(opChannel, 90)) {
255  mf::LogWarning("ProtoDUNEChannelMapAlgv8") << "Requesting an OpDet number for an uninstrumented channel, " << opChannel;
256  return 99999;
257  }
258  return fHWChannel.at(opChannel);
259  }
std::map< Index, Index > fHWChannel
bool IsValidOpChannel(Index opChannel, Index) const override
Returns whether the ID identifies a valid optical detector channel.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void geo::ProtoDUNEChannelMapAlgv8::Initialize ( GeometryData_t const &  geodata)
overridevirtual

Geometry initialisation.

Reimplemented from geo::DuneApaChannelMapAlg.

Definition at line 47 of file ProtoDUNEChannelMapAlgv8.cxx.

47  {
48  Uninitialize();
49 
50  // Call the base-class version to perform TPC-related actions
52 
53  // Manually entered based on maps from Chris Macias
54  // http://indico.fnal.gov/event/14582/session/30/contribution/30/material/slides/0.pdf
55  //
56  // That gives SSP and channel ranges from OpDet. These offline channels correspond
57  // to the APAs listed. This is for the geometry that includes the arapuca bar with its
58  // 16 optical windows (protodune geometry v8) and updated paddle geo //
59  // USDaS(APA5) MSDaS(APA6) DSDaS(APA4)
60  // 19-28 10-18+29-44 0-9
61  //
62  // USRaS(APA3) MSRaS(APA2) DSRaS(APA1)
63  // 45-60+81-89 71-80 61-70
64  // The difference between v8 and v7 is that the z position within an APA from top to bottom alternates (not the same for IU and MIT bars)
65 
66  // DSDaS -- "normal" pattern
67  fSSP[ 0] = 41; fSSPChOne[ 0] = 0;
68  fSSP[ 5] = 41; fSSPChOne[ 5] = 4;
69  fSSP[ 1] = 41; fSSPChOne[ 1] = 8;
70  fSSP[ 6] = 42; fSSPChOne[ 6] = 0;
71  fSSP[ 2] = 42; fSSPChOne[ 2] = 4;
72  fSSP[ 7] = 42; fSSPChOne[ 7] = 8;
73  fSSP[ 3] = 43; fSSPChOne[ 3] = 0;
74  fSSP[ 8] = 43; fSSPChOne[ 8] = 4;
75  fSSP[ 4] = 43; fSSPChOne[ 4] = 8;
76  fSSP[ 9] = 44; fSSPChOne[ 9] = 0;
77 
78  // MSDaS -- unusual patternfor ARAPUCA
79  fSSP[10] = 61; fSSPChOne[10] = 0;
80  fSSP[15] = 61; fSSPChOne[15] = 4;
81  fSSP[11] = 61; fSSPChOne[11] = 8;
82  fSSP[17] = 62; fSSPChOne[17] = 0;
83  fSSP[12] = 62; fSSPChOne[12] = 4;
84  fSSP[29] = 63; fSSPChOne[29] = 0; // ARAPUCA
85  fSSP[30] = 63; fSSPChOne[30] = 0; // ARAPUCA
86  fSSP[31] = 63; fSSPChOne[31] = 1; // ARAPUCA
87  fSSP[32] = 63; fSSPChOne[32] = 1; // ARAPUCA
88  fSSP[33] = 63; fSSPChOne[33] = 2; // ARAPUCA
89  fSSP[34] = 63; fSSPChOne[34] = 2; // ARAPUCA
90  fSSP[35] = 63; fSSPChOne[35] = 3; // ARAPUCA
91  fSSP[36] = 63; fSSPChOne[36] = 3; // ARAPUCA
92  fSSP[37] = 63; fSSPChOne[37] = 4; // ARAPUCA
93  fSSP[38] = 63; fSSPChOne[38] = 5; // ARAPUCA
94  fSSP[39] = 63; fSSPChOne[39] = 6; // ARAPUCA
95  fSSP[40] = 63; fSSPChOne[40] = 7; // ARAPUCA
96  fSSP[41] = 63; fSSPChOne[41] = 8; // ARAPUCA
97  fSSP[42] = 63; fSSPChOne[42] = 9; // ARAPUCA
98  fSSP[43] = 63; fSSPChOne[43] = 10; // ARAPUCA
99  fSSP[44] = 63; fSSPChOne[44] = 11; // ARAPUCA
100  fSSP[13] = 62; fSSPChOne[13] = 8;
101  fSSP[17] = 64; fSSPChOne[17] = 0;
102  fSSP[14] = 64; fSSPChOne[14] = 4;
103  fSSP[18] = 64; fSSPChOne[18] = 8;
104 
105  // USDaS -- unusual pattern
106  fSSP[19] = 53; fSSPChOne[19] = 0;
107  fSSP[24] = 53; fSSPChOne[24] = 4;
108  fSSP[20] = 53; fSSPChOne[20] = 8;
109  fSSP[25] = 54; fSSPChOne[25] = 0;
110  fSSP[22] = 51; fSSPChOne[22] = 0;
111  fSSP[26] = 54; fSSPChOne[26] = 4;
112  fSSP[24] = 51; fSSPChOne[24] = 4;
113  fSSP[27] = 51; fSSPChOne[27] = 8;
114  fSSP[26] = 54; fSSPChOne[26] = 8;
115  fSSP[28] = 52; fSSPChOne[28] = 0;
116 
117  // DSRaS -- "normal" pattern
118  fSSP[61] = 11; fSSPChOne[61] = 0;
119  fSSP[66] = 11; fSSPChOne[66] = 4;
120  fSSP[62] = 11; fSSPChOne[62] = 8;
121  fSSP[67] = 12; fSSPChOne[67] = 0;
122  fSSP[64] = 12; fSSPChOne[64] = 4;
123  fSSP[68] = 12; fSSPChOne[68] = 8;
124  fSSP[66] = 13; fSSPChOne[66] = 0;
125  fSSP[69] = 13; fSSPChOne[69] = 4;
126  fSSP[68] = 13; fSSPChOne[68] = 8;
127  fSSP[70] = 14; fSSPChOne[70] = 0;
128 
129  // MSRaS -- "normal" pattern
130  fSSP[71] = 21; fSSPChOne[71] = 0;
131  fSSP[76] = 21; fSSPChOne[76] = 4;
132  fSSP[72] = 21; fSSPChOne[72] = 8;
133  fSSP[77] = 22; fSSPChOne[77] = 0;
134  fSSP[73] = 22; fSSPChOne[73] = 4;
135  fSSP[78] = 22; fSSPChOne[78] = 8;
136  fSSP[74] = 23; fSSPChOne[74] = 0;
137  fSSP[79] = 23; fSSPChOne[79] = 4;
138  fSSP[75] = 23; fSSPChOne[75] = 8;
139  fSSP[80] = 24; fSSPChOne[80] = 0;
140 
141  // USRaS -- unusual patternfor ARAPUCA
142  fSSP[81] = 31; fSSPChOne[81] = 0;
143  fSSP[86] = 31; fSSPChOne[86] = 4;
144  fSSP[82] = 31; fSSPChOne[82] = 8;
145  fSSP[45] = 34; fSSPChOne[45] = 0; // ARAPUCA
146  fSSP[46] = 34; fSSPChOne[46] = 0; // ARAPUCA
147  fSSP[47] = 34; fSSPChOne[47] = 1; // ARAPUCA
148  fSSP[48] = 34; fSSPChOne[48] = 1; // ARAPUCA
149  fSSP[49] = 34; fSSPChOne[49] = 2; // ARAPUCA
150  fSSP[50] = 34; fSSPChOne[50] = 2; // ARAPUCA
151  fSSP[51] = 34; fSSPChOne[51] = 3; // ARAPUCA
152  fSSP[52] = 34; fSSPChOne[52] = 3; // ARAPUCA
153  fSSP[53] = 34; fSSPChOne[53] = 4; // ARAPUCA
154  fSSP[54] = 34; fSSPChOne[54] = 5; // ARAPUCA
155  fSSP[55] = 34; fSSPChOne[55] = 6; // ARAPUCA
156  fSSP[56] = 34; fSSPChOne[56] = 7; // ARAPUCA
157  fSSP[57] = 34; fSSPChOne[57] = 8; // ARAPUCA
158  fSSP[58] = 34; fSSPChOne[58] = 9; // ARAPUCA
159  fSSP[59] = 34; fSSPChOne[59] = 10; // ARAPUCA
160  fSSP[60] = 34; fSSPChOne[60] = 11; // ARAPUCA
161  fSSP[83] = 32; fSSPChOne[83] = 0;
162  fSSP[87] = 32; fSSPChOne[87] = 4;
163  fSSP[84] = 32; fSSPChOne[84] = 8;
164  fSSP[88] = 33; fSSPChOne[88] = 0;
165  fSSP[85] = 33; fSSPChOne[85] = 4;
166  fSSP[89] = 33; fSSPChOne[89] = 8;
167 
168  // The above enables OpDet + HW channel -> OpChannel
169  //
170  // Fill the maps below to do the reverse by looping through
171  // all possible OpDet and HW Channel combinations
172 
173  fMaxOpChannel = 0;
174  fNOpChannels = 0;
175 
176  for (Index opDet = 0; opDet < 90; opDet++) {
177  for (Index hwCh = 0; hwCh < NOpHardwareChannels(opDet); hwCh++) {
178 
179  // Find the channel number for this opDet and hw channel
180  Index opChannel = OpChannel(opDet, hwCh);
181 
182  // Count channels and record the maximum possible channel
183  if (opChannel > fMaxOpChannel) fMaxOpChannel = opChannel;
184  fNOpChannels++;
185 
186  // Fill maps for opChannel -> opDet and hwChannel
187  fOpDet[opChannel] = opDet;
188  fHWChannel[opChannel] = hwCh;
189  }
190  }
191 
192 // PrintChannelMaps();
193  }
std::map< Index, Index > fSSPChOne
std::map< Index, Index > fHWChannel
Index NOpHardwareChannels(Index opDet) const override
Returns the number of channels in the specified optical detectors.
unsigned int Index
Index OpChannel(Index detNum, Index channel) const override
Returns the channel ID of the specified hardware channel.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
bool geo::ProtoDUNEChannelMapAlgv8::IsValidOpChannel ( Index  opChannel,
Index  NOpDets 
) const
inlineoverridevirtual

Returns whether the ID identifies a valid optical detector channel.

Parameters
opChannelchannel number
NOpDetsnumber of optical detectors in the detector
Returns
whether opChannel would be a valid channel

The specification of the number of optical channels reflects the logic described in NOpChannel().

Reimplemented from geo::ChannelMapAlg.

Definition at line 49 of file ProtoDUNEChannelMapAlgv8.h.

50  {return fOpDet.count(opChannel); }
Index geo::ProtoDUNEChannelMapAlgv8::MaxOpChannel ( Index  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 the first optical channel ID larger than the last channel ID in a detector with NOpDets optical detectors (with the same logic as NOpChannels()). For example, in a detector with 32 channels with contiguous IDs starting at 0, this function would return 32. If the channels started with ID 1, this function would instead return 33 and if there were a 16 channel gap, so that valid channels are from 0 to 15 and from 32 to 47, this function would return 48.

Reimplemented from geo::ChannelMapAlg.

Definition at line 211 of file ProtoDUNEChannelMapAlgv8.cxx.

211  {
212  return fMaxOpChannel;
213  }
Index geo::ProtoDUNEChannelMapAlgv8::NOpChannels ( Index  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::DuneApaChannelMapAlg.

Definition at line 205 of file ProtoDUNEChannelMapAlgv8.cxx.

205  {
206  return fNOpChannels;
207  }
Index geo::ProtoDUNEChannelMapAlgv8::NOpHardwareChannels ( Index  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::DuneApaChannelMapAlg.

Definition at line 217 of file ProtoDUNEChannelMapAlgv8.cxx.

217  {
218 
219  // ARAPUCAs
220  if ((opDet > 28 && opDet < 61))
221  return 1;
222  else
223  return 4;
224  }
Index geo::ProtoDUNEChannelMapAlgv8::OpChannel ( Index  detNum,
Index  hwchannel 
) 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::DuneApaChannelMapAlg.

Definition at line 228 of file ProtoDUNEChannelMapAlgv8.cxx.

228  {
229 
230  Index sspch = fSSPChOne.at(detNum) + channel;
231  Index ssp = fSSP.at(detNum);
232 
233  // Special handling of ARAPUCA in MSDaS which cross between SSP 62 and 63
234  if (sspch > 12) {
235  mf::LogError("ProtoDUNEChannelMapAlgv8") << "Invalid address: SSP #" << ssp << ", SSP channel" << sspch;
236  }
237 
238  return OpChannelFromSSP(ssp, sspch);
239  }
std::map< Index, Index > fSSPChOne
uint8_t channel
Definition: CRTFragment.hh:201
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Index
Index OpChannelFromSSP(Index ssp, Index sspch) const
Index geo::ProtoDUNEChannelMapAlgv8::OpChannelFromSSP ( Index  ssp,
Index  sspch 
) const

Definition at line 264 of file ProtoDUNEChannelMapAlgv8.cxx.

264  {
265  // Expects SSP #'s of the from NM where N is APA number and M is SSP within the APA
266  // So, IP 504 -> AP # 54
267 
268  // ( ( APA # - 1 ) )*4 + SSP per APA)*12 + SSP channel
269  Index ch = ( (trunc(ssp/10) - 1)*4 + ssp%10 - 1 )*12 + sspch;
270  return ch;
271 
272  }
unsigned int Index
Index geo::ProtoDUNEChannelMapAlgv8::OpDetFromOpChannel ( Index  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::DuneApaChannelMapAlg.

Definition at line 243 of file ProtoDUNEChannelMapAlgv8.cxx.

243  {
244  if (!IsValidOpChannel(opChannel, 90)) {
245  mf::LogWarning("ProtoDUNEChannelMapAlgv8") << "Requesting an OpDet number for an uninstrumented channel, " << opChannel;
246  return 99999;
247  }
248  return fOpDet.at(opChannel);
249  }
bool IsValidOpChannel(Index opChannel, Index) const override
Returns whether the ID identifies a valid optical detector channel.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void geo::ProtoDUNEChannelMapAlgv8::PrintChannelMaps ( ) const

Definition at line 278 of file ProtoDUNEChannelMapAlgv8.cxx.

278  {
279 
280 
281  cout << "---------------------------------------------------------------" << endl;
282  cout << "---------------------------------------------------------------" << endl;
283  cout << "---------------------------------------------------------------" << endl;
284  cout << "---------------------------------------------------------------" << endl;
285  cout << "---------------------------------------------------------------" << endl;
286  cout << "---------------------------------------------------------------" << endl;
287  cout << "---------------------------------------------------------------" << endl;
288  cout << endl << endl;
289 
290  std::vector<Index> ssps = { 11, 12, 13, 14,
291  21, 22, 23, 24,
292  31, 32, 33, 34,
293  41, 42, 43, 44,
294  51, 52, 53, 54,
295  61, 62, 63, 64 };
296 
297  cout << endl << "By SSP" << endl;
298  for (Index ssp : ssps) {
299  for (Index sspch = 0; sspch < 12; sspch++) {
300  cout << setw(2) << ssp << " " << setw(2) << sspch << ": " << setw(3) << OpChannelFromSSP(ssp, sspch) << endl;
301  }
302  }
303 
304  cout << endl << "Non-Beam side" << endl;
305  for (Index opDet = 0; opDet < 45; opDet ++) {
306  cout << setw(2) << opDet << ":";
307  for (Index hwCh = 0; hwCh < NOpHardwareChannels(opDet); hwCh++) {
308  cout << " " << setw(2) << OpChannel(opDet, hwCh);
309  }
310  cout << endl;
311  }
312 
313 
314  cout << endl << "Beam side" << endl;
315  for (Index opDet = 45; opDet < 90; opDet ++) {
316  cout << setw(2) << opDet << ":";
317  for (Index hwCh = 0; hwCh < NOpHardwareChannels(opDet); hwCh++) {
318  cout << " " << setw(2) << OpChannel(opDet, hwCh);
319  }
320  cout << endl;
321  }
322 
323 
324  cout << endl << "Online -> offline" << endl;
325  for (Index opCh = 0; opCh < MaxOpChannel(90); opCh++) {
326  cout << setw(3) << opCh << ": ";
327  if ( IsValidOpChannel(opCh, 90) ) {
328  cout << setw(2) << OpDetFromOpChannel(opCh) << ", "
329  << setw(2) << HardwareChannelFromOpChannel(opCh) << endl;
330  }
331  else {
332  cout << "empty channel" << endl;
333  }
334  }
335 
336  cout << endl << endl;
337  cout << "---------------------------------------------------------------" << endl;
338  cout << "---------------------------------------------------------------" << endl;
339  cout << "---------------------------------------------------------------" << endl;
340  cout << "---------------------------------------------------------------" << endl;
341  cout << "---------------------------------------------------------------" << endl;
342  cout << "---------------------------------------------------------------" << endl;
343  cout << "---------------------------------------------------------------" << endl;
344 
345  }
Index MaxOpChannel(Index NOpDets) const override
Returns the number of optical channels contained in some detectors.
Index NOpHardwareChannels(Index opDet) const override
Returns the number of channels in the specified optical detectors.
Index OpDetFromOpChannel(Index opChannel) const override
Returns the optical detector the specified optical channel belongs.
bool IsValidOpChannel(Index opChannel, Index) const override
Returns whether the ID identifies a valid optical detector channel.
unsigned int Index
Index OpChannel(Index detNum, Index channel) const override
Returns the channel ID of the specified hardware channel.
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
Index HardwareChannelFromOpChannel(Index opChannel) const override
Returns the hardware channel number of specified optical channel.
Index OpChannelFromSSP(Index ssp, Index sspch) const
QTextStream & endl(QTextStream &s)
Index geo::ProtoDUNEChannelMapAlgv8::SSPfromOpDet ( Index  opDet) const
void geo::ProtoDUNEChannelMapAlgv8::Uninitialize ( )
overridevirtual

Deconfiguration: prepare for a following call of Initialize()

Reimplemented from geo::DuneApaChannelMapAlg.

Definition at line 198 of file ProtoDUNEChannelMapAlgv8.cxx.

198  {
199  // Call the base-class version to perform TPC-related actions
201  }
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()

Member Data Documentation

std::map<Index, Index> geo::ProtoDUNEChannelMapAlgv8::fHWChannel
private

Definition at line 65 of file ProtoDUNEChannelMapAlgv8.h.

Index geo::ProtoDUNEChannelMapAlgv8::fMaxOpChannel
private

Definition at line 60 of file ProtoDUNEChannelMapAlgv8.h.

Index geo::ProtoDUNEChannelMapAlgv8::fNOpChannels
private

Definition at line 61 of file ProtoDUNEChannelMapAlgv8.h.

std::map<Index, Index> geo::ProtoDUNEChannelMapAlgv8::fOpDet
private

Definition at line 64 of file ProtoDUNEChannelMapAlgv8.h.

std::map<Index, Index> geo::ProtoDUNEChannelMapAlgv8::fSSP
private

Definition at line 62 of file ProtoDUNEChannelMapAlgv8.h.

std::map<Index, Index> geo::ProtoDUNEChannelMapAlgv8::fSSPChOne
private

Definition at line 63 of file ProtoDUNEChannelMapAlgv8.h.


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