ATLAS Offline Software
Loading...
Searching...
No Matches
GeoStraightAccSection.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6void GeoStraightAccSection::Clockwork::buildSmallCache()
7{
8 if (!r2) {
9 r2 = std::make_unique<Rep2>();
10 }
11 else {
12 for (int i=0;i<14;i++) {
13 r2->halfLength[i] = 0;
14 r2->transfunction[i].reset();
15 }
16 }
17}
18
19void GeoStraightAccSection::Clockwork::fillFastCache (Rep1& rep1) const
20{
21 for (int i=0;i<1024;i++) {
22 for (int j=0;j<14; j++) {
23 GeoTrf::Transform3D XF = (*r2->transfunction[j])(i);
24 rep1.xcent[i][j] = XF(0,3); //dx
25 rep1.ycent[i][j] = XF(1,3); //dy
26 rep1.cosu [i][j] = -XF(0,1);//xy
27 rep1.sinu [i][j] = XF(0,2);//xz
28 rep1.halfLength[i][j]= r2->halfLength[j];
29 }
30 }
31}
32
33// Modifiers
34double & GeoStraightAccSection::XCent(int stackid, int cellid)
35{
36 return m_c->getWritableFastCache().xcent[stackid][cellid];
37}
38double & GeoStraightAccSection::YCent(int stackid, int cellid)
39{
40 return m_c->getWritableFastCache().ycent[stackid][cellid];
41}
42double & GeoStraightAccSection::Cosu(int stackid, int cellid)
43{
44 return m_c->getWritableFastCache().cosu[stackid][cellid];
45}
46double & GeoStraightAccSection::Sinu(int stackid, int cellid)
47{
48 return m_c->getWritableFastCache().sinu[stackid][cellid];
49}
50double & GeoStraightAccSection::HalfLength(int stackid, int cellid)
51{
52 return m_c->getWritableFastCache().halfLength[stackid][cellid];
53}
54
55
56void GeoStraightAccSection::setHalfLength(int stackid, double halfLength) {
57 m_c->getWritableSmallCache().halfLength[stackid]=halfLength;
58}
59
60void GeoStraightAccSection::setTransform(int stackid, GeoXF::TRANSFUNCTION f) {
61 m_c->getWritableSmallCache().transfunction[stackid] =
62 std::unique_ptr<GeoXF::Function> (f.clone());
63}
64
66 : m_c(std::make_unique<Clockwork>())
67{
68}
69
71= default;
72
const double & YCent(int stackid, int cellid) const
void setHalfLength(int stackid, double halfLength)
const double & Cosu(int stackid, int cellid) const
const double & HalfLength(int stackid, int cellid) const
void setTransform(int stackid, GeoXF::TRANSFUNCTION TXE)
std::unique_ptr< Clockwork > m_c
const double & Sinu(int stackid, int cellid) const
const double & XCent(int stackid, int cellid) const
STL namespace.