ATLAS Offline Software
Loading...
Searching...
No Matches
DigitizationModule.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6// DigitizationModule.cxx, ATLAS Detector software
8
10
32
33const std::vector< std::shared_ptr<const Trk::Surface> > Trk::DigitizationModule::segmentationSurfaces(const Trk::DigitizationCell& entryCids, const Trk::DigitizationCell& exitCids) const
34{
35 std::vector< std::shared_ptr<const Trk::Surface> > sSurfaces;
36
37 int startbinX = entryCids.first;
38 int endbinX = exitCids.first;
39 // swap if needed
40 if (startbinX > endbinX) std::swap(startbinX,endbinX);
41 // now cash in the rest
42 for ( ; startbinX <= endbinX; ++startbinX)
43 sSurfaces.push_back(m_segmentationSurfacesX[startbinX]);
44
45 // start bin, end bin
46 int startbinY = entryCids.second;
47 int endbinY = exitCids.second;
48 // swap if needed
49 if (startbinY > endbinY) std::swap(startbinY,endbinY);
50 // now cash in the rest
51 for ( ; startbinY <= endbinY; ++startbinY)
52 sSurfaces.push_back(m_segmentationSurfacesY[startbinY]);
53
54 // return what you have
55 return sSurfaces;
56}
57
58const std::vector< std::shared_ptr<const Trk::Surface> > Trk::DigitizationModule::stepSurfaces(const Amg::Vector3D& start, const Amg::Vector3D& end) const
59{
60 // prepare the return vector
61 std::vector< std::shared_ptr<const Trk::Surface> > stepSurfaces;
62
63 const Trk::DigitizationCell startCell = m_segmentation->cell(start);
64 const Trk::DigitizationCell endCell = m_segmentation->cell(end);
65
66 // go along x - first with the naive binning (i.e. w.o lorentz angle)
67 size_t sCellX = startCell.first;
68 size_t eCellX = endCell.first;
69 if (sCellX > eCellX) std::swap(sCellX,eCellX);
70 // now take the boundaries as well
71 if (sCellX > 0) --sCellX;
72 ++eCellX;
73 // the surfaces along Y are easy, just the bin surfaces
74 size_t sCellY = startCell.second;
75 size_t eCellY = endCell.second;
76 if (sCellY > eCellY) std::swap(sCellY,eCellY);
77 // reserve - be safe
78 stepSurfaces.reserve((eCellY-sCellY)+(eCellX-sCellX)+2);
79 // now fill the x surfaces
80 for ( ; sCellX <= eCellX && sCellX < m_segmentationSurfacesX.size(); ++sCellX)
81 stepSurfaces.push_back(m_segmentationSurfacesX[sCellX]);
82 // end fill the y surfaces
83 for ( ; sCellY <= eCellY && sCellY < m_segmentationSurfacesY.size(); ++sCellY)
84 stepSurfaces.push_back(m_segmentationSurfacesY[sCellY]);
85 // return the lot
86 return stepSurfaces;
87}
88
89
90
const std::vector< std::shared_ptr< const Surface > > stepSurfaces(const Amg::Vector3D &start, const Amg::Vector3D &end) const
return the test surfaces between these points
double lorentzAngle() const
return the lorentz Angle
int readoutDirection() const
return the readout direction
double m_lorentzAngle
the lorentz angle
DigitizationModule(std::shared_ptr< const Segmentation > moduleSegmentation, double halfThickness, int readoutDirection, double lorentzAngle)
Constructor from a Segmentation descriptor.
std::vector< std::shared_ptr< const Surface > > m_boundarySurfaces
boundary surfaces, they are ordered: readout, opposite, x boundaries, y boundaries
std::vector< std::shared_ptr< const Surface > > m_segmentationSurfacesX
segmentation surfaces in X - without boundaries
std::shared_ptr< const Segmentation > m_segmentation
segmentation descriptor
std::vector< std::shared_ptr< const Surface > > m_segmentationSurfacesY
segmentation surfaces in Y - without boundaries
double m_tanLorentzAngle
and the tangent of it
int m_readoutDirection
defines if the readout is along (+1) / (-1) wrt the z axis
double halfThickness() const
module thickness
const std::vector< std::shared_ptr< const Surface > > segmentationSurfaces(const DigitizationCell &entryCids, const DigitizationCell &exitCids) const
Return the internal test segmentation surfaces to test between entry and exit given by their cell id'...
Eigen::Matrix< double, 3, 1 > Vector3D
std::pair< size_t, size_t > DigitizationCell
STL namespace.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)