SegmentationMultiGridStripXYAlg.cxx
Go to the documentation of this file.
2 
4 
6 
7 #include "Geometry/GeometryCore.h"
8 
9 #include <algorithm>
10 #include <sstream>
11 #include <iostream>
12 #include <cmath>
13 
14 namespace gar {
15  namespace geo {
16  namespace seg {
17 
18  //----------------------------------------------------------------------------
19  /// Default constructor used by derived classes passing the encoding string
21  : SegmentationAlg(pset)
22  {
23  _type = "MultiGridStripXY";
24  _description = "Cartesian segmentation in the local XY-plane, containing integer number of tiles/strips/cells";
25 
26  std::cout << "######### gar::geo::seg::SegmentationMultiGridStripXYAlg() " << std::endl ;
27 
28  this->reconfigure(pset);
29  }
30 
31  //----------------------------------------------------------------------------
32  /// Default constructor used by derived classes passing an existing decoder
34  : SegmentationAlg(decode, pset)
35  {
36  _type = "MultiGridStripXY";
37  _description = "Cartesian segmentation in the local XY-plane, containing integer number of tiles/strips/cells";
38 
39  std::cout << "######### gar::geo::seg::SegmentationMultiGridStripXYAlg() " << std::endl ;
40 
41  this->reconfigure(pset);
42  }
43 
44  //----------------------------------------------------------------------------
46  {
47  }
48 
49  //----------------------------------------------------------------------------
51  {
52  _gridSizeX = pset.get<double>("grid_size_x");
53  _gridSizeY = pset.get<double>("grid_size_y");
54 
55  _stripSizeX = pset.get<double>("strip_size_x");
56  _stripSizeY = pset.get<double>("strip_size_y");
57  _encoding = pset.get<std::string>("cellEncoding");
58 
59  _offsetX = pset.get<double>("offset_x");
60  _offsetY = pset.get<double>("offset_y");
61 
62  _xId = pset.get<std::string>("identifier_x");
63  _yId = pset.get<std::string>("identifier_y");
64  _layerId = pset.get<std::string>("identifier_layer");
65  _sliceId = pset.get<std::string>("identifier_slice");
66 
67  _gridBarrelLayers = pset.get< std::vector<std::string> >("grid_barrel_layers");
68  _stripBarrelLayers = pset.get< std::vector<std::string> >("strip_barrel_layers");
69 
70  _gridEndcapLayers = pset.get< std::vector<std::string> >("grid_endcap_layers");
71  _stripEndcapLayers = pset.get< std::vector<std::string> >("strip_endcap_layers");
72 
73  _nLayers = pset.get<unsigned int>("nlayers");
74  _active_slice = pset.get<unsigned int>("active_slice");
75 
76  _frac = 1./3.;
77 
78  _OnSameLayer = pset.get<bool>("strip_on_same_layer");
79 
80  this->PrintParameters();
81 
82  return;
83  }
84 
85  //----------------------------------------------------------------------------
87  {
88 
89  }
90 
91  //----------------------------------------------------------------------------
93  {
94  //Local origin for the Barrel in the middle of the layer
95  //Local origin for the Endcal at the corner of the full stave
96  std::array<double, 3> cellPosition;
97 
98  //Need to differentiate case tile and strips based on layer and slice
99  bool isTile = this->isTile(cID);
100  bool isBarrel = this->isBarrel(cID);
101 
102  if(isTile) {
103  //Need to check if the tile is at the edge of the layer!
104  cellPosition[0] = binToPosition(_decoder->get(cID, _xId), _gridSizeX, _offsetX);
105  cellPosition[1] = binToPosition(_decoder->get(cID, _yId), _gridSizeY, _offsetY);
106  cellPosition[2] = 0.;
107 
108  if( isBarrel ) {
109 
110  //Check if the position is outside of the layer size
111  if( std::fabs(cellPosition[0]) > _layer_dim_X/2. ) {
112 
113  cellPosition[0] = cellPosition[0] / std::fabs(cellPosition[0]) * ( _layer_dim_X - _frac ) / 2.;
114  }
115 
116  if(std::fabs(cellPosition[1]) > _layer_dim_Y/2. ) {
117 
118  cellPosition[1] = cellPosition[1] / std::fabs(cellPosition[1]) * ( _layer_dim_Y - _frac ) / 2.;
119  }
120  }
121 
122  //TODO
123  //Problem here is that the full layer is the endcap stave, no "layer shape"
124  //the problem will occur for hits that are at the limit
125  //checking if x or y are over the layer dim does not work (as the stave is not a square/rectangle)
126  if( not isBarrel ) {
127 
128  float r_point = std::sqrt( cellPosition[0]*cellPosition[0] + cellPosition[1]*cellPosition[1] );
129 
130  //Check if the point is outside.... layer_dim_x = layer_dim_y = apothem
131  if(r_point > _layer_dim_Y) {
132 
133  if( std::fabs(cellPosition[0]) < _EndcapSideLength / 2. || std::fabs(cellPosition[1]) < _EndcapSideLength / 2. ) {
134 
135  if( std::fabs(cellPosition[0]) < _EndcapSideLength / 2. && std::fabs(cellPosition[1]) > _layer_dim_Y ) {
136 
137  cellPosition[1] = cellPosition[1] / std::fabs(cellPosition[1]) * ( _layer_dim_Y - _frac ) ;
138  }
139 
140  if( std::fabs(cellPosition[1]) < _EndcapSideLength / 2. && std::fabs(cellPosition[0]) > _layer_dim_X ) {
141 
142  cellPosition[0] = cellPosition[0] / std::fabs(cellPosition[0]) * ( _layer_dim_X - _frac ) ;
143  }
144 
145  } else if ( std::fabs(cellPosition[0]) > _EndcapSideLength / 2. && std::fabs(cellPosition[1]) > _EndcapSideLength / 2. ) {
146  //Complicated part //do NOTHING the hit will be dropped
147  }
148  }
149  }
150  }
151  else
152  {
153  int cellIndexX = _decoder->get(cID,_xId);
154  int cellIndexY = _decoder->get(cID,_yId);
155 
156  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 == 0) )
157  {
158  //Segmentation in Y
159  int nCellsX = 1;
160  // int nCellsY = int(_layer_dim_Y / _stripSizeY);
161 
162  if(isBarrel) {
163  cellPosition[0] = ( cellIndexX + 0.5 ) * (_layer_dim_X / nCellsX ) - (_layer_dim_X / 2.);
164  cellPosition[1] = ( cellIndexY + 0.5 ) * _stripSizeY;
165  cellPosition[2] = 0.;
166  }
167  else {
168  cellPosition[1] = ( cellIndexY + 0.5 ) * _stripSizeY;
169  cellPosition[0] = ( cellIndexX + 0.5 ) * ( _layer_dim_X / nCellsX );
170  if( cellPosition[1] > _EndcapSideLength / 2.) {
171  //Correct for the endcap
172  float angle = _InnerAngle - M_PI/2;
173  int n = std::round( ( cellPosition[1] - ( _EndcapSideLength / 2. ) ) / _stripSizeX );
174  cellPosition[0] -= n * ( _stripSizeX / std::tan(angle) ) / 2.;
175  }
176  cellPosition[2] = 0.;
177  }
178  }
179 
180  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice+1) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 != 0) )
181  {
182  //Segmentation in X
183  // int nCellsX = int(_layer_dim_X / _stripSizeX);
184  int nCellsY = 1;
185 
186  if(isBarrel) {
187  cellPosition[0] = ( cellIndexX + 0.5 ) * _stripSizeX;
188  cellPosition[1] = ( cellIndexY + 0.5 ) * (_layer_dim_Y / nCellsY ) - (_layer_dim_Y / 2.);
189  cellPosition[2] = 0.;
190  }
191  else {
192  cellPosition[0] = ( cellIndexX + 0.5 ) * _stripSizeX;
193  cellPosition[1] = ( cellIndexY + 0.5 ) * ( _layer_dim_Y / nCellsY );
194  if( cellPosition[0] > _EndcapSideLength / 2.) {
195  //Correct for the endcap
196  float angle = _InnerAngle - M_PI/2;
197  int n = std::round( ( cellPosition[0] - ( _EndcapSideLength / 2. ) ) / _stripSizeY );
198  cellPosition[1] -= n * ( _stripSizeY / std::tan(angle) ) / 2.;
199  }
200  cellPosition[2] = 0.;
201  }
202  }
203  }
204 
205  return cellPosition;
206  }
207 
208  //----------------------------------------------------------------------------
209  /// determine the cell ID based on the position
210  gar::raw::CellID_t SegmentationMultiGridStripXYAlg::GetCellID(const gar::geo::GeometryCore& , 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
211  {
212  gar::raw::CellID_t cID = 0;
213 
214  _decoder->set(cID, "system", det_id);
215  _decoder->set(cID, "module", module);
216  _decoder->set(cID, "stave", stave);
217  _decoder->set(cID, "layer", layer);
218  _decoder->set(cID, "slice", slice);
219 
220  //Need to differentiate case tile and strips based on layer and slice
221  bool isTile = this->isTile(cID);
222 
223  double localX = localPosition[0];
224  double localY = localPosition[1];
225 
226  if(isTile)
227  {
228  _decoder->set(cID, _xId, positionToBin(localX, _gridSizeX, _offsetX));
229  _decoder->set(cID, _yId, positionToBin(localY, _gridSizeY, _offsetY));
230  }
231  else
232  {
233  if( (_OnSameLayer && slice == _active_slice) || (not _OnSameLayer && layer%2 == 0) )
234  {
235  //Segmentation in Y
236  int nCellsX = 1;
237  int nCellsY = int(_layer_dim_Y / _stripSizeY);
238 
239  int _cellIndexX = int ( localX / ( _layer_dim_X / nCellsX ) );
240  int _cellIndexY = int ( localY / ( _layer_dim_Y / nCellsY ) );
241 
242  _decoder->set(cID, _xId, _cellIndexX);
243  _decoder->set(cID, _yId, _cellIndexY);
244  }
245 
246  if( (_OnSameLayer && slice == _active_slice+1) || (not _OnSameLayer && layer%2 != 0) )
247  {
248  //Segmentation in X
249  int nCellsX = int(_layer_dim_X / _stripSizeX);
250  int nCellsY = 1;
251 
252  int _cellIndexX = int ( localX / ( _layer_dim_X / nCellsX ) );
253  int _cellIndexY = int ( localY / ( _layer_dim_Y / nCellsY ) );
254 
255  _decoder->set(cID, _xId, _cellIndexX);
256  _decoder->set(cID, _yId, _cellIndexY);
257  }
258  }
259 
260  return cID;
261  }
262 
263  //----------------------------------------------------------------------------
265  {
266  std::cout << "cell encoding: " << _encoding << std::endl;
267  std::cout << "identifier_x: " << _xId << std::endl;
268  std::cout << "identifier_y: " << _yId << std::endl;
269  std::cout << "grid_size_x: " << _gridSizeX << " cm" << std::endl;
270  std::cout << "grid_size_y: " << _gridSizeY << " cm" << std::endl;
271  std::cout << "strip_size_x: " << _stripSizeX << " cm" << std::endl;
272  std::cout << "strip_size_y: " << _stripSizeY << " cm" << std::endl;
273  std::cout << "offset_x: " << _offsetX << " cm" << std::endl;
274  std::cout << "offset_y: " << _offsetY << " cm" << std::endl;
275 
276  std::cout << "identifier_layer: " << _layerId << std::endl;
277  std::cout << "identifier_slice: " << _sliceId << std::endl;
278  std::cout << "active slice: " << _active_slice << std::endl;
279  std::cout << "nlayers: " << _nLayers << std::endl;
280 
281  std::cout << "grid_barrel_layers: ";
282  for(unsigned int i = 0; i < _gridBarrelLayers.size(); i++)
283  std::cout << _gridBarrelLayers.at(i) << " ";
284  std::cout << std::endl;
285 
286  std::cout << "strip_barrel_layers: ";
287  for(unsigned int i = 0; i < _stripBarrelLayers.size(); i++)
288  std::cout << _stripBarrelLayers.at(i) << " ";
289  std::cout << std::endl;
290 
291  std::cout << "grid_endcap_layers: ";
292  for(unsigned int i = 0; i < _gridEndcapLayers.size(); i++)
293  std::cout << _gridEndcapLayers.at(i) << " ";
294  std::cout << std::endl;
295 
296  std::cout << "strip_endcap_layers: ";
297  for(unsigned int i = 0; i < _stripEndcapLayers.size(); i++)
298  std::cout << _stripEndcapLayers.at(i) << " ";
299  std::cout << std::endl;
300 
301  std::cout << "strip_on_same_layer: " << _OnSameLayer << std::endl;
302  }
303 
304  //----------------------------------------------------------------------------
305  std::array<std::vector<unsigned int>, 2> SegmentationMultiGridStripXYAlg::TokenizeLayerVectors(std::vector<std::string> grid) const
306  {
307  std::vector<unsigned int> _gridFirst;
308  std::vector<unsigned int> _gridLast;
309 
310  for(unsigned int i = 0; i < grid.size(); i++)
311  {
312  std::vector<std::string> descriptors ;
313  Tokenizer t( descriptors ,':') ;
314 
315  std::string value = grid.at(i);
316  std::for_each( value.begin(), value.end(), t ) ;
317 
318  // std::cout << descriptors.size() << std::endl;
319  // for(unsigned int ii = 0; ii < descriptors.size(); ii++)
320  // std::cout << descriptors.at(ii) << std::endl;
321 
322  _gridFirst.push_back(std::atoi(descriptors.at(0).c_str()));
323  _gridLast.push_back(std::atoi(descriptors.at(1).c_str()));
324  }
325 
326  std::array<std::vector<unsigned int>, 2> _list = {{_gridFirst, _gridLast}};
327  return _list;
328  }
329 
330  //----------------------------------------------------------------------------
332  {
333  bool isTile = false;
334 
335  unsigned int det_id = _decoder->get(cID, "system");
336  unsigned int layer = _decoder->get(cID, _layerId);
337 
338  std::array<std::vector<unsigned int>, 2> _list;
339 
340  if(det_id == 1)
342  if(det_id == 2)
344 
345  //Check if it is tile configuration
346  for(unsigned int i = 0; i < _list.at(0).size(); i++)
347  {
348  if( layer >= _list.at(0).at(i) && layer <= _list.at(1).at(i) )
349  {
350  // std::cout << layer << " " << _list.at(0).at(i) << " " << _list.at(1).at(i) << std::endl;
351  isTile = true;
352  break;
353  }
354  else{
355  continue;
356  }
357  }
358 
359  return isTile;
360  }
361 
362  //----------------------------------------------------------------------------
364  {
365  bool isBarrel = true;
366 
367  int det_id = _decoder->get(cID, "system");
368  int module = _decoder->get(cID, "module");
369  if( det_id == 2 && (module == 0 || module == 6) ) isBarrel = false;
370 
371  return isBarrel;
372  }
373 
374  //----------------------------------------------------------------------------
375  double SegmentationMultiGridStripXYAlg::getStripLength(const gar::geo::GeometryCore& , const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const
376  {
377  double stripLength = 0.;
378  bool isBarrel = this->isBarrel(cID);
379 
380  //Strip along X
381  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 == 0) ) {
382  if(isBarrel) {
383  stripLength = _layer_dim_X;
384  } else {
385  float angle = _InnerAngle - M_PI/2;
386  int n = std::round( (local[1] - ( _EndcapSideLength / 2. )) / _stripSizeX );
387  if ( n < 0 ) n = 0;
388  stripLength = _layer_dim_X - ( n * ( _stripSizeX / std::tan(angle) ) );
389  }
390  }
391  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice+1) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 != 0) ) {
392  //Strip along Y
393  if(isBarrel) {
394  stripLength = _layer_dim_Y;
395  } else {
396  float angle = _InnerAngle - M_PI/2;
397  int n = std::round( (local[1] - ( _EndcapSideLength / 2. )) / _stripSizeY );
398  if ( n < 0 ) n = 0;
399  stripLength = _layer_dim_Y - ( n * ( _stripSizeY / std::tan(angle) ) );
400  }
401  }
402 
403  return stripLength;
404  }
405 
406  //----------------------------------------------------------------------------
407  std::pair<TVector3, TVector3> SegmentationMultiGridStripXYAlg::getStripEnds(const gar::geo::GeometryCore& , const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const
408  {
409  //Local origin for the Barrel in the middle of the layer
410  //Local origin for the Endcal at the corner of the full stave
411  TVector3 stripEnd1(0., 0., 0.);
412  TVector3 stripEnd2(0., 0., 0.);
413  bool isBarrel = this->isBarrel(cID);
414 
415  //Strip along X (local)
416  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 == 0) ) {
417 
418  if(isBarrel) {
419  stripEnd1.SetX(-_layer_dim_X/2.);
420  stripEnd2.SetX(_layer_dim_X/2.);
421  } else {
422  stripEnd1.SetX(0.);
423  //not perfect at the edges...
424  float angle = _InnerAngle - M_PI/2;
425  int n = std::round( (local[1] - ( _EndcapSideLength / 2. )) / _stripSizeX );
426  if ( n < 0 ) n = 0;
427  stripEnd2.SetX( _layer_dim_X - ( n * ( _stripSizeX / std::tan(angle) ) ) );
428  }
429 
430  stripEnd1.SetY(local[1]);
431  stripEnd2.SetY(local[1]);
432  stripEnd1.SetZ(local[2]);
433  stripEnd2.SetZ(local[2]);
434  }
435  //Strip along Y (local)
436  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice+1) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 != 0) ) {
437 
438  if(isBarrel) {
439  stripEnd1.SetY(-_layer_dim_Y/2.);
440  stripEnd2.SetY(_layer_dim_Y/2.);
441  } else {
442  stripEnd1.SetY(0.);
443  float angle = _InnerAngle - M_PI/2;
444  int n = std::round( (local[0] - (_EndcapSideLength / 2.) ) / _stripSizeY );
445  if ( n < 0 ) n = 0;
446  stripEnd2.SetY( _layer_dim_Y - ( n * ( _stripSizeY / std::tan(angle) ) ) );//not perfect at the edges...
447  }
448 
449  stripEnd1.SetX(local[0]);
450  stripEnd2.SetX(local[0]);
451  stripEnd1.SetZ(local[2]);
452  stripEnd2.SetZ(local[2]);
453  }
454 
455  return std::make_pair(stripEnd1, stripEnd2);
456  }
457 
458  //----------------------------------------------------------------------------
459  std::pair<float, float> SegmentationMultiGridStripXYAlg::CalculateLightPropagation(const gar::geo::GeometryCore& , const std::array<double, 3> &local, const gar::raw::CellID_t& cID) const
460  {
461  //Propagate the light to the SiPM on the side
462  //convert c to mm/ns
463  // c = 29.9792458 cm/ns
464  float c = (CLHEP::c_light * CLHEP::mm / CLHEP::ns) / CLHEP::cm; // in cm/ns
465  //time1 is left SiPM
466  float time1 = 0.;
467  //time2 is right SiPM
468  float time2 = 0.;
469  //check if it is barrel or not
470  bool isBarrel = this->isBarrel(cID);
471 
472  //Strip along X (local)
473  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 == 0) )
474  {
475  if(isBarrel) {
476  time1 = ( _layer_dim_X / 2 + local[0] ) / c;
477  time2 = ( _layer_dim_X / 2 - local[0] ) / c;
478  } else {
479  float angle = _InnerAngle - M_PI/2;
480  int n = std::round( (local[0] - ( _EndcapSideLength / 2. )) / _stripSizeY );
481  if ( n < 0 ) n = 0;
482  float strip_dim = _layer_dim_X - ( n * ( _stripSizeY / std::tan(angle) ) );
483  time1 = ( strip_dim / 2. + local[0] ) / c;
484  time2 = ( strip_dim / 2. - local[0] ) / c;
485  }
486  }
487 
488  //Strip along Y (local)
489  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice+1) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 != 0) )
490  {
491  if(isBarrel) {
492  time1 = ( _layer_dim_Y / 2 + local[1] ) / c;
493  time2 = ( _layer_dim_Y / 2 - local[1] ) / c;
494  } else {
495  float angle = _InnerAngle - M_PI/2;
496  int n = std::round( (local[1] - ( _EndcapSideLength / 2. )) / _stripSizeX );
497  if ( n < 0 ) n = 0;
498  float strip_dim = _layer_dim_Y - ( n * ( _stripSizeX / std::tan(angle) ) );
499  time1 = ( strip_dim / 2. + local[1] ) / c;
500  time2 = ( strip_dim / 2. - local[1] ) / c;
501  }
502  }
503 
504  return std::make_pair(time1, time2);
505  }
506 
507  //----------------------------------------------------------------------------
508  std::array<double, 3> SegmentationMultiGridStripXYAlg::ReconstructStripHitPosition(const gar::geo::GeometryCore& geo, const std::array<double, 3> &local, const float &xlocal, const gar::raw::CellID_t& cID) const
509  {
510  float pos = xlocal;
511  //Need to check if the local position is bigger than the strip length!
512  bool isBarrel = this->isBarrel(cID);
513  float stripLength = this->getStripLength(geo, local, cID);
514 
515  if(isBarrel) {
516  if( std::abs(pos) > stripLength / 2. ) pos = (pos > 0) ? stripLength / 2. : -stripLength / 2.;
517  } else {
518  if( std::abs(pos) > stripLength ) pos = (pos > 0) ? stripLength : 0.;
519  }
520 
521  std::array<double, 3> newlocal;
522 
523  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 == 0) )
524  newlocal = {pos, local[1], local[2]};
525 
526  if( (_OnSameLayer && _decoder->get(cID, _sliceId) == _active_slice+1) || (not _OnSameLayer && _decoder->get(cID, _layerId)%2 != 0) ) //Strip along Y
527  newlocal = {local[0], pos, local[2]};
528 
529  return newlocal;
530  }
531 
532  }//seg
533  } // geo
534 } //gar
static constexpr double cm
Definition: Units.h:68
std::pair< float, float > CalculateLightPropagation(const gar::geo::GeometryCore &geo, const std::array< double, 3 > &local, const gar::raw::CellID_t &cID) const override
double _frac
fraction of tiles to remove at the edge
const BitFieldCoder * _decoder
double getStripLength(const gar::geo::GeometryCore &geo, const std::array< double, 3 > &local, const gar::raw::CellID_t &cID) const override
void Initialize(const gar::geo::GeometryCore &geo) override
SegmentationMultiGridStripXYAlg(fhicl::ParameterSet const &pset)
Default constructor used by derived classes passing the encoding string.
void set(long64 &bitfield, size_t index, ulong64 value) const
std::string string
Definition: nybbler.cc:12
std::vector< std::string > _gridBarrelLayers
the layers (start::end) for grid in Barrel
std::array< std::vector< unsigned int >, 2 > TokenizeLayerVectors(std::vector< std::string > grid) const
bool isTile(const gar::raw::CellID_t &cID) const override
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
void reconfigure(fhicl::ParameterSet const &pset) override
static int positionToBin(double position, double cellSize, double offset=0)
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
static double binToPosition(gar::raw::CellID_t bin, double cellSize, double offset=0)
T abs(T value)
std::string _layerId
the field name used for layer
std::string _sliceId
the field name used for slice
std::void_t< T > n
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
T get(std::string const &key) const
Definition: ParameterSet.h:271
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
determine the cell ID based on the position
long long int CellID_t
Definition: CaloRawDigit.h:24
#define M_PI
Definition: includeROOT.h:54
std::array< double, 3 > GetPosition(const gar::geo::GeometryCore &geo, const gar::raw::CellID_t &cID) const override
General GArSoft Utilities.
long64 get(long64 bitfield, size_t index) const
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
static constexpr double mm
Definition: Units.h:65
void decode(std::any const &a, Hep2Vector &result)
Definition: CLHEP_ps.h:12
std::pair< TVector3, TVector3 > getStripEnds(const gar::geo::GeometryCore &geo, const std::array< double, 3 > &local, const gar::raw::CellID_t &cID) const override
bool isBarrel(const gar::raw::CellID_t &cID) const override
std::vector< std::string > _stripEndcapLayers
the layers (start::end) for strips in Endcap
LArSoft geometry interface.
Definition: ChannelGeo.h:16
QAsciiDict< Entry > ns
QTextStream & endl(QTextStream &s)