ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDigitization
TrkDigEvent
src
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
9
#include "
TrkDigEvent/DigitizationModule.h
"
10
11
Trk::DigitizationModule::DigitizationModule
(std::shared_ptr<const Segmentation> moduleSegmentation,
12
double
halfThickness
,
13
int
readoutDirection
,
14
double
lorentzAngle
) :
15
16
m_halfThickness
(
halfThickness
),
17
m_readoutDirection
(
readoutDirection
),
18
m_lorentzAngle
(
lorentzAngle
),
19
m_tanLorentzAngle
(tan(
lorentzAngle
)),
20
m_segmentation
(
std
::move(moduleSegmentation)),
21
m_boundarySurfaces
(),
22
m_segmentationSurfacesX
(),
23
m_segmentationSurfacesY
()
24
{
25
m_segmentation
->createSegmenationSurfaces(
m_boundarySurfaces
,
26
m_segmentationSurfacesX
,
27
m_segmentationSurfacesY
,
28
halfThickness
,
29
readoutDirection
,
30
lorentzAngle
);
31
}
32
33
const
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
58
const
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
DigitizationModule.h
Trk::DigitizationModule::stepSurfaces
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
Definition
DigitizationModule.cxx:58
Trk::DigitizationModule::lorentzAngle
double lorentzAngle() const
return the lorentz Angle
Definition
DigitizationModule.h:115
Trk::DigitizationModule::m_halfThickness
double m_halfThickness
Definition
DigitizationModule.h:96
Trk::DigitizationModule::readoutDirection
int readoutDirection() const
return the readout direction
Definition
DigitizationModule.h:112
Trk::DigitizationModule::m_lorentzAngle
double m_lorentzAngle
the lorentz angle
Definition
DigitizationModule.h:98
Trk::DigitizationModule::DigitizationModule
DigitizationModule(std::shared_ptr< const Segmentation > moduleSegmentation, double halfThickness, int readoutDirection, double lorentzAngle)
Constructor from a Segmentation descriptor.
Definition
DigitizationModule.cxx:11
Trk::DigitizationModule::m_boundarySurfaces
std::vector< std::shared_ptr< const Surface > > m_boundarySurfaces
boundary surfaces, they are ordered: readout, opposite, x boundaries, y boundaries
Definition
DigitizationModule.h:102
Trk::DigitizationModule::m_segmentationSurfacesX
std::vector< std::shared_ptr< const Surface > > m_segmentationSurfacesX
segmentation surfaces in X - without boundaries
Definition
DigitizationModule.h:103
Trk::DigitizationModule::m_segmentation
std::shared_ptr< const Segmentation > m_segmentation
segmentation descriptor
Definition
DigitizationModule.h:101
Trk::DigitizationModule::m_segmentationSurfacesY
std::vector< std::shared_ptr< const Surface > > m_segmentationSurfacesY
segmentation surfaces in Y - without boundaries
Definition
DigitizationModule.h:104
Trk::DigitizationModule::m_tanLorentzAngle
double m_tanLorentzAngle
and the tangent of it
Definition
DigitizationModule.h:99
Trk::DigitizationModule::m_readoutDirection
int m_readoutDirection
defines if the readout is along (+1) / (-1) wrt the z axis
Definition
DigitizationModule.h:97
Trk::DigitizationModule::halfThickness
double halfThickness() const
module thickness
Definition
DigitizationModule.h:109
Trk::DigitizationModule::segmentationSurfaces
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'...
Definition
DigitizationModule.cxx:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk::DigitizationCell
std::pair< size_t, size_t > DigitizationCell
Definition
DigitizationCell.h:18
std
STL namespace.
std::swap
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)
Definition
AthLinks/ElementLinkVector.h:484
Generated on
for ATLAS Offline Software by
1.17.0