EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
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/Geometry/GeometryIdentifier.hpp
"
12
#include "
Acts/Utilities/Definitions.hpp
"
13
#include "
ActsFatras/EventData/Barcode.hpp
"
14
15
#include <cstdint>
16
17
namespace
ActsFatras {
18
26
class
Hit
{
27
public
:
28
using
Scalar
= double;
29
using
Vector3
=
Acts::ActsVector<Scalar, 3>
;
30
using
Vector4
=
Acts::ActsVector<Scalar, 4>
;
31
33
Hit
() =
default
;
46
Hit
(
Acts::GeometryIdentifier
geometryId
,
Barcode
particleId
,
47
const
Vector4
&
pos4
,
const
Vector4
& before4,
const
Vector4
& after4,
48
int32_t index_ = -1)
49
:
m_geometryId
(geometryId),
50
m_particleId
(particleId),
51
m_index
(index_),
52
m_pos4
(pos4),
53
m_before4
(before4),
54
m_after4
(after4) {}
55
Hit
(
const
Hit
&) =
default
;
56
Hit
(
Hit
&&) =
default
;
57
Hit
&
operator=
(
const
Hit
&) =
default
;
58
Hit
&
operator=
(
Hit
&&) =
default
;
59
61
constexpr
Acts::GeometryIdentifier
geometryId
()
const
{
return
m_geometryId
; }
63
constexpr
Barcode
particleId
()
const
{
return
m_particleId
; }
67
constexpr int32_t
index
()
const
{
return
m_index
; }
68
70
const
Vector4
&
position4
()
const
{
return
m_pos4
; }
72
auto
position
()
const
{
return
m_pos4
.segment<3>(
Acts::ePos0
); }
74
Scalar
time
()
const
{
return
m_pos4
[
Acts::eTime
]; }
75
77
const
Vector4
&
momentum4Before
()
const
{
return
m_before4
; }
79
const
Vector4
&
momentum4After
()
const
{
return
m_after4
; }
81
Vector3
unitDirectionBefore
()
const
{
82
return
m_before4
.segment<3>(
Acts::eMom0
).normalized();
83
}
85
Vector3
unitDirectionAfter
()
const
{
86
return
m_after4
.segment<3>(
Acts::eMom0
).normalized();
87
}
89
Vector3
unitDirection
()
const
{
90
auto
dir0 =
m_before4
/ (2 *
m_before4
.segment<3>(
Acts::eMom0
).norm());
91
auto
dir1 =
m_after4
/ (2 *
m_after4
.segment<3>(
Acts::eMom0
).norm());
92
return
(dir0 + dir1).segment<3>(
Acts::eMom0
).normalized();
93
}
98
Scalar
depositedEnergy
()
const
{
99
return
m_before4
[
Acts::eEnergy
] -
m_after4
[
Acts::eEnergy
];
100
}
101
102
private
:
104
Acts::GeometryIdentifier
m_geometryId
;
106
Barcode
m_particleId
;
108
int32_t
m_index
= -1;
110
Vector4
m_pos4
= Vector4::Zero();
112
Vector4
m_before4
= Vector4::Zero();
114
Vector4
m_after4
= Vector4::Zero();
115
};
116
117
}
// namespace ActsFatras
acts
blob
sPHENIX
Fatras
include
ActsFatras
EventData
Hit.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:26
using
1.8.2 with
EIC GitHub integration