ATLAS Offline Software
Loading...
Searching...
No Matches
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
22namespace 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
47
50
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
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition BinUtility.h:39
const DigitizationCell cell(const Amg::Vector3D &position) const override
Get the digitization cell fropm a 3D position - ignores the shift.
virtual ~RectangularSegmentation()
Virtual Destructor.
const Amg::Vector2D cellPosition(const DigitizationCell &cId) const override
calculate the cell Position from the Id
const SurfaceBounds & moduleBounds() const override
return the surface bounds by reference
size_t numCellsY() const
Return the simple binning parameters.
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 ...
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.
const DigitizationCell cellT(const T &position) const
RectangularSegmentation & operator=(const RectangularSegmentation &)=delete
size_t numCellsX() const
Return the simple binning parameters.
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)
std::shared_ptr< const RectangleBounds > m_activeBounds
RectangularSegmentation(const RectangularSegmentation &)=delete
TODO contructor from BinUtilities for more complex readouts.
Segementation class for generic pixel, strixels and strip segmentations on a rectangle shape.
Abstract base class for surface bounds to be specified.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::pair< size_t, size_t > DigitizationCell