LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
AuxDetChannelMapAlg.h
Go to the documentation of this file.
1 #ifndef GEO_AUXDETCHANNELMAPALG_H
9 #define GEO_AUXDETCHANNELMAPALG_H
10 
11 // LArSoft libraries
12 
13 // Framework libraries
14 #include "cetlib_except/exception.h"
15 
16 // ROOT libraries
17 #include "TVector3.h"
18 // ???? AuxDetGeometryData_t
19 // C/C++ standard libraries
20 #include <vector>
21 #include <map>
22 #include <set>
23 
24 
25 namespace geo{
26 
27  // forward-declaration from geometry
28  struct AuxDetGeometryData_t;
29  class AuxDetGeo;
30 
33 
34  typedef std::pair<uint32_t, size_t> chanAndSV;
35 
36  public:
37 
38  virtual ~AuxDetChannelMapAlg() = default;
39 
40  virtual void Initialize(AuxDetGeometryData_t& geodata) = 0;
41  virtual void Uninitialize() = 0;
42 
43  // method returns the entry in the sorted AuxDetGeo vector so that the
44  // Geometry in turn can return that object
45  virtual size_t NearestAuxDet (const double* point,
46  std::vector<geo::AuxDetGeo*> const& auxDets) const;
47  virtual size_t NearestSensitiveAuxDet (const double* point,
48  std::vector<geo::AuxDetGeo*> const& auxDets,
49  size_t & ad) const;
50  virtual size_t ChannelToAuxDet (std::vector<geo::AuxDetGeo*> const& auxDets,
51  std::string const& detName,
52  uint32_t const& channel) const;
53  virtual std::pair<size_t, size_t> ChannelToSensitiveAuxDet(std::vector<geo::AuxDetGeo*> const& auxDets,
54  std::string const& detName,
55  uint32_t const& channel) const;
56 
57  // Experiments must implement these method. It accounts for auxiliary detectors like
58  // Multiwire proportional chambers where there is only a single sensitive volume, but
59  // multiple channels running through that volume.
60  virtual uint32_t PositionToAuxDetChannel(double const worldLoc[3],
61  std::vector<geo::AuxDetGeo*> const& auxDets,
62  size_t & ad,
63  size_t & sv) const = 0;
64 
65  virtual const TVector3 AuxDetChannelToPosition(uint32_t const& channel,
66  std::string const& auxDetName,
67  std::vector<geo::AuxDetGeo*> const& auxDets) const = 0;
68 
69  protected:
70 
71  std::map<size_t, std::string> fADGeoToName;
72  std::map<std::string, size_t> fNameToADGeo;
73  std::map<size_t, std::vector<chanAndSV> > fADGeoToChannelAndSV;
74 
77  };
78 }
79 #endif // GEO_AUXDETCHANNELMAPALG_H
80 
std::map< std::string, size_t > fNameToADGeo
map the names to the AuxDetGeo index
std::map< size_t, std::vector< chanAndSV > > fADGeoToChannelAndSV
virtual ~AuxDetChannelMapAlg()=default
virtual void Initialize(AuxDetGeometryData_t &geodata)=0
virtual const TVector3 AuxDetChannelToPosition(uint32_t const &channel, std::string const &auxDetName, std::vector< geo::AuxDetGeo * > const &auxDets) const =0
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
virtual size_t ChannelToAuxDet(std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const
virtual void Uninitialize()=0
std::pair< uint32_t, size_t > chanAndSV
std::map< size_t, std::string > fADGeoToName
map the AuxDetGeo index to the name
Namespace collecting geometry-related classes utilities.
virtual uint32_t PositionToAuxDetChannel(double const worldLoc[3], std::vector< geo::AuxDetGeo * > const &auxDets, size_t &ad, size_t &sv) const =0
virtual size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets, size_t &ad) const
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet(std::vector< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const