ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
}
CLHEPtoEigenConverter.h
Geo2G4STParameterisation.h
Geo2G4STParameterisation::m_nCopies
unsigned int m_nCopies
Definition
Geo2G4STParameterisation.h:65
Geo2G4STParameterisation::ComputeTransformation
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
Definition
Geo2G4STParameterisation.cxx:18
Geo2G4STParameterisation::Geo2G4STParameterisation
Geo2G4STParameterisation(const GeoXF::Function *func, unsigned int copies)
Definition
Geo2G4STParameterisation.cxx:11
Geo2G4STParameterisation::m_function
const GeoXF::Function * m_function
Definition
Geo2G4STParameterisation.h:64
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
for ATLAS Offline Software by
1.17.0