Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Hit.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Hit.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2020 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Definitions/Algebra.hpp
"
12
#include "
Acts/Definitions/Common.hpp
"
13
#include "
Acts/Geometry/GeometryIdentifier.hpp
"
14
#include "
ActsFatras/EventData/Barcode.hpp
"
15
16
#include <cstdint>
17
18
namespace
ActsFatras {
19
27
class
Hit
{
28
public
:
29
using
Scalar
=
Acts::ActsScalar
;
30
using
Vector3
=
Acts::ActsVector<3>
;
31
using
Vector4
=
Acts::ActsVector<4>
;
32
34
Hit
() =
default
;
47
Hit
(
Acts::GeometryIdentifier
geometryId
,
Barcode
particleId
,
48
const
Vector4
&
pos4
,
const
Vector4
& before4,
const
Vector4
& after4,
49
int32_t index_ = -1)
50
:
m_geometryId
(geometryId),
51
m_particleId
(particleId),
52
m_index
(index_),
53
m_pos4
(pos4),
54
m_before4
(before4),
55
m_after4
(after4) {}
56
Hit
(
const
Hit
&) =
default
;
57
Hit
(
Hit
&&) =
default
;
58
Hit
&
operator=
(
const
Hit
&) =
default
;
59
Hit
&
operator=
(
Hit
&&) =
default
;
60
62
constexpr
Acts::GeometryIdentifier
geometryId
()
const
{
return
m_geometryId
; }
64
constexpr
Barcode
particleId
()
const
{
return
m_particleId
; }
68
constexpr int32_t
index
()
const
{
return
m_index
; }
69
71
const
Vector4
&
fourPosition
()
const
{
return
m_pos4
; }
73
auto
position
()
const
{
return
m_pos4
.segment<3>(
Acts::ePos0
); }
75
Scalar
time
()
const
{
return
m_pos4
[
Acts::eTime
]; }
76
78
const
Vector4
&
momentum4Before
()
const
{
return
m_before4
; }
80
const
Vector4
&
momentum4After
()
const
{
return
m_after4
; }
82
Vector3
directionBefore
()
const
{
83
return
m_before4
.segment<3>(
Acts::eMom0
).normalized();
84
}
86
Vector3
directionAfter
()
const
{
87
return
m_after4
.segment<3>(
Acts::eMom0
).normalized();
88
}
90
Vector3
direction
()
const
{
91
auto
dir0 =
m_before4
.segment<3>(
Acts::eMom0
).normalized();
92
auto
dir1 =
m_after4
.segment<3>(
Acts::eMom0
).normalized();
93
return
((dir0 + dir1) / 2.).segment<3>(
Acts::eMom0
).normalized();
94
}
99
Scalar
depositedEnergy
()
const
{
100
return
m_before4
[
Acts::eEnergy
] -
m_after4
[
Acts::eEnergy
];
101
}
102
103
private
:
105
Acts::GeometryIdentifier
m_geometryId
;
107
Barcode
m_particleId
;
109
int32_t
m_index
= -1;
111
Vector4
m_pos4
= Vector4::Zero();
113
Vector4
m_before4
= Vector4::Zero();
115
Vector4
m_after4
= Vector4::Zero();
116
};
117
118
}
// namespace ActsFatras
acts
blob
sPHENIX
Fatras
include
ActsFatras
EventData
Hit.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:41
using
1.8.2 with
sPHENIX GitHub integration