SegmentationMultiGridStripXYAlg.h
Go to the documentation of this file.
1 #ifndef SEGMENTATIONMULTIGRIDSTRIPXYALG_H
2 #define SEGMENTATIONMULTIGRIDSTRIPXYALG_H
3 
5 
6 #include <string>
7 #include <vector>
8 #include <array>
9 
10 namespace fhicl{
11  class ParameterSet;
12 }
13 
14 namespace gar {
15  namespace geo {
16  namespace seg {
17 
19 
20  public:
22 
24 
26 
27  void reconfigure(fhicl::ParameterSet const& pset) override;
28 
29  void Initialize(const gar::geo::GeometryCore& geo) override;
30 
31  std::array<double, 3> GetPosition(const gar::geo::GeometryCore& geo, const gar::raw::CellID_t& cID) const override;
32 
33  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 override;
34 
35  bool isTile(const gar::raw::CellID_t& cID) const override;
36 
37  bool isBarrel(const gar::raw::CellID_t& cID) const override;
38 
39  double getStripLength(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const override;
40 
41  std::pair<TVector3, TVector3> getStripEnds(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const override;
42 
43  std::pair<float, float> CalculateLightPropagation(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const override;
44 
45  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 override;
46 
47  const double& gridSizeX() const override { return _gridSizeX; }
48 
49  const double& gridSizeY() const { return _gridSizeY; }
50 
51  const double& stripSizeX() const override { return _stripSizeX; }
52 
53  const double& stripSizeY() const { return _stripSizeY; }
54 
55  const double& offsetX() const { return _offsetX; }
56 
57  const double& offsetY() const { return _offsetY; }
58 
59  const double& layerDimX() const { return _layer_dim_X; }
60 
61  const double& layerDimY() const { return _layer_dim_Y; }
62 
63  const std::string& fieldNameX() const { return _xId; }
64 
65  const std::string& fieldNameY() const { return _yId; }
66 
67  const std::string& fieldNameLayer() const { return _layerId; }
68 
69  const std::string& fieldNameSlice() const { return _sliceId; }
70 
71  const unsigned int& nLayers() const override { return _nLayers; }
72 
73  void setGridSizeX(double cellSize) { _gridSizeX = cellSize; }
74 
75  void setGridSizeY(double cellSize) { _gridSizeY = cellSize; }
76 
77  void setStripSizeX(double stripSize) { _stripSizeX = stripSize; }
78 
79  void setStripSizeY(double stripSize) { _stripSizeY = stripSize; }
80 
81  void setOffsetX(double offset) { _offsetX = offset; }
82 
83  void setOffsetY(double offset) { _offsetY = offset; }
84 
85  void setFieldNameX(const std::string& fieldName) { _xId = fieldName; }
86 
87  void setFieldNameY(const std::string& fieldName) { _yId = fieldName; }
88 
89  void setFieldNameLayer(const std::string& fieldName) { _layerId = fieldName; }
90 
91  void setFieldNameSlice(const std::string& fieldName) { _sliceId = fieldName; }
92 
93  void setLayerDimXY(const double& dimX, const double& dimY) const override { _layer_dim_X = dimX; _layer_dim_Y = dimY; }
94 
95  void setVariables(const double& innerangle, const double &endcapsidelength) const override { _InnerAngle = innerangle; _EndcapSideLength = endcapsidelength; }
96 
97  protected:
98 
99  void PrintParameters() const override;
100 
101  std::array<std::vector<unsigned int>, 2> TokenizeLayerVectors(std::vector<std::string> grid) const;
102 
103  /// the grid size in X
104  double _gridSizeX;
105  /// the coordinate offset in X
106  double _offsetX;
107  /// the grid size in Y
108  double _gridSizeY;
109  /// the coordinate offset in Y
110  double _offsetY;
111  /// the field name used for X
113  /// the field name used for Y
115  /// the field name used for layer
117  /// the field name used for slice
119  /// the encoding string
121  /// the strip size in X
122  double _stripSizeX;
123  /// the strip size in Y
124  double _stripSizeY;
125  /// fraction of tiles to remove at the edge
126  double _frac;
127  /// number of layers
128  unsigned int _nLayers;
129  /// active slice number
130  unsigned int _active_slice;
131  /// the layers (start::end) for grid in Barrel
132  std::vector<std::string> _gridBarrelLayers;
133  /// the layers (start::end) for strips in Barrel
134  std::vector<std::string> _stripBarrelLayers;
135  /// the layers (start::end) for grid in Endcap
136  std::vector<std::string> _gridEndcapLayers;
137  /// the layers (start::end) for strips in Endcap
138  std::vector<std::string> _stripEndcapLayers;
139  /// layer dimension in X
140  mutable double _layer_dim_X;
141  /// layer dimension in Y
142  mutable double _layer_dim_Y;
143  /// Inner Angle
144  mutable double _InnerAngle;
145  /// Endcap Side Length
146  mutable double _EndcapSideLength;
147  /// are the strips on the same layer?
149  };
150  }
151  }
152 }
153 
154 #endif
double _frac
fraction of tiles to remove at the edge
std::string string
Definition: nybbler.cc:12
std::vector< std::string > _gridBarrelLayers
the layers (start::end) for grid in Barrel
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
void setLayerDimXY(const double &dimX, const double &dimY) const override
std::string _layerId
the field name used for layer
static QFile::DecoderFn decoder
Definition: qfile.cpp:522
void setVariables(const double &innerangle, const double &endcapsidelength) const override
virtual void reconfigure(fhicl::ParameterSet const &pset)
std::string _sliceId
the field name used for slice
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
void Initialize(void)
long long int CellID_t
Definition: CaloRawDigit.h:24
General GArSoft Utilities.
std::vector< std::string > _stripBarrelLayers
the layers (start::end) for strips in Barrel
std::vector< std::string > _gridEndcapLayers
the layers (start::end) for grid in Endcap
std::vector< std::string > _stripEndcapLayers
the layers (start::end) for strips in Endcap
LArSoft geometry interface.
Definition: ChannelGeo.h:16