ChannelMapAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ChannelMapAlg.h
3 /// \brief Interface to algorithm class for a specific detector channel mapping
4 ///
5 /// \version $Id: $
6 /// \author brebel@fnal.gov
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef GEO_CHANNELMAPALG_H
9 #define GEO_CHANNELMAPALG_H
10 
11 // Framework libraries
12 #include "cetlib_except/exception.h"
13 
14 // ROOT libraries
15 #include "TVector3.h"
16 
17 // C/C++ standard libraries
18 #include <vector>
19 #include <map>
20 #include <set>
21 
22 #include "Geometry/GeometryCore.h"
23 
24 #include "TVector3.h"
25 
26 namespace gar{
27  namespace geo{
28  namespace seg{
29  /// Exception thrown on invalid wire number (e.g. NearestWireID())
31  public:
33 
35  int bad_chan,
36  int better_chan = -1)
37  : cet::exception (cat)
38  , chan_number (bad_chan)
39  , better_chan_number(better_chan)
40  {}
41 
42  int chan_number = std::numeric_limits<int>::min(); ///< the invalid wire number
43  int better_chan_number = std::numeric_limits<int>::min(); ///< a suggestion for a good wire number
44 
45  }; // class InvalidWireIDError
46 
47 
49 
50  public:
51 
52  virtual ~ChannelMapAlg() = default;
53 
54  virtual void Initialize(gar::geo::GeometryCore &geo) = 0;
55  virtual void Uninitialize() = 0;
56  virtual unsigned int Nchannels() const = 0;
57  virtual unsigned int NearestChannel(float const* xyz) const = 0;
58  // the first channel returned is the closest, but all the nearest neighbors in the ROC are given too.
59  virtual void NearestChannelInfo(float const* xyz, gar::geo::ChanWithNeighbors &cwn) const = 0;
60  virtual unsigned int GapChannelNumber() const = 0;
61  virtual void ChannelToPosition(unsigned int chan, float* xyz) const = 0;
62  virtual float GetIROCInnerRadius() const = 0;
63  virtual float GetIROCOuterRadius() const = 0;
64  virtual float GetOROCInnerRadius() const = 0;
65  virtual float GetOROCOuterRadius() const = 0;
66  virtual float GetOROCPadHeightChangeRadius() const = 0;
67 
68 
69  protected:
70 
71  };
72  }
73  }
74 } // namespace gar
75 
76 #endif // GEO_CHANNELMAPALG_H
std::vector< gar::geo::ChanWithPos > ChanWithNeighbors
Definition: GeometryCore.h:91
std::string string
Definition: nybbler.cc:12
int chan_number
the invalid wire number
Definition: ChannelMapAlg.h:42
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
int better_chan_number
a suggestion for a good wire number
Definition: ChannelMapAlg.h:43
void Initialize(void)
General GArSoft Utilities.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
InvalidChannelIDError(std::string const &cat)
Definition: ChannelMapAlg.h:32
InvalidChannelIDError(std::string const &cat, int bad_chan, int better_chan=-1)
Definition: ChannelMapAlg.h:34
LArSoft geometry interface.
Definition: ChannelGeo.h:16
Exception thrown on invalid wire number (e.g. NearestWireID())
Definition: ChannelMapAlg.h:30
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33