SegmentationAlg.h
Go to the documentation of this file.
1 #ifndef ECALSEGMENTATIONALG_H
2 #define ECALSEGMENTATIONALG_H
3 
4 #include <vector>
5 #include <map>
6 
7 #include "Geometry/GeometryCore.h"
10 
11 #include "TVector3.h"
12 
13 namespace fhicl{
14  class ParameterSet;
15 }
16 
17 namespace gar {
18  namespace geo {
19 
20  class GeometryCore;
21  class BitFieldCoder;
22 
23  namespace seg {
24 
26 
27  public:
28  virtual ~SegmentationAlg();
29 
30  virtual const std::string& name() const {
31  return _name;
32  }
33 
34  virtual void setName(const std::string& value) {
35  _name = value;
36  }
37 
38  virtual const std::string& type() const {
39  return _type;
40  }
41 
42  virtual const std::string& description() const {
43  return _description;
44  }
45 
46  virtual const BitFieldCoder* decoder() const {
47  return _decoder;
48  }
49 
50  virtual const double& gridSizeX() const {
51  return _gridSizeX;
52  }
53 
54  virtual const double& stripSizeX() const {
55  return _stripSizeX;
56  }
57 
58 
59  virtual const unsigned int& nLayers() const {
60  return _nLayers;
61  }
62 
63  virtual const unsigned int& nPlanes() const {
64  return _nPlanes;
65  }
66 
67  virtual const std::string& cellEncoding() const {
68  return _encoding;
69  }
70 
71  virtual void setDecoder(const BitFieldCoder* decoder);
72 
73  //Pure virtual member functions
74  virtual void reconfigure(fhicl::ParameterSet const& pset) = 0;
75 
76  virtual void Initialize(const gar::geo::GeometryCore& geo) = 0;
77 
78  virtual std::array<double, 3> GetPosition(const gar::geo::GeometryCore& geo, const gar::raw::CellID_t& cID) const = 0;
79 
80  virtual gar::raw::CellID_t GetCellID(const gar::geo::GeometryCore& geo, const unsigned int& det_id, const unsigned int& stave, const unsigned int& module, const unsigned int& layer, const unsigned int& slice, const std::array<double, 3>& localPosition) const = 0;
81 
82  virtual void PrintParameters() const = 0;
83 
84  virtual bool isTile(const gar::raw::CellID_t& cID) const = 0;
85 
86  virtual bool isBarrel(const gar::raw::CellID_t& cID) const = 0;
87 
88  virtual void setLayerDimXY(const double& dimX, const double& dimY) const = 0;
89 
90  virtual void setVariables(const double& innerangle, const double &endcapsidelength) const = 0;
91 
92  //Non-pure virtual member functions
93  virtual double getStripLength(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const;
94 
95  virtual std::pair<TVector3, TVector3> getStripEnds(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const;
96 
97  virtual std::pair<float, float> CalculateLightPropagation(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const;
98 
99  virtual std::array<double, 3> ReconstructStripHitPosition(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const float &xlocal, const gar::raw::CellID_t& cID) const;
100 
101  protected:
103 
104  SegmentationAlg(const BitFieldCoder* decoder, fhicl::ParameterSet const& pset);
105 
106  static double binToPosition(gar::raw::CellID_t bin, double cellSize, double offset = 0);
107 
108  static int positionToBin(double position, double cellSize, double offset = 0);
109 
111 
113 
115 
117 
118  double _gridSizeX;
119 
120  double _stripSizeX;
121 
122  unsigned int _nLayers;
123 
124  unsigned int _nPlanes;
125 
126  const BitFieldCoder* _decoder = 0;
127 
128  private:
130  };
131  }
132  }
133 }
134 
135 #endif
virtual const double & gridSizeX() const
virtual const std::string & name() const
virtual const std::string & description() const
std::string string
Definition: nybbler.cc:12
virtual void setName(const std::string &value)
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
virtual const unsigned int & nPlanes() const
virtual const std::string & type() const
static QFile::DecoderFn decoder
Definition: qfile.cpp:522
virtual void reconfigure(fhicl::ParameterSet const &pset)
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
virtual const std::string & cellEncoding() const
void Initialize(void)
Definition of basic calo raw digits.
virtual const double & stripSizeX() const
long long int CellID_t
Definition: CaloRawDigit.h:24
General GArSoft Utilities.
QTextStream & bin(QTextStream &s)
virtual const BitFieldCoder * decoder() const
LArSoft geometry interface.
Definition: ChannelGeo.h:16
virtual const unsigned int & nLayers() const