DD4hep
1.31.0
Detector Description Toolkit for High Energy Physics
Main Page
Related Pages
Modules
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
u
Enumerator
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
b
d
g
o
p
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
x
Functions
_
c
d
g
h
i
l
m
n
o
p
r
s
u
Variables
Typedefs
_
a
c
d
e
f
g
j
l
o
p
r
s
t
u
v
x
Enumerations
Enumerator
Macros
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
DDG4
src
Geant4HitHandler.cpp
Go to the documentation of this file.
1
//==========================================================================
2
// AIDA Detector description implementation
3
//--------------------------------------------------------------------------
4
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5
// All rights reserved.
6
//
7
// For the licensing terms see $DD4hepINSTALL/LICENSE.
8
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9
//
10
// Author : M.Frank
11
//
12
//==========================================================================
13
14
// Framework include files
15
#include <
DDG4/Geant4HitHandler.h
>
16
#include <
DD4hep/DD4hepUnits.h
>
17
#include <CLHEP/Units/SystemOfUnits.h>
18
19
// Geant4 include files
20
#include <G4NavigationHistory.hh>
21
22
using namespace
dd4hep::sim
;
23
25
dd4hep::Position
Geant4HitHandler::localToGlobal
(
const
DDSegmentation::Vector3D
& local)
const
{
26
return
localToGlobal
(G4ThreeVector(local.
X
/ dd4hep::mm,local.
Y
/ dd4hep::mm,local.
Z
/ dd4hep::mm));
27
}
28
30
dd4hep::Position
Geant4HitHandler::localToGlobal
(
const
Position
& local)
const
{
31
return
localToGlobal
(G4ThreeVector(local.X(),local.Y(),local.Z()));
32
}
33
35
dd4hep::Position
Geant4HitHandler::localToGlobal
(
double
x,
double
y,
double
z)
const
{
36
return
localToGlobal
(G4ThreeVector(x,y,z));
37
}
38
40
dd4hep::Position
Geant4HitHandler::localToGlobal
(
const
G4ThreeVector& loc)
const
{
41
G4ThreeVector p =
touchable_ptr
->GetHistory()->GetTopTransform().Inverse().TransformPoint(loc);
42
return
Position
(p.x(),p.y(),p.z());
43
}
44
46
dd4hep::Position
Geant4HitHandler::globalToLocal
(
double
x,
double
y,
double
z)
const
{
47
G4ThreeVector p =
globalToLocalG4
(G4ThreeVector(x,y,z));
48
return
Position
(p.x(),p.y(),p.z());
49
}
50
52
dd4hep::Position
Geant4HitHandler::globalToLocal
(
const
Position
& global)
const
{
53
G4ThreeVector p =
globalToLocalG4
(G4ThreeVector(global.X(),global.Y(),global.Z()));
54
return
Position
(p.x(),p.y(),p.z());
55
}
56
58
dd4hep::Position
Geant4HitHandler::globalToLocal
(
const
G4ThreeVector& global)
const
{
59
G4ThreeVector p =
globalToLocalG4
(global);
60
return
Position
(p.x(),p.y(),p.z());
61
}
62
64
G4ThreeVector
Geant4HitHandler::globalToLocalG4
(
double
x,
double
y,
double
z)
const
{
65
return
globalToLocalG4
(G4ThreeVector(x,y,z));
66
}
67
69
G4ThreeVector
Geant4HitHandler::globalToLocalG4
(
const
G4ThreeVector& global)
const
{
70
return
touchable_ptr
->GetHistory()->GetTopTransform().TransformPoint(global);
71
}
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition:
Segmentation.h:47
dd4hep::sim::Geant4HitHandler::globalToLocalG4
G4ThreeVector globalToLocalG4(double x, double y, double z) const
Coordinate transformation to local coordinates.
Definition:
Geant4HitHandler.cpp:64
Geant4HitHandler.h
dd4hep::sim::Geant4HitHandler::touchable_ptr
const G4VTouchable * touchable_ptr
Definition:
Geant4HitHandler.h:46
dd4hep::sim::Geant4HitHandler::globalToLocal
Position globalToLocal(double x, double y, double z) const
Coordinate transformation to local coordinates.
Definition:
Geant4HitHandler.cpp:46
dd4hep::DDSegmentation::Vector3D::Y
double Y
Definition:
Segmentation.h:70
dd4hep::sim::Geant4HitHandler::localToGlobal
Position localToGlobal(const Position &local) const
Coordinate transformation to global coordinates.
Definition:
Geant4HitHandler.cpp:30
dd4hep::Position
ROOT::Math::XYZVector Position
Definition:
Objects.h:80
dd4hep::sim
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Definition:
EDM4hepFileReader.cpp:41
dd4hep::DDSegmentation::Vector3D::X
double X
Definition:
Segmentation.h:70
DD4hepUnits.h
dd4hep::DDSegmentation::Vector3D::Z
double Z
Definition:
Segmentation.h:70
Generated on Tue Apr 15 2025 16:54:27 for DD4hep by
1.8.18