6void GeoStraightAccSection::Clockwork::buildSmallCache()
9 r2 = std::make_unique<Rep2>();
12 for (
int i=0;
i<14;
i++) {
13 r2->halfLength[
i] = 0;
14 r2->transfunction[
i].reset();
19void GeoStraightAccSection::Clockwork::fillFastCache (Rep1& rep1)
const
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);
25 rep1.ycent[
i][j] = XF(1,3);
26 rep1.cosu [
i][j] = -XF(0,1);
27 rep1.sinu [
i][j] = XF(0,2);
28 rep1.halfLength[
i][j]=
r2->halfLength[j];
36 return m_c->getWritableFastCache().xcent[stackid][cellid];
40 return m_c->getWritableFastCache().ycent[stackid][cellid];
44 return m_c->getWritableFastCache().cosu[stackid][cellid];
48 return m_c->getWritableFastCache().sinu[stackid][cellid];
52 return m_c->getWritableFastCache().halfLength[stackid][cellid];
57 m_c->getWritableSmallCache().halfLength[stackid]=halfLength;
61 m_c->getWritableSmallCache().transfunction[stackid] =
62 std::unique_ptr<GeoXF::Function> (f.clone());
66 :
m_c(
std::make_unique<Clockwork>())
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