ATLAS Offline Software
Simulation
G4Utilities
Geo2G4
src
Geo2G4STParameterisation.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
Geo2G4STParameterisation.h
"
6
#include "G4AutoDelete.hh"
7
#include "G4VPhysicalVolume.hh"
8
#include "
GeoPrimitives/CLHEPtoEigenConverter.h
"
9
#include "CLHEP/Geometry/Transform3D.h"
10
11
Geo2G4STParameterisation::Geo2G4STParameterisation
(
const
GeoXF::Function* func,
12
unsigned
int
copies):
13
m_function(func->
clone
()),
14
m_nCopies(copies)
15
{
16
}
17
18
void
Geo2G4STParameterisation::ComputeTransformation
(
const
G4int copyNo,
19
G4VPhysicalVolume* physVol)
const
20
{
21
HepGeom::Transform3D
transform
=
Amg::EigenTransformToCLHEP
((*
m_function
)(copyNo));
22
G4ThreeVector translation =
transform
.getTranslation();
23
24
// keep thread-local rotation matrix (see discussion on atlas/athena!58732)
25
static
G4ThreadLocal G4RotationMatrix*
rotation
=
nullptr
;
26
if
(!
rotation
) {
27
rotation
=
new
G4RotationMatrix();
28
G4AutoDelete::Register(
rotation
);
29
}
30
*
rotation
=
transform
.getRotation().inverse();
31
32
physVol->SetTranslation(translation);
33
physVol->SetRotation(
rotation
);
34
}
Geo2G4STParameterisation::m_function
const GeoXF::Function * m_function
Definition:
Geo2G4STParameterisation.h:64
Geo2G4STParameterisation::ComputeTransformation
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
Definition:
Geo2G4STParameterisation.cxx:18
python.Utilities.clone
clone
Definition:
Utilities.py:134
Geo2G4STParameterisation::Geo2G4STParameterisation
Geo2G4STParameterisation(const GeoXF::Function *func, unsigned int copies)
Definition:
Geo2G4STParameterisation.cxx:11
Geo2G4STParameterisation.h
xAOD::rotation
rotation
Definition:
TrackSurface_v1.cxx:15
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition:
GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition:
GeoPrimitivesHelpers.h:156
CLHEPtoEigenConverter.h
Amg::EigenTransformToCLHEP
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
Definition:
CLHEPtoEigenConverter.h:120
Generated on Mon Dec 23 2024 21:10:50 for ATLAS Offline Software by
1.8.18