Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
geo::ChannelMap35OptAlg Class Reference

#include <ChannelMap35OptAlg.h>

Inheritance diagram for geo::ChannelMap35OptAlg:
geo::ChannelMapAlg

Classes

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

Public Member Functions

 ChannelMap35OptAlg (fhicl::ParameterSet const &p)
 
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...
 
virtual unsigned int Nchannels (readout::ROPID const &ropid) const override
 Returns the number of channels in the specified ROP. More...
 
View_t View (raw::ChannelID_t const channel) const
 
SigType_t SignalTypeForChannelImpl (raw::ChannelID_t const channel) const override
 Return the signal type of the specified channel. More...
 
std::set< View_t > const & Views () const
 
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 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...
 
virtual double WireCoordinate (double YPos, double ZPos, geo::PlaneID const &planeID) const override
 Returns the index of the wire nearest to the specified position. 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...
 

Private Member Functions

template<typename T >
T const & AccessAPAelement (PlaneInfoMap_t< T > const &data, geo::PlaneID planeid) const
 
unsigned int WiresPerPlane (geo::PlaneID const &planeid) const
 
unsigned int AnchoredWires (geo::PlaneID const &planeid) const
 

Private Attributes

unsigned int fNcryostat
 number of cryostats in the detector More...
 
unsigned int fNchannels
 number of channels in the detector More...
 
raw::ChannelID_t fTopChannel
 book keeping highest channel # More...
 
std::vector< unsigned int > fNTPC
 number of TPCs 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...
 
unsigned int fPlanesPerAPA
 
raw::ChannelID_t fChannelsPerAPA
 
PlaneInfoMap_t< unsigned int > nAnchoredWires
 
PlaneInfoMap_t< unsigned int > fWiresPerPlane
 
geo::GeoObjectSorter35 fSorter
 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
 

Additional Inherited Members

- 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::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::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 36 of file ChannelMap35OptAlg.h.

Constructor & Destructor Documentation

geo::ChannelMap35OptAlg::ChannelMap35OptAlg ( fhicl::ParameterSet const &  p)

Definition at line 36 of file ChannelMap35OptAlg.cxx.

38  {
39  }
p
Definition: test.py:223
geo::GeoObjectSorter35 fSorter
sorts geo::XXXGeo objects

Member Function Documentation

template<typename T >
T const& geo::ChannelMap35OptAlg::AccessAPAelement ( PlaneInfoMap_t< T > const &  data,
geo::PlaneID  planeid 
) const
inlineprivate

Definition at line 311 of file ChannelMap35OptAlg.h.

312  { planeid.TPC /= 2; return AccessElement(data, planeid); }
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
unsigned int geo::ChannelMap35OptAlg::AnchoredWires ( geo::PlaneID const &  planeid) const
inlineprivate

Definition at line 315 of file ChannelMap35OptAlg.h.

316  { return AccessAPAelement(nAnchoredWires, planeid); }
PlaneInfoMap_t< unsigned int > nAnchoredWires
T const & AccessAPAelement(PlaneInfoMap_t< T > const &data, geo::PlaneID planeid) const
readout::ROPID geo::ChannelMap35OptAlg::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 592 of file ChannelMap35OptAlg.cxx.

593  {
594  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
595  } // ChannelMap35OptAlg::ROPtoTPCs()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< geo::WireID > geo::ChannelMap35OptAlg::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 220 of file ChannelMap35OptAlg.cxx.

221  {
222 
223  // first check if this channel ID is legal
224  if(channel >= fNchannels )
225  throw cet::exception("Geometry") << "ILLEGAL CHANNEL ID for channel " << channel << "\n";
226 
227  std::vector< WireID > AllSegments;
228 
229  static unsigned int cstat;
230  static unsigned int tpc;
231  static unsigned int plane;
232  static unsigned int wireThisPlane;
233  static unsigned int NextPlane;
234  static unsigned int ThisPlane;
235 
236  for(unsigned int csloop = 0; csloop != fNcryostat; ++csloop){
237 
238  bool breakVariable = false;
239 
240  for(unsigned int apaloop = 0; apaloop != fNTPC[csloop]/2; ++apaloop){
241  for(unsigned int planeloop = 0; planeloop != fPlanesPerAPA; ++planeloop){
242 
243  NextPlane = fFirstChannelInNextPlane[csloop][apaloop][planeloop];
244  ThisPlane = fFirstChannelInThisPlane[csloop][apaloop][planeloop];
245 
246  if(channel < NextPlane){
247 
248  cstat = csloop;
249  tpc = 2*apaloop;
250  plane = planeloop;
251  wireThisPlane = channel - ThisPlane;
252 
253  breakVariable = true;
254  break;
255  }// end if break
256  if(breakVariable) break;
257 
258  }// end plane loop
259  if(breakVariable) break;
260 
261  }// end apa loop
262  if(breakVariable) break;
263 
264  }// end cryostat loop
265 
266 
267  int WrapDirection = 1; // go from tpc to (tpc+1) or tpc to (tpc-1)
268 
269  // find the lowest wire
270  raw::ChannelID_t ChannelGroup = std::floor( wireThisPlane/nAnchoredWires[cstat][tpc/2][plane] );
271  unsigned int bottomwire = wireThisPlane-ChannelGroup*nAnchoredWires[cstat][tpc/2][plane];
272 
273  if(ChannelGroup%2==1){
274  // start in the other TPC
275  tpc += 1;
276  WrapDirection = -1;
277  }
278 
279  for(unsigned int WireSegmentCount = 0; WireSegmentCount != 50; ++WireSegmentCount){
280 
281  tpc += WrapDirection*(WireSegmentCount%2);
282 
283  geo::WireID CodeWire(cstat, tpc, plane, bottomwire + WireSegmentCount*nAnchoredWires[cstat][std::floor(tpc/2)][plane]);
284 
285  AllSegments.push_back(CodeWire);
286 
287  // reset the tcp variable so it doesnt "accumulate value"
288  tpc -= WrapDirection*(WireSegmentCount%2);
289 
290  if( bottomwire + (WireSegmentCount+1)*nAnchoredWires[cstat][std::floor(tpc/2)][plane] >
291  fWiresPerPlane[cstat][std::floor(tpc/2)][plane]-1) break;
292 
293  } //end WireSegmentCount loop
294 
295 
296  return AllSegments;
297  }
PlaneInfoMap_t< unsigned int > nAnchoredWires
uint8_t channel
Definition: CRTFragment.hh:201
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
unsigned int fNcryostat
number of cryostats in the detector
unsigned int fNchannels
number of channels in the detector
PlaneInfoMap_t< unsigned int > fWiresPerPlane
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
raw::ChannelID_t geo::ChannelMap35OptAlg::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.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 600 of file ChannelMap35OptAlg.cxx.

601  {
602  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
603  } // ChannelMap35OptAlg::FirstChannelInROP()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::TPCID geo::ChannelMap35OptAlg::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 540 of file ChannelMap35OptAlg.cxx.

541  {
542  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
543  } // ChannelMap35OptAlg::FirstTPCinTPCset()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::PlaneID geo::ChannelMap35OptAlg::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.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 608 of file ChannelMap35OptAlg.cxx.

609  {
610  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
611  } // ChannelMap35OptAlg::FirstWirePlaneInROP()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMap35OptAlg::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.

Definition at line 494 of file ChannelMap35OptAlg.cxx.

495  {
496  unsigned int channel = opChannel % 12;
497  return channel;
498  }
uint8_t channel
Definition: CRTFragment.hh:201
bool geo::ChannelMap35OptAlg::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 561 of file ChannelMap35OptAlg.cxx.

561  {
562  return ropid.ROP < NROPs(ropid);
563  } // ChannelMap35OptAlg::HasROP()
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
bool geo::ChannelMap35OptAlg::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 516 of file ChannelMap35OptAlg.cxx.

517  {
518  return tpcsetid.TPCset < NTPCsets(tpcsetid);
519  } // ChannelMap35OptAlg::HasTPCset()
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
void geo::ChannelMap35OptAlg::Initialize ( GeometryData_t const &  geodata)
overridevirtual

Geometry initialisation.

Implements geo::ChannelMapAlg.

Definition at line 42 of file ChannelMap35OptAlg.cxx.

43  {
44  // start over:
45  Uninitialize();
46 
47  std::vector<geo::CryostatGeo> const& cgeo = geodata.cryostats;
48 
49  fNcryostat = cgeo.size();
50 
51  mf::LogInfo("ChannelMap35OptAlg") << "Initializing...";
52 
53  fNTPC.resize(fNcryostat);
54  fWiresPerPlane.resize(fNcryostat);
57  nAnchoredWires.resize(fNcryostat);
58  fViews.clear();
59  fPlaneIDs.clear();
60  fPlanesPerAPA = cgeo[0].TPC(0).Nplanes();
61 
62  fTopChannel = 0;
63 
64  // Size some vectors and initialize the FirstChannel vectors.
65  for(unsigned int cs = 0; cs != fNcryostat; ++cs){
66 
67  fNTPC[cs] = cgeo[cs].NTPC();
68 
69  nAnchoredWires[cs].resize(fNTPC[cs]);
70  fWiresPerPlane[cs].resize(fNTPC[cs]);
71  fFirstChannelInThisPlane[cs].resize(fNTPC[cs]/2);
72  fFirstChannelInNextPlane[cs].resize(fNTPC[cs]/2);
73 
74  for(unsigned int apa = 0; apa != fNTPC[cs]/2; ++apa){
75 
80 
81  }// end loop over apas
82  }// end cryostats
83 
84  // Find the number of wires anchored to the frame
85  for(unsigned int c = 0; c != fNcryostat; ++c){
86  for(unsigned int a = 0; a != fNTPC[c]/2; ++a){
87  for(unsigned int p = 0; p != fPlanesPerAPA; ++p){
88 
89  unsigned int t = 2*a;
90  fWiresPerPlane[c][a][p] = cgeo[c].TPC(t).Plane(p).Nwires();
91  double xyz[3] = {0.};
92  double xyz_next[3] = {0.};
93 
94  fViews.emplace(cgeo[c].TPC(t).Plane(p).View());
95 
96  for(unsigned int w = 0; w != fWiresPerPlane[c][a][p]; ++w){
97 
98  // for vertical planes
99  if(cgeo[c].TPC(t).Plane(p).View() == geo::kZ) {
100  nAnchoredWires[c][a][p] = fWiresPerPlane[c][a][p];
101  break;
102  }
103 
104  cgeo[c].TPC(t).Plane(p).Wire(w).GetCenter(xyz);
105  cgeo[c].TPC(t).Plane(p).Wire(w+1).GetCenter(xyz_next);
106 
107  if(xyz[2]==xyz_next[2]){
108  nAnchoredWires[c][a][p] = w; // w-1(for last)+1(for index) = w
109  break;
110  }
111 
112  }
113  }
114  }
115  }
116 
117  raw::ChannelID_t CurrentChannel = 0;
118 
119  for(unsigned int cs = 0; cs != fNcryostat; ++cs){
120  for(unsigned int apa = 0; apa != fNTPC[cs]/2; ++apa){
121  for(unsigned int p = 0; p != fPlanesPerAPA; ++p){
122 
123  fFirstChannelInThisPlane[cs][apa][p] = CurrentChannel;
124  CurrentChannel = CurrentChannel + 2*nAnchoredWires[cs][apa][p];
125  fFirstChannelInNextPlane[cs][apa][p] = CurrentChannel;
126 
127  }// end plane loop
128  }// end apa loop
129  }// end cs
130 
131 
132  // Save the number of channels
133  fNchannels = CurrentChannel;
134 
135  // Save the number of channels
137 
138 
139  fWirePitch.resize(fPlanesPerAPA);
140  fOrientation.resize(fPlanesPerAPA);
143 
144 
145  //save data into fFirstWireCenterY, fFirstWireCenterZ and fWireSortingInZ
146  fPlaneData.resize(fNcryostat);
147  for (unsigned int cs=0; cs<fNcryostat; cs++){
148  fPlaneData[cs].resize(fNTPC[cs]);
149  for (unsigned int tpc=0; tpc<fNTPC[cs]; tpc++){
150  fPlaneData[cs][tpc].resize(fPlanesPerAPA);
151  for (unsigned int plane=0; plane<fPlanesPerAPA; plane++){
152  PlaneData_t& PlaneData = fPlaneData[cs][tpc][plane];
153  fPlaneIDs.emplace(cs, tpc, plane);
154  double xyz[3]={0.0, 0.0, 0.0};
155  const geo::PlaneGeo& thePlane = cgeo[cs].TPC(tpc).Plane(plane);
156  thePlane.Wire(0).GetCenter(xyz);
157  PlaneData.fFirstWireCenterY = xyz[1];
158  PlaneData.fFirstWireCenterZ = xyz[2];
159  // we are interested in the ordering of wire numbers: we find that a
160  // point is N wires left of a wire W: is that wire W + N or W - N?
161  // In fact, for TPC #0 it is W + N for V and Z planes, W - N for U
162  // plane; for TPC #0 it is W + N for V and Z planes, W - N for U
163  PlaneData.fWireSortingInZ = thePlane.WireIDincreasesWithZ()? +1.: -1.;
164 
165  // find boundaries of the APA frame for this plane by looking at endpoints of wires
166 
167  double endpoint[3];
168  thePlane.Wire(0).GetStart(endpoint);
169  PlaneData.fYmax = endpoint[1];
170  PlaneData.fYmin = endpoint[1];
171  PlaneData.fZmax = endpoint[2];
172  PlaneData.fZmin = endpoint[2];
173  unsigned int nwires = thePlane.Nwires();
174  for (unsigned int iwire=0;iwire<nwires;iwire++){
175  thePlane.Wire(iwire).GetStart(endpoint);
176  PlaneData.fYmax = std::max(PlaneData.fYmax,endpoint[1]);
177  PlaneData.fYmin = std::min(PlaneData.fYmin,endpoint[1]);
178  PlaneData.fZmax = std::max(PlaneData.fZmax,endpoint[2]);
179  PlaneData.fZmin = std::min(PlaneData.fZmin,endpoint[2]);
180  thePlane.Wire(iwire).GetEnd(endpoint);
181  PlaneData.fYmax = std::max(PlaneData.fYmax,endpoint[1]);
182  PlaneData.fYmin = std::min(PlaneData.fYmin,endpoint[1]);
183  PlaneData.fZmax = std::max(PlaneData.fZmax,endpoint[2]);
184  PlaneData.fZmin = std::min(PlaneData.fZmin,endpoint[2]);
185  } // loop on wire
186 
187  } // for plane
188  } // for TPC
189  } // for cryostat
190 
191  //initialize fWirePitch and fOrientation
192  for (unsigned int plane=0; plane<fPlanesPerAPA; plane++){
193  fWirePitch[plane]=cgeo[0].TPC(0).WirePitch(plane);
194  fOrientation[plane]=cgeo[0].TPC(0).Plane(plane).Wire(0).ThetaZ();
195  fSinOrientation[plane] = sin(fOrientation[plane]);
196  fCosOrientation[plane] = cos(fOrientation[plane]);
197 
198  } // for
199 
200 
201  mf::LogVerbatim("ChannelMap35OptAlg") << "fNchannels = " << fNchannels ;
202  mf::LogVerbatim("ChannelMap35OptAlg") << "U channels per APA = " << 2*nAnchoredWires[0][0][0] ;
203  mf::LogVerbatim("ChannelMap35OptAlg") << "V channels per APA = " << 2*nAnchoredWires[0][0][1] ;
204  mf::LogVerbatim("ChannelMap35OptAlg") << "Z channels per APA side = " << nAnchoredWires[0][0][2] ;
205 
206  return;
207 
208  }
void GetStart(double *xyz) const
Definition: WireGeo.h:157
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
raw::ChannelID_t fChannelsPerAPA
PlaneInfoMap_t< unsigned int > nAnchoredWires
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Planes which measure Z direction.
Definition: geo_types.h:132
std::set< View_t > fViews
vector of the views present in the detector
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
raw::ChannelID_t fTopChannel
book keeping highest channel #
const double a
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
p
Definition: test.py:223
View_t View(raw::ChannelID_t const channel) const
static int max(int a, int b)
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
PlaneInfoMap_t< PlaneData_t > fPlaneData
unsigned int fNcryostat
number of cryostats in the detector
unsigned int fNchannels
number of channels in the detector
PlaneInfoMap_t< unsigned int > fWiresPerPlane
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
std::vector< double > fOrientation
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
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
std::vector< double > fWirePitch
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
const char * cs
recob::tracking::Plane Plane
Definition: TrackState.h:17
std::vector< double > fSinOrientation
std::vector< double > fCosOrientation
unsigned int geo::ChannelMap35OptAlg::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 555 of file ChannelMap35OptAlg.cxx.

555  {
556  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
557  } // ChannelMap35OptAlg::MaxROPs()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMap35OptAlg::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 509 of file ChannelMap35OptAlg.cxx.

510  {
511  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
512  } // ChannelMap35OptAlg::MaxTPCsets()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMap35OptAlg::Nchannels ( ) const
overridevirtual

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

Implements geo::ChannelMapAlg.

Definition at line 301 of file ChannelMap35OptAlg.cxx.

302  {
303  return fNchannels;
304  }
unsigned int fNchannels
number of channels in the detector
unsigned int geo::ChannelMap35OptAlg::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 309 of file ChannelMap35OptAlg.cxx.

310  {
311  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
312  } // ChannelMap35OptAlg::Nchannels(ROPID)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
virtual WireID geo::ChannelMap35OptAlg::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 68 of file ChannelMap35OptAlg.h.

72  { 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 geo::ChannelMap35OptAlg::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 351 of file ChannelMap35OptAlg.cxx.

352  {
353 
354  // cap the position to be within the boundaries of the wire endpoints.
355  // This simulates charge drifting in from outside of the wire frames inwards towards
356  // the first and last collection wires on the side, and towards the right endpoints
357 
358  const PlaneData_t& PlaneData = AccessElement(fPlaneData, planeid);
359  double ycap = std::max(PlaneData.fYmin,std::min(PlaneData.fYmax,xyz.Y()));
360  double zcap = std::max(PlaneData.fZmin,std::min(PlaneData.fZmax,xyz.Z()));
361 
362  // add 0.5 to have the correct rounding
363  int NearestWireNumber
364  = int (0.5 + WireCoordinate(ycap, zcap, planeid));
365 
366  // If we are outside of the wireplane range, throw an exception
367  // (this response maintains consistency with the previous
368  // implementation based on geometry lookup)
369  if(NearestWireNumber < 0 ||
370  NearestWireNumber >= (int) WiresPerPlane(planeid))
371  {
372  const int wireNumber = NearestWireNumber; // save for the output
373 
374  if(wireNumber < 0 ) NearestWireNumber = 0;
375  else NearestWireNumber = WiresPerPlane(planeid) - 1;
376 
377  /*
378  // comment in the following statement to throw an exception instead
379  throw InvalidWireIDError("Geometry", wireNumber, NearestWireNumber)
380  << "ChannelMap35OptAlg::NearestWireID(): can't Find Nearest Wire for position ("
381  << xyz.X() << "," << xyz.Y() << "," << xyz.Z() << ")"
382  << " approx wire number # " << wireNumber
383  << " (capped from " << NearestWireNumber << ")\n";
384  */
385  } // if invalid wire
386 
387  return { planeid, (geo::WireID::WireID_t) NearestWireNumber };
388  } // ChannelMap35OptAlg::NearestWireID()
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
static int max(int a, int b)
virtual double WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the index of the wire nearest to the specified position.
PlaneInfoMap_t< PlaneData_t > fPlaneData
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:561
unsigned int WiresPerPlane(geo::PlaneID const &planeid) const
unsigned int geo::ChannelMap35OptAlg::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.

Definition at line 459 of file ChannelMap35OptAlg.cxx.

460  {
461  return 12*NOpDets;
462  }
unsigned int geo::ChannelMap35OptAlg::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.

Definition at line 465 of file ChannelMap35OptAlg.cxx.

466  {
467  // CSU 3-sipm design
468  if (opDet == 0 || opDet == 4 || opDet == 6)
469  return 8;
470 
471  // LSU 2-sipm design
472  if (opDet == 2)
473  return 2;
474 
475  // IU 12-sipm design
476  return 12;
477  }
unsigned int geo::ChannelMap35OptAlg::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.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 548 of file ChannelMap35OptAlg.cxx.

549  {
550  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
551  } // ChannelMap35OptAlg::NROPs()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMap35OptAlg::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
Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 502 of file ChannelMap35OptAlg.cxx.

503  {
504  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
505  } // ChannelMap35OptAlg::NTPCsets()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMap35OptAlg::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.

Definition at line 480 of file ChannelMap35OptAlg.cxx.

481  {
482  unsigned int uniqueChannel = (detNum * 12) + channel;
483  return uniqueChannel;
484  }
uint8_t channel
Definition: CRTFragment.hh:201
unsigned int geo::ChannelMap35OptAlg::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.

Definition at line 487 of file ChannelMap35OptAlg.cxx.

488  {
489  unsigned int detectorNum = (unsigned int) opChannel / 12;
490  return detectorNum;
491  }
std::set< PlaneID > const & geo::ChannelMap35OptAlg::PlaneIDs ( ) const
overridevirtual

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

Implements geo::ChannelMapAlg.

Definition at line 453 of file ChannelMap35OptAlg.cxx.

454  {
455  return fPlaneIDs;
456  }
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
virtual raw::ChannelID_t geo::ChannelMap35OptAlg::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 77 of file ChannelMap35OptAlg.h.

81  { 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.
raw::ChannelID_t geo::ChannelMap35OptAlg::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 392 of file ChannelMap35OptAlg.cxx.

393  {
394 
395  unsigned int OtherSideWires = 0;
396 
398 
399  // get number of wires starting on the first side of the APA if starting
400  // on the other side TPC.
401  if (wireid.TPC % 2 == 1) OtherSideWires += AnchoredWires(wireid);
402 
403  // Lastly, account for the fact that channel number while moving up wire number in one
404  // plane resets after 2 times the number of wires anchored -- one for each APA side.
405  // At the same time, OtherSideWires accounts for the fact that if a channel starts on
406  // the other side, it is offset by the number of wires on the first side.
407  Channel += (OtherSideWires + wireid.Wire)%(2*AnchoredWires(wireid));
408 
409  return Channel;
410 
411  }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
unsigned int AnchoredWires(geo::PlaneID const &planeid) const
T const & AccessAPAelement(PlaneInfoMap_t< T > const &data, geo::PlaneID planeid) const
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
std::vector< geo::TPCID > geo::ChannelMap35OptAlg::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.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 584 of file ChannelMap35OptAlg.cxx.

585  {
586  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
587  } // ChannelMap35OptAlg::ROPtoTPCs()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< geo::PlaneID > geo::ChannelMap35OptAlg::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.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 576 of file ChannelMap35OptAlg.cxx.

577  {
578  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
579  } // ChannelMap35OptAlg::ROPtoWirePlanes()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
SigType_t geo::ChannelMap35OptAlg::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 415 of file ChannelMap35OptAlg.cxx.

416  {
418  SigType_t sigt = kInduction;
419 
420  if( chan < fFirstChannelInThisPlane[0][0][2] ){ sigt = kInduction; }
421  else if( (chan >= fFirstChannelInThisPlane[0][0][2]) &&
422  (chan < fFirstChannelInNextPlane[0][0][2]) ){ sigt = kCollection; }
423  else{ mf::LogWarning("BadChannelSignalType") << "Channel " << channel
424  << " (" << chan << ") not given signal type." << std::endl; }
425 
426  return sigt;
427  }
raw::ChannelID_t fChannelsPerAPA
uint8_t channel
Definition: CRTFragment.hh:201
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
Signal from induction planes.
Definition: geo_types.h:145
enum geo::_plane_sigtype SigType_t
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
QTextStream & endl(QTextStream &s)
Signal from collection planes.
Definition: geo_types.h:146
virtual geo::GeoObjectSorter const& geo::ChannelMap35OptAlg::Sorter ( ) const
inlineoverridevirtual

Returns the object to sort geometry with.

Implements geo::ChannelMapAlg.

Definition at line 262 of file ChannelMap35OptAlg.h.

263  { return fSorter; }
geo::GeoObjectSorter35 fSorter
sorts geo::XXXGeo objects
std::vector< geo::TPCID > geo::ChannelMap35OptAlg::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

Note that the check is performed on the validity of the TPC set ID, that does not necessarily imply that the TPC set specified by the ID actually exists. Check the existence of the TPC set first (HasTPCset()). Behaviour on valid, non-existent TPC set IDs is undefined.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 532 of file ChannelMap35OptAlg.cxx.

533  {
534  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
535  } // ChannelMap35OptAlg::TPCsetToTPCs()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
readout::TPCsetID geo::ChannelMap35OptAlg::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

Note that the check is performed on the validity of the TPC set ID, that does not necessarily imply that the TPC set specified by the ID actually exists. Check the existence of the TPC set first (HasTPCset()). Behaviour on valid, non-existent TPC set IDs is undefined.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 524 of file ChannelMap35OptAlg.cxx.

525  {
526  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
527  } // ChannelMap35OptAlg::TPCtoTPCset()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void geo::ChannelMap35OptAlg::Uninitialize ( )
overridevirtual

Deconfiguration: prepare for a following call of Initialize()

Implements geo::ChannelMapAlg.

Definition at line 211 of file ChannelMap35OptAlg.cxx.

212  {
213 
214  PlaneInfoMap_t<raw::ChannelID_t>().swap(fFirstChannelInThisPlane);
215  PlaneInfoMap_t<raw::ChannelID_t>().swap(fFirstChannelInNextPlane);
216 
217  }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
void swap(Handle< T > &a, Handle< T > &b)
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
View_t geo::ChannelMap35OptAlg::View ( raw::ChannelID_t const  channel) const

Definition at line 430 of file ChannelMap35OptAlg.cxx.

431  {
433  View_t view = geo::kU;
434 
435  if( chan < fFirstChannelInNextPlane[0][0][0] ){ view = geo::kU; }
436  else if( (chan >= fFirstChannelInThisPlane[0][0][1]) &&
437  (chan < fFirstChannelInNextPlane[0][0][1]) ){ view = geo::kV; }
438  else if( (chan >= fFirstChannelInThisPlane[0][0][2]) &&
439  (chan < fFirstChannelInNextPlane[0][0][2]) ){ view = geo::kZ; }
440  else{ mf::LogWarning("BadChannelViewType") << "Channel " << channel
441  << " (" << chan << ") not given view type.";}
442 
443  return view;
444  }
raw::ChannelID_t fChannelsPerAPA
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:130
Planes which measure Z direction.
Definition: geo_types.h:132
uint8_t channel
Definition: CRTFragment.hh:201
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
Planes which measure U.
Definition: geo_types.h:129
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
std::set< View_t > const & geo::ChannelMap35OptAlg::Views ( ) const

Definition at line 447 of file ChannelMap35OptAlg.cxx.

448  {
449  return fViews;
450  }
std::set< View_t > fViews
vector of the views present in the detector
virtual double geo::ChannelMap35OptAlg::WireCoordinate ( double  YPos,
double  ZPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
inlineoverridevirtual

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 56 of file ChannelMap35OptAlg.h.

61  { return WireCoordinate(YPos, ZPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
virtual double WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the index of the wire nearest to the specified position.
double geo::ChannelMap35OptAlg::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 317 of file ChannelMap35OptAlg.cxx.

318  {
319  // Returns the wire number corresponding to a (Y,Z) position in the plane
320  // with float precision.
321  // Core code ripped from original NearestWireID() implementation
322 
323  const PlaneData_t& PlaneData = AccessElement(fPlaneData, planeid);
324 
325  //get the orientation angle of a given plane and calculate the distance between first wire
326  //and a point projected in the plane
327 // const double rotate = (planeid.TPC % 2 == 1)? -1.: +1.;
328 
329  // the formula used here is geometric:
330  // distance = delta_y cos(theta_z) + delta_z sin(theta_z)
331  // with a correction for the orientation of the TPC:
332  // odd TPCs have supplementary wire angle (pi-theta_z), changing cosine sign
333 
334  const bool bSuppl = (planeid.TPC % 2) == 1;
335  float distance =
336  -(YPos - PlaneData.fFirstWireCenterY) * (bSuppl? -1.: +1.) * fCosOrientation[planeid.Plane]
337  +(ZPos - PlaneData.fFirstWireCenterZ) * fSinOrientation[planeid.Plane]
338  ;
339 
340  // The sign of this formula is correct if the wire with larger ID is on the
341  // "right" (intuitively, larger z; rigorously, smaller intercept)
342  // than this one.
343  // Of course, we are not always that lucky. fWireSortingInZ fixes our luck.
344 
345  return PlaneData.fWireSortingInZ * distance/fWirePitch[planeid.Plane];
346  } // ChannelMap35OptAlg::WireCoordinate()
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
PlaneInfoMap_t< PlaneData_t > fPlaneData
std::vector< double > fWirePitch
std::vector< double > fSinOrientation
std::vector< double > fCosOrientation
readout::ROPID geo::ChannelMap35OptAlg::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.

Todo:
to be completed

Implements geo::ChannelMapAlg.

Definition at line 568 of file ChannelMap35OptAlg.cxx.

569  {
570  throw cet::exception("ChannelMap35OptAlg") << __func__ << " not implemented!\n";
571  } // ChannelMap35OptAlg::WirePlaneToROP()
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMap35OptAlg::WiresPerPlane ( geo::PlaneID const &  planeid) const
inlineprivate

Definition at line 313 of file ChannelMap35OptAlg.h.

314  { return AccessAPAelement(fWiresPerPlane, planeid); }
PlaneInfoMap_t< unsigned int > fWiresPerPlane
T const & AccessAPAelement(PlaneInfoMap_t< T > const &data, geo::PlaneID planeid) const

Member Data Documentation

raw::ChannelID_t geo::ChannelMap35OptAlg::fChannelsPerAPA
private

Definition at line 282 of file ChannelMap35OptAlg.h.

std::vector< double > geo::ChannelMap35OptAlg::fCosOrientation
private

Definition at line 307 of file ChannelMap35OptAlg.h.

unsigned int geo::ChannelMap35OptAlg::fNchannels
private

number of channels in the detector

Definition at line 275 of file ChannelMap35OptAlg.h.

unsigned int geo::ChannelMap35OptAlg::fNcryostat
private

number of cryostats in the detector

Definition at line 274 of file ChannelMap35OptAlg.h.

std::vector<unsigned int> geo::ChannelMap35OptAlg::fNTPC
private

number of TPCs in each cryostat

Definition at line 277 of file ChannelMap35OptAlg.h.

std::vector< double > geo::ChannelMap35OptAlg::fOrientation
private

Definition at line 305 of file ChannelMap35OptAlg.h.

PlaneInfoMap_t<PlaneData_t> geo::ChannelMap35OptAlg::fPlaneData
private

Definition at line 302 of file ChannelMap35OptAlg.h.

std::set<PlaneID> geo::ChannelMap35OptAlg::fPlaneIDs
private

vector of the PlaneIDs present in the detector

Definition at line 279 of file ChannelMap35OptAlg.h.

unsigned int geo::ChannelMap35OptAlg::fPlanesPerAPA
private

Definition at line 281 of file ChannelMap35OptAlg.h.

std::vector< double > geo::ChannelMap35OptAlg::fSinOrientation
private

Definition at line 306 of file ChannelMap35OptAlg.h.

geo::GeoObjectSorter35 geo::ChannelMap35OptAlg::fSorter
private

sorts geo::XXXGeo objects

Definition at line 287 of file ChannelMap35OptAlg.h.

raw::ChannelID_t geo::ChannelMap35OptAlg::fTopChannel
private

book keeping highest channel #

Definition at line 276 of file ChannelMap35OptAlg.h.

std::set<View_t> geo::ChannelMap35OptAlg::fViews
private

vector of the views present in the detector

Definition at line 278 of file ChannelMap35OptAlg.h.

std::vector< double > geo::ChannelMap35OptAlg::fWirePitch
private

Definition at line 304 of file ChannelMap35OptAlg.h.

PlaneInfoMap_t<unsigned int> geo::ChannelMap35OptAlg::fWiresPerPlane
private

The number of wires in this plane in the heirachy

Definition at line 285 of file ChannelMap35OptAlg.h.

PlaneInfoMap_t<unsigned int> geo::ChannelMap35OptAlg::nAnchoredWires
private

Definition at line 283 of file ChannelMap35OptAlg.h.


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