ATLAS Offline Software
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 
6 void 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 
19 void 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
34 double & GeoStraightAccSection::XCent(int stackid, int cellid)
35 {
36  return m_c->getWritableFastCache().xcent[stackid][cellid];
37 }
38 double & GeoStraightAccSection::YCent(int stackid, int cellid)
39 {
40  return m_c->getWritableFastCache().ycent[stackid][cellid];
41 }
42 double & GeoStraightAccSection::Cosu(int stackid, int cellid)
43 {
44  return m_c->getWritableFastCache().cosu[stackid][cellid];
45 }
46 double & GeoStraightAccSection::Sinu(int stackid, int cellid)
47 {
48  return m_c->getWritableFastCache().sinu[stackid][cellid];
49 }
50 double & GeoStraightAccSection::HalfLength(int stackid, int cellid)
51 {
52  return m_c->getWritableFastCache().halfLength[stackid][cellid];
53 }
54 
55 
56 void GeoStraightAccSection::setHalfLength(int stackid, double halfLength) {
57  m_c->getWritableSmallCache().halfLength[stackid]=halfLength;
58 }
59 
60 void 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 
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
GeoStraightAccSection::Sinu
const double & Sinu(int stackid, int cellid) const
GeoStraightAccSection::m_c
std::unique_ptr< Clockwork > m_c
Definition: GeoStraightAccSection.h:58
MCP::ScaleSmearParam::r2
@ r2
GeoStraightAccSection::~GeoStraightAccSection
~GeoStraightAccSection()
GeoStraightAccSection.h
GeoStraightAccSection::YCent
const double & YCent(int stackid, int cellid) const
lumiFormat.i
int i
Definition: lumiFormat.py:92
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
GeoStraightAccSection::Cosu
const double & Cosu(int stackid, int cellid) const
GeoStraightAccSection::setHalfLength
void setHalfLength(int stackid, double halfLength)
Definition: GeoStraightAccSection.cxx:56
GeoStraightAccSection::HalfLength
const double & HalfLength(int stackid, int cellid) const
GeoStraightAccSection::XCent
const double & XCent(int stackid, int cellid) const
GeoStraightAccSection::setTransform
void setTransform(int stackid, GeoXF::TRANSFUNCTION TXE)
Definition: GeoStraightAccSection.cxx:60
GeoStraightAccSection::GeoStraightAccSection
GeoStraightAccSection()
Definition: GeoStraightAccSection.cxx:65