ATLAS Offline Software
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 
6 #include "G4AutoDelete.hh"
7 #include "G4VPhysicalVolume.hh"
9 #include "CLHEP/Geometry/Transform3D.h"
10 
12  unsigned int copies):
13  m_function(func->clone()),
14  m_nCopies(copies)
15 {
16 }
17 
19  G4VPhysicalVolume* physVol) const
20 {
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