ATLAS Offline Software
RectangularSegmentation.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // RectangularSegmentation.h, ATLAS Detector software
8 
9 #ifndef TRKDIGEVENT_RECTANGLESEGMENTATION_H
10 #define TRKDIGEVENT_RECTANGLESEGMENTATION_H
11 
12 // GeoPrimitives
14 // Trk includes
19 // STL
20 #include <memory>
21 
22 namespace Trk {
23 
37  public:
39  RectangularSegmentation(std::shared_ptr<const Trk::RectangleBounds>,
40  size_t numCellsX, size_t numCellsY=1);
41 
43  RectangularSegmentation(std::shared_ptr<const Trk::RectangleBounds>,
44  size_t numCellsX, double longY, size_t numCellsY, double numOfChips);
45 
50 
52  virtual ~RectangularSegmentation();
53 
54 
56  void createSegmenationSurfaces(std::vector< std::shared_ptr< const Surface> >& boundarySurfaces,
57  std::vector< std::shared_ptr< const Surface> >& segmentationSurfacesX,
58  std::vector< std::shared_ptr< const Surface> >& segmentationSurfacesY,
59  double halfThickness,
60  int readoutDirection=1.,
61  double lorentzAngle=0.) const override;
62 
64  const DigitizationCell cell(const Amg::Vector3D& position) const override;
65 
67  const DigitizationCell cell(const Amg::Vector2D& position) const override;
68 
70  const Amg::Vector2D cellPosition(const DigitizationCell& cId) const override;
71 
74  const Amg::Vector3D& end,
75  double halfThickness,
76  int readoutDirection=1,
77  double lorentzAngle=0.) const override;
78 
79 
81  const SurfaceBounds& moduleBounds() const override;
82 
84  size_t numCellsX() const;
85 
87  size_t numCellsY() const;
88 
89  private:
90 
91  template <class T> const DigitizationCell cellT(const T& position) const;
92 
93  std::shared_ptr<const RectangleBounds> m_activeBounds;
95  size_t m_binsX;
96  size_t m_binsY;
97 
98  };
99 
100  inline const SurfaceBounds& RectangularSegmentation::moduleBounds() const { return (*(m_activeBounds.get())); }
101 
102  inline size_t RectangularSegmentation::numCellsX() const { return m_binsX; }
103 
104  inline size_t RectangularSegmentation::numCellsY() const { return m_binsY; }
105 
106  template <class T> const DigitizationCell RectangularSegmentation::cellT(const T& position) const
107  {
108  if (m_binsX == 1)
109  return DigitizationCell(0, m_binUtility->bin(position,0));
110  else if (m_binsY == 1 )
111  return DigitizationCell(m_binUtility->bin(position,0), 0);
112  return DigitizationCell(m_binUtility->bin(position,0), m_binUtility->bin(position,1));
113  }
114 
115  inline const DigitizationCell RectangularSegmentation::cell(const Amg::Vector3D& position) const { return cellT<Amg::Vector3D>(position); }
116 
117  inline const DigitizationCell RectangularSegmentation::cell(const Amg::Vector2D& position) const { return cellT<Amg::Vector2D>(position); }
118 
119 }
120 
121 #endif
RectangleBounds.h
Trk::RectangularSegmentation::m_activeBounds
std::shared_ptr< const RectangleBounds > m_activeBounds
Definition: RectangularSegmentation.h:93
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::RectangularSegmentation::~RectangularSegmentation
virtual ~RectangularSegmentation()
Virtual Destructor.
Definition: RectangularSegmentation.cxx:89
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
BinUtility.h
Trk::RectangularSegmentation::numCellsY
size_t numCellsY() const
Return the simple binning parameters.
Definition: RectangularSegmentation.h:104
Trk::DigitizationCell
std::pair< size_t, size_t > DigitizationCell
Definition: DigitizationCell.h:18
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
GeoPrimitives.h
Trk::RectangularSegmentation::digitizationStep
const DigitizationStep digitizationStep(const Amg::Vector3D &start, const Amg::Vector3D &end, double halfThickness, int readoutDirection=1, double lorentzAngle=0.) const override
Fill the associated digitsation cell from this start and end position, correct for lorentz effect if ...
Definition: RectangularSegmentation.cxx:221
Trk::RectangularSegmentation::m_binsX
size_t m_binsX
Definition: RectangularSegmentation.h:95
Trk::RectangularSegmentation::m_binsY
size_t m_binsY
Definition: RectangularSegmentation.h:96
Trk::RectangularSegmentation::moduleBounds
const SurfaceBounds & moduleBounds() const override
return the surface bounds by reference
Definition: RectangularSegmentation.h:100
Trk::DigitizationStep
Definition: DigitizationCell.h:21
Trk::BinUtility
Definition: BinUtility.h:39
Trk::RectangularSegmentation::createSegmenationSurfaces
void createSegmenationSurfaces(std::vector< std::shared_ptr< const Surface > > &boundarySurfaces, std::vector< std::shared_ptr< const Surface > > &segmentationSurfacesX, std::vector< std::shared_ptr< const Surface > > &segmentationSurfacesY, double halfThickness, int readoutDirection=1., double lorentzAngle=0.) const override
Create the segmentation surfaces in X.
Definition: RectangularSegmentation.cxx:94
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::RectangularSegmentation::cell
const DigitizationCell cell(const Amg::Vector3D &position) const override
Get the digitization cell fropm a 3D position - ignores the shift.
Definition: RectangularSegmentation.h:115
Trk::RectangularSegmentation::numCellsX
size_t numCellsX() const
Return the simple binning parameters.
Definition: RectangularSegmentation.h:102
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::RectangularSegmentation::cellT
const DigitizationCell cellT(const T &position) const
Definition: RectangularSegmentation.h:106
DigitizationCell.h
Trk::RectangularSegmentation::RectangularSegmentation
RectangularSegmentation(std::shared_ptr< const Trk::RectangleBounds >, size_t numCellsX, size_t numCellsY=1)
Constructor for all same-size pixels or strips (in cas numCellsY is set to 1)
Definition: RectangularSegmentation.cxx:21
Trk::RectangularSegmentation::operator=
RectangularSegmentation & operator=(const RectangularSegmentation &)=delete
Trk::BinUtility::bin
size_t bin(const Amg::Vector3D &position, size_t ba=0) const
Bin from a 3D vector (already in binning frame)
Definition: BinUtility.h:136
Segmentation.h
Trk::RectangularSegmentation
Definition: RectangularSegmentation.h:36
Trk::Segmentation
Definition: Segmentation.h:39
Trk::RectangularSegmentation::m_binUtility
BinUtility * m_binUtility
Definition: RectangularSegmentation.h:94
Trk::RectangularSegmentation::cellPosition
const Amg::Vector2D cellPosition(const DigitizationCell &cId) const override
calculate the cell Position from the Id
Definition: RectangularSegmentation.cxx:210
Trk::RectangularSegmentation::RectangularSegmentation
RectangularSegmentation(const RectangularSegmentation &)=delete
TODO contructor from BinUtilities for more complex readouts.